use of org.apache.geode.cache.CustomExpiry in project geode by apache.
the class AbstractRegion method setCustomEntryIdleTimeout.
@Override
public CustomExpiry setCustomEntryIdleTimeout(CustomExpiry custom) {
checkReadiness();
if (custom != null && !this.statisticsEnabled) {
throw new IllegalStateException(LocalizedStrings.AbstractRegion_CANNOT_SET_IDLE_TIMEOUT_WHEN_STATISTICS_ARE_DISABLED.toLocalizedString());
}
CustomExpiry old = getCustomEntryIdleTimeout();
this.customEntryIdleTimeout = custom;
updateEntryExpiryPossible();
idleTimeoutChanged(getEntryIdleTimeout());
return old;
}
use of org.apache.geode.cache.CustomExpiry in project geode by apache.
the class PartitionedRegion method setCustomEntryTimeToLive.
/**
* Changes the custom timeToLive for values in this region
*
* @param custom the new CustomExpiry
* @return the old CustomExpiry
*/
@Override
public CustomExpiry setCustomEntryTimeToLive(CustomExpiry custom) {
CustomExpiry expiry = super.setCustomEntryTimeToLive(custom);
// Set to Bucket regions as well
if (this.getDataStore() != null) {
// not for accessors
for (Object o : this.getDataStore().getAllLocalBuckets()) {
Map.Entry entry = (Map.Entry) o;
Region bucketRegion = (Region) entry.getValue();
bucketRegion.getAttributesMutator().setCustomEntryTimeToLive(custom);
}
}
return expiry;
}
Aggregations