org.apache.spark

TaskContext

abstract class TaskContext extends Serializable

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()
Linear Supertypes
Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. TaskContext
  2. Serializable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TaskContext()

Abstract Value Members

  1. abstract def addTaskCompletionListener(f: (TaskContext) ⇒ Unit): TaskContext

    Adds a listener in the form of a Scala closure to be executed on task completion.

    Adds a listener in the form of a Scala closure to be executed on task completion. This will be called in all situations - success, failure, or cancellation. An example use is for HadoopRDD to register a callback to close the input stream.

  2. abstract def addTaskCompletionListener(listener: TaskCompletionListener): TaskContext

    Adds a (Java friendly) listener to be executed on task completion.

    Adds a (Java friendly) listener to be executed on task completion. This will be called in all situation - success, failure, or cancellation. An example use is for HadoopRDD to register a callback to close the input stream.

  3. abstract def attemptNumber(): Int

    How many times this task has been attempted.

    How many times this task has been attempted. The first task attempt will be assigned attemptNumber = 0, and subsequent attempts will have increasing attempt numbers.

  4. abstract def getMetricsSources(sourceName: String): Seq[Source]

    ::DeveloperApi:: Returns all metrics sources with the given name which are associated with the instance which runs the task.

    ::DeveloperApi:: Returns all metrics sources with the given name which are associated with the instance which runs the task. For more information see org.apache.spark.metrics.MetricsSystem!.

    Annotations
    @DeveloperApi()
  5. abstract def isCompleted(): Boolean

    Returns true if the task has completed.

  6. abstract def isInterrupted(): Boolean

    Returns true if the task has been killed.

  7. abstract def isRunningLocally(): Boolean

    Returns true if the task is running locally in the driver program.

    Returns true if the task is running locally in the driver program.

    returns

  8. abstract def partitionId(): Int

    The ID of the RDD partition that is computed by this task.

  9. abstract def stageId(): Int

    The ID of the stage that this task belong to.

  10. abstract def taskAttemptId(): Long

    An ID that is unique to this task attempt (within the same SparkContext, no two task attempts will share the same attempt ID).

    An ID that is unique to this task attempt (within the same SparkContext, no two task attempts will share the same attempt ID). This is roughly equivalent to Hadoop's TaskAttemptID.

  11. abstract def taskMetrics(): TaskMetrics

    ::DeveloperApi::

    ::DeveloperApi::

    Annotations
    @DeveloperApi()
  12. abstract def addOnCompleteCallback(f: () ⇒ Unit): Unit

    Adds a callback function to be executed on task completion.

    Adds a callback function to be executed on task completion. An example use is for HadoopRDD to register a callback to close the input stream. Will be called in any situation - success, failure, or cancellation.

    f

    Callback function.

    Annotations
    @deprecated
    Deprecated

    (Since version 1.2.0) use addTaskCompletionListener

  13. abstract def attemptId(): Long

    Annotations
    @deprecated
    Deprecated

    (Since version 1.3.0) use attemptNumber

  14. abstract def runningLocally(): Boolean

    Annotations
    @deprecated
    Deprecated

    (Since version 1.2.0) use isRunningLocally

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  17. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  18. def toString(): String

    Definition Classes
    AnyRef → Any
  19. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped