diff options
author | Holden Karau <holden@us.ibm.com> | 2016-12-20 15:51:21 -0800 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2016-12-20 15:51:21 -0800 |
commit | 047a9d92caa1f0af2305e4afeba8339abf32518b (patch) | |
tree | ae8588410abee1171dc0cf18ffcbd71a99f62399 /core/src/main/scala/org | |
parent | caed89321fdabe83e46451ca4e968f86481ad500 (diff) | |
download | spark-047a9d92caa1f0af2305e4afeba8339abf32518b.tar.gz spark-047a9d92caa1f0af2305e4afeba8339abf32518b.tar.bz2 spark-047a9d92caa1f0af2305e4afeba8339abf32518b.zip |
[SPARK-18576][PYTHON] Add basic TaskContext information to PySpark
## What changes were proposed in this pull request?
Adds basic TaskContext information to PySpark.
## How was this patch tested?
New unit tests to `tests.py` & existing unit tests.
Author: Holden Karau <holden@us.ibm.com>
Closes #16211 from holdenk/SPARK-18576-pyspark-taskcontext.
Diffstat (limited to 'core/src/main/scala/org')
-rw-r--r-- | core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala b/core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala index 0ca91b9bf8..04ae97ed3c 100644 --- a/core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala +++ b/core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala @@ -275,6 +275,11 @@ private[spark] class PythonRunner( dataOut.writeInt(partitionIndex) // Python version of driver PythonRDD.writeUTF(pythonVer, dataOut) + // Write out the TaskContextInfo + dataOut.writeInt(context.stageId()) + dataOut.writeInt(context.partitionId()) + dataOut.writeInt(context.attemptNumber()) + dataOut.writeLong(context.taskAttemptId()) // sparkFilesDir PythonRDD.writeUTF(SparkFiles.getRootDirectory(), dataOut) // Python includes (*.zip and *.egg files) |