/** * Adds data in the specified region to be sent to the specified roles */ protected void add(DistributedRegion r, ReliableDistributionData data, Set roles) { QueuedRegionData qrd = null; synchronized(this.regionMap) { qrd = (QueuedRegionData)this.regionMap.get(r); } qrd.add(r, data, roles); r.getCachePerfStats().incReliableQueuedOps(data.getOperationCount() * roles.size()); } public Set getQueuingRoles(DistributedRegion r) {
/** * Adds data in the specified region to be sent to the specified roles */ protected void add(DistributedRegion r, ReliableDistributionData data, Set roles) { QueuedRegionData qrd = null; synchronized(this.regionMap) { qrd = (QueuedRegionData)this.regionMap.get(r); } qrd.add(r, data, roles); r.getCachePerfStats().incReliableQueuedOps(data.getOperationCount() * roles.size()); } public Set getQueuingRoles(DistributedRegion r) {
public static void verifyDeltaFailuresInC2S() { CachePerfStats stats = ((DistributedRegion)GemFireCacheImpl.getInstance() .getRegion(regionName + 0)).getCachePerfStats(); if (stats.getDeltaFailedUpdates() == 0) { throw new TestException( "CachePerfStats indicating failed delta updates is expected to be non-zero."); } }
public static void verifyDeltaFailuresInP2P() { CachePerfStats stats = ((DistributedRegion)GemFireCacheImpl.getInstance() .getRegion(regionName + 0)).getCachePerfStats(); if (stats.getDeltaFailedUpdates() == 0) { throw new TestException( "CachePerfStats indicating failed delta updates is expected to be non-zero."); } }
public static void verifyNoFailurePeer() throws Exception { Region reg = cache.getRegion(Region.SEPARATOR + REGION_NAME); long elapsed = 0; long start = System.currentTimeMillis(); while(elapsed < 10000 && reg.size() < NUM_OF_CREATES){ try { elapsed = System.currentTimeMillis() - start; Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } } assertTrue("create's are missing", reg.size() == NUM_OF_CREATES); // start validation CachePerfStats stats = ((DistributedRegion)cache.getRegion(REGION_NAME)) .getCachePerfStats(); long deltaFailures = stats.getDeltaFailedUpdates(); assertTrue("delta failures count is not zero", deltaFailures == 0); assertTrue("fromDelta invoked", !DeltaTestImpl.fromDeltaFeatureUsed()); }
@Override protected boolean operateOnRegion(CacheEvent event, DistributionManager dm) throws EntryNotFoundException { boolean sendReply = true; DistributedRegion region = (DistributedRegion) event.getRegion(); region.getCachePerfStats().incTombstoneGCCount(); FilterInfo routing = null; if (this.filterRouting != null) { routing = this.filterRouting.getFilterInfo(region.getMyId()); } region.expireTombstones(this.regionGCVersions, this.eventID, routing); this.appliedOperation = true; return sendReply; }
@Override protected boolean operateOnRegion(CacheEvent event, DistributionManager dm) throws EntryNotFoundException { boolean sendReply = true; DistributedRegion region = (DistributedRegion) event.getRegion(); region.getCachePerfStats().incTombstoneGCCount(); FilterInfo routing = null; if (this.filterRouting != null) { routing = this.filterRouting.getFilterInfo(region.getMyId()); } region.expireTombstones(this.regionGCVersions, this.eventID, routing); this.appliedOperation = true; return sendReply; }
this.r.getCachePerfStats().incReliableQueuedOps(- l.size()); this.l.clear(); return true;
this.r.getCachePerfStats().incReliableQueuedOps(- l.size()); this.l.clear(); return true;
!event.inhibitAllNotifications()) { final boolean isNewKey = event.getOperation().isCreate(); final long start = getCachePerfStats().startCacheWriterCall(); try { SearchLoadAndWriteProcessor processor = getCachePerfStats().endCacheWriterCall(start);
final long start = getCachePerfStats().startCacheWriterCall(); try { SearchLoadAndWriteProcessor processor = getCachePerfStats().endCacheWriterCall(start);
/** * Distribute Tombstone garbage-collection information to all peers with storage */ protected EventID distributeTombstoneGC(Set<Object> keysRemoved) { this.getCachePerfStats().incTombstoneGCCount(); EventID eventId = new EventID(getSystem()); DistributedTombstoneOperation gc = DistributedTombstoneOperation.gc(this, eventId); gc.distribute(); notifyClientsOfTombstoneGC(getVersionVector().getTombstoneGCVector(), keysRemoved, eventId, null); return eventId; }
final long start = getCachePerfStats().startCacheWriterCall(); try { SearchLoadAndWriteProcessor processor = getCachePerfStats().endCacheWriterCall(start);
!event.inhibitAllNotifications()) { final boolean isNewKey = event.getOperation().isCreate(); final long start = getCachePerfStats().startCacheWriterCall(); try { SearchLoadAndWriteProcessor processor = getCachePerfStats().endCacheWriterCall(start);
/** * Distribute Tombstone garbage-collection information to all peers with storage */ protected EventID distributeTombstoneGC(Set<Object> keysRemoved) { this.getCachePerfStats().incTombstoneGCCount(); EventID eventId = new EventID(getSystem()); DistributedTombstoneOperation gc = DistributedTombstoneOperation.gc(this, eventId); gc.distribute(); notifyClientsOfTombstoneGC(getVersionVector().getTombstoneGCVector(), keysRemoved, eventId, null); return eventId; }
|| (netWriteRecipients != null && !netWriteRecipients.isEmpty())) && !event.inhibitAllNotifications()) { final long start = getCachePerfStats().startCacheWriterCall(); try { event.setOldValueFromRegion(); getCachePerfStats().endCacheWriterCall(start);
.getCacheTransactionManager(); final ImageState imgState = this.region.getImageState(); final CachePerfStats stats = this.region.getCachePerfStats(); for (Map.Entry<?, ?> e : txIdMap.entrySet()) { final TXId txId = (TXId)e.getKey();
public static void verifyNoDeltaReceived(Integer updates) { CachePerfStats stats = ((DistributedRegion)cache.getRegion(REGION_NAME)) .getCachePerfStats(); long deltaFailures = stats.getDeltaFailedUpdates(); long deltas = stats.getDeltaUpdates(); assertTrue( "Failures while processing delta at receiver. But deltas were not expected.", deltaFailures == 0); assertFalse( "Expected no deltas to be processed at receiver but processed were " + deltas + " (statistics)", deltas > 0); assertFalse( "Expected no deltas to be processed at receiver but processed were " + DeltaTestImpl.getFromDeltaInvokations() + " (implementation counter)", DeltaTestImpl.fromDeltaFeatureUsed()); assertTrue("Expected " + updates + " updates but found " + numOfUpdates, numOfUpdates == updates); }
public static void verifyDeltaReceiverStats(Integer path, Long expectedDeltasProcessed, Long expectedDeltaFailures) { long numOfDeltasProcessed = 0; long deltaTime = 0; long deltaFailures = 0; if (path == PEER_TO_PEER || path == CLIENT_TO_SERVER || path == SERVER_TO_CLIENT) { CachePerfStats stats = ((DistributedRegion)cache.getRegion(REGION_NAME)) .getCachePerfStats(); numOfDeltasProcessed = stats.getDeltaUpdates(); deltaTime = stats.getDeltaUpdatesTime(); deltaFailures = stats.getDeltaFailedUpdates(); } else { fail("Invalid path code for delta propagation: " + path); } assertTrue("Number of deltas received was expected to be " + expectedDeltasProcessed + " but is " + numOfDeltasProcessed, numOfDeltasProcessed == expectedDeltasProcessed); // It is possible for deltaTime to be zero depending on the system clock // resolution assertTrue("Delta calculation is expected to be >= zero but was " + deltaTime, deltaTime >= 0); assertTrue("Number of delta failures was expected to be " + expectedDeltaFailures + " but is " + deltaFailures, deltaFailures == expectedDeltaFailures); }
public static void verifyDeltaReceived(Integer updates) { Region region = cache.getRegion(Region.SEPARATOR + REGION_NAME); CachePerfStats stats = ((DistributedRegion)cache.getRegion(REGION_NAME)) .getCachePerfStats(); long deltaFailures = stats.getDeltaFailedUpdates(); long deltas = stats.getDeltaUpdates(); assertTrue("Failures while processing delta at receiver.", deltaFailures == 0); assertTrue("Expected 2 deltas to be processed at receiver but were " + deltas + " (statistics)", deltas == 2); assertTrue( "Expected 2 deltas to be processed at receiver but were " + DeltaTestImpl.getFromDeltaInvokations() + " (implementation counter)", DeltaTestImpl .getFromDeltaInvokations() == 2); assertTrue( "Expected " + updates + " updates but found " + numOfUpdates, numOfUpdates == updates); DeltaTestImpl val = (DeltaTestImpl)region.getEntry("KEY").getValue(); assertTrue("Latest value not received, found: " + val, NEW_STR.equals(val .getStr())); }