/** * 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 Iterator iter = this.getDataStore().getAllLocalBuckets().iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry)iter.next(); Region bucketRegion = (BucketRegion)entry.getValue(); bucketRegion.getAttributesMutator().setCustomEntryTimeToLive(custom); } } return expiry; }
/** * 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 Iterator iter = this.getDataStore().getAllLocalBuckets().iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry)iter.next(); Region bucketRegion = (BucketRegion)entry.getValue(); bucketRegion.getAttributesMutator().setCustomEntryTimeToLive(custom); } } return expiry; }
ExpirationAttributes expire2 = new ExpirationAttributes(timeout2, ExpirationAction.INVALIDATE); mutt.setCustomEntryTimeToLive(new TestExpiry(key1, expire2)); expire2 = new ExpirationAttributes(timeout2, ExpirationAction.INVALIDATE); mutt.setCustomEntryTimeToLive(new TestExpiry(key1, expire2));
mutator.setCustomEntryTimeToLive(attrs.getCustomEntryTimeToLive());
mutator.setCustomEntryTimeToLive(attrs.getCustomEntryTimeToLive());
mutator.setCustomEntryIdleTimeout(customEntryIdle); mutator.setEntryTimeToLive(entryTTL); mutator.setCustomEntryTimeToLive(customTtl); mutator.setRegionIdleTimeout(regionIdle); mutator.setRegionTimeToLive(regionTTL); assertEquals(customEntryIdle, mutator.setCustomEntryIdleTimeout(customEntryIdle2)); assertEquals(entryTTL, mutator.setEntryTimeToLive(entryTTL2)); assertEquals(customTtl, mutator.setCustomEntryTimeToLive(customTtl2)); assertEquals(regionIdle, mutator.setRegionIdleTimeout(regionIdle2)); assertEquals(regionTTL, mutator.setRegionTimeToLive(regionTTL2));