org.apache.geode.cache.RegionAttributes.getMirrorType()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(64)

本文整理了Java中org.apache.geode.cache.RegionAttributes.getMirrorType方法的一些代码示例,展示了RegionAttributes.getMirrorType的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RegionAttributes.getMirrorType方法的具体详情如下:
包路径:org.apache.geode.cache.RegionAttributes
类名称:RegionAttributes
方法名:getMirrorType

RegionAttributes.getMirrorType介绍

[英]Returns the type of mirroring for this region.
[中]返回此区域的镜像类型。

代码示例

代码示例来源:origin: apache/geode

@Override
public MirrorType getMirrorType() {
 return this.ra.getMirrorType();
}

代码示例来源:origin: apache/geode

|| ((RegionAttributesCreation) attrs).hasMirrorType())) {
String mirrorString;
MirrorType mirror = attrs.getMirrorType();
if (mirror.equals(MirrorType.NONE))
 mirrorString = NONE;

代码示例来源:origin: apache/geode

public void remoteTestPostSnapshot(String name, boolean isController, boolean isRoot)
  throws CacheException {
 assertTrue(preSnapshotRegion.isDestroyed());
 try {
  preSnapshotRegion.get("0");
  fail("Should have thrown a RegionReinitializedException");
 } catch (RegionReinitializedException e) {
  // pass
 }
 LogWriter log = getCache().getLogger();
 // get new reference to region
 Region postSnapshotRegion = isRoot ? getRootRegion(name) : getRootRegion().getSubregion(name);
 assertNotNull("Could not get reference to reinitialized region", postSnapshotRegion);
 boolean expectData =
   isController || postSnapshotRegion.getAttributes().getMirrorType().isMirrored()
     || postSnapshotRegion.getAttributes().getDataPolicy().isPreloaded();
 log.info("region has " + postSnapshotRegion.keySet().size() + " entries");
 assertEquals(expectData ? MAX_KEYS : 0, postSnapshotRegion.keySet().size());
 // gets the data either locally or by netSearch
 assertEquals(new Integer(3), postSnapshotRegion.get("3"));
 // bug 33311 coverage
 if (expectData) {
  assertFalse(postSnapshotRegion.containsValueForKey("9"));
  assertTrue(postSnapshotRegion.containsKey("9"));
 }
}

代码示例来源:origin: apache/geode

/**
 * Tests locally invalidating a region entry
 */
@Test
public void testLocalInvalidateEntry() throws CacheException {
 if (!supportsLocalDestroyAndLocalInvalidate()) {
  return;
 }
 String name = this.getUniqueName();
 Object key = "KEY";
 Object value = "VALUE";
 Region region = createRegion(name);
 region.put(key, value);
 Region.Entry entry = region.getEntry(key);
 boolean isMirrorKeysValues = getRegionAttributes().getMirrorType().isKeysValues();
 try {
  region.localInvalidate(key);
  if (isMirrorKeysValues)
   fail("Should have thrown an IllegalStateException");
 } catch (IllegalStateException e) {
  if (!isMirrorKeysValues)
   throw e;
  else
   return; // abort test
 }
 assertNull(entry.getValue());
 assertNull(region.get(key));
}

代码示例来源:origin: apache/geode

boolean isMirrored = getRegionAttributes().getMirrorType().isMirrored();

代码示例来源:origin: apache/geode

region.put("C", "c");
boolean isKV = getRegionAttributes().getMirrorType().isKeysValues();
try {
 region.localInvalidateRegion();

代码示例来源:origin: apache/geode

assertEquals(DataPolicy.DEFAULT, attrs.getDataPolicy());
assertEquals(InterestPolicy.DEFAULT, attrs.getSubscriptionAttributes().getInterestPolicy());
assertEquals(MirrorType.NONE, attrs.getMirrorType());
assertEquals(null, attrs.getDiskStoreName());
assertEquals(AttributesFactory.DEFAULT_DISK_SYNCHRONOUS, attrs.isDiskSynchronous());

相关文章

微信公众号

最新文章

更多

RegionAttributes类方法