本文整理了Java中org.apache.geode.cache.RegionAttributes.isLockGrantor
方法的一些代码示例,展示了RegionAttributes.isLockGrantor
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RegionAttributes.isLockGrantor
方法的具体详情如下:
包路径:org.apache.geode.cache.RegionAttributes
类名称:RegionAttributes
方法名:isLockGrantor
[英]Returns true if this member is configured to be lock grantor for the region. Result will always be false if the scope is not Scope.GLOBAL
.
This attribute does not indicate whether or not this member is currently lock grantor. It only indicates that at the time of region creation, this member should attempt to become lock grantor. Default value is false.
[中]如果此成员配置为该区域的锁授予者,则返回true。如果作用域不是[$0$],则结果将始终为false。
此属性不指示此成员当前是否为锁授予者。它只表示在创建区域时,该成员应尝试成为锁授予人。默认值为false。
代码示例来源:origin: apache/geode
@Test
public void testCopyConstructor() {
AttributesFactory f1 = new AttributesFactory();
f1.setLockGrantor(true);
RegionAttributes origAttrs = f1.create();
assertEquals(true, origAttrs.isLockGrantor());
AttributesFactory f2 = new AttributesFactory(origAttrs);
RegionAttributes attrs = f2.create();
assertEquals(true, attrs.isLockGrantor());
}
代码示例来源:origin: apache/geode
statisticsEnabled = ra.getStatisticsEnabled();
entryTimeToLive = ra.getEntryTimeToLive().getTimeout();
isLockGrantor = ra.isLockGrantor();
entryIdleTimeout = ra.getEntryIdleTimeout().getTimeout();
regionIdleTimeout = ra.getRegionIdleTimeout().getTimeout();
代码示例来源:origin: apache/geode
if ((!(attrs instanceof RegionAttributesCreation)
|| ((RegionAttributesCreation) attrs).hasIsLockGrantor())) {
if (generateDefaults() || attrs.isLockGrantor())
atts.addAttribute("", "", IS_LOCK_GRANTOR, "", String.valueOf(attrs.isLockGrantor()));
代码示例来源:origin: apache/geode
int initialCapacity = regAttrs.getInitialCapacity();
float loadFactor = regAttrs.getLoadFactor();
boolean lockGrantor = regAttrs.isLockGrantor();
boolean multicastEnabled = regAttrs.getMulticastEnabled();
int concurrencyLevel = regAttrs.getConcurrencyLevel();
代码示例来源:origin: apache/geode
if (attrs.isLockGrantor() == true) {
throw new IllegalStateException(
"setLockGranter(true) is not allowed in Partitioned Regions.");
代码示例来源:origin: apache/geode
this.statisticsEnabled = attrs.getStatisticsEnabled();
this.ignoreJTA = attrs.getIgnoreJTA();
this.isLockGrantor = attrs.isLockGrantor();
this.keyConstraint = attrs.getKeyConstraint();
this.valueConstraint = attrs.getValueConstraint();
代码示例来源:origin: apache/geode
this.regionAttributes.asyncEventQueueIds =
new CopyOnWriteArraySet<String>(regionAttributes.getAsyncEventQueueIds());
this.regionAttributes.isLockGrantor = regionAttributes.isLockGrantor(); // fix for bug 47067
if (regionAttributes instanceof UserSpecifiedRegionAttributes) {
this.regionAttributes
代码示例来源:origin: apache/geode
if (parentIsUserSpecified) {
if (parentWithHas.hasIsLockGrantor()) {
setLockGrantor(parent.isLockGrantor());
setLockGrantor(parent.isLockGrantor());
代码示例来源:origin: org.springframework.data/spring-data-geode
private Region<K, V> enableAsLockGrantor(Region<K, V> region) {
Optional.ofNullable(region)
.filter(it -> it.getAttributes().isLockGrantor())
.ifPresent(Region::becomeLockGrantor);
return region;
}
代码示例来源:origin: org.springframework.data/spring-data-geode
private RegionAttributes<K, V> verifyLockGrantorEligibility(RegionAttributes<K, V> regionAttributes, Scope scope) {
Optional.ofNullable(regionAttributes).ifPresent(attributes ->
Assert.state(!attributes.isLockGrantor() || verifyScope(scope),
"Lock Grantor only applies to GLOBAL Scoped Regions"));
return regionAttributes;
}
代码示例来源:origin: org.springframework.data/spring-data-gemfire
private Region<K, V> enableAsLockGrantor(Region<K, V> region) {
Optional.ofNullable(region)
.filter(it -> it.getAttributes().isLockGrantor())
.ifPresent(Region::becomeLockGrantor);
return region;
}
代码示例来源:origin: org.springframework.data/spring-data-gemfire
private RegionAttributes<K, V> verifyLockGrantorEligibility(RegionAttributes<K, V> regionAttributes, Scope scope) {
Optional.ofNullable(regionAttributes).ifPresent(attributes ->
Assert.state(!attributes.isLockGrantor() || verifyScope(scope),
"Lock Grantor only applies to GLOBAL Scoped Regions"));
return regionAttributes;
}
代码示例来源:origin: org.springframework.data/spring-data-geode-test
when(mockRegionAttributes.getKeyConstraint()).thenAnswer(newGetter(keyConstraint));
when(mockRegionAttributes.getLoadFactor()).thenAnswer(newGetter(loadFactor));
when(mockRegionAttributes.isLockGrantor()).thenAnswer(newGetter(lockGrantor));
when(mockRegionAttributes.getMulticastEnabled()).thenAnswer(newGetter(multicastEnabled));
when(mockRegionAttributes.getOffHeap()).thenAnswer(newGetter(offHeap));
代码示例来源:origin: org.springframework.data/spring-data-geode-test
when(mockRegionAttributes.getValueConstraint()).thenAnswer(newGetter(baseRegionAttributes::getValueConstraint));
when(mockRegionAttributes.isDiskSynchronous()).thenAnswer(newGetter(baseRegionAttributes::isDiskSynchronous));
when(mockRegionAttributes.isLockGrantor()).thenAnswer(newGetter(baseRegionAttributes::isLockGrantor));
代码示例来源:origin: org.springframework.data/spring-data-geode
regionFactory.setKeyConstraint(regionAttributes.getKeyConstraint());
regionFactory.setLoadFactor(regionAttributes.getLoadFactor());
regionFactory.setLockGrantor(regionAttributes.isLockGrantor());
regionFactory.setMembershipAttributes(regionAttributes.getMembershipAttributes());
regionFactory.setMulticastEnabled(regionAttributes.getMulticastEnabled());
代码示例来源:origin: org.springframework.data/spring-data-gemfire
regionFactory.setKeyConstraint(regionAttributes.getKeyConstraint());
regionFactory.setLoadFactor(regionAttributes.getLoadFactor());
regionFactory.setLockGrantor(regionAttributes.isLockGrantor());
regionFactory.setMembershipAttributes(regionAttributes.getMembershipAttributes());
regionFactory.setMulticastEnabled(regionAttributes.getMulticastEnabled());
内容来源于网络,如有侵权,请联系作者删除!