Github user kayousterhout commented on a diff in the pull request:
https://github.com/apache/spark/pull/6652#discussion_r31975311
--- Diff: core/src/test/scala/org/apache/spark/MapOutputTrackerSuite.scala
---
@@ -205,4 +205,36 @@ class MapOutputTrackerSuite extends SparkFunSuite {
// masterTracker.stop() // this throws an exception
rpcEnv.shutdown()
}
+
+ test("getLocationsWithLargestOutputs with multiple outputs in same
machine") {
+ val rpcEnv = createRpcEnv("test")
+ val tracker = new MapOutputTrackerMaster(conf)
+ tracker.trackerEndpoint =
rpcEnv.setupEndpoint(MapOutputTracker.ENDPOINT_NAME,
+ new MapOutputTrackerMasterEndpoint(rpcEnv, tracker, conf))
+ // Setup 3 map tasks
+ // on hostA with output size 2
+ // on hostA with output size 2
+ // on hostB with output size 3
+ tracker.registerShuffle(10, 3)
+ tracker.registerMapOutput(10, 0, MapStatus(BlockManagerId("a",
"hostA", 1000),
+ Array(2L)))
+ tracker.registerMapOutput(10, 1, MapStatus(BlockManagerId("a",
"hostA", 1000),
+ Array(2L)))
+ tracker.registerMapOutput(10, 2, MapStatus(BlockManagerId("b",
"hostB", 1000),
+ Array(3L)))
+
+ val topLocs50 = tracker.getLocationsWithLargestOutputs(10, 0, 1, 0.5)
--- End diff --
Can you add comments to this test -- just one here saying "When the
threshold is 50%, only host A should be returned a preferred location" and then
below, "When the threshold is only 20%, both hosts should be returned"
---
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]