Interface DistributedCallable<T>

  • Type Parameters:
    T - the result type
    All Superinterfaces:
    Serializable
    All Known Implementing Classes:
    DistributedCommand

    public interface DistributedCallable<T>
    extends Serializable
    A distributed equivalent of a Callable. A DistributedCallable will be serialized to all nodes and will be be invoked once per VirtualNodeID. The callable will be run and its results will be merged together by calling merge(List).
    • Method Detail

      • init

        MonitoredCallable<T> init​(DistributedCallableContext ctx)
        Invoked once per VirtualNodeID. 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.