|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object org.apache.spark.TaskContext
public abstract class TaskContext
Contextual information about a task which can be read or mutated during execution. To access the TaskContext for a running task, use:
org.apache.spark.TaskContext.get()
Constructor Summary | |
---|---|
TaskContext()
|
Method Summary | |
---|---|
abstract void |
addOnCompleteCallback(scala.Function0<scala.runtime.BoxedUnit> f)
Adds a callback function to be executed on task completion. |
abstract TaskContext |
addTaskCompletionListener(scala.Function1<TaskContext,scala.runtime.BoxedUnit> f)
Adds a listener in the form of a Scala closure to be executed on task completion. |
abstract TaskContext |
addTaskCompletionListener(TaskCompletionListener listener)
Adds a (Java friendly) listener to be executed on task completion. |
abstract long |
attemptId()
|
abstract int |
attemptNumber()
How many times this task has been attempted. |
static TaskContext |
get()
Return the currently active TaskContext. |
abstract boolean |
isCompleted()
Returns true if the task has completed. |
abstract boolean |
isInterrupted()
Returns true if the task has been killed. |
abstract boolean |
isRunningLocally()
Returns true if the task is running locally in the driver program. |
abstract int |
partitionId()
The ID of the RDD partition that is computed by this task. |
abstract boolean |
runningLocally()
|
abstract int |
stageId()
The ID of the stage that this task belong to. |
abstract long |
taskAttemptId()
An ID that is unique to this task attempt (within the same SparkContext, no two task attempts will share the same attempt ID). |
abstract org.apache.spark.executor.TaskMetrics |
taskMetrics()
::DeveloperApi:: |
Methods inherited from class Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TaskContext()
Method Detail |
---|
public static TaskContext get()
public abstract boolean isCompleted()
public abstract boolean isInterrupted()
public abstract boolean runningLocally()
public abstract boolean isRunningLocally()
public abstract TaskContext addTaskCompletionListener(TaskCompletionListener listener)
listener
- (undocumented)
public abstract TaskContext addTaskCompletionListener(scala.Function1<TaskContext,scala.runtime.BoxedUnit> f)
f
- (undocumented)
public abstract void addOnCompleteCallback(scala.Function0<scala.runtime.BoxedUnit> f)
f
- Callback function.public abstract int stageId()
public abstract int partitionId()
public abstract int attemptNumber()
public abstract long attemptId()
public abstract long taskAttemptId()
public abstract org.apache.spark.executor.TaskMetrics taskMetrics()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |