Ngone51 commented on code in PR #46706:
URL: https://github.com/apache/spark/pull/46706#discussion_r1612618745


##########
core/src/test/scala/org/apache/spark/MapOutputTrackerSuite.scala:
##########
@@ -1110,4 +1110,57 @@ class MapOutputTrackerSuite extends SparkFunSuite with 
LocalSparkContext {
       rpcEnv.shutdown()
     }
   }
+
+  test("mapIdToMapIndex should cleanup unused mapIndexes after 
removeOutputsByFilter") {
+    val rpcEnv = createRpcEnv("test")
+    val tracker = newTrackerMaster()
+    try {
+      tracker.trackerEndpoint = 
rpcEnv.setupEndpoint(MapOutputTracker.ENDPOINT_NAME,
+        new MapOutputTrackerMasterEndpoint(rpcEnv, tracker, conf))
+      tracker.registerShuffle(0, 1, 1)
+      tracker.registerMapOutput(0, 0, MapStatus(BlockManagerId("exec-1", 
"hostA", 1000),
+        Array(2L), 0))
+      tracker.removeOutputsOnHost("hostA")
+      assert(tracker.shuffleStatuses(0).mapIdToMapIndex.filter(_._2 == 0).size 
== 0)
+    } finally {
+      tracker.stop()
+      rpcEnv.shutdown()
+    }
+  }
+
+  test("mapIdToMapIndex should cleanup unused mapIndexes after 
unregisterMapOutput") {

Review Comment:
   ```suggestion
     test("SPARK-48394: mapIdToMapIndex should cleanup unused mapIndexes after 
unregisterMapOutput") {
   ```



##########
core/src/test/scala/org/apache/spark/MapOutputTrackerSuite.scala:
##########
@@ -1110,4 +1110,57 @@ class MapOutputTrackerSuite extends SparkFunSuite with 
LocalSparkContext {
       rpcEnv.shutdown()
     }
   }
+
+  test("mapIdToMapIndex should cleanup unused mapIndexes after 
removeOutputsByFilter") {
+    val rpcEnv = createRpcEnv("test")
+    val tracker = newTrackerMaster()
+    try {
+      tracker.trackerEndpoint = 
rpcEnv.setupEndpoint(MapOutputTracker.ENDPOINT_NAME,
+        new MapOutputTrackerMasterEndpoint(rpcEnv, tracker, conf))
+      tracker.registerShuffle(0, 1, 1)
+      tracker.registerMapOutput(0, 0, MapStatus(BlockManagerId("exec-1", 
"hostA", 1000),
+        Array(2L), 0))
+      tracker.removeOutputsOnHost("hostA")
+      assert(tracker.shuffleStatuses(0).mapIdToMapIndex.filter(_._2 == 0).size 
== 0)
+    } finally {
+      tracker.stop()
+      rpcEnv.shutdown()
+    }
+  }
+
+  test("mapIdToMapIndex should cleanup unused mapIndexes after 
unregisterMapOutput") {
+    val rpcEnv = createRpcEnv("test")
+    val tracker = newTrackerMaster()
+    try {
+      tracker.trackerEndpoint = 
rpcEnv.setupEndpoint(MapOutputTracker.ENDPOINT_NAME,
+        new MapOutputTrackerMasterEndpoint(rpcEnv, tracker, conf))
+      tracker.registerShuffle(0, 1, 1)
+      tracker.registerMapOutput(0, 0, MapStatus(BlockManagerId("exec-1", 
"hostA", 1000),
+        Array(2L), 0))
+      tracker.unregisterMapOutput(0, 0, BlockManagerId("exec-1", "hostA", 
1000))
+      assert(tracker.shuffleStatuses(0).mapIdToMapIndex.filter(_._2 == 0).size 
== 0)
+    } finally {
+      tracker.stop()
+      rpcEnv.shutdown()
+    }
+  }
+
+  test("mapIdToMapIndex should cleanup unused mapIndexes after 
registerMapOutput") {

Review Comment:
   ```suggestion
     test("SPARK-48394: mapIdToMapIndex should cleanup unused mapIndexes after 
registerMapOutput") {
   ```



##########
core/src/test/scala/org/apache/spark/MapOutputTrackerSuite.scala:
##########
@@ -1110,4 +1110,57 @@ class MapOutputTrackerSuite extends SparkFunSuite with 
LocalSparkContext {
       rpcEnv.shutdown()
     }
   }
+
+  test("mapIdToMapIndex should cleanup unused mapIndexes after 
removeOutputsByFilter") {

Review Comment:
   ```suggestion
     test("SPARK-48394: mapIdToMapIndex should cleanup unused mapIndexes after 
removeOutputsByFilter") {
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to