use of org.apache.flink.shaded.guava30.com.google.common.cache.CacheBuilder in project kylo by Teradata.
the class RepositoryConfig method templateUpdateInfoCache.
@Bean
public Cache<String, Boolean> templateUpdateInfoCache() {
CacheBuilder builder = CacheBuilder.newBuilder();
if (expireRepositoryCache) {
builder.expireAfterWrite(1, TimeUnit.HOURS);
log.info("Template repository cache initialized with expiry of 1 hour");
}
return builder.build();
}
use of org.apache.flink.shaded.guava30.com.google.common.cache.CacheBuilder in project summerb by skarpushin.
the class UserServiceCachedImpl method afterPropertiesSet.
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void afterPropertiesSet() throws Exception {
CacheBuilder cacheBuilder = (CacheBuilder) CacheBuilder.newBuilder().maximumSize(1000).recordStats();
cacheByEmail = new TransactionBoundCache<String, User>("UserCacheByEmail", cacheBuilder, loaderByEmail);
cacheByUuid = new TransactionBoundCache<String, User>("UserCacheByUuid", cacheBuilder, loaderByUuid);
eventBus.register(this);
}
Aggregations