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 20:36:18 UTC

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

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

 ##########
 File path: pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/assignment/segment/OfflineSegmentAssignment.java
 ##########
 @@ -189,45 +163,48 @@ public void init(HelixManager helixManager, TableConfig tableConfig) {
     InstancePartitions instancePartitions = instancePartitionsMap.get(InstancePartitionsType.OFFLINE);
     Preconditions.checkState(instancePartitions != null, "Failed to find OFFLINE instance partitions for table: %s",
         _offlineTableName);
-    LOGGER.info("Rebalancing table: {} with instance partitions: {}", _offlineTableName, instancePartitions);
+    boolean bootstrap =
+        config.getBoolean(RebalanceConfigConstants.BOOTSTRAP, RebalanceConfigConstants.DEFAULT_BOOTSTRAP);
+    LOGGER.info("Rebalancing table: {} with instance partitions: {}, bootstrap: {}", _offlineTableName,
+        instancePartitions, bootstrap);
+    checkReplication(instancePartitions);
 
     Map<String, Map<String, String>> newAssignment;
-    if (instancePartitions.getNumReplicaGroups() == 1) {
-      // Non-replica-group based assignment
+    if (bootstrap) {
+      LOGGER.info("Bootstrapping the table: {}", _offlineTableName);
 
-      List<String> instances =
-          SegmentAssignmentUtils.getInstancesForNonReplicaGroupBasedAssignment(instancePartitions, _replication);
-      newAssignment = SegmentAssignmentUtils
-          .rebalanceTableWithHelixAutoRebalanceStrategy(currentAssignment, instances, _replication);
+      // When bootstrap is enabled, start with an empty table add reassign all segments
 
 Review comment:
   Can you adjust the comment here?

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