cloud-fan commented on a change in pull request #19788: [SPARK-9853][Core]
Optimize shuffle fetch of contiguous partition IDs
URL: https://github.com/apache/spark/pull/19788#discussion_r242541250
##########
File path: core/src/test/scala/org/apache/spark/MapOutputTrackerSuite.scala
##########
@@ -313,18 +315,76 @@ class MapOutputTrackerSuite extends SparkFunSuite {
tracker.registerMapOutput(10, 1, MapStatus(BlockManagerId("b", "hostB",
1000),
Array(size10000, size0, size1000, size0)))
assert(tracker.containsShuffle(10))
- assert(tracker.getMapSizesByExecutorId(10, 0, 4).toSeq ===
- Seq(
- (BlockManagerId("a", "hostA", 1000),
- Seq((ShuffleBlockId(10, 0, 1), size1000), (ShuffleBlockId(10, 0,
3), size10000))),
- (BlockManagerId("b", "hostB", 1000),
- Seq((ShuffleBlockId(10, 1, 0), size10000), (ShuffleBlockId(10,
1, 2), size1000)))
- )
+ assert(tracker.getMapSizesByExecutorId(10, 0, 4, serializerRelocatable =
true).toSeq ===
+ Seq(
+ (BlockManagerId("a", "hostA", 1000),
+ Seq((ShuffleBlockId(10, 0, 1), size1000), (ShuffleBlockId(10, 0, 3),
size10000))),
+ (BlockManagerId("b", "hostB", 1000),
+ Seq((ShuffleBlockId(10, 1, 0), size10000), (ShuffleBlockId(10, 1,
2), size1000)))
+ )
)
tracker.unregisterShuffle(10)
tracker.stop()
rpcEnv.shutdown()
}
+ test("fetch contiguous partitions") {
+ val rpcEnv = createRpcEnv("test")
+ val tracker = newTrackerMaster()
+ tracker.trackerEndpoint =
rpcEnv.setupEndpoint(MapOutputTracker.ENDPOINT_NAME,
+ new MapOutputTrackerMasterEndpoint(rpcEnv, tracker, conf))
+ tracker.registerShuffle(10, 2)
+ assert(tracker.containsShuffle(10))
+ val size1000 = MapStatus.decompressSize(MapStatus.compressSize(1000L))
+ val size2000 = MapStatus.decompressSize(MapStatus.compressSize(2000L))
+ val size10000 = MapStatus.decompressSize(MapStatus.compressSize(10000L))
+ tracker.registerMapOutput(10, 0, MapStatus(BlockManagerId("a", "hostA",
1000),
+ Array(1000L, 10000L, 2000L)))
+ tracker.registerMapOutput(10, 1, MapStatus(BlockManagerId("b", "hostB",
1000),
+ Array(10000L, 2000L, 1000L)))
+ val statuses1 = tracker.getMapSizesByExecutorId(10, 0, 2,
serializerRelocatable = true)
+ assert(statuses1.toSet ===
+ Seq((BlockManagerId("a", "hostA", 1000),
+ ArrayBuffer((ContinuousShuffleBlockId(10, 0, 0, 2), size1000 +
size10000))),
+ (BlockManagerId("b", "hostB", 1000),
+ ArrayBuffer((ContinuousShuffleBlockId(10, 1, 0, 2), size10000 +
size2000))))
+ .toSet)
+ val statuses2 = tracker.getMapSizesByExecutorId(10, 2, 3,
serializerRelocatable = true)
+ assert(statuses2.toSet ===
+ Seq((BlockManagerId("a", "hostA", 1000),
+ ArrayBuffer((ShuffleBlockId(10, 0, 2), size2000))),
+ (BlockManagerId("b", "hostB", 1000),
+ ArrayBuffer((ShuffleBlockId(10, 1, 2), size1000))))
+ .toSet)
+ assert(0 == tracker.getNumCachedSerializedBroadcast)
+ tracker.stop()
+ rpcEnv.shutdown()
+ }
+
+ test("fetch contiguous partitions (continuousBlockBatchFetch = false)") {
Review comment:
let's prepend `Do not` to the test name
----------------------------------------------------------------
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]