本文整理了Java中org.apache.geode.cache.RegionAttributes.getRegionIdleTimeout
方法的一些代码示例,展示了RegionAttributes.getRegionIdleTimeout
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RegionAttributes.getRegionIdleTimeout
方法的具体详情如下:
包路径:org.apache.geode.cache.RegionAttributes
类名称:RegionAttributes
方法名:getRegionIdleTimeout
[英]Gets the idleTimeout expiration attributes for the region as a whole. Default is 0 which indicates that no expiration of this type will happen. Note that the XML element that corresponds to this method "region-idle-time", does not include "out" in its name.
[中]获取整个区域的idleTimeout过期属性。默认值为0,表示不会发生此类型的过期。请注意,与此方法“region idle time”对应的XML元素的名称中不包含“out”。
代码示例来源:origin: apache/geode
@Override
public int getRegionIdleTimeoutTimeLimit() {
return this.ra.getRegionIdleTimeout().getTimeout();
}
代码示例来源:origin: apache/geode
@Override
public ExpirationAction getRegionIdleTimeoutAction() {
return this.ra.getRegionIdleTimeout().getAction();
}
代码示例来源:origin: apache/geode
private void validateExpirationAttributes(final RegionAttributes userRA,
final PartitionRegionConfig prconf) {
if (!userRA.getRegionIdleTimeout().equals(prconf.getRegionIdleTimeout())) {
throw new IllegalStateException(
String.format(
"The %1$s set in RegionAttributes is incompatible with %1$s used by other distributed members.",
new Object[] {" region idle timout "}));
}
if (!userRA.getRegionTimeToLive().equals(prconf.getRegionTimeToLive())) {
throw new IllegalStateException(
String.format(
"The %1$s set in RegionAttributes is incompatible with %1$s used by other distributed members.",
new Object[] {" region time to live "}));
}
if (!userRA.getEntryIdleTimeout().equals(prconf.getEntryIdleTimeout())) {
throw new IllegalStateException(
String.format(
"The %1$s set in RegionAttributes is incompatible with %1$s used by other distributed members.",
new Object[] {" entry idle timout "}));
}
if (!userRA.getEntryTimeToLive().equals(prconf.getEntryTimeToLive())) {
throw new IllegalStateException(
String.format(
"The %1$s set in RegionAttributes is incompatible with %1$s used by other distributed members.",
new Object[] {" entry time to live "}));
}
}
代码示例来源:origin: apache/geode
private PartitionAttributes initializeAttributes(final Cache cache) {
PartitionAttributes partitionAttributes = mock(PartitionAttributes.class);
RegionAttributes attributes = mock(RegionAttributes.class);
when(attributes.getCacheListeners()).thenReturn(new CacheListener[0]);
when(attributes.getRegionTimeToLive()).thenReturn(ExpirationAttributes.DEFAULT);
when(attributes.getRegionIdleTimeout()).thenReturn(ExpirationAttributes.DEFAULT);
when(attributes.getEntryTimeToLive()).thenReturn(ExpirationAttributes.DEFAULT);
when(attributes.getEntryIdleTimeout()).thenReturn(ExpirationAttributes.DEFAULT);
when(attributes.getMembershipAttributes()).thenReturn(new MembershipAttributes());
when(cache.getRegionAttributes(RegionShortcut.PARTITION.toString())).thenReturn(attributes);
when(partitionAttributes.getTotalNumBuckets()).thenReturn(113);
return partitionAttributes;
}
代码示例来源:origin: apache/geode
allEntryTtl.add(ra.getEntryTimeToLive());
allCustomTtl.add(ra.getCustomEntryTimeToLive().toString());
allRegionIdleTimeout.add(ra.getRegionIdleTimeout());
allEntryIdleTimeout.add(ra.getEntryIdleTimeout());
allCustomIdle.add(ra.getCustomEntryIdleTimeout().toString());
代码示例来源:origin: apache/geode
when(regionAttributes.getRegionIdleTimeout()).thenReturn(expirationAttributes);
when(regionAttributes.getEntryTimeToLive()).thenReturn(expirationAttributes);
when(regionAttributes.getEntryIdleTimeout()).thenReturn(expirationAttributes);
代码示例来源:origin: apache/geode
"Load Factors are not the same");
if (!equal(this.regionIdleTimeout, other.getRegionIdleTimeout())) {
throw new RuntimeException(
"Region Idle Timeout is not the same");
代码示例来源:origin: apache/geode
isLockGrantor = ra.isLockGrantor();
entryIdleTimeout = ra.getEntryIdleTimeout().getTimeout();
regionIdleTimeout = ra.getRegionIdleTimeout().getTimeout();
regionTimeToLive = ra.getRegionTimeToLive().getTimeout();
expAction = ra.getRegionIdleTimeout().getAction();
if (expAction != null) {
regionIdleTimeoutAction = expAction.toString();
代码示例来源:origin: apache/geode
if (attrs.getRegionIdleTimeout().getAction() == ExpirationAction.LOCAL_INVALIDATE
|| attrs.getRegionTimeToLive().getAction() == ExpirationAction.LOCAL_INVALIDATE) {
throw new IllegalStateException(
|| attrs.getRegionIdleTimeout().getTimeout() != 0
|| attrs.getEntryTimeToLive().getTimeout() != 0
|| attrs.getEntryIdleTimeout().getTimeout() != 0
((PartitionAttributesImpl) pa)
.validateWhenAllAttributesAreSet(attrs instanceof RegionAttributesCreation);
ExpirationAttributes regionIdleTimeout = attrs.getRegionIdleTimeout();
ExpirationAttributes regionTimeToLive = attrs.getRegionTimeToLive();
AbstractRegion.validatePRRegionExpirationAttributes(regionIdleTimeout);
代码示例来源:origin: apache/geode
if (generateDefaults() || !attrs.getRegionIdleTimeout().equals(ExpirationAttributes.DEFAULT))
generate(REGION_IDLE_TIME, attrs.getRegionIdleTimeout(), null);
代码示例来源:origin: apache/geode
int regionIdleTimeout = regAttrs.getRegionIdleTimeout().getTimeout();
int entryTimeToLive = regAttrs.getEntryTimeToLive().getTimeout();
int entryIdleTimeout = regAttrs.getEntryIdleTimeout().getTimeout();
代码示例来源:origin: apache/geode
prConfig = new PartitionRegionConfig(this.partitionedRegionId, this.getFullPath(),
prAttribs, this.getScope(), getAttributes().getEvictionAttributes(),
getAttributes().getRegionIdleTimeout(), getAttributes().getRegionTimeToLive(),
getAttributes().getEntryIdleTimeout(), getAttributes().getEntryTimeToLive(),
this.getAllGatewaySenderIds());
代码示例来源:origin: apache/geode
this.valueConstraint = attrs.getValueConstraint();
this.loadFactor = attrs.getLoadFactor();
this.regionIdleTimeout = attrs.getRegionIdleTimeout();
this.regionTimeToLive = attrs.getRegionTimeToLive();
this.scope = attrs.getScope();
代码示例来源:origin: apache/geode
this.regionAttributes.regionTimeToLiveExpirationAction =
regionAttributes.getRegionTimeToLive().getAction();
this.regionAttributes.regionIdleTimeout = regionAttributes.getRegionIdleTimeout().getTimeout();
this.regionAttributes.regionIdleTimeoutExpirationAction =
regionAttributes.getRegionIdleTimeout().getAction();
代码示例来源:origin: apache/geode
this.regionTimeToLiveExpirationAction = attrs.getRegionTimeToLive().getAction();
setRegionTimeToLiveAtts();
this.regionIdleTimeout = attrs.getRegionIdleTimeout().getTimeout();
this.regionIdleTimeoutExpirationAction = attrs.getRegionIdleTimeout().getAction();
setRegionIdleTimeoutAttributes();
this.entryTimeToLive = attrs.getEntryTimeToLive().getTimeout();
代码示例来源:origin: apache/geode
factory.setEntryTimeToLive(ea);
ea = this.partitionedRegion.getAttributes().getRegionIdleTimeout();
if (ea != null) {
if (ea.getAction() != ExpirationAction.DESTROY)
代码示例来源:origin: apache/geode
this.valueConstraint = attr.getValueConstraint();
this.rTtl = attr.getRegionTimeToLive();
this.rIdleTimeout = attr.getRegionIdleTimeout();
this.eTtl = attr.getEntryTimeToLive();
this.customEttlDesc = getDesc(attr.getCustomEntryTimeToLive());
代码示例来源:origin: apache/geode
assertEquals(Arrays.asList(new CacheListener[0]), Arrays.asList(attrs.getCacheListeners()));
assertEquals(0, attrs.getRegionTimeToLive().getTimeout());
assertEquals(0, attrs.getRegionIdleTimeout().getTimeout());
assertEquals(0, attrs.getEntryTimeToLive().getTimeout());
assertEquals(null, attrs.getCustomEntryTimeToLive());
代码示例来源:origin: apache/geode
if (parentIsUserSpecified) {
if (parentWithHas.hasRegionIdleTimeout()) {
setRegionIdleTimeout(parent.getRegionIdleTimeout());
setRegionIdleTimeout(parent.getRegionIdleTimeout());
代码示例来源:origin: org.springframework.data/spring-data-gemfire
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);
}
内容来源于网络,如有侵权,请联系作者删除!