/** * 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 * @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); }
/** * 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); }