<commit_before># westcache
java cache with single-point administration
[![Build Status](https://travis-ci.org/bingoohuang/westcache.svg?branch=master)](https://travis-ci.org/bingoohuang/westcache)
[![Coverage Status](https://coveralls.io/repos/github/bingoohuang/westcache/badge.svg?branch=master)](https://coveralls.io/github/bingoohuang/westcache?branch=master)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.bingoohuang/westcache/badge.svg?style=flat-square)](https://maven-badges.herokuapp.com/maven-central/com.github.bingoohuang/westcache/)
[![BCH compliance](https://bettercodehub.com/edge/badge/bingoohuang/westcache)](https://bettercodehub.com)

## In ideal world, no cache needed.
In the ideal world, everything works well and fast, and there is no need to considerate caching which is in order to make things faster.
So we take the business points and follow task steps, like write a service as following:
```java
@Service
public class UserService {
    @Inject UserDao userDao;
    
    public Map<String, UserMeta> loadUserMetas() {
        List<UserMeta> metas = userDao.selectAllUserMetas();
        Map<String, UserMeta> map = Maps.newHashMap();
        for (UserMeta meta : metas) {
            map.put(meta.getMetaId(), meta);
        }
        return map;
    }
}
```

## You complete your work and search for more efficient.
As you searched the whole code, you find that the user metas are basic data, 
which means the data will no change nearly. But the program read it from the database<commit_msg>remove BCH compliance in README<commit_after># westcache
java cache with single-point administration
[![Build Status](https://travis-ci.org/bingoohuang/westcache.svg?branch=master)](https://travis-ci.org/bingoohuang/westcache)
[![Coverage Status](https://coveralls.io/repos/github/bingoohuang/westcache/badge.svg?branch=master)](https://coveralls.io/github/bingoohuang/westcache?branch=master)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.bingoohuang/westcache/badge.svg?style=flat-square)](https://maven-badges.herokuapp.com/maven-central/com.github.bingoohuang/westcache/)

## In ideal world, no cache needed.
In the ideal world, everything works well and fast, and there is no need to considerate caching which is in order to make things faster.
So we take the business points and follow task steps, like write a service as following:
```java
@Service
public class UserService {
    @Inject UserDao userDao;
    
    public Map<String, UserMeta> loadUserMetas() {
        List<UserMeta> metas = userDao.selectAllUserMetas();
        Map<String, UserMeta> map = Maps.newHashMap();
        for (UserMeta meta : metas) {
            map.put(meta.getMetaId(), meta);
        }
        return map;
    }
}
```

## You complete your work and search for more efficient.
As you searched the whole code, you find that the user metas are basic data, 
which means the data will no change nearly. But the program read it from the database
{'fraction_non_alphanumeric': 0.11450381679389313, 'fraction_numerical': 0.0, 'mean_word_length': 4.353463587921847, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 14, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '584342', 'n_tokens_mistral': 935, 'n_tokens_neox': 915, 'n_words': 259}