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

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

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

RegionAttributes.getConcurrencyChecksEnabled介绍

[英]Returns true if concurrent update checks are turned on for this region.

When this is enabled, concurrent updates will be conflated if they are applied out of order.

All members must set this attribute the same. Default is set to true.
[中]如果此区域启用了并发更新检查,则返回true。
启用此选项后,如果应用顺序不正确,则并发更新将合并。
所有成员必须将此属性设置为相同。默认设置为true。

代码示例

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

@Override
public boolean getConcurrencyChecksEnabled() {
 return this.ra.getConcurrencyChecksEnabled();
}

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

protected void checkVersionTag(DistributedRegion rgn, VersionTag tag) {
 RegionAttributes attr = rgn.getAttributes();
 if (attr.getConcurrencyChecksEnabled() && attr.getDataPolicy().withPersistence()
   && attr.getScope() != Scope.GLOBAL
   && (tag.getMemberID() == null || test_InvalidVersion)) {
  if (logger.isDebugEnabled()) {
   logger.debug("Version tag is missing the memberID: {}", tag);
  }
  String msg =
    String.format("memberID cannot be null for persistent regions: %s", tag);
  RuntimeException ex = (sender.getVersionObject().compareTo(Version.GFE_80) < 0)
    ? new InternalGemFireException(msg) : new InvalidVersionException(msg);
  throw ex;
 }
}

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

private void handleMessageRetry(LocalRegion region, EntryEventImpl clientEvent) {
 if (clientEvent.isPossibleDuplicate()) {
  if (region.getAttributes().getConcurrencyChecksEnabled()) {
   // recover the version tag from other servers
   clientEvent.setRegion(region);
   if (!recoverVersionTagForRetriedOperation(clientEvent)) {
    // no-one has seen this event
    clientEvent.setPossibleDuplicate(false);
   }
  }
 }
}

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

@Before
public void setUp() throws Exception {
 this.getAll70 = new GetAll70();
 MockitoAnnotations.initMocks(this);
 when(this.authzRequest.getAuthorize(any(), any(), any()))
   .thenReturn(mock(GetOperationContext.class));
 when(this.cache.getRegion(isA(String.class))).thenReturn(this.region);
 when(this.keyPart.getObject()).thenReturn(KEYS);
 when(this.message.getPart(eq(0))).thenReturn(this.regionNamePart);
 when(this.message.getPart(eq(1))).thenReturn(this.keyPart);
 when(this.message.getPart(eq(2))).thenReturn(this.requestSerializableValuesPart);
 when(this.region.getAttributes()).thenReturn(this.regionAttributes);
 when(this.regionAttributes.getConcurrencyChecksEnabled()).thenReturn(true);
 when(this.regionNamePart.getString()).thenReturn(REGION_NAME);
 when(this.requestSerializableValuesPart.getInt()).thenReturn(0);
 when(this.serverConnection.getCache()).thenReturn(this.cache);
 when(this.serverConnection.getAuthzRequest()).thenReturn(this.authzRequest);
 when(this.serverConnection.getChunkedResponseMessage()).thenReturn(this.chunkedResponseMessage);
}

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

if (!attr.getDataPolicy().withReplication() || attr.getConcurrencyChecksEnabled()) {
 events = TxEventTestUtil.getPutEvents(tl.lastEvent.getEvents());
} else {

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

@Before
public void setUp() throws Exception {
 this.getAll70 = new GetAll70();
 MockitoAnnotations.initMocks(this);
 when(this.authzRequest.getAuthorize(any(), any(), any()))
   .thenReturn(mock(GetOperationContext.class));
 when(this.cache.getRegion(isA(String.class))).thenReturn(this.region);
 when(this.cache.getCancelCriterion()).thenReturn(mock(CancelCriterion.class));
 when(this.keyPart.getObject()).thenReturn(KEYS);
 when(this.message.getPart(eq(0))).thenReturn(this.regionNamePart);
 when(this.message.getPart(eq(1))).thenReturn(this.keyPart);
 when(this.message.getPart(eq(2))).thenReturn(this.requestSerializableValuesPart);
 when(this.region.getAttributes()).thenReturn(this.regionAttributes);
 when(this.regionAttributes.getConcurrencyChecksEnabled()).thenReturn(true);
 when(this.regionNamePart.getString()).thenReturn(REGION_NAME);
 when(this.requestSerializableValuesPart.getInt()).thenReturn(0);
 when(this.serverConnection.getCache()).thenReturn(this.cache);
 when(this.serverConnection.getCacheServerStats()).thenReturn(mock(CacheServerStats.class));
 when(this.serverConnection.getAuthzRequest()).thenReturn(this.authzRequest);
 when(this.serverConnection.getCachedRegionHelper()).thenReturn(mock(CachedRegionHelper.class));
 when(this.serverConnection.getChunkedResponseMessage()).thenReturn(this.chunkedResponseMessage);
}

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

protected CreateRegionMessage getCreateRegionMessage(Set recps, ReplyProcessor21 proc,
  boolean useMcast) {
 CreateRegionMessage msg = new CreateRegionMessage();
 msg.regionPath = this.newRegion.getFullPath();
 msg.profile = (CacheProfile) this.newRegion.getProfile();
 msg.processorId = proc.getProcessorId();
 msg.concurrencyChecksEnabled = this.newRegion.getAttributes().getConcurrencyChecksEnabled();
 msg.setMulticast(useMcast);
 msg.setRecipients(recps);
 return msg;
}

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

@Override
protected CreateRegionMessage getCreateRegionMessage(Set recps, ReplyProcessor21 proc,
  boolean useMcast) {
 CreateRegionMessage msg = new CreateRegionMessage(this.newRegion.getFullPath(),
   (CacheDistributionAdvisor.CacheProfile) this.newRegion.getProfile(), proc.getProcessorId());
 msg.concurrencyChecksEnabled = this.newRegion.getAttributes().getConcurrencyChecksEnabled();
 msg.setMulticast(useMcast);
 msg.setRecipients(recps);
 return msg;
}

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

if (!attr.getDataPolicy().withReplication() || attr.getConcurrencyChecksEnabled()) {
 events = TxEventTestUtil.getPutEvents(tl.lastEvent.getEvents());
} else {

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

/**
 * Handles both RR and PR cases
 */
@SuppressWarnings(value = "NP_NULL_PARAM_DEREF",
  justification = "Null value handled in sendNewRegisterInterestResponseChunk()")
private static void handleKVSingleton(LocalRegion region, Object entryKey,
  boolean serializeValues, ServerConnection servConn) throws IOException {
 VersionedObjectList values = new VersionedObjectList(MAXIMUM_CHUNK_SIZE, true,
   region == null || region.getAttributes().getConcurrencyChecksEnabled(), serializeValues);
 if (region != null) {
  if (region.containsKey(entryKey) || region.containsTombstone(entryKey)) {
   VersionTagHolder versionHolder = createVersionTagHolder();
   ClientProxyMembershipID id = servConn == null ? null : servConn.getProxyID();
   // From Get70.getValueAndIsObject()
   Object data = region.get(entryKey, null, true, true, true, id, versionHolder, true);
   VersionTag vt = versionHolder.getVersionTag();
   updateValues(values, entryKey, data, vt);
  }
 }
 // Send the last chunk (the only chunk for individual and list keys)
 // always send it back, even if the list is of zero size.
 sendNewRegisterInterestResponseChunk(region, entryKey, values, true, servConn);
}

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

region == null || region.getAttributes().getConcurrencyChecksEnabled(), serializeValues);

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

if (attr.getConcurrencyChecksEnabled() && !attr.getDataPolicy().withReplication()
  && attr.getScope() != Scope.GLOBAL) {
 if (attr.getDataPolicy() == DataPolicy.EMPTY) {

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

if (!attr.getDataPolicy().withReplication() || attr.getConcurrencyChecksEnabled()) {
 events = TxEventTestUtil.getPutEvents(tl.lastEvent.getEvents());
} else {

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

if (attr.getConcurrencyChecksEnabled() && !attr.getDataPolicy().withReplication()
  && attr.getScope() != Scope.GLOBAL) {
 if (attr.getDataPolicy() == DataPolicy.EMPTY) {

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

if (!attr.getDataPolicy().withReplication() || attr.getConcurrencyChecksEnabled()) {
 events = TxEventTestUtil.getPutEvents(tl.lastEvent.getEvents());
} else {

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

if (!attr.getDataPolicy().withReplication() || attr.getConcurrencyChecksEnabled()) {
 events = TxEventTestUtil.getPutEvents(tl.lastEvent.getEvents());
} else {

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

if (this.getAttributes().getConcurrencyChecksEnabled()) {
 diskFlags.add(DiskRegionFlag.IS_WITH_VERSIONING);

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

private static void handleKVList(final LocalRegion region, final List keyList,
  boolean serializeValues, final ServerConnection servConn) throws IOException {
 if (region instanceof PartitionedRegion) {
  handleKVKeysPR((PartitionedRegion) region, keyList, serializeValues, servConn);
  return;
 }
 VersionedObjectList values = new VersionedObjectList(MAXIMUM_CHUNK_SIZE, true,
   region == null || region.getAttributes().getConcurrencyChecksEnabled(), serializeValues);
 // Handle list of keys
 if (region != null) {
  for (Object key : keyList) {
   if (region.containsKey(key) || region.containsTombstone(key)) {
    VersionTagHolder versionHolder = createVersionTagHolder();
    ClientProxyMembershipID id = servConn == null ? null : servConn.getProxyID();
    Object data = region.get(key, null, true, true, true, id, versionHolder, true);
    VersionTag versionTag = versionHolder.getVersionTag();
    updateValues(values, key, data, versionTag);
    if (values.size() == MAXIMUM_CHUNK_SIZE) {
     // Send the chunk and clear the list
     // values.setKeys(null); // Now we need to send keys too.
     sendNewRegisterInterestResponseChunk(region, keyList, values, false, servConn);
     values.clear();
    }
   }
  }
 }
 // Send the last chunk (the only chunk for individual and list keys)
 // always send it back, even if the list is of zero size.
 sendNewRegisterInterestResponseChunk(region, keyList, values, true, servConn);
}

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

this.ignoreJTA = attr.getIgnoreJTA();
this.concurrencyLevel = attr.getConcurrencyLevel();
this.concurrencyChecksEnabled = attr.getConcurrencyChecksEnabled();
this.loadFactor = attr.getLoadFactor();
this.initialCapacity = attr.getInitialCapacity();

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

assertEquals(1, diskSizes.length);
assertEquals(DiskStoreFactory.DEFAULT_DISK_DIR_SIZE, diskSizes[0]);
assertTrue(attrs.getConcurrencyChecksEnabled());

相关文章

微信公众号

最新文章

更多

RegionAttributes类方法