yashmayya commented on code in PR #16096:
URL: https://github.com/apache/pinot/pull/16096#discussion_r2165740824


##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/TableRebalancePauselessIntegrationTest.java:
##########
@@ -0,0 +1,215 @@
+/**
+ * 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.integration.tests;
+
+import java.util.Map;
+import org.apache.pinot.controller.ControllerConf;
+import org.apache.pinot.controller.helix.core.rebalance.RebalanceConfig;
+import org.apache.pinot.controller.helix.core.rebalance.RebalanceResult;
+import org.apache.pinot.controller.helix.core.rebalance.RebalanceSummaryResult;
+import org.apache.pinot.server.starter.helix.BaseServerStarter;
+import org.apache.pinot.spi.config.table.RoutingConfig;
+import org.apache.pinot.spi.config.table.TableConfig;
+import org.apache.pinot.spi.config.table.TableType;
+import org.apache.pinot.spi.config.table.TenantConfig;
+import org.apache.pinot.spi.utils.JsonUtils;
+import org.apache.pinot.spi.utils.StringUtil;
+import org.apache.pinot.util.TestUtils;
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+import static org.testng.Assert.*;
+
+
+public class TableRebalancePauselessIntegrationTest extends 
BasePauselessRealtimeIngestionTest {
+  @Override
+  protected String getFailurePoint() {
+    return null;  // No failure point for basic test
+  }
+
+  @Override
+  protected int getExpectedSegmentsWithFailure() {
+    return NUM_REALTIME_SEGMENTS;  // Always expect full segments
+  }
+
+  @Override
+  protected int getExpectedZKMetadataWithFailure() {
+    return NUM_REALTIME_SEGMENTS;  // Always expect full metadata
+  }
+
+  @Override
+  protected long getCountStarResultWithFailure() {
+    return DEFAULT_COUNT_STAR_RESULT;  // Always expect full count
+  }
+
+  @Override
+  protected void overrideControllerConf(Map<String, Object> properties) {
+    properties.put(ControllerConf.CLUSTER_TENANT_ISOLATION_ENABLE, false);
+  }
+
+  @Override
+  @BeforeClass
+  public void setUp()
+      throws Exception {
+    TestUtils.ensureDirectoriesExistAndEmpty(_tempDir, _segmentDir, _tarDir);
+    startZk();
+    startController();
+    startBroker();
+    startServer();
+    createServerTenant(getServerTenant(), 0, 1);
+    createBrokerTenant(getBrokerTenant(), 1);
+    setMaxSegmentCompletionTimeMillis();
+    setupNonPauselessTable();
+    injectFailure();
+    setupPauselessTable();
+    waitForAllDocsLoaded(600_000L);
+  }
+
+  private static String getQueryString(RebalanceConfig rebalanceConfig) {
+    return "dryRun=" + rebalanceConfig.isDryRun() + "&preChecks=" + 
rebalanceConfig.isPreChecks()
+        + "&reassignInstances=" + rebalanceConfig.isReassignInstances()
+        + "&includeConsuming=" + rebalanceConfig.isIncludeConsuming()
+        + "&minimizeDataMovement=" + rebalanceConfig.getMinimizeDataMovement()
+        + "&bootstrap=" + rebalanceConfig.isBootstrap() + "&downtime=" + 
rebalanceConfig.isDowntime()
+        + "&minAvailableReplicas=" + rebalanceConfig.getMinAvailableReplicas()
+        + "&bestEfforts=" + rebalanceConfig.isBestEfforts()
+        + "&batchSizePerServer=" + rebalanceConfig.getBatchSizePerServer()
+        + "&externalViewCheckIntervalInMs=" + 
rebalanceConfig.getExternalViewCheckIntervalInMs()
+        + "&externalViewStabilizationTimeoutInMs=" + 
rebalanceConfig.getExternalViewStabilizationTimeoutInMs()
+        + "&updateTargetTier=" + rebalanceConfig.isUpdateTargetTier()
+        + "&heartbeatIntervalInMs=" + 
rebalanceConfig.getHeartbeatIntervalInMs()
+        + "&heartbeatTimeoutInMs=" + rebalanceConfig.getHeartbeatTimeoutInMs()
+        + "&maxAttempts=" + rebalanceConfig.getMaxAttempts()
+        + "&retryInitialDelayInMs=" + 
rebalanceConfig.getRetryInitialDelayInMs()
+        + "&forceCommit=" + rebalanceConfig.isForceCommit();
+  }
+
+  private String getRebalanceUrl(RebalanceConfig rebalanceConfig, TableType 
tableType) {
+    return StringUtil.join("/", getControllerRequestURLBuilder().getBaseUrl(), 
"tables", getTableName(), "rebalance")
+        + "?type=" + tableType.toString() + "&" + 
getQueryString(rebalanceConfig);
+  }

Review Comment:
   I'm pushing a commit to clean these up.



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

Reply via email to