Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/4827#discussion_r27083960
--- Diff: core/src/main/scala/org/apache/spark/storage/MemoryStore.scala ---
@@ -97,11 +117,11 @@ private[spark] class MemoryStore(blockManager:
BlockManager, maxMemory: Long)
returnValues: Boolean): PutResult = {
if (level.deserialized) {
val sizeEstimate =
SizeEstimator.estimate(values.asInstanceOf[AnyRef])
- val putAttempt = tryToPut(blockId, values, sizeEstimate,
deserialized = true)
+ val putAttempt = tryToPut(blockId, () => values, sizeEstimate,
deserialized = true)
PutResult(sizeEstimate, Left(values.iterator),
putAttempt.droppedBlocks)
} else {
val bytes = blockManager.dataSerialize(blockId, values.iterator)
- val putAttempt = tryToPut(blockId, bytes, bytes.limit, deserialized
= false)
+ val putAttempt = tryToPut(blockId, () => bytes, bytes.limit,
deserialized = false)
--- End diff --
it's a little odd for this to be `() => bytes` everywhere. Can you create
an alias that looks something like:
```
private def tryToPut(blockId: BlockId, value: Any, ...):
ResultWithDroppedBlocks = {
tryToPut(blockId, () => value(), ...)
}
```
same with dropFromMemory
---
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]