AllocatedPersistentTask
, BulkByScrollTask
, SearchTask
public abstract class CancellableTask extends Task
Task.Status
Constructor | Description |
---|---|
CancellableTask(long id,
java.lang.String type,
java.lang.String action,
java.lang.String description,
TaskId parentTaskId,
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.
|
java.lang.String |
getReasonCancelled() |
The reason the task was cancelled or null if it hasn't been cancelled.
|
boolean |
isCancelled() |
|
protected void |
onCancelled() |
Called after the task is cancelled so that it can take any actions that it has to take.
|
abstract boolean |
shouldCancelChildrenOnCancellation() |
Returns true if this task can potentially have children that need to be cancelled when it parent is cancelled.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAction, getDescription, getHeader, getId, getParentTaskId, getStartTime, getStatus, getType, result, result, taskInfo, taskInfo
public CancellableTask(long id, java.lang.String type, java.lang.String action, java.lang.String description, TaskId parentTaskId, java.util.Map<java.lang.String,java.lang.String> headers)
public boolean cancelOnParentLeaving()
public abstract boolean shouldCancelChildrenOnCancellation()
public boolean isCancelled()
@Nullable public java.lang.String getReasonCancelled()
protected void onCancelled()