wangshengjie123 commented on code in PR #2373:
URL: 
https://github.com/apache/incubator-celeborn/pull/2373#discussion_r1536773685


##########
client/src/main/java/org/apache/celeborn/client/read/CelebornInputStream.java:
##########
@@ -87,6 +96,41 @@ public static CelebornInputStream create(
     }
   }
 
+  public static PartitionLocation[] getSkewPartitionLocations(
+      PartitionLocation[] locations, int subPartitionSize, int 
subPartitionIndex) {
+    Set<PartitionLocation> sortSet =
+        new TreeSet<>(
+            (o1, o2) -> {
+              if (o1.getStorageInfo().fileSize > o2.getStorageInfo().fileSize) 
{
+                return 1;
+              } else if (o1.getStorageInfo().fileSize < 
o2.getStorageInfo().fileSize) {
+                return -1;
+              } else {
+                return o1.hashCode() - o2.hashCode();
+              }
+            });
+    sortSet.addAll(Arrays.asList(locations));
+    PartitionLocation[] orderedPartitionLocations = sortSet.toArray(new 
PartitionLocation[0]);

Review Comment:
   done



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

Reply via email to