advancedxy commented on code in PR #447:
URL: https://github.com/apache/incubator-uniffle/pull/447#discussion_r1057420215
##########
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:
@jerqi Previous impl seems that it doesn't handle end range properly? For
example:
partitionNum: 5, partitionNumPerRange: 3, the partition range should be:
pr-0: 0 - 2,
pr-1: 3 - 4, --> in previous impl, this returns pr-1: 3 - 5.
Is that by 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: [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]