@Override public void performRemoveAllEntry(EntryEventImpl event) { // force shared data view so that we just do the virtual op, accruing things in the bulk // operation for later if (isTX()) { event.getRemoveAllOperation().addEntry(event); } else { basicDestroy(event, true, null); } }
@Override public void performPutAllEntry(EntryEventImpl event) { /* * force shared data view so that we just do the virtual op, accruing things in the put all * operation for later */ if (isTX()) { event.getPutAllOperation().addEntry(event); } else { getSharedDataView().putEntry(event, false, false, null, false, 0L, false); } }
ResultCollector executeLocally(final DistributedRegionFunctionExecutor execution, final Function function, final Object args, int prid, final ResultCollector rc, final Set filter, final ServerToClientFunctionResultSender sender) { final LocalResultCollector<?, ?> localRC = execution.getLocalResultCollector(function, rc); final DistributionManager dm = getDistributionManager(); final DistributedRegionFunctionResultSender resultSender = new DistributedRegionFunctionResultSender(dm, localRC, function, sender); final RegionFunctionContextImpl context = new RegionFunctionContextImpl(cache, function.getId(), DistributedRegion.this, args, filter, null, null, resultSender, execution.isReExecute()); execution.executeFunctionOnLocalNode(function, context, resultSender, dm, isTX()); return localRC; }
void distributeUpdateEntryVersion(EntryEventImpl event) { if (!this.isRegionInvalid() && event.isDistributed() && !event.isOriginRemote() && !isTX() /* only distribute if non-tx */) { if (event.isDistributed() && !event.isOriginRemote()) { // before distribute: DR has sent callback earlier UpdateEntryVersionOperation op = new UpdateEntryVersionOperation(event); op.distribute(); } } }
void distributeInvalidate(EntryEventImpl event) { if (!this.isRegionInvalid() && event.isDistributed() && !event.isOriginRemote() && !isTX() /* only distribute if non-tx */) { if (event.isDistributed() && !event.isOriginRemote()) { boolean distribute = !event.getInhibitDistribution(); if (distribute) { // before distribute: DR.invalidate, it has triggered callback earlier InvalidateOperation op = new InvalidateOperation(event); op.distribute(); } } } }
private void putNewValueInRegion(boolean isCreate, EntryEventImpl clientEvent, long lastModified, EntryEventImpl event) { RegionEntry re = null; // Set eventId. Required for interested clients. event.setNewEventId(cache.getDistributedSystem()); long startPut = CachePerfStats.getStatTime(); validateKey(event.getKey()); // this next step also distributes the object to other processes, if necessary try { re = basicPutEntry(event, lastModified); // Update client event with latest version tag from re. if (re != null && clientEvent != null) { clientEvent.setVersionTag(event.getVersionTag()); } if (!isTX()) { getCachePerfStats().endPut(startPut, event.isOriginRemote()); } } catch (ConcurrentCacheModificationException e) { // the cache was modified while we were searching for this entry and // the netsearch result was elided. Return the current value from the cache updateEventWithCurrentRegionEntry(event, clientEvent); } catch (CacheWriterException cwe) { if (logger.isDebugEnabled()) { logger.debug("findObjectInSystem: writer exception putting entry {} : {}", event, cwe); } } if (isCreate) { recordMiss(re, event.getKey()); } }
@Override public boolean requiresOneHopForMissingEntry(EntryEventImpl event) { // received from another member - don't use one-hop if (event.isOriginRemote()) { return false; } // local ops aren't distributed if (event.getOperation().isLocal()) { return false; } // if it already has a valid version tag it can go out with a DistributedCacheOperation if (event.getVersionTag() != null && event.getVersionTag().getRegionVersion() > 0) { return false; } // if we're not allowed to generate a version tag we need to send it to someone who can if (!this.generateVersionTag) { return true; } return this.getConcurrencyChecksEnabled() && (this.serverRegionProxy == null) && !isTX() && this.scope.isDistributed() && !this.getDataPolicy().withReplication(); }