/** * Builder which sets the maximum number elements on Disk. 0 means unlimited. * <p> * This property can be modified dynamically while the cache is operating. * * @param maxElementsOnDisk the maximum number of Elements to allow on the disk. 0 means unlimited. * @return this configuration instance * @see #setMaxElementsOnDisk(int) * @deprecated use {@link #maxEntriesLocalDisk(int)} for unclustered caches and {@link #maxEntriesInCache(long)} for clustered caches. */ public final CacheConfiguration maxElementsOnDisk(int maxElementsOnDisk) { setMaxElementsOnDisk(maxElementsOnDisk); return this; }
/** * setMaxElementsOnDisk * * @param maxElements * @deprecated use {@link #setMaxEntriesLocalDisk(long)} */ @Deprecated public void setMaxElementsOnDisk(int maxElements) { cacheConfiguration.setMaxElementsOnDisk(maxElements); }
/** * {@inheritDoc} */ public void setRegionCacheTargetMaxTotalCount(String region, int targetMaxTotalCount) { Cache cache = this.cacheManager.getCache(region); if (cache != null) { cache.getCacheConfiguration().setMaxElementsOnDisk(targetMaxTotalCount); sendNotification(CACHE_REGION_CHANGED, getRegionCacheAttributes(region), region); } }
/** * {@inheritDoc} */ @Override public void setMaxElementsOnDisk(int maxElements) { if (getMaxElementsOnDisk() != maxElements) { try { cache.getCacheConfiguration().setMaxElementsOnDisk(maxElements); } catch (RuntimeException e) { throw Utils.newPlainException(e); } } }
/** * Sets the maximum number elements on Disk. 0 means unlimited. * <p> * This property can be modified dynamically while the cache is operating. * * @param maxEntriesLocalDisk the maximum number of Elements to allow on the disk. 0 means unlimited. */ public void setMaxEntriesLocalDisk(long maxEntriesLocalDisk) { if (isTerracottaClustered()) { throw new InvalidConfigurationException("MaxEntriesLocalDisk is not applicable for Terracotta clustered caches"); } verifyGreaterThanOrEqualToZero(maxEntriesLocalDisk, "maxEntriesLocalDisk"); if (maxEntriesLocalDisk > Integer.MAX_VALUE) { throw new IllegalArgumentException("Values greater than Integer.MAX_VALUE are not currently supported."); } // This check against pool usage is only there to see if this configuration backs up a running cache if (onDiskPoolUsage != null && isTerracottaClustered()) { throw new IllegalStateException("Can't use local disks with Terracotta clustered caches!"); } maxEntriesLocalDiskExplicitlySet = true; setMaxElementsOnDisk((int)maxEntriesLocalDisk); }
/** * Builder which sets the maximum number elements on Disk. 0 means unlimited. * <p> * This property can be modified dynamically while the cache is operating. * * @param maxElementsOnDisk the maximum number of Elements to allow on the disk. 0 means unlimited. * @return this configuration instance * @see #setMaxElementsOnDisk(int) * @deprecated use {@link #maxEntriesLocalDisk(int)} for unclustered caches and {@link #maxEntriesInCache(long)} for clustered caches. */ public final CacheConfiguration maxElementsOnDisk(int maxElementsOnDisk) { setMaxElementsOnDisk(maxElementsOnDisk); return this; }
/** * Builder which sets the maximum number elements on Disk. 0 means unlimited. * <p/> * This property can be modified dynamically while the cache is operating. * * @param maxElementsOnDisk the maximum number of Elements to allow on the disk. 0 means unlimited. * @return this configuration instance * @see #setMaxElementsOnDisk(int) */ public final CacheConfiguration maxElementsOnDisk(int maxElementsOnDisk) { setMaxElementsOnDisk(maxElementsOnDisk); return this; }
/** * setMaxElementsOnDisk * * @param maxElements * @deprecated use {@link #setMaxEntriesLocalDisk(long)} */ @Deprecated public void setMaxElementsOnDisk(int maxElements) { cacheConfiguration.setMaxElementsOnDisk(maxElements); }
/** * setMaxElementsOnDisk * * @param maxElements * @deprecated use {@link #setMaxEntriesLocalDisk(long)} */ @Deprecated public void setMaxElementsOnDisk(int maxElements) { cacheConfiguration.setMaxElementsOnDisk(maxElements); }
/** * setMaxElementsOnDisk * * @param maxElements * @deprecated use {@link #setMaxEntriesLocalDisk(long)} */ @Deprecated public void setMaxElementsOnDisk(int maxElements) { cacheConfiguration.setMaxElementsOnDisk(maxElements); }
} else { supportConfig.setMaxElementsOnDisk(activeSize); }
/** * {@inheritDoc} */ public void setRegionCacheTargetMaxTotalCount(String region, int targetMaxTotalCount) { Cache cache = this.cacheManager.getCache(region); if (cache != null) { cache.getCacheConfiguration().setMaxElementsOnDisk(targetMaxTotalCount); sendNotification(CACHE_REGION_CHANGED, getRegionCacheAttributes(region), region); } }
/** * {@inheritDoc} */ public void setRegionCacheTargetMaxTotalCount(String region, int targetMaxTotalCount) { Cache cache = this.cacheManager.getCache(region); if (cache != null) { cache.getCacheConfiguration().setMaxElementsOnDisk(targetMaxTotalCount); sendNotification(CACHE_REGION_CHANGED, getRegionCacheAttributes(region), region); } }
/** * {@inheritDoc} */ public void setRegionCacheTargetMaxTotalCount(String region, int targetMaxTotalCount) { Cache cache = this.cacheManager.getCache(region); if (cache != null) { cache.getCacheConfiguration().setMaxElementsOnDisk(targetMaxTotalCount); sendNotification(CACHE_REGION_CHANGED, getRegionCacheAttributes(region), region); } }
/** * {@inheritDoc} */ public void setMaxElementsOnDisk(int maxElements) { if (getMaxElementsOnDisk() != maxElements) { try { cache.getCacheConfiguration().setMaxElementsOnDisk(maxElements); } catch (RuntimeException e) { throw Utils.newPlainException(e); } } }
public void setMaxElementsOnDisk( int maxElementsOnDisk ) { this.maxElementsOnDisk = maxElementsOnDisk; if ( this.ehcache != null ) { this.ehcache.getCacheConfiguration().setMaxElementsOnDisk( this.maxElementsOnDisk ); this.ehcache.getCacheConfiguration().maxEntriesLocalDisk( this.maxElementsOnDisk ); } }
/** * {@inheritDoc} */ @Override public void setMaxElementsOnDisk(int maxElements) { if (getMaxElementsOnDisk() != maxElements) { try { cache.getCacheConfiguration().setMaxElementsOnDisk(maxElements); } catch (RuntimeException e) { throw Utils.newPlainException(e); } } }
/** * {@inheritDoc} */ @Override public void setMaxElementsOnDisk(int maxElements) { if (getMaxElementsOnDisk() != maxElements) { try { cache.getCacheConfiguration().setMaxElementsOnDisk(maxElements); } catch (RuntimeException e) { throw Utils.newPlainException(e); } } }
protected CacheConfiguration getEhCacheConfiguration(final org.bonitasoft.engine.cache.CacheConfiguration cacheConfig) { final CacheConfiguration ehCacheConfig = new CacheConfiguration(); ehCacheConfig.setMaxElementsInMemory(cacheConfig.getMaxElementsInMemory()); ehCacheConfig.setMaxElementsOnDisk(cacheConfig.getMaxElementsOnDisk()); ehCacheConfig.setOverflowToDisk(!cacheConfig.isInMemoryOnly()); ehCacheConfig.setEternal(cacheConfig.isEternal()); ehCacheConfig.setCopyOnRead(cacheConfig.isCopyOnRead()); ehCacheConfig.setCopyOnWrite(cacheConfig.isCopyOnWrite()); if (!cacheConfig.isEternal()) { ehCacheConfig.setTimeToLiveSeconds(cacheConfig.getTimeToLiveSeconds()); } return ehCacheConfig; }
protected CacheConfiguration getEhCacheConfiguration(final org.bonitasoft.engine.cache.CacheConfiguration cacheConfig) { final CacheConfiguration ehCacheConfig = new CacheConfiguration(); ehCacheConfig.setMaxElementsInMemory(cacheConfig.getMaxElementsInMemory()); ehCacheConfig.setMaxElementsOnDisk(cacheConfig.getMaxElementsOnDisk()); ehCacheConfig.setOverflowToDisk(!cacheConfig.isInMemoryOnly()); ehCacheConfig.setEternal(cacheConfig.isEternal()); ehCacheConfig.setCopyOnRead(cacheConfig.isCopyOnRead()); ehCacheConfig.setCopyOnWrite(cacheConfig.isCopyOnWrite()); if (!cacheConfig.isEternal()) { ehCacheConfig.setTimeToLiveSeconds(cacheConfig.getTimeToLiveSeconds()); } return ehCacheConfig; }