Jackie-Jiang commented on code in PR #11730: URL: https://github.com/apache/pinot/pull/11730#discussion_r1346199062
########## pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/rebalance/RebalanceConfig.java: ########## @@ -0,0 +1,189 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.pinot.controller.helix.core.rebalance; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + + +@ApiModel +public class RebalanceConfig { + // Whether to rebalance table in dry-run mode + @JsonProperty("dryRun") + @ApiModelProperty(example = "false") + private boolean _dryRun = false; + + // Whether to reassign instances before reassigning segments + @JsonProperty("reassignInstances") + @ApiModelProperty(example = "false") + private boolean _reassignInstances = false; + + // Whether to reassign CONSUMING segments + @JsonProperty("includeConsuming") + @ApiModelProperty(example = "false") + private boolean _includeConsuming = false; + + // Whether to rebalance table in bootstrap mode (regardless of minimum segment movement, reassign all segments in a + // round-robin fashion as if adding new segments to an empty table) + @JsonProperty("bootstrap") + @ApiModelProperty(example = "false") + private boolean _bootstrap = false; + + // Whether to allow downtime for the rebalance + @JsonProperty("downtime") + @ApiModelProperty(example = "false") + private boolean _downtime = false; + + // For no-downtime rebalance, minimum number of replicas to keep alive during rebalance, or maximum number of replicas + // allowed to be unavailable if value is negative + @JsonProperty("minAvailableReplicas") + @ApiModelProperty(example = "1") + private int _minAvailableReplicas = 1; Review Comment: We might want to put a constant for this as well ########## pinot-controller/src/main/java/org/apache/pinot/controller/ControllerConf.java: ########## @@ -961,13 +960,12 @@ public boolean enableSegmentRelocatorLocalTierMigration() { } public long getSegmentRelocatorExternalViewCheckIntervalInMs() { - return getProperty(ControllerPeriodicTasksConf.SEGMENT_RELOCATOR_EXTERNAL_VIEW_CHECK_INTERVAL_IN_MS, - RebalanceConfigConstants.DEFAULT_EXTERNAL_VIEW_CHECK_INTERVAL_IN_MS); + return getProperty(ControllerPeriodicTasksConf.SEGMENT_RELOCATOR_EXTERNAL_VIEW_CHECK_INTERVAL_IN_MS, 1000L); Review Comment: Let's use a constant for the default value. We should use the same value here and also in the `RebalanceConfig`. Maybe simply add it into `RebalanceConfig` -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org