You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@uniffle.apache.org by GitBox <gi...@apache.org> on 2022/12/27 03:43:34 UTC

[GitHub] [incubator-uniffle] jerqi commented on a diff in pull request #447: [Improvement] Refactor getPartitionRange to calculate range directly

jerqi commented on code in PR #447:
URL: https://github.com/apache/incubator-uniffle/pull/447#discussion_r1057422823


##########
storage/src/main/java/org/apache/uniffle/storage/util/ShuffleStorageUtils.java:
##########
@@ -167,15 +167,13 @@ public static String getShuffleDataPathWithRange(
 
   public static int[] getPartitionRange(int partitionId, int partitionNumPerRange, int partitionNum) {
     int[] range = null;
-    int prNum = partitionNum % partitionNumPerRange == 0
-        ? partitionNum / partitionNumPerRange : partitionNum / partitionNumPerRange + 1;
-    for (int i = 0; i < prNum; i++) {
-      int start = i * partitionNumPerRange;
-      int end = (i + 1) * partitionNumPerRange - 1;
-      if (partitionId >= start && partitionId <= end) {
-        range = new int[]{start, end};

Review Comment:
   The range partition is unavailable. So you don't need to obey the origin design. 



-- 
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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org