void sendLast(ProcedureChunkMessage message) { final int seqNo = this.seqno.getAndIncrement(); message.setPrevSeqNumber(seqNo); message.setSeqNumber(seqNo + 1); if (GemFireXDUtils.TraceQuery) { SanityManager.DEBUG_PRINT("DataAwareDistribution", "Sending " + message.toString()); } this.sender.lastResult(message); }
/*** * * @param sender: the underlying result sender of the function service. */ public ProcedureSender(ResultSender<?> sender, EmbedConnection conn) { this.sender = (InternalResultSender)sender; this.sender .enableOrderedResultStreaming(GemFireXDUtils.PROCEDURE_ORDER_RESULTS); //this.resultSetSenders=new Vector<ResultSetSender>(); this.seqno = new AtomicInteger(0); this.parentConn = conn; }
/**** * add the member id to the message so that the coordinate node knows which node * sends back this message. * @param message */ void send(ProcedureChunkMessage message) { final int seqNo = this.seqno.getAndIncrement(); message.setPrevSeqNumber(seqNo); message.setSeqNumber(seqNo + 1); if (GemFireXDUtils.TraceQuery) { SanityManager.DEBUG_PRINT("DataAwareDistribution", "Sending " + message); } this.sender.sendResult(message); }
public void run() { executeFunctionLocally(fn, cx, sender, newDM); if (!sender.isLastResultReceived() && fn.hasResult()) { sender.setException(new FunctionException(LocalizedStrings .ExecuteFunction_THE_FUNCTION_0_DID_NOT_SENT_LAST_RESULT .toLocalizedString(fn.getId()))); } } });
private void handleException(Throwable functionException, final Function fn, final FunctionContext cx, final InternalResultSender sender, DM dm) { FunctionStats stats = FunctionStats.getFunctionStats(fn.getId(), dm .getSystem()); LogWriterI18n logger = dm.getLoggerI18n(); if (logger.fineEnabled()) { logger.fine( "Exception occured on local node while executing Function: " + fn.getId(), functionException); } stats.endFunctionExecutionWithException(fn.hasResult()); if (fn.hasResult()) { if (waitOnException || forwardExceptions) { sender.lastResult(functionException); } else { sender.setException(functionException); } } else { if (logger.warningEnabled()) { logger.warning( LocalizedStrings.FunctionService_EXCEPTION_ON_LOCAL_NODE, functionException); } } } }
&& this.activation.getFunctionContext() != null && ((InternalResultSender)this.activation.getFunctionContext() .getResultSender()).isLocallyExecuted()) { final Set<InternalDistributedMember> allDMs = this.dm .getDistributionManagerIdsIncludingAdmin();
private void handleException(Throwable functionException, final Function fn, final FunctionContext cx, final ResultSender sender, DM dm){ FunctionStats stats = FunctionStats.getFunctionStats(fn.getId(), dm .getSystem()); if (logger.isDebugEnabled()) { logger.debug("Exception occured on local node while executing Function: {}", fn.getId(), functionException); } stats.endFunctionExecutionWithException(fn.hasResult()); if (fn.hasResult()) { if (waitOnException || forwardExceptions) { sender.lastResult(functionException); } else { ((InternalResultSender)sender).setException(functionException); } } else { logger.warn(LocalizedMessage.create( LocalizedStrings.FunctionService_EXCEPTION_ON_LOCAL_NODE), functionException); } } }
public void run() { executeFunctionLocally(fn, cx, sender, newDM); if (!((InternalResultSender)sender).isLastResultReceived() && fn.hasResult()) { ((InternalResultSender)sender) .setException(new FunctionException( LocalizedStrings.ExecuteFunction_THE_FUNCTION_0_DID_NOT_SENT_LAST_RESULT .toString(fn.getId()))); } } });
&& this.activation.getFunctionContext() != null && ((InternalResultSender)this.activation.getFunctionContext() .getResultSender()).isLocallyExecuted()) { final Set<InternalDistributedMember> allDMs = this.dm .getDistributionManagerIdsIncludingAdmin();
public void run() { executeFunctionLocally(fn, cx, sender, newDM); if (!sender.isLastResultReceived() && fn.hasResult()) { ((InternalResultSender)sender) .setException(new FunctionException( LocalizedStrings.ExecuteFunction_THE_FUNCTION_0_DID_NOT_SENT_LAST_RESULT .toString(fn.getId()))); } } });
/**** * add the member id to the message so that the coordinate node knows which node * sends back this message. * @param message */ void send(ProcedureChunkMessage message) { final int seqNo = this.seqno.getAndIncrement(); message.setPrevSeqNumber(seqNo); message.setSeqNumber(seqNo + 1); if (GemFireXDUtils.TraceQuery) { SanityManager.DEBUG_PRINT("DataAwareDistribution", "Sending " + message); } this.sender.sendResult(message); }
public final void executeFunctionOnLocalNode(final Function fn, final FunctionContext cx, final ResultSender sender, DM dm, final boolean isTx) { if (dm instanceof DistributionManager && !isTx) { final DistributionManager newDM = (DistributionManager)dm; newDM.getFunctionExcecutor().execute(new Runnable() { public void run() { executeFunctionLocally(fn, cx, sender, newDM); if (!((InternalResultSender)sender).isLastResultReceived() && fn.hasResult()) { ((InternalResultSender)sender) .setException(new FunctionException( LocalizedStrings.ExecuteFunction_THE_FUNCTION_0_DID_NOT_SENT_LAST_RESULT .toString(fn.getId()))); } } }); } else { executeFunctionLocally(fn, cx, sender, dm); if (!((InternalResultSender)sender).isLastResultReceived() && fn.hasResult()) { ((InternalResultSender)sender) .setException(new FunctionException( LocalizedStrings.ExecuteFunction_THE_FUNCTION_0_DID_NOT_SENT_LAST_RESULT .toString(fn.getId()))); } } }
void sendLast(ProcedureChunkMessage message) { final int seqNo = this.seqno.getAndIncrement(); message.setPrevSeqNumber(seqNo); message.setSeqNumber(seqNo + 1); if (GemFireXDUtils.TraceQuery) { SanityManager.DEBUG_PRINT("DataAwareDistribution", "Sending " + message.toString()); } this.sender.lastResult(message); }
/*** * * @param sender: the underlying result sender of the function service. */ public ProcedureSender(ResultSender<?> sender, EmbedConnection conn) { this.sender = (InternalResultSender)sender; this.sender .enableOrderedResultStreaming(GemFireXDUtils.PROCEDURE_ORDER_RESULTS); //this.resultSetSenders=new Vector<ResultSetSender>(); this.seqno = new AtomicInteger(0); this.parentConn = conn; }
|| (this.activation.getFunctionContext() != null && ((InternalResultSender)this.activation.getFunctionContext() .getResultSender()).isLocallyExecuted()))) { final Set<InternalDistributedMember> allDMs = this.dm .getDistributionManagerIdsIncludingAdmin();
public void run() { executeFunctionLocally(fn, cx, sender, newDM); if (!sender.isLastResultReceived() && fn.hasResult()) { ((InternalResultSender)sender) .setException(new FunctionException( LocalizedStrings.ExecuteFunction_THE_FUNCTION_0_DID_NOT_SENT_LAST_RESULT .toString(fn.getId()))); } } });
/**** * add the member id to the message so that the coordinate node knows which node * sends back this message. * @param message */ void send(ProcedureChunkMessage message) { final int seqNo = this.seqno.getAndIncrement(); message.setPrevSeqNumber(seqNo); message.setSeqNumber(seqNo + 1); if (GemFireXDUtils.TraceQuery) { SanityManager.DEBUG_PRINT("DataAwareDistribution", "Sending " + message); } this.sender.sendResult(message); }
public final void executeFunctionOnLocalNode(final Function fn, final FunctionContext cx, final InternalResultSender sender, DM dm, final TXStateInterface tx) { if (dm instanceof DistributionManager && tx == null) { final DistributionManager newDM = (DistributionManager)dm; newDM.getFunctionExcecutor().execute(new Runnable() { public void run() { executeFunctionLocally(fn, cx, sender, newDM); if (!sender.isLastResultReceived() && fn.hasResult()) { sender.setException(new FunctionException(LocalizedStrings .ExecuteFunction_THE_FUNCTION_0_DID_NOT_SENT_LAST_RESULT .toLocalizedString(fn.getId()))); } } }); } else { executeFunctionLocally(fn, cx, sender, dm); if (!sender.isLastResultReceived() && fn.hasResult()) { sender.setException(new FunctionException(LocalizedStrings .ExecuteFunction_THE_FUNCTION_0_DID_NOT_SENT_LAST_RESULT .toLocalizedString(fn.getId()))); } } }
void sendLast(ProcedureChunkMessage message) { final int seqNo = this.seqno.getAndIncrement(); message.setPrevSeqNumber(seqNo); message.setSeqNumber(seqNo + 1); if (GemFireXDUtils.TraceQuery) { SanityManager.DEBUG_PRINT("DataAwareDistribution", "Sending " + message.toString()); } this.sender.lastResult(message); }
/*** * * @param sender: the underlying result sender of the function service. */ public ProcedureSender(ResultSender<?> sender, EmbedConnection conn) { this.sender = (InternalResultSender)sender; this.sender .enableOrderedResultStreaming(GemFireXDUtils.PROCEDURE_ORDER_RESULTS); //this.resultSetSenders=new Vector<ResultSetSender>(); this.seqno = new AtomicInteger(0); this.parentConn = conn; }