-
- Type Parameters:
T
- the result type
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
DistributedCommand
public interface DistributedCallable<T> extends Serializable
A distributed equivalent of aCallable
. ADistributedCallable
will be serialized to all nodes and will be be invoked once perVirtualNodeID
. The callable will be run and its results will be merged together by callingmerge(List)
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MonitoredCallable<T>
init(DistributedCallableContext ctx)
Invoked once perVirtualNodeID
.T
merge(List<T> results)
Invoked to perform a merge of results.
-
-
-
Method Detail
-
init
MonitoredCallable<T> init(DistributedCallableContext ctx)
Invoked once perVirtualNodeID
. This method will be called on the remote side.- Parameters:
ctx
- a remote context from which the callable can obtain its distributed identity, etc.- Returns:
- the actual callable to invoke.
-
merge
T merge(List<T> results)
Invoked to perform a merge of results. Implementations should not make any assumptions about the order of the results (specifically, the order of the results will not necessarily be the same as partition ids). This also may be invoked multiple times to allow hierarchical merging.- Parameters:
results
- the results- Returns:
- the merged results.
-
-