private static CacheConfiguration cacheConfiguration() { return new CacheConfiguration(CACHE_NAME, 2048) .persistence(new PersistenceConfiguration().strategy(PersistenceConfiguration.Strategy.NONE)) .timeToIdleSeconds(120) .timeToLiveSeconds(0) .eternal(false) .memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LRU); }
.overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .timeToIdleSeconds(timeToIdleSeconds));
supportConfig = supportConfig.maxEntriesLocalHeap(activeSize); supportConfig = supportConfig.memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LRU); supportConfig = supportConfig.timeToLiveSeconds(DEFAULT_SUPPORT_TTL_SECONDS);
.overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .timeToIdleSeconds(timeToIdleSeconds) .diskPersistent(diskPersistent)
.overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .timeToIdleSeconds(timeToIdleSeconds) .diskPersistent(diskPersistent) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .timeToIdleSeconds(timeToIdleSeconds) .diskPersistent(diskPersistent) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .timeToIdleSeconds(timeToIdleSeconds) .diskPersistent(diskPersistent) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .timeToIdleSeconds(timeToIdleSeconds) .diskPersistent(diskPersistent) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .timeToIdleSeconds(timeToIdleSeconds) .diskPersistent(diskPersistent)
.overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .timeToIdleSeconds(timeToIdleSeconds));
.overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .timeToIdleSeconds(timeToIdleSeconds));
.overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .timeToIdleSeconds(timeToIdleSeconds));
protected HttpCache(String name) { CacheManager manager = CacheManager.getInstance(); this._cache = new Cache( new CacheConfiguration(name, 10000) .memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LFU) .eternal(false) .timeToLiveSeconds(3600) .timeToIdleSeconds(1200) .diskExpiryThreadIntervalSeconds(0) .persistence(new PersistenceConfiguration().strategy(Strategy.LOCALTEMPSWAP))); manager.addCache(this._cache); }
boolean isEternal = serverConfigurationService.getBoolean(clusterConfigName + ".eternal", false); if (isEternal) { clusterCache.eternal(true).timeToIdleSeconds(0).timeToLiveSeconds(0); } else { clusterCache.eternal(false) .timeToIdleSeconds(serverConfigurationService.getInt(clusterConfigName + ".timeToIdle", DEFAULT_CACHE_TIMEOUT)) .timeToLiveSeconds(serverConfigurationService.getInt(clusterConfigName + ".timeToLive", DEFAULT_CACHE_TIMEOUT));
public LocalCacheManager(String name, int max, int exptime, boolean copyOnRead, boolean copyOnWrite) { this.cache = CacheManager.getInstance().getCache(name); if (cache == null) { CacheConfiguration config = new CacheConfiguration(name, max) .copyOnRead(copyOnRead) .copyOnWrite(copyOnWrite) .memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LRU) .eternal(false) .timeToLiveSeconds(exptime) .timeToIdleSeconds(exptime) .diskExpiryThreadIntervalSeconds(60) .persistence(new PersistenceConfiguration().strategy(PersistenceConfiguration.Strategy.NONE)); this.cache = new Cache(config, null, null); CacheManager.getInstance().addCache(cache); if (logger.isInfoEnabled()) { logger.info("Arcus k/v local cache is enabled : %s", cache.toString()); } } }
config.timeToLiveSeconds(SECONDS.convert(settings.getExpireAfterWrite(), MILLISECONDS));
ehCacheConfig.setName(cacheName); CacheConfiguration defaultCache = new CacheConfiguration(cacheName, 1).eternal(false).timeToIdleSeconds(30) .timeToLiveSeconds(30).overflowToDisk(false); ehCacheConfig.addDefaultCache(defaultCache); cacheManager = new CacheManager(ehCacheConfig);
supportConfig = supportConfig.maxEntriesLocalHeap(activeSize); supportConfig = supportConfig.memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LRU); supportConfig = supportConfig.timeToLiveSeconds(DEFAULT_SUPPORT_TTL_SECONDS);
supportConfig = supportConfig.maxEntriesLocalHeap(activeSize); supportConfig = supportConfig.memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LRU); supportConfig = supportConfig.timeToLiveSeconds(DEFAULT_SUPPORT_TTL_SECONDS);
.timeToLiveSeconds(30).overflowToDisk(false); ehCacheConfig.addDefaultCache(defaultCache); CacheService cacheService = new CacheService(new CacheManager(ehCacheConfig));
.overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .timeToIdleSeconds(timeToIdleSeconds) .diskPersistent(diskPersistent)
.overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .timeToIdleSeconds(timeToIdleSeconds) .diskPersistent(diskPersistent)
getMemoryStoreEvictionPolicy() ).eternal( isEternal() ).timeToLiveSeconds( getTimeToLiveSeconds() ).timeToIdleSeconds( getTimeToIdleSeconds() ).diskExpiryThreadIntervalSeconds(
.overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .timeToIdleSeconds(timeToIdleSeconds) .diskPersistent(diskPersistent)