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

    https://github.com/apache/spark/pull/1165#discussion_r15331347
  
    --- Diff: core/src/main/scala/org/apache/spark/storage/MemoryStore.scala ---
    @@ -87,9 +97,47 @@ private class MemoryStore(blockManager: BlockManager, 
maxMemory: Long)
           values: Iterator[Any],
           level: StorageLevel,
           returnValues: Boolean): PutResult = {
    -    val valueEntries = new ArrayBuffer[Any]()
    -    valueEntries ++= values
    -    putValues(blockId, valueEntries, level, returnValues)
    +    putValues(blockId, values, level, returnValues, allowPersistToDisk = 
true)
    +  }
    +
    +  /**
    +   * Attempt to put the given block in memory store.
    +   *
    +   * There may not be enough space to fully unroll the iterator in memory, 
in which case we
    +   * optionally drop the values to disk if
    +   *   (1) the block's storage level specifies useDisk, and
    +   *   (2) `allowPersistToDisk` is true.
    +   *
    +   * One scenario in which `allowPersistToDisk` is false is when the 
BlockManager reads a block
    +   * back from disk and attempts to cache it in memory. In this case, we 
should not persist the
    +   * block back on disk again, as it is already in disk store.
    +   */
    +  private[storage] def putValues(
    --- End diff --
    
    Nit: it's kind of weird that this is called putValues when it takes an 
Iterator, and BlockManager has something called putIterator. Maybe this should 
also be putIterator.


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