public final class Task extends Object
| Constructor and Description |
|---|
Task(JobID jobId,
JobVertexID vertexId,
int taskIndex,
int parallelism,
ExecutionAttemptID executionId,
String taskName,
TaskManager taskManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancelExecution() |
void |
cancelingDone() |
void |
failExternally(Throwable cause)
Sets the tasks to be cancelled and reports a failure back to the master.
|
RuntimeEnvironment |
getEnvironment() |
ExecutionAttemptID |
getExecutionId()
Gets the ID of the execution attempt.
|
ExecutionState |
getExecutionState()
Returns the current execution state of the task.
|
JobID |
getJobID()
Returns the ID of the job this task belongs to.
|
int |
getNumberOfSubtasks()
Gets the total number of subtasks of the task that this subtask belongs to.
|
int |
getSubtaskIndex()
Gets the index of the parallel subtask [0, parallelism).
|
String |
getTaskName() |
String |
getTaskNameWithSubtasks() |
JobVertexID |
getVertexID()
Returns the ID of this task vertex.
|
boolean |
isCanceledOrFailed() |
boolean |
markAsFinished()
Marks the task as finished.
|
void |
markFailed(Throwable error) |
void |
registerExecutionListener(ExecutionListener listener) |
void |
registerProfiler(TaskManagerProfiler taskManagerProfiler,
Configuration jobConfiguration)
Registers the task manager profiler with the task.
|
void |
setEnvironment(RuntimeEnvironment environment) |
boolean |
startExecution()
Starts the execution of this task.
|
String |
toString() |
void |
unregisterExecutionListener(ExecutionListener listener) |
void |
unregisterMemoryManager(MemoryManager memoryManager)
Unregisters the task from the central memory manager.
|
void |
unregisterProfiler(TaskManagerProfiler taskManagerProfiler)
Unregisters the task from the task manager profiler.
|
public Task(JobID jobId, JobVertexID vertexId, int taskIndex, int parallelism, ExecutionAttemptID executionId, String taskName, TaskManager taskManager)
public JobID getJobID()
public JobVertexID getVertexID()
public int getSubtaskIndex()
public int getNumberOfSubtasks()
public ExecutionAttemptID getExecutionId()
public ExecutionState getExecutionState()
public void setEnvironment(RuntimeEnvironment environment)
public RuntimeEnvironment getEnvironment()
public boolean isCanceledOrFailed()
public String getTaskName()
public String getTaskNameWithSubtasks()
public boolean markAsFinished()
public void markFailed(Throwable error)
public void cancelExecution()
public void failExternally(Throwable cause)
cause - The exception to report in the error messagepublic void cancelingDone()
public boolean startExecution()
public void unregisterMemoryManager(MemoryManager memoryManager)
memoryManager - the central memory managerpublic void registerProfiler(TaskManagerProfiler taskManagerProfiler, Configuration jobConfiguration)
taskManagerProfiler - the task manager profilerjobConfiguration - the configuration attached to the jobpublic void unregisterProfiler(TaskManagerProfiler taskManagerProfiler)
taskManagerProfiler - the task manager profilerpublic void registerExecutionListener(ExecutionListener listener)
public void unregisterExecutionListener(ExecutionListener listener)
Copyright © 2015 The Apache Software Foundation. All rights reserved.