public abstract class CancellableTask extends Task
Task.Status
Constructor and Description |
---|
CancellableTask(long id,
java.lang.String type,
java.lang.String action,
java.lang.String description,
TaskId parentTaskId) |
Modifier and Type | Method and 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 should can potentially have children that needs to be cancelled when the parent is cancelled.
|
getAction, getDescription, 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)
public boolean cancelOnParentLeaving()
public abstract boolean shouldCancelChildrenOnCancellation()
public boolean isCancelled()
@Nullable public java.lang.String getReasonCancelled()
protected void onCancelled()