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() { return new CacheConfiguration(CACHE_NAME, 2048) .persistence(new PersistenceConfiguration().strategy(PersistenceConfiguration.Strategy.NONE)) .timeToIdleSeconds(120) .timeToLiveSeconds(0) .eternal(false) .memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LRU); }
private synchronized Cache getHeap() { if (heap == null) { if (CacheManager.getInstance().cacheExists("hydrated-cache")) { heap = CacheManager.getInstance().getCache("hydrated-cache"); } else { CacheConfiguration config = new CacheConfiguration("hydrated-cache", 0).eternal(true).overflowToDisk(false).maxElementsInMemory(100000); Cache cache = new Cache(config); CacheManager.create().addCache(cache); heap = cache; } } return heap; }
private synchronized Cache getHeap() { if (offHeap == null) { if (CacheManager.getInstance().cacheExists("hydrated-offheap-cache")) { offHeap = CacheManager.getInstance().getCache("hydrated-offheap-cache"); } else { CacheConfiguration config = new CacheConfiguration("hydrated-offheap-cache", 500).eternal(true).overflowToOffHeap(true).maxMemoryOffHeap("1400M"); Cache cache = new Cache(config); CacheManager.create().addCache(cache); offHeap = cache; } } return offHeap; }
eternal(false).// timeToIdleSeconds(86400).// diskExpiryThreadIntervalSeconds(0).//
.eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .timeToIdleSeconds(timeToIdleSeconds));
.memoryStoreEvictionPolicy(memoryStoreEvictionPolicy) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .timeToIdleSeconds(timeToIdleSeconds)
.eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .timeToIdleSeconds(timeToIdleSeconds) .memoryStoreEvictionPolicy(memoryStoreEvictionPolicy) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .timeToIdleSeconds(timeToIdleSeconds) .memoryStoreEvictionPolicy(memoryStoreEvictionPolicy) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .timeToIdleSeconds(timeToIdleSeconds) .memoryStoreEvictionPolicy(memoryStoreEvictionPolicy) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .timeToIdleSeconds(timeToIdleSeconds) .memoryStoreEvictionPolicy(memoryStoreEvictionPolicy) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .timeToIdleSeconds(timeToIdleSeconds) .memoryStoreEvictionPolicy(memoryStoreEvictionPolicy)
.eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .timeToIdleSeconds(timeToIdleSeconds));
.eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .timeToIdleSeconds(timeToIdleSeconds));
.eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .timeToIdleSeconds(timeToIdleSeconds));
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()); } } }
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 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); } } }
.memoryStoreEvictionPolicy(memoryStoreEvictionPolicy) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .timeToIdleSeconds(timeToIdleSeconds)
.memoryStoreEvictionPolicy(memoryStoreEvictionPolicy) .overflowToDisk(overflowToDisk) .eternal(eternal) .timeToLiveSeconds(timeToLiveSeconds) .timeToIdleSeconds(timeToIdleSeconds)
CacheConfiguration config = new CacheConfiguration(name, 1000).eternal(true); Searchable searchable = new Searchable(); searchable.setKeys(false);