supportConfig = supportConfig.persistence(new PersistenceConfiguration().strategy(Strategy.NONE)); int activeSize = 2 * refreshAheadConfig.getBatchSize() * refreshAheadConfig.getNumberOfThreads(); supportConfig = supportConfig.maxEntriesLocalHeap(activeSize); supportConfig = supportConfig.memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LRU); supportConfig = supportConfig.timeToLiveSeconds(DEFAULT_SUPPORT_TTL_SECONDS);
public DefaultCacheManagerProvider() { net.sf.ehcache.config.Configuration config = new net.sf.ehcache.config.Configuration(); config.setUpdateCheck(false); CacheConfiguration tokenCacheConfiguration = new CacheConfiguration(). maxEntriesLocalHeap(DEFAULT_MAX_CACHE_ENTRIES). name("tokenCache"). persistence(new PersistenceConfiguration().strategy(Strategy.NONE)); tokenCacheConfiguration.validateConfiguration(); config.addCache(tokenCacheConfiguration ); cacheManager = CacheManager.create(config); }
supportConfig = supportConfig.persistence(new PersistenceConfiguration().strategy(Strategy.NONE)); int activeSize = 2 * refreshAheadConfig.getBatchSize() * refreshAheadConfig.getNumberOfThreads(); supportConfig = supportConfig.maxEntriesLocalHeap(activeSize); supportConfig = supportConfig.memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LRU); supportConfig = supportConfig.timeToLiveSeconds(DEFAULT_SUPPORT_TTL_SECONDS);
supportConfig = supportConfig.persistence(new PersistenceConfiguration().strategy(Strategy.NONE)); int activeSize = 2 * refreshAheadConfig.getBatchSize() * refreshAheadConfig.getNumberOfThreads(); supportConfig = supportConfig.maxEntriesLocalHeap(activeSize); supportConfig = supportConfig.memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LRU); supportConfig = supportConfig.timeToLiveSeconds(DEFAULT_SUPPORT_TTL_SECONDS);
cacheConfiguration = cacheConfiguration.maxEntriesLocalHeap( getMaxElementsInMemory() );