Package org.elasticsearch.persistent
Class PersistentTasksCustomMetadata.Builder
org.elasticsearch.persistent.PersistentTasksCustomMetadata.Builder
- Enclosing class:
- PersistentTasksCustomMetadata
public static class PersistentTasksCustomMetadata.Builder
extends
-
Method Summary
Modifier and TypeMethodDescription<Params extends PersistentTaskParams>
PersistentTasksCustomMetadata.BuildertaskId, taskName, Params params, PersistentTasksCustomMetadata.Assignment assignment)
Adds a new task to the builderbuild()
long
boolean
taskId)
Checks if the task is currently present in the listboolean
taskId, long allocationId)
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 createdtaskId, PersistentTasksCustomMetadata.Assignment assignment)
Reassigns the task to another nodetaskId)
Removes the tasktaskId, PersistentTaskState taskState)
Updates the task stateMethods inherited from class java.lang.
, , , , , , , , , ,
-
Method Details
-
getLastAllocationId
public long getLastAllocationId() -
addTask
public <Params extends PersistentTaskParams> taskId, 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 taskId, PersistentTasksCustomMetadata.Assignment assignment)Reassigns the task to another node -
updateTaskState
public taskId, PersistentTaskState taskState)Updates the task state -
removeTask
public taskId)Removes the task -
hasTask
public boolean hasTask( taskId)Checks if the task is currently present in the list -
hasTask
public boolean hasTask( taskId, long allocationId)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
-