public GoCacheFactory(TransactionSynchronizationManager transactionSynchronizationManager, @Value("${cruise.cache.elements.limit}") int maxElementsInMemory, @Value("${cruise.cache.is.eternal}") boolean eternal) { this.transactionSynchronizationManager = transactionSynchronizationManager; cacheConfiguration = new CacheConfiguration("goCache", maxElementsInMemory) .persistence(new PersistenceConfiguration().strategy(PersistenceConfiguration.Strategy.NONE)) .eternal(eternal) .memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LRU); }
private static CacheConfiguration cacheConfiguration(String cacheName) { return new CacheConfiguration(cacheName, 1024) .memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LRU) .overflowToDisk(false) .diskPersistent(false); }
private static CacheConfiguration cacheConfiguration(String cacheName) { return new CacheConfiguration(cacheName, 1024) .memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LRU) .overflowToDisk(false) .diskPersistent(false); }
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); }
memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LRU).// eternal(false).// timeToIdleSeconds(86400).//
int activeSize = 2 * refreshAheadConfig.getBatchSize() * refreshAheadConfig.getNumberOfThreads(); supportConfig = supportConfig.maxEntriesLocalHeap(activeSize); supportConfig = supportConfig.memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LRU); supportConfig = supportConfig.timeToLiveSeconds(DEFAULT_SUPPORT_TTL_SECONDS);
.memoryStoreEvictionPolicy(memoryStoreEvictionPolicy) .overflowToDisk(overflowToDisk) .eternal(eternal)
.memoryStoreEvictionPolicy(memoryStoreEvictionPolicy) .overflowToDisk(overflowToDisk) .eternal(eternal) .memoryStoreEvictionPolicy(memoryStoreEvictionPolicy) .overflowToDisk(overflowToDisk) .eternal(eternal) .memoryStoreEvictionPolicy(memoryStoreEvictionPolicy) .overflowToDisk(overflowToDisk) .eternal(eternal) .memoryStoreEvictionPolicy(memoryStoreEvictionPolicy) .overflowToDisk(overflowToDisk) .eternal(eternal) .memoryStoreEvictionPolicy(memoryStoreEvictionPolicy) .overflowToDisk(overflowToDisk) .eternal(eternal)
private Cache createCache() { Cache eventsDeliveredCache = new Cache( new CacheConfiguration(this.proxyIdentifier, 0).memoryStoreEvictionPolicy( MemoryStoreEvictionPolicy.LRU) .eternal(true) .persistence( new PersistenceConfiguration().strategy(Strategy.LOCALTEMPSWAP)) .transactionalMode(TransactionalMode.OFF)); eventsDeliveredCache.disableDynamicFeatures(); this.cacheManager = this.getOrCreateCacheManager(super.diskStorePath); this.cacheManager.addCache(eventsDeliveredCache); return this.cacheManager.getCache(this.proxyIdentifier); }
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); }
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()); } } }
public NcwmsCatalogue(NcwmsConfig config) throws IOException { super(config, new SimpleLayerNameMapper()); this.styleCatalogue = SldTemplateStyleCatalogue.getStyleCatalogue(); dynamicCacheEnabled = config.getDynamicCacheInfo().isEnabled(); if (dynamicCacheEnabled) { if (EdalCache.cacheManager.cacheExists(CACHE_NAME) == false) { NcwmsDynamicCacheInfo cacheInfo = config.getDynamicCacheInfo(); /* * Configure cache */ CacheConfiguration cacheConfig = new CacheConfiguration(CACHE_NAME, cacheInfo.getNumberOfDatasets()) .memoryStoreEvictionPolicy(EVICTION_POLICY) .persistence(new PersistenceConfiguration() .strategy(PERSISTENCE_STRATEGY)) .transactionalMode(TRANSACTIONAL_MODE); if (cacheInfo.getElementLifetimeMinutes() > 0) { cacheConfig.setTimeToLiveSeconds( (long) (cacheInfo.getElementLifetimeMinutes() * 60)); } else { cacheConfig.eternal(true); } dynamicDatasetCache = new Cache(cacheConfig); EdalCache.cacheManager.addCache(dynamicDatasetCache); } else { dynamicDatasetCache = EdalCache.cacheManager.getCache(CACHE_NAME); } } }
int activeSize = 2 * refreshAheadConfig.getBatchSize() * refreshAheadConfig.getNumberOfThreads(); supportConfig = supportConfig.maxEntriesLocalHeap(activeSize); supportConfig = supportConfig.memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LRU); supportConfig = supportConfig.timeToLiveSeconds(DEFAULT_SUPPORT_TTL_SECONDS);
int activeSize = 2 * refreshAheadConfig.getBatchSize() * refreshAheadConfig.getNumberOfThreads(); supportConfig = supportConfig.maxEntriesLocalHeap(activeSize); supportConfig = supportConfig.memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LRU); supportConfig = supportConfig.timeToLiveSeconds(DEFAULT_SUPPORT_TTL_SECONDS);
.memoryStoreEvictionPolicy(memoryStoreEvictionPolicy) .overflowToDisk(overflowToDisk) .eternal(eternal)
.memoryStoreEvictionPolicy(memoryStoreEvictionPolicy) .overflowToDisk(overflowToDisk) .eternal(eternal)
.memoryStoreEvictionPolicy(memoryStoreEvictionPolicy) .overflowToDisk(overflowToDisk) .eternal(eternal)
new CacheConfiguration().name( getName() ).memoryStoreEvictionPolicy( getMemoryStoreEvictionPolicy() ).eternal( isEternal() ).timeToLiveSeconds( getTimeToLiveSeconds() ).timeToIdleSeconds(
.memoryStoreEvictionPolicy(EVICTION_POLICY) .persistence( new PersistenceConfiguration().strategy(PERSISTENCE_STRATEGY))
defaultCacheConfiguration.setOverflowToDisk(true); defaultCacheConfiguration.setDiskPersistent(false); defaultCacheConfiguration.memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LRU); defaultCacheConfiguration.setDiskExpiryThreadIntervalSeconds(localDiskExpiryThreadIntervalSeconds);