Package org.elasticsearch.persistent
Class PersistentTasksCustomMetadata.Builder
java.lang.Object
org.elasticsearch.persistent.PersistentTasksCustomMetadata.Builder
- Enclosing class:
- PersistentTasksCustomMetadata
-
Method Summary
Modifier and TypeMethodDescription<Params extends PersistentTaskParams>
PersistentTasksCustomMetadata.BuilderaddTask(String taskId, String taskName, Params params, PersistentTasksCustomMetadata.Assignment assignment)
Adds a new task to the builderbuild()
long
boolean
Checks if the task is currently present in the listboolean
Checks if the task is currently present in the list and has the right allocation idboolean
Returns true if any the task list was changed since the builder was createdreassignTask(String taskId, PersistentTasksCustomMetadata.Assignment assignment)
Reassigns the task to another noderemoveTask(String taskId)
Removes the taskupdateTaskState(String taskId, PersistentTaskState taskState)
Updates the task state
-
Method Details
-
getLastAllocationId
public long getLastAllocationId() -
addTask
public <Params extends PersistentTaskParams> PersistentTasksCustomMetadata.Builder addTask(String taskId, String taskName, Params params, PersistentTasksCustomMetadata.Assignment assignment)Adds a new task to the builderAfter the task is added its id can be found by calling {
getLastAllocationId()
} method. -
reassignTask
public PersistentTasksCustomMetadata.Builder reassignTask(String taskId, PersistentTasksCustomMetadata.Assignment assignment)Reassigns the task to another node -
updateTaskState
public PersistentTasksCustomMetadata.Builder updateTaskState(String taskId, PersistentTaskState taskState)Updates the task state -
removeTask
Removes the task -
hasTask
Checks if the task is currently present in the list -
hasTask
Checks if the task is currently present in the list and has the right allocation id -
isChanged
public boolean isChanged()Returns true if any the task list was changed since the builder was created -
build
-