@Override public String getCustomEntryIdleTimeout() { Object o = this.ra.getCustomEntryIdleTimeout(); if (o == null) { return ""; } else { return o.toString(); } }
allRegionIdleTimeout.add(ra.getRegionIdleTimeout()); allEntryIdleTimeout.add(ra.getEntryIdleTimeout()); allCustomIdle.add(ra.getCustomEntryIdleTimeout().toString()); allScopes.add(ra.getScope()); allLoadFactors.add(new Float(ra.getLoadFactor()));
"EntryIdleTimeout is not the same"); if (!equal(this.customEntryIdleTimeout, other.getCustomEntryIdleTimeout())) { throw new RuntimeException(String.format( "CustomEntryIdleTimeout is not the same. this %s, other: %s", this.customEntryIdleTimeout, other.getCustomEntryIdleTimeout()));
CustomExpiry<?, ?> customIdleTimeout = ra.getCustomEntryIdleTimeout(); if (customIdleTimeout != null) { customExpiryIdleTimeoutClass = customIdleTimeout.getClass().getName();
|| ((RegionAttributesCreation) attrs).hasCustomEntryIdleTimeout())) { if (generateDefaults() || !attrs.getEntryIdleTimeout().equals(ExpirationAttributes.DEFAULT) || attrs.getCustomEntryIdleTimeout() != null) generate(ENTRY_IDLE_TIME, attrs.getEntryIdleTimeout(), attrs.getCustomEntryIdleTimeout());
Object o2 = regAttrs.getCustomEntryIdleTimeout(); if (o2 != null) { customEntryIdleTimeout = o2.toString();
|| attrs.getEntryTimeToLive().getTimeout() != 0 || attrs.getEntryIdleTimeout().getTimeout() != 0 || attrs.getCustomEntryIdleTimeout() != null || attrs.getCustomEntryTimeToLive() != null)) { throw new IllegalStateException( "Statistics must be enabled for expiration"); || attrs.getEntryIdleTimeout().getTimeout() != 0 || attrs.getCustomEntryTimeToLive() != null || attrs.getCustomEntryIdleTimeout() != null) { throw new IllegalStateException( String.format("If the data policy is %s then entry expiration is not allowed.",
CustomExpiry<?, ?> customIdle = regionAttributes.getCustomEntryIdleTimeout(); if (customIdle != null) { try {
this.cacheWriter = attrs.getCacheWriter(); this.entryIdleTimeout = attrs.getEntryIdleTimeout(); this.customEntryIdleTimeout = attrs.getCustomEntryIdleTimeout(); this.entryTimeToLive = attrs.getEntryTimeToLive(); this.customEntryTimeToLive = attrs.getCustomEntryTimeToLive();
factory.setRegionTimeToLive(ea); CustomExpiry ce = this.partitionedRegion.getAttributes().getCustomEntryIdleTimeout(); if (ce != null) { factory.setCustomEntryIdleTimeout(ce);
this.entryIdleTimeoutExpirationAction = attrs.getEntryIdleTimeout().getAction(); setEntryIdleTimeoutAttributes(); this.customEntryIdleTimeout = attrs.getCustomEntryIdleTimeout(); updateEntryExpiryPossible(); this.statisticsEnabled = attrs.getStatisticsEnabled();
this.regionAttributes.entryIdleTimeoutExpirationAction = regionAttributes.getEntryIdleTimeout().getAction(); this.regionAttributes.customEntryIdleTimeout = regionAttributes.getCustomEntryIdleTimeout();
this.customEttlDesc = getDesc(attr.getCustomEntryTimeToLive()); this.eIdleTimeout = attr.getEntryIdleTimeout(); this.customEIdleDesc = getDesc(attr.getCustomEntryIdleTimeout()); this.dataPolicy = attr.getDataPolicy(); this.scope = attr.getScope();
assertEquals(null, attrs.getCustomEntryTimeToLive()); assertEquals(0, attrs.getEntryIdleTimeout().getTimeout()); assertEquals(null, attrs.getCustomEntryIdleTimeout()); assertEquals(Scope.DISTRIBUTED_NO_ACK, attrs.getScope()); assertEquals(DataPolicy.DEFAULT, attrs.getDataPolicy());
setCustomEntryIdleTimeout(parent.getCustomEntryIdleTimeout());
new AtomicReference<>(baseRegionAttributes.getCustomEntryIdleTimeout()); .when(mockAttributesMutator).setCloningEnabled(anyBoolean()); doAnswer(newSetter(customEntryIdleTimeout, baseRegionAttributes.getCustomEntryIdleTimeout())) .when(mockAttributesMutator).setCustomEntryIdleTimeout(any(CustomExpiry.class)); when(mockRegionAttributes.getConcurrencyChecksEnabled()).thenAnswer(newGetter(baseRegionAttributes::getConcurrencyChecksEnabled)); when(mockRegionAttributes.getConcurrencyLevel()).thenAnswer(newGetter(baseRegionAttributes::getConcurrencyLevel)); when(mockRegionAttributes.getCustomEntryIdleTimeout()).thenAnswer(newGetter(customEntryIdleTimeout::get)); when(mockRegionAttributes.getCustomEntryTimeToLive()).thenAnswer(newGetter(customEntryTimeToLive::get)); when(mockRegionAttributes.getDataPolicy()).thenAnswer(newGetter(baseRegionAttributes::getDataPolicy));
private Optional<String> configureWithRegionAttributes(ClientRegionFactory<K, V> clientRegionFactory) { AtomicReference<String> regionAttributesPoolName = new AtomicReference<>(null); Optional.ofNullable(getAttributes()).ifPresent(regionAttributes -> { regionAttributesPoolName.set(regionAttributes.getPoolName()); stream(nullSafeArray(regionAttributes.getCacheListeners(), CacheListener.class)) .forEach(clientRegionFactory::addCacheListener); clientRegionFactory.setCloningEnabled(regionAttributes.getCloningEnabled()); clientRegionFactory.setCompressor(regionAttributes.getCompressor()); clientRegionFactory.setConcurrencyChecksEnabled(regionAttributes.getConcurrencyChecksEnabled()); clientRegionFactory.setConcurrencyLevel(regionAttributes.getConcurrencyLevel()); clientRegionFactory.setCustomEntryIdleTimeout(regionAttributes.getCustomEntryIdleTimeout()); clientRegionFactory.setCustomEntryTimeToLive(regionAttributes.getCustomEntryTimeToLive()); clientRegionFactory.setDiskStoreName(regionAttributes.getDiskStoreName()); clientRegionFactory.setDiskSynchronous(regionAttributes.isDiskSynchronous()); clientRegionFactory.setEntryIdleTimeout(regionAttributes.getEntryIdleTimeout()); clientRegionFactory.setEntryTimeToLive(regionAttributes.getEntryTimeToLive()); clientRegionFactory.setEvictionAttributes(regionAttributes.getEvictionAttributes()); clientRegionFactory.setInitialCapacity(regionAttributes.getInitialCapacity()); clientRegionFactory.setKeyConstraint(regionAttributes.getKeyConstraint()); clientRegionFactory.setLoadFactor(regionAttributes.getLoadFactor()); clientRegionFactory.setRegionIdleTimeout(regionAttributes.getRegionIdleTimeout()); clientRegionFactory.setRegionTimeToLive(regionAttributes.getRegionTimeToLive()); clientRegionFactory.setStatisticsEnabled(regionAttributes.getStatisticsEnabled()); clientRegionFactory.setValueConstraint(regionAttributes.getValueConstraint()); }); return Optional.ofNullable(regionAttributesPoolName.get()).filter(StringUtils::hasText); }
private Optional<String> configureWithRegionAttributes(ClientRegionFactory<K, V> clientRegionFactory) { AtomicReference<String> regionAttributesPoolName = new AtomicReference<>(null); Optional.ofNullable(getAttributes()).ifPresent(regionAttributes -> { regionAttributesPoolName.set(regionAttributes.getPoolName()); stream(nullSafeArray(regionAttributes.getCacheListeners(), CacheListener.class)) .forEach(clientRegionFactory::addCacheListener); clientRegionFactory.setCloningEnabled(regionAttributes.getCloningEnabled()); clientRegionFactory.setCompressor(regionAttributes.getCompressor()); clientRegionFactory.setConcurrencyChecksEnabled(regionAttributes.getConcurrencyChecksEnabled()); clientRegionFactory.setConcurrencyLevel(regionAttributes.getConcurrencyLevel()); clientRegionFactory.setCustomEntryIdleTimeout(regionAttributes.getCustomEntryIdleTimeout()); clientRegionFactory.setCustomEntryTimeToLive(regionAttributes.getCustomEntryTimeToLive()); clientRegionFactory.setDiskStoreName(regionAttributes.getDiskStoreName()); clientRegionFactory.setDiskSynchronous(regionAttributes.isDiskSynchronous()); clientRegionFactory.setEntryIdleTimeout(regionAttributes.getEntryIdleTimeout()); clientRegionFactory.setEntryTimeToLive(regionAttributes.getEntryTimeToLive()); clientRegionFactory.setEvictionAttributes(regionAttributes.getEvictionAttributes()); clientRegionFactory.setInitialCapacity(regionAttributes.getInitialCapacity()); clientRegionFactory.setKeyConstraint(regionAttributes.getKeyConstraint()); clientRegionFactory.setLoadFactor(regionAttributes.getLoadFactor()); clientRegionFactory.setRegionIdleTimeout(regionAttributes.getRegionIdleTimeout()); clientRegionFactory.setRegionTimeToLive(regionAttributes.getRegionTimeToLive()); clientRegionFactory.setStatisticsEnabled(regionAttributes.getStatisticsEnabled()); clientRegionFactory.setValueConstraint(regionAttributes.getValueConstraint()); }); return Optional.ofNullable(regionAttributesPoolName.get()).filter(StringUtils::hasText); }
regionFactory.setConcurrencyChecksEnabled(regionAttributes.getConcurrencyChecksEnabled()); regionFactory.setConcurrencyLevel(regionAttributes.getConcurrencyLevel()); regionFactory.setCustomEntryIdleTimeout(regionAttributes.getCustomEntryIdleTimeout()); regionFactory.setCustomEntryTimeToLive(regionAttributes.getCustomEntryTimeToLive()); regionFactory.setDiskSynchronous(regionAttributes.isDiskSynchronous());
regionFactory.setConcurrencyChecksEnabled(regionAttributes.getConcurrencyChecksEnabled()); regionFactory.setConcurrencyLevel(regionAttributes.getConcurrencyLevel()); regionFactory.setCustomEntryIdleTimeout(regionAttributes.getCustomEntryIdleTimeout()); regionFactory.setCustomEntryTimeToLive(regionAttributes.getCustomEntryTimeToLive()); regionFactory.setDiskSynchronous(regionAttributes.isDiskSynchronous());