Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/11436#discussion_r54628030
--- 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 --
I think a better name is `returnWithReadLock`. If the block already exists,
we're not really "downgrading" it, since we never owned the write lock in the
first place. Then the comment to explain it can be clearer:
```
If true, this method will hold the read lock when it returns even if the
block already exists.
If false, this method will hold no locks when it returns.
```
---
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.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]