Package org.apache.ignite.client
Interface ClientCompute
-
public interface ClientCompute
Thin client compute facade. Defines compute grid functionality for executing tasks over nodes in theClientClusterGroup
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description ClientClusterGroup
clusterGroup()
Gets cluster group to which thisClientCompute
instance belongs.<T,R>
Rexecute(String taskName, T arg)
Executes given task within the cluster group.<T,R>
Future<R>executeAsync(String taskName, T arg)
Deprecated.UseexecuteAsync2(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 returnedClientCompute
instance.ClientCompute
withNoResultCache()
Disables result caching for tasks executed by returnedClientCompute
instance.ClientCompute
withTimeout(long timeout)
Sets timeout for tasks executed by returnedClientCompute
instance.
-
-
-
Method Detail
-
clusterGroup
ClientClusterGroup clusterGroup()
Gets cluster group to which thisClientCompute
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 toComputeTask
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 benull
.- 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.UseexecuteAsync2(String, Object)
instead. This method callsexecuteAsync2(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 toComputeTask
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 benull
.- 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 toComputeTask
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 benull
.- 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 returnedClientCompute
instance.- Parameters:
timeout
- Task execution timeout.- Returns:
ClientCompute
instance with given timeout.
-
withNoFailover
ClientCompute withNoFailover()
Sets no-failover flag for tasks executed by returnedClientCompute
instance. If flag is set, job will be never failed over even if remote node crashes or rejects execution. SeeComputeTask
documentation for more information about jobs failover.- Returns:
ClientCompute
instance with no-failover flag.
-
withNoResultCache
ClientCompute withNoResultCache()
Disables result caching for tasks executed by returnedClientCompute
instance. SeeComputeTask
documentation for more information tasks result caching.- Returns:
ClientCompute
instance with "no result cache" flag.
-
-