Package 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 toGridTaskProcessor
andGridClosureProcessor
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 Description IgniteComputeHandler(GridKernalContext ctx, Function<TaskExecutionOptions,TaskExecutionOptions> optsTransformer)
IgniteComputeHandler(IgniteComputeHandler other, Function<TaskExecutionOptions,TaskExecutionOptions> optsTransformer)
Creates copy of specified computation handler.
-
Method Summary
-
-
-
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 withoptsTransformer
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
- Jobargs
- 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()
-
-