jackylee-ch commented on code in PR #12057:
URL: https://github.com/apache/gluten/pull/12057#discussion_r3214797873


##########
gluten-celeborn/src/main/java/org/apache/spark/shuffle/gluten/celeborn/CelebornUtils.java:
##########
@@ -700,4 +700,54 @@ public static void stopFailedShuffleCleaner(Object 
failedShuffleCleaner) {
       throw new RuntimeException(e);
     }
   }
+
+  public static void prepareForMergeData(
+      ShuffleClient shuffleClient, int shuffleId, int mapId, int attemptId) {
+    try {
+      Method prepareMethod =
+          shuffleClient
+              .getClass()
+              .getDeclaredMethod("prepareForMergeData", Integer.TYPE, 
Integer.TYPE, Integer.TYPE);
+      prepareMethod.invoke(shuffleClient, shuffleId, mapId, attemptId);
+    } catch (NoSuchMethodException ignored) {

Review Comment:
   should we have a warning for this?



##########
gluten-celeborn/src/main/java/org/apache/spark/shuffle/gluten/celeborn/CelebornUtils.java:
##########
@@ -700,4 +700,54 @@ public static void stopFailedShuffleCleaner(Object 
failedShuffleCleaner) {
       throw new RuntimeException(e);
     }
   }
+
+  public static void prepareForMergeData(
+      ShuffleClient shuffleClient, int shuffleId, int mapId, int attemptId) {
+    try {
+      Method prepareMethod =
+          shuffleClient
+              .getClass()
+              .getDeclaredMethod("prepareForMergeData", Integer.TYPE, 
Integer.TYPE, Integer.TYPE);
+      prepareMethod.invoke(shuffleClient, shuffleId, mapId, attemptId);
+    } catch (NoSuchMethodException ignored) {
+    } catch (Exception e) {
+      throw new RuntimeException(e);
+    }
+  }
+
+  public static void mapperEnd(
+      ShuffleClient shuffleClient,
+      int shuffleId,
+      int mapId,
+      int attemptId,
+      int numMappers,
+      int numPartitions) {
+    try {
+      try {
+        // for Celeborn 0.6.3
+        Method mapperEndMethod =
+            shuffleClient
+                .getClass()
+                .getDeclaredMethod(
+                    "mapperEnd",
+                    Integer.TYPE,
+                    Integer.TYPE,
+                    Integer.TYPE,
+                    Integer.TYPE,
+                    Integer.TYPE);
+        mapperEndMethod.invoke(
+            shuffleClient, shuffleId, mapId, attemptId, numMappers, 
numPartitions);
+      } catch (NoSuchMethodException e) {
+        Method mapperEndMethod =
+            shuffleClient
+                .getClass()
+                .getDeclaredMethod(
+                    "mapperEnd", Integer.TYPE, Integer.TYPE, Integer.TYPE, 
Integer.TYPE);
+        mapperEndMethod.invoke(shuffleClient, shuffleId, mapId, attemptId, 
numMappers);
+      }
+    } catch (NoSuchMethodException ignored) {

Review Comment:
   ditto



-- 
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