public class AllocatedPersistentTask extends CancellableTask
| Modifier and Type | Class | Description |
|---|---|---|
static class |
AllocatedPersistentTask.State |
Task.Status| Constructor | Description |
|---|---|
AllocatedPersistentTask(long id,
java.lang.String type,
java.lang.String action,
java.lang.String description,
TaskId parentTask,
java.util.Map<java.lang.String,java.lang.String> headers) |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
cancelOnParentLeaving() |
Returns true if this task should be automatically cancelled if the coordinating node that
requested this task left the cluster.
|
long |
getAllocationId() |
|
java.lang.Exception |
getFailure() |
|
java.lang.String |
getPersistentTaskId() |
|
AllocatedPersistentTask.State |
getState() |
|
Task.Status |
getStatus() |
Build a status for this task or null if this task doesn't have status.
|
void |
markAsCompleted() |
|
void |
markAsFailed(java.lang.Exception e) |
|
boolean |
shouldCancelChildrenOnCancellation() |
Returns true if this task can potentially have children that need to be cancelled when it parent is cancelled.
|
void |
updatePersistentStatus(Task.Status status,
ActionListener<PersistentTasksCustomMetaData.PersistentTask<?>> listener) |
Updates the persistent state for the corresponding persistent task.
|
void |
waitForPersistentTaskStatus(java.util.function.Predicate<PersistentTasksCustomMetaData.PersistentTask<?>> predicate,
TimeValue timeout,
PersistentTasksService.WaitForPersistentTaskStatusListener<?> listener) |
Waits for this persistent task to have the desired state.
|
getReasonCancelled, isCancelled, onCancelledclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAction, getDescription, getHeader, getId, getParentTaskId, getStartTime, getType, result, result, taskInfo, taskInfopublic AllocatedPersistentTask(long id,
java.lang.String type,
java.lang.String action,
java.lang.String description,
TaskId parentTask,
java.util.Map<java.lang.String,java.lang.String> headers)
public boolean shouldCancelChildrenOnCancellation()
CancellableTaskshouldCancelChildrenOnCancellation in class CancellableTaskpublic final boolean cancelOnParentLeaving()
CancellableTaskcancelOnParentLeaving in class CancellableTaskpublic Task.Status getStatus()
Taskpublic void updatePersistentStatus(Task.Status status, ActionListener<PersistentTasksCustomMetaData.PersistentTask<?>> listener)
This doesn't affect the status of this allocated task.
public java.lang.String getPersistentTaskId()
public java.lang.Exception getFailure()
public AllocatedPersistentTask.State getState()
public long getAllocationId()
public void waitForPersistentTaskStatus(java.util.function.Predicate<PersistentTasksCustomMetaData.PersistentTask<?>> predicate, @Nullable TimeValue timeout, PersistentTasksService.WaitForPersistentTaskStatusListener<?> listener)
public void markAsCompleted()
public void markAsFailed(java.lang.Exception e)