vanzin commented on a change in pull request #23688: [SPARK-25035][Core]
Avoiding memory mapping at disk-stored blocks replication
URL: https://github.com/apache/spark/pull/23688#discussion_r255660659
##########
File path: core/src/test/scala/org/apache/spark/storage/BlockManagerSuite.scala
##########
@@ -906,6 +910,47 @@ class BlockManagerSuite extends SparkFunSuite with
Matchers with BeforeAndAfterE
}
}
+ def testPutBlockDataAsStream(blockManager: BlockManager, storageLevel:
StorageLevel): Unit = {
+ val message = "message"
+ val ser = serializer.newInstance().serialize(message).array()
+ val blockId = new RDDBlockId(0, 0)
+ val streamCallbackWithId =
+ blockManager.putBlockDataAsStream(blockId, storageLevel,
ClassTag(message.getClass))
+ streamCallbackWithId.onData("0", ByteBuffer.wrap(ser))
+ streamCallbackWithId.onComplete("0")
+ val blockStatusOption = blockManager.getStatus(blockId)
+ assert(!blockStatusOption.isEmpty)
+ val blockStatus = blockStatusOption.get
+ assert((blockStatus.diskSize > 0) === !storageLevel.useMemory)
+ assert((blockStatus.memSize > 0) === storageLevel.useMemory)
+ assert(blockManager.getBlockData(blockId).nioByteBuffer().array() === ser)
+ }
+
+ Seq(
+ "caching" -> StorageLevel.MEMORY_ONLY,
Review comment:
Add `MEMORY_ONLY_SER`?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]