spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JoshRosen <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-12817] Add BlockManager.getOrElseUpdate...
Date Wed, 02 Mar 2016 00:41:36 GMT
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/11436#discussion_r54662358
  
    --- Diff: core/src/main/scala/org/apache/spark/storage/BlockManager.scala ---
    @@ -707,26 +719,33 @@ private[spark] class BlockManager(
           tellMaster: Boolean = true,
           effectiveStorageLevel: Option[StorageLevel] = None): Boolean = {
         require(bytes != null, "Bytes is null")
    -    doPut(blockId, ByteBufferValues(bytes), level, tellMaster, effectiveStorageLevel)
    +    doPut(blockId, ByteBufferValues(bytes), level, tellMaster, effectiveStorageLevel).isEmpty
       }
     
       /**
        * Put the given block according to the given level in one of the block stores, replicating
        * the values if necessary.
        *
    -   * The effective storage level refers to the level according to which the block will
actually be
    -   * handled. This allows the caller to specify an alternate behavior of doPut while
preserving
    -   * the original level specified by the user.
    -   *
    -   * @return true if the block was stored or false if the block was already stored or
an
    -   *         error occurred.
    +   * @param effectiveStorageLevel the level according to which the block will actually
be handled.
    +   *                              This allows the caller to specify an alternate behavior
of doPut
    +   *                              while preserving the original level specified by the
user.
    +   * @param downgradeToReadLock if true, this method will downgrade its write lock on
the block
    --- End diff --
    
    Good idea; updated.


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

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


Mime
View raw message