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

    https://github.com/apache/spark/pull/1165#discussion_r15091852
  
    --- Diff: core/src/main/scala/org/apache/spark/storage/BlockManager.scala 
---
    @@ -463,16 +463,16 @@ private[spark] class BlockManager(
                   val values = dataDeserialize(blockId, bytes)
                   if (level.deserialized) {
                     // Cache the values before returning them
    -                // TODO: Consider creating a putValues that also takes in 
a iterator?
    -                val valuesBuffer = new ArrayBuffer[Any]
    -                valuesBuffer ++= values
    -                memoryStore.putValues(blockId, valuesBuffer, level, 
returnValues = true).data
    -                  match {
    -                    case Left(values2) =>
    -                      return Some(new BlockResult(values2, 
DataReadMethod.Disk, info.size))
    -                    case _ =>
    -                      throw new SparkException("Memory store did not 
return back an iterator")
    -                  }
    +                val putResult = memoryStore.putValues(blockId, values, 
level, returnValues = true)
    +                putResult.data match {
    +                  case Left(it) =>
    +                    return Some(new BlockResult(it, DataReadMethod.Disk, 
info.size))
    +                  case Right(b) =>
    +                    return Some(new BlockResult(
    +                      dataDeserialize(blockId, b),
    --- End diff --
    
    I just realized we don't need to write the values to disk again here, 
because in this method we're already reading from disk. Looks like we need a 
more specific fix for this case than what our current API offers.


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