Package org.apache.ignite.compute
Interface ComputeJob<T,R>
- Type Parameters:
T
- Type of the job argument.R
- Type of the job result.
public interface ComputeJob<T,R>
Core Ignite Compute Job interface. If you want to define your own job, you should implement this interface and
deploy the job to the cluster with Deployment API. Then, you can execute this job on the cluster by calling
IgniteCompute
APIs.
If you want to pass/return custom data structures to/from the job, you should also implement Marshaller
and return it from inputMarshaller()
and resultMarshaller()
methods.
-
Method Summary
Modifier and TypeMethodDescription@Nullable CompletableFuture<R>
executeAsync
(JobExecutionContext context, T arg) Executes the job on an Ignite node.default @Nullable Marshaller<T,
byte[]> Marshaller for the input argument.default @Nullable Marshaller<R,
byte[]> Marshaller for the job result.
-
Method Details
-
executeAsync
Executes the job on an Ignite node.- Parameters:
context
- The execution context.arg
- Job arguments.- Returns:
- Job future. Can be null if the job is synchronous and does not return any result.
-
inputMarshaller
Marshaller for the input argument. Default isnull
meaning that only primitive types are supported.- Returns:
- Input marshaller.
-
resultMarshaller
Marshaller for the job result. Default isnull
meaning that only primitive types are supported.- Returns:
- Result marshaller.
-