Skip to content

Commit 72a3abf

Browse files
committed
Add override for stageId, stageAttemptId and partitionId.
Updating wording in TaskContext.stageAttemptId
1 parent 291bbbc commit 72a3abf

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

core/src/main/scala/org/apache/spark/TaskContext.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ abstract class TaskContext extends Serializable {
151151
def stageId(): Int
152152

153153
/**
154-
* An ID that is unique to the stage attempt that this task belongs to.
154+
* An ID that is unique to the stage attempt that this task belongs to. It represents how many
155+
* times the stage has been attempted. The first stage attempt will be assigned stageAttemptId = 0
156+
* , and subsequent attempts will increasing stageAttemptId one by one.
155157
*/
156158
def stageAttemptId(): Int
157159

core/src/main/scala/org/apache/spark/TaskContextImpl.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ import org.apache.spark.util._
4141
* `TaskMetrics` & `MetricsSystem` objects are not thread safe.
4242
*/
4343
private[spark] class TaskContextImpl(
44-
val stageId: Int,
45-
val stageAttemptId: Int,
46-
val partitionId: Int,
44+
override val stageId: Int,
45+
override val stageAttemptId: Int,
46+
override val partitionId: Int,
4747
override val taskAttemptId: Long,
4848
override val attemptNumber: Int,
4949
override val taskMemoryManager: TaskMemoryManager,

0 commit comments

Comments
 (0)