org.apache.ignite.internal

## Class IgniteComputeHandler

- java.lang.Object
- - org.apache.ignite.internal.IgniteComputeHandler

    public class IgniteComputeHandler
    extends Object

Represents a general facade that delegates Ignite compute requests to `GridTaskProcessor` and `GridClosureProcessor` internal processors. It also provides a built-in mechanism for accumulating execution options that are automatically applied to computations.

See Also:
  `TaskExecutionOptions`, `IgniteComputeImpl`, `PlatformCompute`

### Constructor Summary

Constructors
Constructor and Description
`IgniteComputeHandler(GridKernalContext ctx, Function<TaskExecutionOptions,TaskExecutionOptions> optsTransformer)`
`IgniteComputeHandler(IgniteComputeHandler other, Function<TaskExecutionOptions,TaskExecutionOptions> optsTransformer)` Creates copy of specified computation handler.

### Method Summary

All Methods Instance Methods Concrete Methods
`<R> IgniteInternalFuture<R>` `affinityCallAsync(@NotNull Collection<String> cacheNames, int partId, IgniteCallable<R> job)` Affinity call implementation.
`<R> IgniteInternalFuture<R>` `affinityCallAsync(@NotNull Collection<String> cacheNames, Object affKey, IgniteCallable<R> job)` Affinity call implementation.
`<R> IgniteInternalFuture<R>` `affinityCallAsync(String cacheName, Object affKey, IgniteCallable<R> job)` Affinity call implementation.
`IgniteInternalFuture<?>` `affinityRunAsync(@NotNull Collection<String> cacheNames, int partId, IgniteRunnable job)` Affinity run implementation.
`IgniteInternalFuture<?>` `affinityRunAsync(@NotNull Collection<String> cacheNames, Object affKey, IgniteRunnable job)` Affinity run implementation.
`IgniteInternalFuture<?>` `affinityRunAsync(String cacheName, Object affKey, IgniteRunnable job)` Affinity run implementation.
`<T,R> IgniteInternalFuture<Collection<R>>` `applyAsync(IgniteClosure<T,R> job, @Nullable Collection<? extends T> args)` Apply implementation.
`<R,T> IgniteInternalFuture<R>` `applyAsync(IgniteClosure<T,R> job, T arg)` Apply implementation.
`<R1,R2,T> IgniteInternalFuture<R2>` `applyAsync(IgniteClosure<T,R1> job, Collection<? extends T> args, IgniteReducer<R1,R2> rdc)` Apply with reducer implementation.
`IgniteComputeHandler` `asPublicRequest()`
`<R> IgniteInternalFuture<Collection<R>>` `broadcastAsync(IgniteCallable<R> job)` Broadcast implementation.
`<R,T> IgniteInternalFuture<Collection<R>>` `broadcastAsync(IgniteClosure<T,R> job, T arg)` Broadcast implementation.
`IgniteInternalFuture<?>` `broadcastAsync(IgniteRunnable job)` Broadcast implementation.
`<R> IgniteInternalFuture<Collection<R>>` `callAsync(Collection<? extends IgniteCallable<R>> jobs)` Call implementation.
`<R1,R2> IgniteInternalFuture<R2>` `callAsync(Collection<? extends IgniteCallable<R1>> jobs, IgniteReducer<R1,R2> rdc)` Call with reducer implementation.
`<R> IgniteInternalFuture<R>` `callAsync(IgniteCallable<R> job)` Call implementation.
`<T,R> IgniteInternalFuture<R>` `executeAsync(Class<? extends ComputeTask<T,R>> taskCls, T arg)` Execute implementation.
`<T,R> ComputeTaskInternalFuture<R>` `executeAsync(ComputeTask<T,R> task, T arg)` Execute implementation.
`<T,R> IgniteInternalFuture<R>` `executeAsync(String taskName, T arg)` Execute implementation.
`IgniteInternalFuture<?>` `runAsync(Collection<? extends IgniteRunnable> jobs)` Run implementation.
`IgniteInternalFuture<?>` `runAsync(IgniteRunnable job)` Run implementation.
`IgniteComputeHandler` `withExecutor(String execName)`
`IgniteComputeHandler` `withName(String taskName)`
`IgniteComputeHandler` `withNoFailover()`
`IgniteComputeHandler` `withNoResultCache()`
`IgniteComputeHandler` `withProjection(Collection<ClusterNode> prj)`
`IgniteComputeHandler` `withProjectionPredicate(IgnitePredicate<ClusterNode> predicate)`
`IgniteComputeHandler` `withTimeout(long timeout)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### IgniteComputeHandler

    public IgniteComputeHandler(IgniteComputeHandler other,
                                Function<TaskExecutionOptions,TaskExecutionOptions> optsTransformer)

Creates copy of specified computation handler. The result instance will inherit all options set for the original handler so far with `optsTransformer` applied to them.

Parameters:
  `other` - Ignite computation handler.
  `optsTransformer` - Function for initial execution options customization.

#### IgniteComputeHandler

    public IgniteComputeHandler(GridKernalContext ctx,
                                Function<TaskExecutionOptions,TaskExecutionOptions> optsTransformer)

Parameters:
  `ctx` - Kernal context.
  `optsTransformer` - Function for initial execution options customization.

### Method Detail

#### affinityRunAsync

    public IgniteInternalFuture<?> affinityRunAsync(String cacheName,
                                                    Object affKey,
                                                    IgniteRunnable job)

Affinity run implementation.

Parameters:
  `cacheName` - Cache name.
  `affKey` - Affinity key.
  `job` - Job.
Returns:
  Internal future.

#### affinityRunAsync

    public IgniteInternalFuture<?> affinityRunAsync(@NotNull
                                                    @NotNull Collection<String> cacheNames,
                                                    Object affKey,
                                                    IgniteRunnable job)

Affinity run implementation.

Parameters:
  `cacheNames` - Cache names collection.
  `affKey` - Affinity key.
  `job` - Job.
Returns:
  Internal future.

#### affinityRunAsync

    public IgniteInternalFuture<?> affinityRunAsync(@NotNull
                                                    @NotNull Collection<String> cacheNames,
                                                    int partId,
                                                    IgniteRunnable job)

Affinity run implementation.

Parameters:
  `cacheNames` - Cache names collection.
  `partId` - partition ID.
  `job` - Job.
Returns:
  Internal future.

#### affinityCallAsync

    public <R> IgniteInternalFuture<R> affinityCallAsync(String cacheName,
                                                         Object affKey,
                                                         IgniteCallable<R> job)

Affinity call implementation.

Parameters:
  `cacheName` - Cache name.
  `affKey` - Affinity key.
  `job` - Job.
Returns:
  Internal future.

#### affinityCallAsync

    public <R> IgniteInternalFuture<R> affinityCallAsync(@NotNull
                                                         @NotNull Collection<String> cacheNames,
                                                         Object affKey,
                                                         IgniteCallable<R> job)

Affinity call implementation.

Parameters:
  `cacheNames` - Cache names collection.
  `affKey` - Affinity key.
  `job` - Job.
Returns:
  Internal future.

#### affinityCallAsync

    public <R> IgniteInternalFuture<R> affinityCallAsync(@NotNull
                                                         @NotNull Collection<String> cacheNames,
                                                         int partId,
                                                         IgniteCallable<R> job)

Affinity call implementation.

Parameters:
  `cacheNames` - Cache names collection.
  `partId` - Partition ID.
  `job` - Job.
Returns:
  Internal future.

#### executeAsync

    public <T,R> IgniteInternalFuture<R> executeAsync(String taskName,
                                                      @Nullable
                                                      T arg)

Execute implementation.

Parameters:
  `taskName` - Task name.
  `arg` - Argument.
Returns:
  Internal future.

#### executeAsync

    public <T,R> IgniteInternalFuture<R> executeAsync(Class<? extends ComputeTask<T,R>> taskCls,
                                                      @Nullable
                                                      T arg)

Execute implementation.

Parameters:
  `taskCls` - Task class.
  `arg` - Argument.
Returns:
  Internal future.

#### executeAsync

    public <T,R> ComputeTaskInternalFuture<R> executeAsync(ComputeTask<T,R> task,
                                                           @Nullable
                                                           T arg)

Execute implementation.

Parameters:
  `task` - Task.
  `arg` - Task argument.
Returns:
  Task future.

#### broadcastAsync

    public IgniteInternalFuture<?> broadcastAsync(IgniteRunnable job)

Broadcast implementation.

Parameters:
  `job` - Job.
Returns:
  Internal future.

#### broadcastAsync

    public <R> IgniteInternalFuture<Collection<R>> broadcastAsync(IgniteCallable<R> job)

Broadcast implementation.

Parameters:
  `job` - Job.
Returns:
  Internal future.

#### broadcastAsync

    public <R,T> IgniteInternalFuture<Collection<R>> broadcastAsync(IgniteClosure<T,R> job,
                                                                    @Nullable
                                                                    T arg)

Broadcast implementation.

Parameters:
  `job` - Job.
  `arg` - Argument.
Returns:
  Internal future.

#### runAsync

    public IgniteInternalFuture<?> runAsync(IgniteRunnable job)

Run implementation.

Parameters:
  `job` - Job.
Returns:
  Internal future.

#### runAsync

    public IgniteInternalFuture<?> runAsync(Collection<? extends IgniteRunnable> jobs)

Run implementation.

Parameters:
  `jobs` - Jobs.
Returns:
  Internal future.

#### applyAsync

    public <R,T> IgniteInternalFuture<R> applyAsync(IgniteClosure<T,R> job,
                                                    @Nullable
                                                    T arg)

Apply implementation.

Parameters:
  `job` - Job.
  `arg` - Argument.
Returns:
  Internal future.

#### callAsync

    public <R> IgniteInternalFuture<R> callAsync(IgniteCallable<R> job)

Call implementation.

Parameters:
  `job` - Job.
Returns:
  Internal future.

#### callAsync

    public <R> IgniteInternalFuture<Collection<R>> callAsync(Collection<? extends IgniteCallable<R>> jobs)

Call implementation.

Parameters:
  `jobs` - Jobs.
Returns:
  Internal future.

#### applyAsync

    public <T,R> IgniteInternalFuture<Collection<R>> applyAsync(IgniteClosure<T,R> job,
                                                                @Nullable
                                                                @Nullable Collection<? extends T> args)

Apply implementation.

Parameters:
  `job` - Job.
  `args` - Arguments/
Returns:
  Internal future.

#### callAsync

    public <R1,R2> IgniteInternalFuture<R2> callAsync(Collection<? extends IgniteCallable<R1>> jobs,
                                                      IgniteReducer<R1,R2> rdc)

Call with reducer implementation.

Parameters:
  `jobs` - Jobs.
  `rdc` - Reducer.
Returns:
  Internal future.

#### applyAsync

    public <R1,R2,T> IgniteInternalFuture<R2> applyAsync(IgniteClosure<T,R1> job,
                                                         Collection<? extends T> args,
                                                         IgniteReducer<R1,R2> rdc)

Apply with reducer implementation.

Parameters:
  `job` - Job
  `args` - Arguments.
  `rdc` - Reducer.
Returns:
  Internal future.

#### withName

    public IgniteComputeHandler withName(String taskName)

#### withTimeout

    public IgniteComputeHandler withTimeout(long timeout)

#### withNoFailover

    public IgniteComputeHandler withNoFailover()

#### withProjection

    public IgniteComputeHandler withProjection(Collection<ClusterNode> prj)

#### withNoResultCache

    public IgniteComputeHandler withNoResultCache()

#### withExecutor

    public IgniteComputeHandler withExecutor(String execName)

#### withProjectionPredicate

    public IgniteComputeHandler withProjectionPredicate(IgnitePredicate<ClusterNode> predicate)

#### asPublicRequest

    public IgniteComputeHandler asPublicRequest()

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.16.0
Release Date | : December 15 2023