public boolean getConcurrencyChecksEnabled() { return this.ra.getConcurrencyChecksEnabled(); }
public boolean getConcurrencyChecksEnabled() { return this.ra.getConcurrencyChecksEnabled(); }
/** * Returns a display string for region attributes getConcurrencyChecksEnabled. * Added for concurrencyChecksEnabled (RegionAttribute) in 7.0 */ public static String getConcurrencyChecksEnabled(RegionAttributes attrs) { return new String(" concurrencyChecksEnabled: " + attrs.getConcurrencyChecksEnabled() + "\n"); }
/** * Returns a display string for ((EntryEventImpl)event.isConcurrencyConflict() * Added for concurrencyChecksEnabled (RegionAttribute) in 7.0 * EntryEventImpl gives us access to an internal method, event.isConcurrencyConflict() */ public static String getConcurrencyConflict(EntryEvent event) { String rc = new String(""); Region region = event.getRegion(); if (region.getAttributes().getConcurrencyChecksEnabled()) { rc = new String(" event.isConcurrencyConflict(): " + ((EntryEventImpl)(event)).isConcurrencyConflict() + "\n"); } return rc; } }
@Override public Object call() throws Exception { Region r = getCache().getRegion(regionName); assertTrue(r.getAttributes().getConcurrencyChecksEnabled()); return null; } };
@Override public Object call() throws Exception { Region r = getCache().getRegion(regionName); assertTrue(r.getAttributes().getConcurrencyChecksEnabled()); return null; } };
@Override public Object call() throws Exception { Region r = getCache().getRegion(regionName); assertTrue(r.getAttributes().getConcurrencyChecksEnabled()); return null; } };
/** Return the versionTag for the given Region and key. * * @param aRegion The Region * @param key The key * * @returns A String representation of the VersionTag for key in Region. */ public static String getVersionTagStr(Region aRegion, Object key) { String versionTagStr = ""; RegionAttributes attr = aRegion.getAttributes(); if (attr.getConcurrencyChecksEnabled()) { Object version = null; try { version = ((LocalRegion)aRegion).getVersionTag(key); } catch (EntryDestroyedException e) { // If EntryDestroyedException is triggered here, the key should be a tombstone and // GCed inside getVersionTag(). version=null is accepted in this case } versionTagStr = ", my version=" + version; } return versionTagStr; }
@Override public Object call() throws Exception { RegionFactory rf = getCache().createRegionFactory(RegionShortcut.REPLICATE_PERSISTENT); Region r = rf.create(regionName); assertTrue(r.getAttributes().getConcurrencyChecksEnabled()); return null; } });
@Override public Object call() throws Exception { RegionFactory rf = getCache().createRegionFactory(RegionShortcut.REPLICATE); Region region = rf.create(regionName); assertTrue(region.getAttributes().getConcurrencyChecksEnabled()); return null; } });
@Override public Object call() throws Exception { RegionFactory<Integer, String> rf = getCache().createRegionFactory(RegionShortcut.PARTITION_PERSISTENT); Region<Integer, String> r = rf.create(regionName); assertTrue(r.getAttributes().getConcurrencyChecksEnabled()); return null; } };
@Override public Object call() throws Exception { Region r = getCache().createRegionFactory(RegionShortcut.PARTITION_PERSISTENT).create(regionName); assertTrue(r.getAttributes().getConcurrencyChecksEnabled()); return null; } });
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); } } } }
@Override public Object call() throws Exception { Cache cache = getCache(); AttributesFactory af = new AttributesFactory(); af.setScope(Scope.DISTRIBUTED_ACK); RegionFactory rf = cache.createRegionFactory(af.create()); Region r = rf.create(regionName); assertNotNull(r); assertTrue(r.getAttributes().getConcurrencyChecksEnabled()); return null; } });
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 = LocalizedStrings.DistributedPutAllOperation_MISSING_VERSION .toLocalizedString(tag); RuntimeException ex = (sender.getVersionObject().compareTo(Version.GFE_80) < 0) ? new InternalGemFireException(msg) : new InvalidVersionException(msg); throw ex; } }
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; }
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; }
/** * Handles both RR and PR cases */ @SuppressWarnings("rawtypes") @edu.umd.cs.findbugs.annotations.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(maximumChunkSize, true, region == null ? true : region.getAttributes() .getConcurrencyChecksEnabled(), serializeValues); if (region != null) { if (region.containsKey(entryKey) || region.containsTombstone(entryKey)) { EntryEventImpl versionHolder = EntryEventImpl.createVersionTagHolder(); ClientProxyMembershipID id = servConn == null ? null : servConn.getProxyID(); // From Get70.getValueAndIsObject() Object data = region.get(entryKey, null, true, true, true, id, versionHolder, true, false); 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); }
/** Test to make sure region attributes take */ public void testRegionAttributes() throws CacheException { // @todo for now just test concurrencyLevel, add tests for the rest AttributesFactory factory = new AttributesFactory(); factory.setConcurrencyLevel(60); factory.setConcurrencyChecksEnabled(true); factory.setScope(Scope.DISTRIBUTED_ACK); RegionAttributes attrs = factory.create(); String name = getUniqueName(); Region region = createRegion(name, attrs); assertEquals(60, region.getAttributes().getConcurrencyLevel()); assertTrue("expected concurrencyChecksEnabled to be true", region.getAttributes().getConcurrencyChecksEnabled()); }
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 (rgn.getLogWriterI18n().fineEnabled()) { rgn.getLogWriterI18n().info(LocalizedStrings.DEBUG, "Version tag is missing the memberID: " + tag); } String msg = LocalizedStrings.DistributedPutAllOperation_MISSING_VERSION .toLocalizedString(tag); RuntimeException ex = (sender.getVersionObject().compareTo(Version.GFXD_101) < 0) ? new InternalGemFireException(msg) : new InvalidVersionException(msg); throw ex; } } }