use of org.apache.geode.internal.cache.FunctionStreamingReplyMessage in project geode by apache.
the class FunctionStreamingResultCollector method process.
@Override
public void process(DistributionMessage msg) {
if (!waitingOnMember(msg.getSender())) {
return;
}
this.msgsBeingProcessed.incrementAndGet();
try {
ReplyMessage m = (ReplyMessage) msg;
if (m.getException() == null) {
FunctionStreamingReplyMessage functionReplyMsg = (FunctionStreamingReplyMessage) m;
Object result = functionReplyMsg.getResult();
boolean isLast = false;
synchronized (processSingleResult) {
isLast = trackMessage(functionReplyMsg);
this.functionResultWaiter.processData(result, isLast, msg.getSender());
}
if (isLast) {
// removes from members and cause us
super.process(msg, false);
// to ignore future messages received from that member
}
} else {
if (execution.forwardExceptions || (execution.waitOnException)) {
// send BucketMovedException forward which will be handled by LocalResultCollectorImpl
synchronized (processSingleResult) {
this.functionResultWaiter.processData(m.getException().getCause(), true, msg.getSender());
}
}
super.process(msg, false);
}
} finally {
this.msgsBeingProcessed.decrementAndGet();
// check to see if decrementing msgsBeingProcessed requires signalling to
checkIfDone();
// proceed
}
}
Aggregations