Search in sources :

Example 1 with PRFunctionStreamingResultCollector

use of org.apache.geode.internal.cache.partitioned.PRFunctionStreamingResultCollector in project geode by apache.

the class PartitionedRegionFunctionResultWaiter method getPartitionedDataFrom.

/**
   * Returns normally if succeeded to get data, otherwise throws an exception Have to wait outside
   * this function and when getResult() is called. For the time being get the correct results.
   */
public ResultCollector getPartitionedDataFrom(Map<InternalDistributedMember, FunctionRemoteContext> recipMap, PartitionedRegion pr, AbstractExecution execution) {
    if (recipMap.isEmpty()) {
        return this.rc;
    }
    Set<InternalDistributedMember> recipientsSet = new HashSet<InternalDistributedMember>();
    for (InternalDistributedMember member : recipMap.keySet()) {
        recipientsSet.add(member);
    }
    this.recipients = recipientsSet;
    PRFunctionStreamingResultCollector processor = new PRFunctionStreamingResultCollector(this, this.sys, recipientsSet, this.rc, functionObject, pr, execution);
    this.reply = processor;
    for (Map.Entry<InternalDistributedMember, FunctionRemoteContext> entry : recipMap.entrySet()) {
        FunctionRemoteContext context = entry.getValue();
        DistributionMessage m = createRequestMessage(entry.getKey(), processor, context);
        this.sys.getDistributionManager().putOutgoing(m);
    }
    return processor;
}
Also used : InternalDistributedMember(org.apache.geode.distributed.internal.membership.InternalDistributedMember) DistributionMessage(org.apache.geode.distributed.internal.DistributionMessage) Map(java.util.Map) PRFunctionStreamingResultCollector(org.apache.geode.internal.cache.partitioned.PRFunctionStreamingResultCollector) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)1 Map (java.util.Map)1 DistributionMessage (org.apache.geode.distributed.internal.DistributionMessage)1 InternalDistributedMember (org.apache.geode.distributed.internal.membership.InternalDistributedMember)1 PRFunctionStreamingResultCollector (org.apache.geode.internal.cache.partitioned.PRFunctionStreamingResultCollector)1