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

    https://github.com/apache/spark/pull/1165#discussion_r15383171
  
    --- Diff: core/src/main/scala/org/apache/spark/storage/MemoryStore.scala ---
    @@ -275,8 +426,36 @@ private class MemoryStore(blockManager: BlockManager, 
maxMemory: Long)
       override def contains(blockId: BlockId): Boolean = {
         entries.synchronized { entries.containsKey(blockId) }
       }
    +
    +  /**
    +   * Reserve memory for unrolling blocks used by this thread.
    +   */
    +  private def reserveUnrollMemory(memory: Long): Unit = 
putLock.synchronized {
    +    unrollMemoryMap(Thread.currentThread().getId) = memory
    +  }
    +
    +  /**
    +   * Release memory used by this thread for unrolling blocks.
    +   */
    +  private[spark] def releaseUnrollMemory(): Unit = putLock.synchronized {
    +    unrollMemoryMap.remove(Thread.currentThread().getId)
    +  }
    +
    +  /**
    +   * Return the amount of memory currently occupied for unrolling blocks 
across all threads.
    +   */
    +  private def currentUnrollMemory: Long = putLock.synchronized {
    +    unrollMemoryMap.values.sum
    +  }
    +
    +  /**
    +   * Return the amount of memory currently occupied for unrolling blocks 
by this thread.
    +   */
    +  private def threadCurrentUnrollMemory: Long = putLock.synchronized {
    --- End diff --
    
    Maybe call it currentUnrollMemoryForThisThread or unrollMemoryForThisThread


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

Reply via email to