You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@celeborn.apache.org by "pan3793 (via GitHub)" <gi...@apache.org> on 2023/02/23 17:20:55 UTC

[GitHub] [incubator-celeborn] pan3793 commented on a diff in pull request #1232: [CELEBORN-295] Optimize data push

pan3793 commented on code in PR #1232:
URL: https://github.com/apache/incubator-celeborn/pull/1232#discussion_r1116014783


##########
client-spark/common/src/main/java/org/apache/spark/shuffle/celeborn/SortBasedPusher.java:
##########
@@ -92,6 +101,22 @@ public SortBasedPusher(
     this.taskAttemptId = taskAttemptId;
     this.numMappers = numMappers;
     this.numPartitions = numPartitions;
+
+    shuffledPartitions = new int[numPartitions];
+    reverseShuffledPartitions = new int[numPartitions];
+    ArrayList<Integer> list = new ArrayList(numPartitions);
+    for (int i = 0; i < numPartitions; i++) {
+      list.add(i);
+    }
+    if (conf.pushSortRandomizePartitionIdEnabled()) {
+      Collections.shuffle(list);

Review Comment:
   the logic can be simplified by `Utils#randomizeInPlace` 



-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org