Github user tdas commented on a diff in the pull request:
https://github.com/apache/spark/pull/6968#discussion_r33628298
--- Diff: core/src/main/scala/org/apache/spark/rdd/RDDCheckpointData.scala
---
@@ -46,37 +45,35 @@ private[spark] class RDDCheckpointData[T:
ClassTag](@transient rdd: RDD[T])
import CheckpointState._
// The checkpoint state of the associated RDD.
- var cpState = Initialized
+ private var cpState = Initialized
// The file to which the associated RDD has been checkpointed to
- @transient var cpFile: Option[String] = None
+ private var cpFile: Option[String] = None
// The CheckpointRDD created from the checkpoint file, that is, the new
parent the associated RDD.
- var cpRDD: Option[RDD[T]] = None
-
- // Mark the RDD for checkpointing
- def markForCheckpoint() {
- RDDCheckpointData.synchronized {
- if (cpState == Initialized) cpState = MarkedForCheckpoint
- }
- }
+ // This is defined if and only if `cpState` is `Checkpointed`.
+ private var cpRDD: Option[CheckpointRDD[T]] = None
// Is the RDD already checkpointed
- def isCheckpointed: Boolean = {
- RDDCheckpointData.synchronized { cpState == Checkpointed }
+ def isCheckpointed: Boolean = synchronized {
+ cpState == Checkpointed
--- End diff --
Could you add the reasoning in the documentation.
---
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]