You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2020/04/08 22:12:27 UTC

[GitHub] [incubator-pinot] snleee commented on a change in pull request #5224: Support bootstrap mode for table rebalance

snleee commented on a change in pull request #5224: Support bootstrap mode for table rebalance
URL: https://github.com/apache/incubator-pinot/pull/5224#discussion_r405844234
 
 

 ##########
 File path: pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/assignment/segment/SegmentAssignmentUtils.java
 ##########
 @@ -86,6 +86,55 @@ private SegmentAssignmentUtils() {
     return instances;
   }
 
+  /**
+   * Assigns the segment for the non-replica-group based segment assignment strategy and returns the assigned instances.
+   */
+  static List<String> assignSegmentWithoutReplicaGroup(Map<String, Map<String, String>> currentAssignment,
+      InstancePartitions instancePartitions, int replication) {
+    List<String> instances =
+        SegmentAssignmentUtils.getInstancesForNonReplicaGroupBasedAssignment(instancePartitions, replication);
+    int[] numSegmentsAssignedPerInstance = getNumSegmentsAssignedPerInstance(currentAssignment, instances);
+    int numInstances = numSegmentsAssignedPerInstance.length;
+    PriorityQueue<Pairs.IntPair> heap = new PriorityQueue<>(numInstances, Pairs.intPairComparator());
 
 Review comment:
   I assume `Pairs.intPairComparator` that this will be an ascending order?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org