Github user JoshRosen commented on a diff in the pull request:
https://github.com/apache/spark/pull/11534#discussion_r55412172
--- Diff:
core/src/main/scala/org/apache/spark/storage/memory/MemoryStore.scala ---
@@ -34,13 +35,15 @@ private case class MemoryEntry(value: Any, size: Long,
deserialized: Boolean)
* Stores blocks in memory, either as Arrays of deserialized Java objects
or as
* serialized ByteBuffers.
*/
-private[spark] class MemoryStore(blockManager: BlockManager,
memoryManager: MemoryManager)
- extends BlockStore(blockManager) {
+private[spark] class MemoryStore(
+ conf: SparkConf,
+ blockManager: BlockManager,
+ memoryManager: MemoryManager)
+ extends Logging {
// Note: all changes to memory allocations, notably putting blocks,
evicting blocks, and
// acquiring or releasing unroll memory, must be synchronized on
`memoryManager`!
- private val conf = blockManager.conf
private val entries = new LinkedHashMap[BlockId, MemoryEntry](32, 0.75f,
true)
--- End diff --
Good catch. In the old code, there were multiple places that called into
the MemoryStore, some in the BlockManager and others in the CahceManager, so I
think we needed these locks to ensure thread-safety. Now, though, I think that
all accesses should be coming from the BlockManager so I think we can remove
this locking and rely on the caller holding the appropriate BlockManager locks
instead.
---
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]