/** * Sets the maximum amount of bytes the cache being configured will use on the OffHeap tier * <p> * Changes to this property once the cache is operating will have no effect. * * @param maxBytesOffHeap max bytes on disk in bytes */ public void setMaxBytesLocalOffHeap(final Long maxBytesOffHeap) { if (offHeapPoolUsage != null) { throw new IllegalStateException("OffHeap can't be set dynamically!"); } verifyGreaterThanZero(maxBytesOffHeap, "maxBytesLocalOffHeap"); this.maxBytesLocalOffHeapExplicitlySet = true; this.maxBytesLocalOffHeap = maxBytesOffHeap; }
/** * Setter for maxBytesLocalHeap in bytes * <p> * This property can be modified dynamically while the cache is operating. * * @param maxBytesHeap max bytes in heap in bytes */ public void setMaxBytesLocalHeap(final Long maxBytesHeap) { if (onHeapPoolUsage != null && getMaxEntriesLocalHeap() > 0) { throw new InvalidConfigurationException("MaxEntriesLocalHeap is not compatible with " + "MaxBytesLocalHeap set on cache"); } if (onHeapPoolUsage != null && onHeapPoolUsage != PoolUsage.Cache) { throw new IllegalStateException("A Cache can't switch memory pool!"); } checkDynamicChange(); verifyGreaterThanZero(maxBytesHeap, "maxBytesLocalHeap"); Long oldValue = this.maxBytesLocalHeap; this.maxBytesLocalHeap = maxBytesHeap; fireMaxBytesOnLocalHeapChanged(oldValue, maxBytesHeap); }
/** * Sets the maximum amount of bytes the cache being configured will use on the OnDisk tier * <p> * This property can be modified dynamically while the cache is operating. * * @param maxBytesDisk max bytes on disk in bytes */ public void setMaxBytesLocalDisk(final Long maxBytesDisk) { if (isTerracottaClustered()) { throw new InvalidConfigurationException("MaxBytesLocalDisk is not applicable for Terracotta clustered caches"); } if (onDiskPoolUsage != null && getMaxEntriesLocalDisk() > 0) { throw new InvalidConfigurationException("MaxEntriesLocalDisk is not compatible with " + "MaxBytesLocalDisk set on cache"); } if (onDiskPoolUsage != null && onDiskPoolUsage != PoolUsage.Cache) { throw new IllegalStateException("A Cache can't switch disk pool!"); } checkDynamicChange(); verifyGreaterThanZero(maxBytesDisk, "maxBytesLocalDisk"); maxBytesLocalDiskExplicitlySet = true; Long oldValue = this.maxBytesLocalDisk; this.maxBytesLocalDisk = maxBytesDisk; fireMaxBytesOnLocalDiskChanged(oldValue, maxBytesDisk); }
/** * Sets the maximum amount of bytes the cache being configured will use on the OffHeap tier * @param maxBytesOffHeap max bytes on disk in bytes */ public void setMaxBytesLocalOffHeap(final Long maxBytesOffHeap) { if (offHeapPoolUsage != null) { throw new IllegalStateException("OffHeap can't be set dynamically!"); } verifyGreaterThanZero(maxBytesOffHeap, "maxBytesLocalOffHeap"); this.maxBytesLocalOffHeapExplicitlySet = true; this.maxBytesLocalOffHeap = maxBytesOffHeap; }
/** * Sets the maximum amount of bytes the cache being configured will use on the OffHeap tier * <p> * Changes to this property once the cache is operating will have no effect. * * @param maxBytesOffHeap max bytes on disk in bytes */ public void setMaxBytesLocalOffHeap(final Long maxBytesOffHeap) { if (offHeapPoolUsage != null) { throw new IllegalStateException("OffHeap can't be set dynamically!"); } verifyGreaterThanZero(maxBytesOffHeap, "maxBytesLocalOffHeap"); this.maxBytesLocalOffHeapExplicitlySet = true; this.maxBytesLocalOffHeap = maxBytesOffHeap; }
/** * Sets the maximum amount of bytes the cache being configured will use on the OffHeap tier * <p/> * Changes to this property once the cache is operating will have no effect. * * @param maxBytesOffHeap max bytes on disk in bytes */ public void setMaxBytesLocalOffHeap(final Long maxBytesOffHeap) { if (offHeapPoolUsage != null) { throw new IllegalStateException("OffHeap can't be set dynamically!"); } verifyGreaterThanZero(maxBytesOffHeap, "maxBytesLocalOffHeap"); this.maxBytesLocalOffHeapExplicitlySet = true; this.maxBytesLocalOffHeap = maxBytesOffHeap; }
/** * Sets the maximum amount of bytes the cache being configured will use on the OnDisk tier * @param maxBytesDisk max bytes on disk in bytes */ public void setMaxBytesLocalDisk(final Long maxBytesDisk) { if (onDiskPoolUsage != null && getMaxEntriesLocalDisk() > 0) { throw new InvalidConfigurationException("MaxEntriesLocalDisk is not compatible with " + "MaxBytesLocalDisk set on cache"); } if (onDiskPoolUsage != null && onDiskPoolUsage != PoolUsage.Cache) { throw new IllegalStateException("A Cache can't switch disk pool!"); } verifyGreaterThanZero(maxBytesDisk, "maxBytesLocalDisk"); maxBytesLocalDiskExplicitlySet = true; Long oldValue = this.maxBytesLocalDisk; this.maxBytesLocalDisk = maxBytesDisk; fireMaxBytesOnLocalDiskChanged(oldValue, maxBytesDisk); }
/** * Setter for maxBytesLocalHeap in bytes * @param maxBytesHeap max bytes in heap in bytes */ public void setMaxBytesLocalHeap(final Long maxBytesHeap) { if (onHeapPoolUsage != null && getMaxEntriesLocalHeap() > 0) { throw new InvalidConfigurationException("MaxEntriesLocalHeap is not compatible with " + "MaxBytesLocalHeap set on cache"); } if (onHeapPoolUsage != null && onHeapPoolUsage != PoolUsage.Cache) { throw new IllegalStateException("A Cache can't switch memory pool!"); } verifyGreaterThanZero(maxBytesHeap, "maxBytesLocalHeap"); Long oldValue = this.maxBytesLocalHeap; this.maxBytesLocalHeap = maxBytesHeap; fireMaxBytesOnLocalHeapChanged(oldValue, maxBytesHeap); }
/** * Setter for maxBytesLocalHeap in bytes * <p/> * This property can be modified dynamically while the cache is operating. * * @param maxBytesHeap max bytes in heap in bytes */ public void setMaxBytesLocalHeap(final Long maxBytesHeap) { if (onHeapPoolUsage != null && getMaxEntriesLocalHeap() > 0) { throw new InvalidConfigurationException("MaxEntriesLocalHeap is not compatible with " + "MaxBytesLocalHeap set on cache"); } if (onHeapPoolUsage != null && onHeapPoolUsage != PoolUsage.Cache) { throw new IllegalStateException("A Cache can't switch memory pool!"); } checkDynamicChange(); verifyGreaterThanZero(maxBytesHeap, "maxBytesLocalHeap"); Long oldValue = this.maxBytesLocalHeap; this.maxBytesLocalHeap = maxBytesHeap; fireMaxBytesOnLocalHeapChanged(oldValue, maxBytesHeap); }
/** * Setter for maxBytesLocalHeap in bytes * <p> * This property can be modified dynamically while the cache is operating. * * @param maxBytesHeap max bytes in heap in bytes */ public void setMaxBytesLocalHeap(final Long maxBytesHeap) { if (onHeapPoolUsage != null && getMaxEntriesLocalHeap() > 0) { throw new InvalidConfigurationException("MaxEntriesLocalHeap is not compatible with " + "MaxBytesLocalHeap set on cache"); } if (onHeapPoolUsage != null && onHeapPoolUsage != PoolUsage.Cache) { throw new IllegalStateException("A Cache can't switch memory pool!"); } checkDynamicChange(); verifyGreaterThanZero(maxBytesHeap, "maxBytesLocalHeap"); Long oldValue = this.maxBytesLocalHeap; this.maxBytesLocalHeap = maxBytesHeap; fireMaxBytesOnLocalHeapChanged(oldValue, maxBytesHeap); }
/** * Sets the maximum amount of bytes the cache being configured will use on the OnDisk tier * <p> * This property can be modified dynamically while the cache is operating. * * @param maxBytesDisk max bytes on disk in bytes */ public void setMaxBytesLocalDisk(final Long maxBytesDisk) { if (isTerracottaClustered()) { throw new InvalidConfigurationException("MaxBytesLocalDisk is not applicable for Terracotta clustered caches"); } if (onDiskPoolUsage != null && getMaxEntriesLocalDisk() > 0) { throw new InvalidConfigurationException("MaxEntriesLocalDisk is not compatible with " + "MaxBytesLocalDisk set on cache"); } if (onDiskPoolUsage != null && onDiskPoolUsage != PoolUsage.Cache) { throw new IllegalStateException("A Cache can't switch disk pool!"); } checkDynamicChange(); verifyGreaterThanZero(maxBytesDisk, "maxBytesLocalDisk"); maxBytesLocalDiskExplicitlySet = true; Long oldValue = this.maxBytesLocalDisk; this.maxBytesLocalDisk = maxBytesDisk; fireMaxBytesOnLocalDiskChanged(oldValue, maxBytesDisk); }
/** * Sets the maximum amount of bytes the cache being configured will use on the OnDisk tier * <p/> * This property can be modified dynamically while the cache is operating. * * @param maxBytesDisk max bytes on disk in bytes */ public void setMaxBytesLocalDisk(final Long maxBytesDisk) { if (isTerracottaClustered()) { throw new InvalidConfigurationException("MaxBytesLocalDisk is not applicable for Terracotta clustered caches"); } if (onDiskPoolUsage != null && getMaxEntriesLocalDisk() > 0) { throw new InvalidConfigurationException("MaxEntriesLocalDisk is not compatible with " + "MaxBytesLocalDisk set on cache"); } if (onDiskPoolUsage != null && onDiskPoolUsage != PoolUsage.Cache) { throw new IllegalStateException("A Cache can't switch disk pool!"); } checkDynamicChange(); verifyGreaterThanZero(maxBytesDisk, "maxBytesLocalDisk"); maxBytesLocalDiskExplicitlySet = true; Long oldValue = this.maxBytesLocalDisk; this.maxBytesLocalDisk = maxBytesDisk; fireMaxBytesOnLocalDiskChanged(oldValue, maxBytesDisk); }