3232import org .apache .spark .util .TaskCompletionListener ;
3333import org .apache .spark .util .TaskCompletionListenerException ;
3434
35+ /**
36+ * :: DeveloperApi ::
37+ * Contextual information about a task which can be read or mutated during execution.
38+ */
3539@ DeveloperApi
3640public class TaskContext implements Serializable {
3741
@@ -41,6 +45,17 @@ public class TaskContext implements Serializable {
4145 private Boolean runningLocally ;
4246 private TaskMetrics taskMetrics ;
4347
48+ /**
49+ * :: DeveloperApi ::
50+ * Contextual information about a task which can be read or mutated during execution.
51+ *
52+ * @param stageId stage id
53+ * @param partitionId index of the partition
54+ * @param attemptId the number of attempts to execute this task
55+ * @param runningLocally whether the task is running locally in the driver JVM
56+ * @param taskMetrics performance metrics of the task
57+ */
58+ @ DeveloperApi
4459 public TaskContext (Integer stageId , Integer partitionId , Long attemptId , Boolean runningLocally ,
4560 TaskMetrics taskMetrics ) {
4661 this .attemptId = attemptId ;
@@ -51,6 +66,17 @@ public TaskContext(Integer stageId, Integer partitionId, Long attemptId, Boolean
5166 taskContext .set (this );
5267 }
5368
69+
70+ /**
71+ * :: DeveloperApi ::
72+ * Contextual information about a task which can be read or mutated during execution.
73+ *
74+ * @param stageId stage id
75+ * @param partitionId index of the partition
76+ * @param attemptId the number of attempts to execute this task
77+ * @param runningLocally whether the task is running locally in the driver JVM
78+ */
79+ @ DeveloperApi
5480 public TaskContext (Integer stageId , Integer partitionId , Long attemptId ,
5581 Boolean runningLocally ) {
5682 this .attemptId = attemptId ;
@@ -61,6 +87,16 @@ public TaskContext(Integer stageId, Integer partitionId, Long attemptId,
6187 taskContext .set (this );
6288 }
6389
90+
91+ /**
92+ * :: DeveloperApi ::
93+ * Contextual information about a task which can be read or mutated during execution.
94+ *
95+ * @param stageId stage id
96+ * @param partitionId index of the partition
97+ * @param attemptId the number of attempts to execute this task
98+ */
99+ @ DeveloperApi
64100 public TaskContext (Integer stageId , Integer partitionId , Long attemptId ) {
65101 this .attemptId = attemptId ;
66102 this .partitionId = partitionId ;
0 commit comments