private synchronized void lastResult(Object oneResult, ResultCollector collector, boolean lastRemoteResult, boolean lastLocalResult, DistributedMember memberID) { if(lastRemoteResult){ this.completelyDoneFromRemote = true; } if(lastLocalResult) { this.localLastResultRecieved = true; } if (this.serverSender != null) { // Client-Server if (this.completelyDoneFromRemote && this.localLastResultRecieved) { lastClientSend(memberID, oneResult); collector.endResults(); } else { clientSend(oneResult, memberID); } } else { // P2P if (this.completelyDoneFromRemote && this.localLastResultRecieved) { collector.addResult(memberID, oneResult); collector.endResults(); } else { collector.addResult(memberID, oneResult); } } }
public final void lastResult(final Object oneResult) { lastResult(oneResult, true, true, true); }
lastClientSend(memberID, oneResult); reply.endResults(); lastResult(oneResult, reply, true, false, memberID); clientSend(oneResult, memberID); lastResult(oneResult, reply, true, false, memberID);
private ResultCollector executeFunctionOnRemoteNode( InternalDistributedMember targetNode, final Function function, final Object object, final Set routingKeys, ResultCollector rc, Set bucketSet, ServerToClientFunctionResultSender sender, AbstractExecution execution) { PartitionedRegionFunctionResultSender resultSender = new PartitionedRegionFunctionResultSender( null, this, 0, rc, sender, false, true, execution.isForwardExceptions(), function, bucketSet); PartitionedRegionFunctionResultWaiter resultReciever = new PartitionedRegionFunctionResultWaiter( getSystem(), this.getPRId(), rc, function, resultSender); FunctionRemoteContext context = new FunctionRemoteContext(function, object, routingKeys, bucketSet, execution.isReExecute(), execution.isFnSerializationReqd()); HashMap<InternalDistributedMember, FunctionRemoteContext> recipMap = new HashMap<InternalDistributedMember, FunctionRemoteContext>(); recipMap.put(targetNode, context); ResultCollector reply = resultReciever.getPartitionedDataFrom(recipMap, this, execution); return reply; }
if (doTXFlush) { flushTXPendingOps(); lastClientSend(dm.getDistributionManagerId(), oneResult); this.rc.endResults(); this.localLastResultRecieved = true; lastResult(oneResult, rc, false, true, dm.getDistributionManagerId()); lastResult(oneResult, rc, false, true, dm.getDistributionManagerId());
lastClientSend(dm.getDistributionManagerId(), oneResult); this.rc.endResults(); this.localLastResultRecieved = true; lastResult(oneResult, rc, false, true, dm.getDistributionManagerId()); lastResult(oneResult, rc, false, true, dm.getDistributionManagerId());
ServerConnection.executeFunctionOnLocalNodeOnly((byte)3);//executed locally executeFunctionLocally(fn, cx, sender, dm); if (!sender.isLastResultReceived() && fn.hasResult()) { ((InternalResultSender)sender) .setException(new FunctionException( if (!sender.isLastResultReceived() && fn.hasResult()) { sender.setException(new FunctionException(LocalizedStrings .ExecuteFunction_THE_FUNCTION_0_DID_NOT_SENT_LAST_RESULT .toLocalizedString(fn.getId())));
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()))); } } });
clientSend(oneResult, dm.getDistributionManagerId());
lastClientSend(memberID, oneResult); reply.endResults(); lastResult(oneResult, reply, true, false, memberID); clientSend(oneResult, memberID); lastResult(oneResult, reply, true, false, memberID);
private ResultCollector executeFunctionOnRemoteNode( InternalDistributedMember targetNode, final Function function, final Object object, final Set routingKeys, ResultCollector rc, Set bucketSet, ServerToClientFunctionResultSender sender, AbstractExecution execution, TXStateInterface tx) { PartitionedRegionFunctionResultSender resultSender = new PartitionedRegionFunctionResultSender( null, tx, this, 0, rc, sender, false, true, execution.isForwardExceptions(), function, bucketSet); PartitionedRegionFunctionResultWaiter resultReciever = new PartitionedRegionFunctionResultWaiter( getSystem(), this.getPRId(), rc, function, resultSender); FunctionRemoteContext context = new FunctionRemoteContext(function, object, routingKeys, bucketSet, execution.isReExecute(), execution.isFnSerializationReqd(), tx); HashMap<InternalDistributedMember, FunctionRemoteContext> recipMap = new HashMap<InternalDistributedMember, FunctionRemoteContext>(); recipMap.put(targetNode, context); ResultCollector reply = resultReciever.getPartitionedDataFrom(recipMap, this, execution); return reply; }
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()))); } } });
logger.fine("PartitionedRegionFunctionResultSender sending result from local node to client " + oneResult); clientSend(oneResult, dm.getDistributionManagerId());
.getLocalResultCollector(function, rc); final DM dm = getDistributionManager(); final PartitionedRegionFunctionResultSender resultSender = new PartitionedRegionFunctionResultSender( dm, this, 0L, localResultCollector, execution .getServerResultSender(), memberToKeysMap.isEmpty(), remoteOnly,
private synchronized void lastResult(Object oneResult, ResultCollector collector, boolean lastRemoteResult, boolean lastLocalResult, DistributedMember memberID) { if(lastRemoteResult){ this.completelyDoneFromRemote = true; } if(lastLocalResult) { this.localLastResultRecieved = true; } if (this.serverSender != null) { // Client-Server if (this.completelyDoneFromRemote && this.localLastResultRecieved) { lastClientSend(memberID, oneResult); collector.endResults(); } else { clientSend(oneResult, memberID); } } else { // P2P if (this.completelyDoneFromRemote && this.localLastResultRecieved) { collector.addResult(memberID, oneResult); collector.endResults(); } else { collector.addResult(memberID, oneResult); } } }
/** * This function processes the result data it receives. Adds the result to * resultCollector as it gets the objects. On getting the last msg from all * the sender it will call endResult on ResultSender. */ public void processData(Object result, boolean lastMsg, DistributedMember memberID) { boolean completelyDone = false; if (lastMsg) { this.totalLastMsgRecieved++; } if (this.totalLastMsgRecieved == this.recipients.size()) { completelyDone = true; } ((PartitionedRegionFunctionResultSender)resultSender).lastResult( result, completelyDone, this.reply, memberID); } }
ServerConnection.executeFunctionOnLocalNodeOnly((byte)3);//executed locally executeFunctionLocally(fn, cx, sender, dm); if (!sender.isLastResultReceived() && fn.hasResult()) { ((InternalResultSender)sender) .setException(new FunctionException( if (!sender.isLastResultReceived() && fn.hasResult()) { ((InternalResultSender)sender) .setException(new FunctionException(
.getLocalResultCollector(function, rc); final DM dm = getDistributionManager(); final PartitionedRegionFunctionResultSender resultSender = new PartitionedRegionFunctionResultSender( dm, tx, this, 0L, localResultCollector, execution .getServerResultSender(), recipMap.isEmpty(), !isSelf, execution.isForwardExceptions(), function, localBucketSet);
/** * This function processes the result data it receives. Adds the result to * resultCollector as it gets the objects. On getting the last msg from all * the sender it will call endResult on ResultSender. */ @Override public void processData(Object result, boolean lastMsg, DistributedMember memberID) { boolean completelyDone = false; if (lastMsg) { this.totalLastMsgRecieved++; } if (this.totalLastMsgRecieved == this.recipients.size()) { completelyDone = true; } ((PartitionedRegionFunctionResultSender)resultSender).lastResult( result, completelyDone, this.reply, memberID); } }
.getLocalResultCollector(function, rc); final DM dm = getDistributionManager(); final PartitionedRegionFunctionResultSender resultSender = new PartitionedRegionFunctionResultSender( dm, tx, this, 0L, localResultCollector, execution .getServerResultSender(), memberToKeysMap.isEmpty(), remoteOnly,