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

    https://github.com/apache/spark/pull/11502#discussion_r75572673
  
    --- Diff: core/src/main/scala/org/apache/spark/storage/BlockManager.scala 
---
    @@ -432,98 +432,105 @@ private[spark] class BlockManager(
             logDebug(s"Block $blockId was not found")
             None
           case Some(info) =>
    -        val level = info.level
    -        logDebug(s"Level for block $blockId is $level")
    -
    -        // Look for the block in memory
    -        if (level.useMemory) {
    -          logDebug(s"Getting block $blockId from memory")
    -          val result = if (asBlockResult) {
    -            memoryStore.getValues(blockId).map { iter =>
    -              val ci = CompletionIterator[Any, Iterator[Any]](iter, 
releaseLock(blockId))
    -              new BlockResult(ci, DataReadMethod.Memory, info.size)
    -            }
    -          } else {
    -            memoryStore.getBytes(blockId)
    -          }
    -          result match {
    -            case Some(values) =>
    -              return result
    -            case None =>
    -              logDebug(s"Block $blockId not found in memory")
    -          }
    +        doGetLocal(blockId, info, asBlockResult)
    +    }
    +  }
    +
    +  private def doGetLocal(
    +      blockId: BlockId,
    +      info: BlockInfo,
    +      asBlockResult: Boolean): Option[Any] = {
    +    val level = info.level
    +    logDebug(s"Level for block $blockId is $level")
    +
    +    // Look for the block in memory
    +    if (level.useMemory) {
    +      logDebug(s"Getting block $blockId from memory")
    +      val result = if (asBlockResult) {
    --- End diff --
    
    Hey? excuse me, @JoshRosen  can I ask you a question(may be a little 
stupid...)? what's the `asBlockResult` mean? why here should use it?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to