public abstract class TaskState extends Object
Startup process:
Shutdown process:
This is a do-it-yourself enum. Java enums values are instances of a single class. In this version, each enum value is the sole instance of a separate class, allowing each state to have its own behavior.
| Modifier and Type | Class and Description |
|---|---|
static class |
TaskState.EndingState
Task for which a termination request has been sent to the Drill-bit, but
confirmation has not yet been received from the Node Manager.
|
static class |
TaskState.KillingState
Task for which a forced termination request has been sent to the Node
Manager, but a stop message has not yet been received.
|
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
cancellable |
static TaskState |
END |
static TaskState |
ENDING |
protected boolean |
hasContainer |
static TaskState |
KILLING |
protected String |
label |
static TaskState |
LAUNCHING |
protected TaskLifecycleListener.Event |
lifeCycleEvent |
static TaskState |
REQUESTING |
static TaskState |
RUNNING |
static TaskState |
START |
static TaskState |
WAIT_END_ACK |
static TaskState |
WAIT_START_ACK |
| Constructor and Description |
|---|
TaskState(boolean hasContainer,
TaskLifecycleListener.Event lcEvent,
boolean cancellable) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel(EventContext context)
Cluster manager wishes to cancel this task.
|
protected void |
completed(EventContext context,
org.apache.hadoop.yarn.api.records.ContainerStatus status) |
void |
completionAck(EventContext context)
The monitoring plugin has detected that the task has confirmed that it has
started shutdown.
|
void |
containerAllocated(EventContext context,
org.apache.hadoop.yarn.api.records.Container container)
Resource Manager reports that the task has been allocated a container.
|
void |
containerCompleted(EventContext context,
org.apache.hadoop.yarn.api.records.ContainerStatus status)
Resource Manager reports that the task has completed execution and provided
the completion status.
|
void |
containerStarted(EventContext context)
Node Manager reports that the task has started execution.
|
void |
containerStopped(EventContext context)
Node Manager reports that the task has stopped execution.
|
protected void |
endOrAck(EventContext context) |
String |
getLabel() |
boolean |
hasContainer() |
boolean |
isCancellable() |
void |
launchFailed(EventContext context,
Throwable t)
The launch of the container failed.
|
void |
requestContainer(EventContext context) |
void |
startAck(EventContext context)
The monitoring plugin has detected that the task has confirmed that it is
fully started.
|
void |
stopTaskFailed(EventContext context,
Throwable t)
The node manager request to stop a task failed.
|
protected void |
taskStartFailed(EventContext context,
Task.Disposition disposition)
Task failed when starting.
|
protected void |
taskTerminated(EventContext context)
A running task terminated.
|
void |
tick(EventContext context,
long curTime) |
String |
toString() |
protected void |
transition(EventContext context,
TaskState newState)
Implement a state transition, alerting any life cycle listeners and
updating the log file.
|
public static final TaskState START
public static final TaskState REQUESTING
public static final TaskState LAUNCHING
public static final TaskState WAIT_START_ACK
public static final TaskState RUNNING
public static final TaskState ENDING
public static final TaskState KILLING
public static final TaskState WAIT_END_ACK
public static final TaskState END
protected final boolean hasContainer
protected final TaskLifecycleListener.Event lifeCycleEvent
protected final String label
protected final boolean cancellable
public TaskState(boolean hasContainer,
TaskLifecycleListener.Event lcEvent,
boolean cancellable)
protected void endOrAck(EventContext context)
public void requestContainer(EventContext context)
public void containerAllocated(EventContext context, org.apache.hadoop.yarn.api.records.Container container)
context - container - public void launchFailed(EventContext context, Throwable t)
context - t - public void containerStarted(EventContext context)
context - public void startAck(EventContext context)
public void stopTaskFailed(EventContext context, Throwable t)
context - t - public void completionAck(EventContext context)
public void containerStopped(EventContext context)
context - public void containerCompleted(EventContext context, org.apache.hadoop.yarn.api.records.ContainerStatus status)
context - status - public void cancel(EventContext context)
context - public void tick(EventContext context, long curTime)
protected void transition(EventContext context, TaskState newState)
context - newState - protected void taskStartFailed(EventContext context, Task.Disposition disposition)
If the run failed, and the task can be retried, it may
then move from
END --> STARTING
context - disposition - protected void taskTerminated(EventContext context)
Every task goes from:
* --> END
If the run failed, and the task can be retried, it may
then move from
END --> STARTING
context - protected void completed(EventContext context, org.apache.hadoop.yarn.api.records.ContainerStatus status)
public boolean hasContainer()
public String getLabel()
public boolean isCancellable()
Copyright © 2021 The Apache Software Foundation. All rights reserved.