Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/9983#discussion_r45937461
--- Diff:
core/src/main/scala/org/apache/spark/rdd/ReliableCheckpointRDD.scala ---
@@ -151,6 +200,57 @@ private[spark] object ReliableCheckpointRDD extends
Logging {
}
}
+ def writePartitionerToCheckpointDir(
+ sc: SparkContext, partitioner: Partitioner, checkpointDirPath: Path):
Unit = {
+ try {
+ val partitionerFilePath = new Path(checkpointDirPath,
checkpointPartitionerFileName)
+ val bufferSize = sc.conf.getInt("spark.buffer.size", 65536)
+ val fs = partitionerFilePath.getFileSystem(sc.hadoopConfiguration)
+ val fileOutputStream = fs.create(partitionerFilePath, false,
bufferSize)
+ val serializer = SparkEnv.get.serializer.newInstance()
+ val serializeStream = serializer.serializeStream(fileOutputStream)
+ Utils.tryWithSafeFinally {
+ serializeStream.writeObject(partitioner)
+ } {
+ serializeStream.close()
+ }
+ logDebug(s"Written partitioner to $partitionerFilePath")
+ } catch {
+ case NonFatal(e) =>
+ logWarning(s"Error writing partitioner $partitioner to
$checkpointDirPath")
+ }
+ }
+
+ def readCheckpointedPartitionerFile(
--- End diff --
maybe `readPartitionerFromCheckpoint`?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]