Package org.apache.ignite.client

## Interface ClientCompute

-     public interface ClientCompute

  Thin client compute facade. Defines compute grid functionality for executing tasks over nodes in the `ClientClusterGroup`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `ClientClusterGroup` | `clusterGroup()` | Gets cluster group to which this `ClientCompute` instance belongs.
    `<T,​R> R` | `execute​(String taskName, T arg)` | Executes given task within the cluster group.
    `<T,​R> Future<R>` | `executeAsync​(String taskName, T arg)` | Deprecated. Use `executeAsync2(String, Object)` instead.
    `<T,​R> IgniteClientFuture<R>` | `executeAsync2​(String taskName, T arg)` | Executes given task asynchronously within the cluster group.
    `ClientCompute` | `withNoFailover()` | Sets no-failover flag for tasks executed by returned `ClientCompute` instance.
    `ClientCompute` | `withNoResultCache()` | Disables result caching for tasks executed by returned `ClientCompute` instance.
    `ClientCompute` | `withTimeout​(long timeout)` | Sets timeout for tasks executed by returned `ClientCompute` instance.

- - ### Method Detail

    - #### clusterGroup

          ClientClusterGroup clusterGroup()

      Gets cluster group to which this `ClientCompute` instance belongs.
      Returns:
        Cluster group to which this `ClientCompute` instance belongs.

    - #### execute

          <T,​R> R execute​(String taskName,
                                @Nullable
                                T arg)
                         throws ClientException,
                                InterruptedException

      Executes given task within the cluster group. For step-by-step explanation of task execution process refer to `ComputeTask` documentation.
      Type Parameters:
        `T` - Type of the task argument.
        `R` - Type of the task result.
      Parameters:
        `taskName` - Name of the task to execute.
        `arg` - Optional argument of task execution, can be `null`.
      Returns:
        Task result.
      Throws:
        `ClientException` - If task failed.
        `InterruptedException` - If the wait for task completion was interrupted.
      See Also:
        `for information about task execution.`

    - #### executeAsync

          @Deprecated
          <T,​R> Future<R> executeAsync​(String taskName,
                                             @Nullable
                                             T arg)
                                      throws ClientException

      Deprecated.
      Use `executeAsync2(String, Object)` instead. This method calls `executeAsync2(String, Object)` internally, but returns a more limited Future interface.
      Executes given task asynchronously within the cluster group. For step-by-step explanation of task execution process refer to `ComputeTask` documentation.
      Type Parameters:
        `T` - Type of the task argument.
        `R` - Type of the task result.
      Parameters:
        `taskName` - Name of the task to execute.
        `arg` - Optional argument of task execution, can be `null`.
      Returns:
        A Future representing pending completion of the task.
      Throws:
        `ClientException` - If task failed.
      See Also:
        `for information about task execution.`

    - #### executeAsync2

          <T,​R> IgniteClientFuture<R> executeAsync2​(String taskName,
                                                          @Nullable
                                                          T arg)
                                                   throws ClientException

      Executes given task asynchronously within the cluster group. For step-by-step explanation of task execution process refer to `ComputeTask` documentation.
      Type Parameters:
        `T` - Type of the task argument.
        `R` - Type of the task result.
      Parameters:
        `taskName` - Name of the task to execute.
        `arg` - Optional argument of task execution, can be `null`.
      Returns:
        A Future representing pending completion of the task.
      Throws:
        `ClientException` - If task failed.
      See Also:
        `for information about task execution.`

    - #### withTimeout

          ClientCompute withTimeout​(long timeout)

      Sets timeout for tasks executed by returned `ClientCompute` instance.
      Parameters:
        `timeout` - Task execution timeout.
      Returns:
        `ClientCompute` instance with given timeout.

    - #### withNoFailover

          ClientCompute withNoFailover()

      Sets no-failover flag for tasks executed by returned `ClientCompute` instance. If flag is set, job will be never failed over even if remote node crashes or rejects execution. See `ComputeTask` documentation for more information about jobs failover.
      Returns:
        `ClientCompute` instance with no-failover flag.

    - #### withNoResultCache

          ClientCompute withNoResultCache()

      Disables result caching for tasks executed by returned `ClientCompute` instance. See `ComputeTask` documentation for more information tasks result caching.
      Returns:
        `ClientCompute` instance with "no result cache" flag.