RemoteOperationResponse createReplyProcessor(LocalRegion r, Set<?> recipients, Object key) { // r.getCache().getLogger().warning("RemotePutAllMessage.createReplyProcessor()", // new Exception("stack trace")); return new PutAllResponse(r.getSystem(), recipients); }
RemoteOperationResponse createReplyProcessor(LocalRegion r, Set recipients, Object key) { return new RemoveAllResponse(r.getSystem(), recipients); }
RemoteOperationResponse createReplyProcessor(LocalRegion r, Set recipients, Object key) { return new PutAllResponse(r.getSystem(), recipients); }
/** * @param currRegion * @param target * @return the response */ public static FetchKeysResponse send(LocalRegion currRegion, DistributedMember target) { FetchKeysResponse response = new FetchKeysResponse(currRegion.getSystem(), currRegion, (InternalDistributedMember)target); RemoteFetchKeysMessage msg = new RemoteFetchKeysMessage((InternalDistributedMember)target, currRegion.getFullPath(), response); currRegion.getSystem().getDistributionManager().putOutgoing(msg); return response; }
/** * @param currRegion * @param target * @return the response */ public static FetchKeysResponse send(LocalRegion currRegion, InternalDistributedMember target, TXStateInterface tx) { final InternalDistributedSystem sys = currRegion.getSystem(); final FetchKeysResponse response = new FetchKeysResponse(sys, currRegion, target); final RemoteFetchKeysMessage msg = new RemoteFetchKeysMessage(target, currRegion, response, tx); sys.getDistributionManager().putOutgoing(msg); return response; }
private EntryEventImpl createNewEvent(LocalRegion region, VersionTag tag, Object key) { EntryEventImpl updateTimeStampEvent = EntryEventImpl.createVersionTagHolder(tag); updateTimeStampEvent.setOperation(Operation.UPDATE_VERSION_STAMP); updateTimeStampEvent.setRegion(region); if (region instanceof PartitionedRegion) { updateTimeStampEvent.setKeyInfo(((PartitionedRegion)region).getKeyInfo(key)); } else { updateTimeStampEvent.setKeyInfo(new KeyInfo(key, null, 0)); } updateTimeStampEvent.setGenerateCallbacks(false); updateTimeStampEvent.distributedMember = region.getSystem().getDistributedMember(); updateTimeStampEvent.setNewEventId(region.getSystem()); return updateTimeStampEvent; }
/** * Send RemoteFetchVersionMessage to the recipient for the given key * @param recipient * @param r * @param key * @return the processor used to fetch the VersionTag for the key * @throws RemoteOperationException if the member is no longer available */ public static FetchVersionResponse send(InternalDistributedMember recipient, LocalRegion r, Object key) throws RemoteOperationException { FetchVersionResponse response = new FetchVersionResponse(r.getSystem(), recipient); RemoteFetchVersionMessage msg = new RemoteFetchVersionMessage(recipient, r, response, key); Set<?> failures = r.getDistributionManager().putOutgoing(msg); if (failures != null && failures.size() > 0) { throw new RemoteOperationException( LocalizedStrings.GetMessage_FAILED_SENDING_0.toLocalizedString(msg)); } return response; }
private EntryEventImpl createNewEvent(LocalRegion region, VersionTag tag, Object key, Object value) { EntryEventImpl updateEvent = EntryEventImpl.createVersionTagHolder(tag); updateEvent.setOperation(Operation.UPDATE); updateEvent.setRegion(region); if (region instanceof PartitionedRegion) { updateEvent.setKeyInfo(((PartitionedRegion)region).getKeyInfo(key)); } else { updateEvent.setKeyInfo(new KeyInfo(key, value, null)); } updateEvent.setNewValue(value); updateEvent.setGenerateCallbacks(true); updateEvent.distributedMember = region.getSystem().getDistributedMember(); updateEvent.setNewEventId(region.getSystem()); return updateEvent; }
/** * Send RemoteFetchVersionMessage to the recipient for the given key * @param recipient * @param r * @param key * @return the processor used to fetch the VersionTag for the key * @throws RemoteOperationException if the member is no longer available */ public static FetchVersionResponse send(InternalDistributedMember recipient, LocalRegion r, Object key) throws RemoteOperationException { FetchVersionResponse response = new FetchVersionResponse(r.getSystem(), recipient); RemoteFetchVersionMessage msg = new RemoteFetchVersionMessage(recipient, r.getFullPath(), response, key); Set<?> failures = r.getDistributionManager().putOutgoing(msg); if (failures != null && failures.size() > 0) { throw new RemoteOperationException(LocalizedStrings.GetMessage_FAILED_SENDING_0.toLocalizedString(msg)); } return response; }
/** * generate version tag if it does not exist and set it into the event. * @param event * @param entry */ public void generateAndSetVersionTag(InternalCacheEvent event, RegionEntry entry) { if (entry != null && event.getOperation().isEntry()) { EntryEventImpl entryEvent = (EntryEventImpl)event; if (!entryEvent.isOriginRemote() && shouldGenerateVersionTag(entry, entryEvent)) { boolean eventHasDelta = (getSystem().getConfig().getDeltaPropagation() && !this.scope.isDistributedNoAck() && entryEvent.getDeltaBytes() != null); VersionTag v = entry.generateVersionTag(null, eventHasDelta, this, entryEvent); if(logger.isDebugEnabled()) { logger.debug("generated version tag {} for {}", v, entryEvent.getKey()); } } } }
/** * sends a message to the given recipients asking for the size of either * their primary bucket entries or the values sets of their primary * buckets * @param recipients recipients of the message * @param r the local PartitionedRegion instance * @param queryType either TYPE_ENTRIES or TYPE_VALUES */ public static SizeResponse send(Set recipients, LocalRegion r, int queryType) { Assert.assertTrue(recipients != null, "RemoteSizeMessage NULL recipients set"); SizeResponse p = new SizeResponse(r.getSystem(), recipients); RemoteSizeMessage m = new RemoteSizeMessage(recipients, r.getFullPath(), p, queryType); r.getDistributionManager().putOutgoing(m); return p; }
public final void applyOperation() throws StandardException { // Distribute the message only in case of PR try { @SuppressWarnings("unchecked") Set<DistributedMember> members = ((CacheDistributionAdvisee)rgn) .getCacheDistributionAdvisor() .adviseSerialAsyncEventQueueOrGatewaySender(); if (GemFireXDUtils.TraceDBSynchronizer) { SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_DB_SYNCHRONIZER, "BaseActivation: distributing bulk DML to remote nodes. " + "Message={" + this + "} to members=" + members); } this.send(this.rgn.getSystem(), members); } catch (SQLException sqle) { throw Misc.wrapSQLException(sqle, sqle); } addToLocalDBSynchronizerConditionally(true); }
public final void applyOperation() throws StandardException { // Distribute the message only in case of PR try { @SuppressWarnings("unchecked") Set<DistributedMember> members = ((CacheDistributionAdvisee)rgn) .getCacheDistributionAdvisor() .adviseSerialAsyncEventQueueOrGatewaySender(); if (GemFireXDUtils.TraceDBSynchronizer) { SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_DB_SYNCHRONIZER, "BaseActivation: distributing bulk DML to remote nodes. " + "Message={" + this + "} to members=" + members); } this.send(this.rgn.getSystem(), members); } catch (SQLException sqle) { throw Misc.wrapSQLException(sqle, sqle); } addToLocalDBSynchronizerConditionally(true); }
public final void applyOperation() throws StandardException { // Distribute the message only in case of PR try { @SuppressWarnings("unchecked") Set<DistributedMember> members = ((CacheDistributionAdvisee)rgn) .getCacheDistributionAdvisor() .adviseSerialAsyncEventQueueOrGatewaySender(); if (GemFireXDUtils.TraceDBSynchronizer) { SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_DB_SYNCHRONIZER, "BaseActivation: distributing bulk DML to remote nodes. " + "Message={" + this + "} to members=" + members); } this.send(this.rgn.getSystem(), members); } catch (SQLException sqle) { throw Misc.wrapSQLException(sqle, sqle); } addToLocalDBSynchronizerConditionally(true); }
public static RemoveAllResponse send(DistributedMember recipient, EntryEventImpl event, RemoveAllEntryData[] removeAllData, int removeAllDataCount, boolean useOriginRemote, int processorType, boolean possibleDuplicate) throws RemoteOperationException { //Assert.assertTrue(recipient != null, "RemoteRemoveAllMessage NULL recipient"); recipient can be null for event notifications Set recipients = Collections.singleton(recipient); RemoveAllResponse p = new RemoveAllResponse(event.getRegion().getSystem(), recipients); RemoteRemoveAllMessage msg = new RemoteRemoveAllMessage(event, recipients, p, removeAllData, removeAllDataCount, useOriginRemote, processorType, possibleDuplicate); msg.setTransactionDistributed(event.getRegion().getCache().getTxManager().isDistributed()); Set failures = event.getRegion().getDistributionManager().putOutgoing(msg); if (failures != null && failures.size() > 0) { throw new RemoteOperationException(LocalizedStrings.RemotePutMessage_FAILED_SENDING_0.toLocalizedString(msg)); } return p; }
public static PutAllResponse send(DistributedMember recipient, EntryEventImpl event, PutAllEntryData[] putAllData, int putAllDataCount, boolean useOriginRemote, int processorType, boolean possibleDuplicate) throws RemoteOperationException { //Assert.assertTrue(recipient != null, "RemotePutAllMessage NULL recipient"); recipient can be null for event notifications Set recipients = Collections.singleton(recipient); PutAllResponse p = new PutAllResponse(event.getRegion().getSystem(), recipients); RemotePutAllMessage msg = new RemotePutAllMessage(event, recipients, p, putAllData, putAllDataCount, useOriginRemote, processorType, possibleDuplicate, !event.isGenerateCallbacks()); msg.setTransactionDistributed(event.getRegion().getCache().getTxManager().isDistributed()); Set failures = event.getRegion().getDistributionManager().putOutgoing(msg); if (failures != null && failures.size() > 0) { throw new RemoteOperationException(LocalizedStrings.RemotePutMessage_FAILED_SENDING_0.toLocalizedString(msg)); } return p; }
/** * generate version tag if it does not exist and set it into the event. * @param entryEvent * @param entry */ public final void generateAndSetVersionTag(EntryEventImpl entryEvent, RegionEntry entry) { // InternalDistributedSystem.getLoggerI18n().info(LocalizedStrings.DEBUG, "generateAndSetVersionTag entry="+entry.toString(), new Exception("stack trace")); if (!entryEvent.isOriginRemote() && shouldGenerateVersionTag(entry, entryEvent)) { boolean eventHasDelta = (getSystem().getConfig().getDeltaPropagation() && !this.scope.isDistributedNoAck() && entryEvent.getDeltaBytes() != null); VersionTag v = entry.generateVersionTag(null, false, eventHasDelta, this, entryEvent); if (v != null) { LogWriterI18n log = getLogWriterI18n(); if (log.fineEnabled()) { log.fine("generated version tag " + v + " for " + entryEvent.getKey()); } // + " for " + entryEvent/*.getKey()*/ + " in region " + this.getName()); } } } }
private void executeOnServerNoAck(String functionId, byte hasResult, boolean isHA, boolean optimizeForWrite) throws FunctionException { ServerRegionProxy srp = getServerRegionProxy(); FunctionStats stats = FunctionStats.getFunctionStats(functionId, this.region.getSystem()); try { validateExecution(null, null); long start = stats.startTime(); stats.startFunctionExecution(false); srp.executeFunctionNoAck(this.region.getFullPath(), functionId, this, hasResult, isHA, optimizeForWrite, false); stats.endFunctionExecution(start, false); } catch(FunctionException functionException){ stats.endFunctionExecutionWithException(false); throw functionException; } catch (Exception exception) { stats.endFunctionExecutionWithException(false); throw new FunctionException(exception); } }
private void executeOnServerNoAck(String functionId, byte hasResult, boolean isHA, boolean optimizeForWrite) throws FunctionException { ServerRegionProxy srp = getServerRegionProxy(); FunctionStats stats = FunctionStats.getFunctionStats(functionId, this.region.getSystem()); try { validateExecution(null, null); long start = stats.startTime(); stats.startFunctionExecution(false); srp.executeFunctionNoAck(this.region.getFullPath(), functionId, this, hasResult, isHA, optimizeForWrite, false); stats.endFunctionExecution(start, false); } catch(FunctionException functionException){ stats.endFunctionExecutionWithException(false); throw functionException; } catch (Exception exception) { stats.endFunctionExecutionWithException(false); throw new FunctionException(exception); } }
private void executeOnServerNoAck(Function function, byte hasResult) throws FunctionException { ServerRegionProxy srp = getServerRegionProxy(); FunctionStats stats = FunctionStats.getFunctionStats(function.getId(), this.region.getSystem()); try { validateExecution(function, null); long start = stats.startTime(); stats.startFunctionExecution(false); srp.executeFunctionNoAck(this.region.getFullPath(), function, this, hasResult, false); stats.endFunctionExecution(start, false); } catch(FunctionException functionException){ stats.endFunctionExecutionWithException(false); throw functionException; } catch (Exception exception) { stats.endFunctionExecutionWithException(false); throw new FunctionException(exception); } }