public final class Task extends Object implements ExecutionObserver
| Constructor and Description |
|---|
Task(ExecutionVertexID vertexID,
RuntimeEnvironment environment,
TaskManager taskManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancelExecution() |
void |
executionStateChanged(ExecutionState newExecutionState,
String optionalMessage)
Called when the execution state of the associated task has changed.
|
Environment |
getEnvironment()
Returns the environment associated with this task.
|
ExecutionState |
getExecutionState()
Returns the current execution state of the task.
|
JobID |
getJobID()
Returns the ID of the job this task belongs to.
|
RuntimeEnvironment |
getRuntimeEnvironment()
Returns the runtime environment associated with this task.
|
ExecutionVertexID |
getVertexID()
Returns the ID of this task.
|
boolean |
isCanceled()
Returns whether the task has been canceled.
|
boolean |
isTerminated()
Checks if the state of the thread which is associated with this task is
TERMINATED. |
void |
killExecution() |
void |
markAsFailed()
Marks the task as failed and triggers the appropriate state changes.
|
void |
registerExecutionListener(ExecutionListener executionListener)
Registers the
ExecutionListener object for this task. |
void |
registerProfiler(TaskManagerProfiler taskManagerProfiler,
Configuration jobConfiguration)
Registers the task manager profiler with the task.
|
void |
startExecution()
Starts the execution of this task.
|
void |
unregisterExecutionListener(ExecutionListener executionListener)
Unregisters the
ExecutionListener object for this environment. |
void |
unregisterMemoryManager(MemoryManager memoryManager)
Unregisters the task from the central memory manager.
|
void |
unregisterProfiler(TaskManagerProfiler taskManagerProfiler)
Unregisters the task from the task manager profiler.
|
void |
userThreadFinished(Thread userThread)
Called when a thread spawn by a user task has finished.
|
void |
userThreadStarted(Thread userThread)
Called when the user task has started a new thread.
|
public Task(ExecutionVertexID vertexID, RuntimeEnvironment environment, TaskManager taskManager)
public JobID getJobID()
public ExecutionVertexID getVertexID()
public Environment getEnvironment()
public void markAsFailed()
public void cancelExecution()
public void killExecution()
public boolean isTerminated()
TERMINATED.true if the state of this thread which is associated with this task is
TERMINATED, false otherwisepublic void startExecution()
public void registerProfiler(TaskManagerProfiler taskManagerProfiler, Configuration jobConfiguration)
taskManagerProfiler - the task manager profilerjobConfiguration - the configuration attached to the jobpublic void unregisterMemoryManager(MemoryManager memoryManager)
memoryManager - the central memory managerpublic void unregisterProfiler(TaskManagerProfiler taskManagerProfiler)
taskManagerProfiler - the task manager profilerpublic ExecutionState getExecutionState()
public void executionStateChanged(ExecutionState newExecutionState, String optionalMessage)
ExecutionObserverexecutionStateChanged in interface ExecutionObservernewExecutionState - the execution state the task has just switched tooptionalMessage - an optional message providing further information on the state changepublic void userThreadStarted(Thread userThread)
ExecutionObserveruserThreadStarted in interface ExecutionObserveruserThread - the user thread which has been startedpublic void userThreadFinished(Thread userThread)
ExecutionObserveruserThreadFinished in interface ExecutionObserveruserThread - the user thread which has finishedpublic void registerExecutionListener(ExecutionListener executionListener)
ExecutionListener object for this task. This object
will be notified about important events during the task execution.executionListener - the object to be notified for important events during the task executionpublic void unregisterExecutionListener(ExecutionListener executionListener)
ExecutionListener object for this environment. This object
will no longer be notified about important events during the task execution.executionListener - the lister object to be unregisteredpublic boolean isCanceled()
ExecutionObserverisCanceled in interface ExecutionObservertrue if the task has been canceled, false otherwisepublic RuntimeEnvironment getRuntimeEnvironment()
Copyright © 2014 The Apache Software Foundation. All rights reserved.