Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/9428#discussion_r44321308
  
    --- Diff: core/src/main/scala/org/apache/spark/rdd/RDD.scala ---
    @@ -258,11 +258,14 @@ abstract class RDD[T: ClassTag](
        * subclasses of RDD.
        */
       final def iterator(split: Partition, context: TaskContext): Iterator[T] 
= {
    -    if (storageLevel != StorageLevel.NONE) {
    +    val iter = if (storageLevel != StorageLevel.NONE) {
           SparkEnv.get.cacheManager.getOrCompute(this, split, context, 
storageLevel)
         } else {
           computeOrReadCheckpoint(split, context)
         }
    +    checkpointData.collect { case data: ReliableRDDCheckpointData[T] =>
    +      data.getCheckpointIterator(this, iter, context, split.index)
    --- End diff --
    
    if you make `getCheckpointIterator` a method in the abstract 
`RDDCheckpointData` then you can just do
    ```
    checkpointData
      .map(_.getCheckpointIterator(this, iter, context, split.index))
      .getOrElse(iter)
    ```
    We can address local checkpointing separately and for now just have it 
return the iterator
    ```
    def getCheckpointIterator(...): Iterator[T] = iter
    ```


---
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]

Reply via email to