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

    https://github.com/apache/spark/pull/21369#discussion_r189768271
  
    --- Diff: 
core/src/main/scala/org/apache/spark/util/collection/ExternalAppendOnlyMap.scala
 ---
    @@ -585,17 +591,24 @@ class ExternalAppendOnlyMap[K, V, C](
           } else {
             logInfo(s"Task ${context.taskAttemptId} force spilling in-memory 
map to disk and " +
               s"it will release 
${org.apache.spark.util.Utils.bytesToString(getUsed())} memory")
    -        nextUpstream = spillMemoryIteratorToDisk(upstream)
    +        val nextUpstream = spillMemoryIteratorToDisk(upstream)
    +        assert(!upstream.hasNext)
             hasSpilled = true
    +        upstream = nextUpstream
             true
           }
         }
     
    +    def destroy() : Unit = {
    +      freeCurrentMap()
    +      upstream = Iterator.empty
    +    }
    +
    +    def toCompletionIterator: CompletionIterator[(K, C), 
SpillableIterator] = {
    --- End diff --
    
    I'd prefer private for this method


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to