Package org.elasticsearch.persistent
Class PersistentTasksService
org.elasticsearch.persistent.PersistentTasksService
public class PersistentTasksService
extends
This service is used by persistent tasks and allocated persistent tasks to communicate changes
to the master node so that the master can update the cluster state and can track of the states
of the persistent tasks.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
-
Field Summary
-
Constructor Summary
ConstructorDescriptionPersistentTasksService(ClusterService clusterService, ThreadPool threadPool, Client client)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
taskId, long taskAllocationId, taskFailure, ActionListener<PersistentTasksCustomMetadata.PersistentTask<?>> listener)
Notifies the master node about the completion of a persistent task.void
taskId, ActionListener<PersistentTasksCustomMetadata.PersistentTask<?>> listener)
Notifies the master node to remove a persistent task from the cluster state<Params extends PersistentTaskParams>
voidtaskId, taskName, Params taskParams, ActionListener<PersistentTasksCustomMetadata.PersistentTask<Params>> listener)
Notifies the master node to create new persistent task and to assign it to a node.void
taskId, <PersistentTasksCustomMetadata.PersistentTask<?>> predicate, org.elasticsearch.core.TimeValue timeout, PersistentTasksService.WaitForPersistentTaskListener<?> listener)
Waits for a given persistent task to comply with a given predicate, then call back the listener accordingly.void
<PersistentTasksCustomMetadata> predicate, org.elasticsearch.core.TimeValue timeout, > listener)
Waits for persistent tasks to comply with a given predicate, then call back the listener accordingly.Methods inherited from class java.lang.
, , , , , , , , , ,
-
Field Details
-
PERSISTENT_TASK_ORIGIN
public static final PERSISTENT_TASK_ORIGIN- See Also:
- Constant Field Values
-
-
Constructor Details
-
PersistentTasksService
-
-
Method Details
-
sendStartRequest
public <Params extends taskId, taskName, Params taskParams, ActionListener<PersistentTasksCustomMetadata.PersistentTask<Params>> listener)Notifies the master node to create new persistent task and to assign it to a node. -
sendCompletionRequest
public void sendCompletionRequest( taskId, long taskAllocationId, @Nullable taskFailure, ActionListener<PersistentTasksCustomMetadata.PersistentTask<?>> listener)Notifies the master node about the completion of a persistent task.When
failure
isnull
, the persistent task is considered as successfully completed. -
sendRemoveRequest
public void sendRemoveRequest( taskId, ActionListener<PersistentTasksCustomMetadata.PersistentTask<?>> listener)Notifies the master node to remove a persistent task from the cluster state -
waitForPersistentTaskCondition
public void waitForPersistentTaskCondition( taskId, <PersistentTasksCustomMetadata.PersistentTask<?>> predicate, @Nullable org.elasticsearch.core.TimeValue timeout, PersistentTasksService.WaitForPersistentTaskListener<?> listener)Waits for a given persistent task to comply with a given predicate, then call back the listener accordingly.- Parameters:
taskId
- the persistent task idpredicate
- the persistent task predicate to evaluatetimeout
- a timeout for waitinglistener
- the callback listener
-
waitForPersistentTasksCondition
public void waitForPersistentTasksCondition(<PersistentTasksCustomMetadata> predicate, @Nullable org.elasticsearch.core.TimeValue timeout, > listener)Waits for persistent tasks to comply with a given predicate, then call back the listener accordingly.- Parameters:
predicate
- the predicate to evaluatetimeout
- a timeout for waitinglistener
- the callback listener
-