public boolean isCallbackArgumentAvailable() { return this.getRawCallbackArgument() != Token.NOT_AVAILABLE; }
public final boolean isCallbackArgumentAvailable() { return this.getRawCallbackArgument() != Token.NOT_AVAILABLE; }
public void collectGatewayCallbackEvents(EntryEvent event) { synchronized(events) { if (((EntryEventImpl)event).getRawCallbackArgument() instanceof GatewayEventCallbackArgument) { this.events.add(event); } events.notifyAll(); } }
/** * Add an entry that this putall operation should distribute. */ public void addEntry(EntryEventImpl ev) { final Object callbackArg = this.callbackArgs != null ? ev.getRawCallbackArgument() : null; this.putAllData[this.putAllDataSize] = new PutAllEntryData(ev, callbackArg); this.putAllDataSize++; // cachedEvents.add(ev); }
/** * Add an entry that this putall operation should distribute. This method is * for a special case: the callback will be called after this in * hasSeenEvent() case, so we should change the status beforehand */ public void addEntry(EntryEventImpl ev, boolean newCallbackInvoked) { final Object callbackArg = this.callbackArgs != null ? ev.getRawCallbackArgument() : null; this.putAllData[this.putAllDataSize] = new PutAllEntryData(ev, callbackArg); this.putAllData[this.putAllDataSize].setCallbacksInvoked(newCallbackInvoked); this.putAllDataSize++; // cachedEvents.add(ev); }
/** * Add an entry for PR bucket's msg. * * @param ev * event to be added * @param bucketId * message is for this bucket */ public void addEntry(EntryEventImpl ev, Integer bucketId) { final Object callbackArg = this.callbackArgs != null ? ev.getRawCallbackArgument() : null; this.putAllData[this.putAllDataSize] = new PutAllEntryData(ev, callbackArg); this.putAllData[this.putAllDataSize].setBucketId(bucketId); this.putAllDataSize++; // cachedEvents.add(ev); }
final void putTXEntryCallbackArg(final TXEntryState txEntry) { final Object callbackArg = getRawCallbackArgument(); if (callbackArg != null) { txEntry.setCallbackArgument(getCallbackArgument(callbackArg)); } else { txEntry.setCallbackArgument(null); } }
private void refreshIndexKey(GemFireTransaction tran, EntryEventImpl event, RegionEntry entry, ExecRow execRow, final GemFireContainer indexContainer, ExtractingIndexKey indexKey, boolean isSuccess) throws StandardException { Object cbArg = event.getRawCallbackArgument(); final boolean isGIIEvent = Boolean.TRUE.equals(cbArg); Object oldValue = isGIIEvent ? execRow.getBaseByteSource(): event.getOldValueAsOffHeapDeserializedOrRaw(); if (GemFireXDUtils.TraceIndex) { GfxdIndexManager.traceIndex("SortedMap2Index::refreshIndexKey " + "Refreshing index key for key=%s Old row=(%s) , " + "for index container=(%s), old value = %s", indexKey,execRow, indexContainer, oldValue); } SortedMap2IndexRefreshIndexKeyOperation.doMe(tran, indexContainer, indexKey, (RowLocation) entry, oldValue,event.isLoadedFromHDFS(), isSuccess); }
private void refreshIndexKey(GemFireTransaction tran, EntryEventImpl event, RegionEntry entry, ExecRow execRow, final GemFireContainer indexContainer, ExtractingIndexKey indexKey, boolean isSuccess) throws StandardException { Object cbArg = event.getRawCallbackArgument(); final boolean isGIIEvent = Boolean.TRUE.equals(cbArg); Object oldValue = isGIIEvent ? execRow.getBaseByteSource(): event.getOldValueAsOffHeapDeserializedOrRaw(); if (GemFireXDUtils.TraceIndex) { GfxdIndexManager.traceIndex("SortedMap2Index::refreshIndexKey " + "Refreshing index key for key=%s Old row=(%s) , " + "for index container=(%s), old value = %s", indexKey,execRow, indexContainer, oldValue); } SortedMap2IndexRefreshIndexKeyOperation.doMe(tran, indexContainer, indexKey, (RowLocation) entry, oldValue,event.isLoadedFromHDFS(), isSuccess); }
private void refreshIndexKey(GemFireTransaction tran, EntryEventImpl event, RegionEntry entry, ExecRow execRow, final GemFireContainer indexContainer, ExtractingIndexKey indexKey, boolean isSuccess) throws StandardException { Object cbArg = event.getRawCallbackArgument(); final boolean isGIIEvent = Boolean.TRUE.equals(cbArg); Object oldValue = isGIIEvent ? execRow.getBaseByteSource(): event.getOldValueAsOffHeapDeserializedOrRaw(); if (GemFireXDUtils.TraceIndex) { GfxdIndexManager.traceIndex("SortedMap2Index::refreshIndexKey " + "Refreshing index key for key=%s Old row=(%s) , " + "for index container=(%s), old value = %s", indexKey,execRow, indexContainer, oldValue); } SortedMap2IndexRefreshIndexKeyOperation.doMe(tran, indexContainer, indexKey, (RowLocation) entry, oldValue,event.isLoadedFromHDFS(), isSuccess); }
private void initialize(boolean notifyOnly, EntryEventImpl event, Object expectedOldValue, boolean cacheWrite) { this.expectedOldValue = expectedOldValue; this.cacheWrite = cacheWrite; this.key = event.getKey(); this.cbArg = event.getRawCallbackArgument(); this.op = event.getOperation(); this.notificationOnly = notifyOnly; this.bridgeContext = event.getContext(); this.eventId = event.getEventId(); this.versionTag = event.getVersionTag(); }
protected DestroyMessage(Set recipients, boolean notifyOnly, int regionId, DirectReplyProcessor processor, EntryEventImpl event, Object expectedOldValue) { super(recipients, regionId, processor, event); this.expectedOldValue = expectedOldValue; this.key = event.getKey(); this.cbArg = event.getRawCallbackArgument(); this.op = event.getOperation(); this.notificationOnly = notifyOnly; this.bridgeContext = event.getContext(); this.eventId = event.getEventId(); this.versionTag = event.getVersionTag(); }
private static boolean isEventFromRemoteSite(GatewayQueueEvent event) { if (event instanceof EntryEventImpl) { Object rawCallbackArg = ((EntryEventImpl)event).getRawCallbackArgument(); int origDSId = -1; int thisDSId = -1; if (rawCallbackArg != null && rawCallbackArg instanceof GatewaySenderEventCallbackArgument) { origDSId = ((GatewaySenderEventCallbackArgument)rawCallbackArg).getOriginatingDSId(); thisDSId = InternalDistributedSystem.getAnyInstance().getDistributionManager().getDistributedSystemId(); // Always apply events coming from other distributed systems. if (origDSId >=0 && thisDSId >=0 && origDSId != thisDSId) { logMessage("DSID[" + origDSId + "]. My DSID is ["+thisDSId+"]"); return true; } } } return false; }
private static boolean isEventFromRemoteSite(GatewayQueueEvent event) { if (event instanceof EntryEventImpl) { Object rawCallbackArg = ((EntryEventImpl)event).getRawCallbackArgument(); int origDSId = -1; int thisDSId = -1; if (rawCallbackArg != null && rawCallbackArg instanceof GatewaySenderEventCallbackArgument) { origDSId = ((GatewaySenderEventCallbackArgument)rawCallbackArg).getOriginatingDSId(); thisDSId = InternalDistributedSystem.getAnyInstance().getDistributionManager().getDistributedSystemId(); // Always apply events coming from other distributed systems. if (origDSId >=0 && thisDSId >=0 && origDSId != thisDSId) { logMessage("DSID[" + origDSId + "]. My DSID is ["+thisDSId+"]"); return true; } } } return false; }
private static boolean isEventFromRemoteSite(GatewayQueueEvent event) { if (event instanceof EntryEventImpl) { Object rawCallbackArg = ((EntryEventImpl)event).getRawCallbackArgument(); int origDSId = -1; int thisDSId = -1; if (rawCallbackArg != null && rawCallbackArg instanceof GatewaySenderEventCallbackArgument) { origDSId = ((GatewaySenderEventCallbackArgument)rawCallbackArg).getOriginatingDSId(); thisDSId = InternalDistributedSystem.getAnyInstance().getDistributionManager().getDistributedSystemId(); // Always apply events coming from other distributed systems. if (origDSId >=0 && thisDSId >=0 && origDSId != thisDSId) { logMessage("DSID[" + origDSId + "]. My DSID is ["+thisDSId+"]"); return true; } } } return false; }
/** * Destroy an entry on the server given its event. * @since 5.7 */ protected void serverDestroy(EntryEventImpl event, Object expectedOldValue) { if (event.getOperation().isDistributed()) { ServerRegionProxy mySRP = getServerProxy(); if (mySRP != null) { // send to server Object key = event.getKey(); Object callbackArg = event.getRawCallbackArgument(); Object result = mySRP.destroy(key, expectedOldValue, event.getOperation(), event, callbackArg); if (result instanceof EntryNotFoundException) { throw (EntryNotFoundException)result; } } } }
/** * Destroy an entry on the server given its event. * @since 5.7 */ protected void serverDestroy(EntryEventImpl event, Object expectedOldValue) { if (event.getOperation().isDistributed()) { ServerRegionProxy mySRP = getServerProxy(); if (mySRP != null) { // send to server Object key = event.getKey(); Object callbackArg = event.getRawCallbackArgument(); Object result = mySRP.destroy(key, expectedOldValue, event.getOperation(), event, callbackArg); if (result instanceof EntryNotFoundException) { throw (EntryNotFoundException)result; } } } }
private final void initialize(final boolean notifyOnly, final EntryEventImpl event, final Object expectedOldValue, boolean cacheWrite, boolean useOriginRemote, boolean possibleDuplicate) { this.expectedOldValue = expectedOldValue; this.cacheWrite = cacheWrite; this.key = event.getKey(); this.cbArg = event.getRawCallbackArgument(); this.op = event.getOperation(); this.bridgeContext = event.getContext(); this.eventId = event.getEventId(); Assert.assertTrue(this.eventId != null); this.useOriginRemote = useOriginRemote; this.possibleDuplicate = possibleDuplicate; this.versionTag = event.getVersionTag(); // added for old value if available sent over the wire for bridge servers. if (event.hasOldValue()) { this.hasOldValue = true; event.exportOldValue(this); } }
protected void initMessage(CacheOperationMessage msg, DirectReplyProcessor p) { final DistributedRegion region = getRegion(); msg.regionPath = region.getFullPath(); msg.processorId = p == null ? 0 : p.getProcessorId(); msg.processor = p; if (this.event.getOperation().isEntry()) { EntryEventImpl entryEvent = getEvent(); msg.callbackArg = entryEvent.getRawCallbackArgument(); msg.possibleDuplicate = entryEvent.isPossibleDuplicate(); VersionTag tag = entryEvent.getVersionTag(); msg.setInhibitNotificationsBit(entryEvent.inhibitAllNotifications()); if (tag != null && tag.hasValidVersion()) { msg.setVersionTag(tag); } } else { msg.callbackArg = ((RegionEventImpl)this.event).getRawCallbackArgument(); } msg.op = this.event.getOperation(); msg.owner = this; msg.regionAllowsConflation = region.getEnableAsyncConflation(); }
protected void initMessage(CacheOperationMessage msg, DirectReplyProcessor p) { msg.regionPath = getRegion().getFullPath(); msg.processorId = p == null ? 0 : p.getProcessorId(); msg.processor = p; if (this.event.getOperation().isEntry()) { EntryEventImpl entryEvent = getEvent(); msg.callbackArg = entryEvent.getRawCallbackArgument(); msg.possibleDuplicate = entryEvent.isPossibleDuplicate(); VersionTag tag = entryEvent.getVersionTag(); msg.setInhibitNotificationsBit(entryEvent.inhibitAllNotifications()); if (tag != null && tag.hasValidVersion()) { msg.setVersionTag(tag); } } else { msg.callbackArg = ((RegionEventImpl)this.event).getRawCallbackArgument(); } msg.op = this.event.getOperation(); msg.owner = this; msg.regionAllowsConflation = getRegion().getEnableAsyncConflation(); }