/** * @return the timestamp that marks the start of the operation */ @Override public long startCacheWriterCall() { this.stats.incInt(cacheWriterCallsInProgressId, 1); this.cachePerfStats.startCacheWriterCall(); return getStatTime(); }
private void cacheWriteBeforeRegionClear(RegionEventImpl event) throws CacheWriterException, TimeoutException { // copy into local var to prevent race condition CacheWriter writer = basicGetWriter(); if (writer != null) { final long start = getCachePerfStats().startCacheWriterCall(); try { writer.beforeRegionClear(event); } finally { getCachePerfStats().endCacheWriterCall(start); } } serverRegionClear(event); }
final long start = getCachePerfStats().startCacheWriterCall();
/** * @return true if cacheWrite was performed * @see DistributedRegion#cacheWriteBeforeRegionDestroy(RegionEventImpl) */ boolean cacheWriteBeforeRegionDestroy(RegionEventImpl event) throws CacheWriterException, TimeoutException { boolean result = false; // copy into local var to prevent race condition CacheWriter writer = basicGetWriter(); if (writer != null) { final long start = getCachePerfStats().startCacheWriterCall(); try { writer.beforeRegionDestroy(event); } finally { getCachePerfStats().endCacheWriterCall(start); } result = true; } serverRegionDestroy(event); return result; }
final long start = getCachePerfStats().startCacheWriterCall(); try { event.setOldValueFromRegion();
@Override boolean cacheWriteBeforeRegionDestroy(RegionEventImpl event) throws CacheWriterException, TimeoutException { boolean result = false; if (event.getOperation().isDistributed()) { CacheWriter localWriter = basicGetWriter(); Set netWriteRecipients = localWriter == null ? this.distAdvisor.adviseNetWrite() : null; if (localWriter != null || netWriteRecipients != null && !netWriteRecipients.isEmpty()) { final long start = getCachePerfStats().startCacheWriterCall(); try { SearchLoadAndWriteProcessor processor = SearchLoadAndWriteProcessor.getProcessor(); try { processor.initialize(this, "preDestroyRegion", null); processor.doNetWrite(event, netWriteRecipients, localWriter, SearchLoadAndWriteProcessor.BEFOREREGIONDESTROY); result = true; } finally { processor.release(); } } finally { getCachePerfStats().endCacheWriterCall(start); } } serverRegionDestroy(event); } return result; }
&& !event.inhibitAllNotifications()) { final boolean isNewKey = event.getOperation().isCreate(); final long start = getCachePerfStats().startCacheWriterCall(); try { SearchLoadAndWriteProcessor processor = SearchLoadAndWriteProcessor.getProcessor();
/** * This invokes a cache writer before a destroy operation. Although it has the same method * signature as the method in LocalRegion, it is invoked in a different code path. LocalRegion * invokes this method via its "entries" member, while PartitionedRegion invokes this method in * its region operation methods and messages. */ @Override boolean cacheWriteBeforeRegionDestroy(RegionEventImpl event) throws CacheWriterException, TimeoutException { if (event.getOperation().isDistributed()) { serverRegionDestroy(event); CacheWriter localWriter = basicGetWriter(); Set netWriteRecipients = localWriter == null ? this.distAdvisor.adviseNetWrite() : null; if (localWriter == null && (netWriteRecipients == null || netWriteRecipients.isEmpty())) { return false; } final long start = getCachePerfStats().startCacheWriterCall(); try { SearchLoadAndWriteProcessor processor = SearchLoadAndWriteProcessor.getProcessor(); processor.initialize(this, "preDestroyRegion", null); processor.doNetWrite(event, netWriteRecipients, localWriter, SearchLoadAndWriteProcessor.BEFOREREGIONDESTROY); processor.release(); } finally { getCachePerfStats().endCacheWriterCall(start); } return true; } return false; }
/** * @return true if cacheWrite was performed * @see DistributedRegion#cacheWriteBeforeDestroy(EntryEventImpl, Object) */ @Override public boolean cacheWriteBeforeDestroy(EntryEventImpl event, Object expectedOldValue) throws CacheWriterException, EntryNotFoundException, TimeoutException { boolean result = false; // copy into local var to prevent race condition CacheWriter writer = basicGetWriter(); if (writer != null && event.getOperation() != Operation.REMOVE && !event.inhibitAllNotifications()) { final long start = getCachePerfStats().startCacheWriterCall(); event.setReadOldValueFromDisk(true); try { writer.beforeDestroy(event); } finally { event.setReadOldValueFromDisk(false); getCachePerfStats().endCacheWriterCall(start); } result = true; } serverDestroy(event, expectedOldValue); return result; }
final long start = getCachePerfStats().startCacheWriterCall(); try { event.setOldValueFromRegion();
@Override public void cacheWriteBeforePut(EntryEventImpl event, Set netWriteRecipients, CacheWriter localWriter, boolean requireOldValue, Object expectedOldValue) throws CacheWriterException, TimeoutException { Assert.assertTrue(netWriteRecipients == null); Operation operation = event.getOperation(); boolean isPutIfAbsentOrReplace = operation == Operation.PUT_IF_ABSENT || operation == Operation.REPLACE; if (!isPutIfAbsentOrReplace && localWriter != null && !event.inhibitAllNotifications()) { final long start = getCachePerfStats().startCacheWriterCall(); final boolean newEntry = event.getOperation().isCreate(); event.setReadOldValueFromDisk(true); try { if (!newEntry) { localWriter.beforeUpdate(event); } else { localWriter.beforeCreate(event); } } finally { event.setReadOldValueFromDisk(false); getCachePerfStats().endCacheWriterCall(start); } } serverPut(event, requireOldValue, expectedOldValue); }