xiangfu0 commented on code in PR #17167:
URL: https://github.com/apache/pinot/pull/17167#discussion_r3041200926
##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/TenantRebalanceIntegrationTest.java:
##########
@@ -32,9 +32,16 @@
public class TenantRebalanceIntegrationTest extends
BaseHybridClusterIntegrationTest {
- private String getRebalanceUrl() {
- return StringUtil.join("/", getControllerRequestURLBuilder().getBaseUrl(),
"tenants", getServerTenant(),
- "rebalance");
+ private TenantRebalanceResult rebalanceTenant(TenantRebalanceConfig config,
@Nullable Map<String, String> queryParams)
+ throws Exception {
+ return getOrCreateAdminClient().getTenantClient()
+ .rebalanceTenantWithConfig(config.getTenantName(),
JsonUtils.objectToString(config), queryParams,
Review Comment:
Acknowledged - these response classes (RebalanceResult, PauseStatusDetails,
TableViews.TableView, ConsumingSegmentsInfoMap,
ServerRebalanceJobStatusResponse, etc.) are currently in pinot-controller,
which pinot-java-client cannot depend on. Moving them to pinot-common requires
also moving their transitive dependencies (RebalanceSummaryResult,
RebalancePreCheckerResult, TableRebalanceProgressStats, etc.) - will address in
a follow-up PR dedicated to response class relocation.
##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/QueryQuotaClusterIntegrationTest.java:
##########
@@ -65,6 +66,7 @@ public class QueryQuotaClusterIntegrationTest extends
BaseClusterIntegrationTest
public void setUp()
throws Exception {
TestUtils.ensureDirectoriesExistAndEmpty(_tempDir, _segmentDir, _tarDir);
+ _httpClient = getHttpClient();
Review Comment:
Acknowledged - these response classes (RebalanceResult, PauseStatusDetails,
TableViews.TableView, ConsumingSegmentsInfoMap,
ServerRebalanceJobStatusResponse, etc.) are currently in pinot-controller,
which pinot-java-client cannot depend on. Moving them to pinot-common requires
also moving their transitive dependencies (RebalanceSummaryResult,
RebalancePreCheckerResult, TableRebalanceProgressStats, etc.) - will address in
a follow-up PR dedicated to response class relocation.
##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/StaleSegmentCheckIntegrationTest.java:
##########
@@ -165,10 +163,9 @@ public void testH3IndexChange()
}
private Map<String, TableStaleSegmentResponse> getStaleSegmentsResponse()
- throws IOException {
- return JsonUtils.stringToObject(sendGetRequest(
- _controllerRequestURLBuilder.forStaleSegments(
- TableNameBuilder.OFFLINE.tableNameWithType(getTableName()))),
+ throws Exception {
+ return getOrCreateAdminClient().getSegmentClient().getStaleSegments(
Review Comment:
Acknowledged - these response classes (RebalanceResult, PauseStatusDetails,
TableViews.TableView, ConsumingSegmentsInfoMap,
ServerRebalanceJobStatusResponse, etc.) are currently in pinot-controller,
which pinot-java-client cannot depend on. Moving them to pinot-common requires
also moving their transitive dependencies (RebalanceSummaryResult,
RebalancePreCheckerResult, TableRebalanceProgressStats, etc.) - will address in
a follow-up PR dedicated to response class relocation.
##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/BaseClusterIntegrationTestSet.java:
##########
@@ -911,24 +909,35 @@ private MetricFieldSpec
constructNewMetric(FieldSpec.DataType dataType) {
return new MetricFieldSpec(column, dataType);
}
+ protected RebalanceResult triggerTableRebalance(RebalanceConfig
rebalanceConfig, TableType tableType)
+ throws IOException, PinotAdminException {
+ Map<String, String> queryParams = new HashMap<>();
+ queryParams.put("type", tableType.toString());
+ String[] params = rebalanceConfig.toQueryString().split("&");
+ for (String param : params) {
+ String[] kv = param.split("=", 2);
+ if (kv.length == 2) {
+ queryParams.put(kv[0], kv[1]);
+ }
+ }
+ return getOrCreateAdminClient().getRebalanceClient()
Review Comment:
Acknowledged - these response classes (RebalanceResult, PauseStatusDetails,
TableViews.TableView, ConsumingSegmentsInfoMap,
ServerRebalanceJobStatusResponse, etc.) are currently in pinot-controller,
which pinot-java-client cannot depend on. Moving them to pinot-common requires
also moving their transitive dependencies (RebalanceSummaryResult,
RebalancePreCheckerResult, TableRebalanceProgressStats, etc.) - will address in
a follow-up PR dedicated to response class relocation.
##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/BaseClusterIntegrationTestSet.java:
##########
@@ -940,16 +949,10 @@ protected void waitForRebalanceToComplete(String
rebalanceJobId, long timeoutMs)
protected void waitForTableEVISConverge(String tableName, long timeoutMs) {
TestUtils.waitForCondition(aVoid -> {
try {
- String requestUrl =
getControllerRequestURLBuilder().forIdealState(tableName);
- SimpleHttpResponse httpResponse =
-
HttpClient.wrapAndThrowHttpException(getHttpClient().sendGetRequest(new
URL(requestUrl).toURI(), null));
TableViews.TableView idealState =
- JsonUtils.stringToObject(httpResponse.getResponse(),
TableViews.TableView.class);
-
- requestUrl =
getControllerRequestURLBuilder().forExternalView(tableName);
- httpResponse = getHttpClient().sendGetRequest(new
URL(requestUrl).toURI(), null);
+ getOrCreateAdminClient().getTableClient().getIdealState(tableName,
TableViews.TableView.class);
Review Comment:
Acknowledged - these response classes (RebalanceResult, PauseStatusDetails,
TableViews.TableView, ConsumingSegmentsInfoMap,
ServerRebalanceJobStatusResponse, etc.) are currently in pinot-controller,
which pinot-java-client cannot depend on. Moving them to pinot-common requires
also moving their transitive dependencies (RebalanceSummaryResult,
RebalancePreCheckerResult, TableRebalanceProgressStats, etc.) - will address in
a follow-up PR dedicated to response class relocation.
##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/BaseClusterIntegrationTestSet.java:
##########
@@ -940,16 +949,10 @@ protected void waitForRebalanceToComplete(String
rebalanceJobId, long timeoutMs)
protected void waitForTableEVISConverge(String tableName, long timeoutMs) {
TestUtils.waitForCondition(aVoid -> {
try {
- String requestUrl =
getControllerRequestURLBuilder().forIdealState(tableName);
- SimpleHttpResponse httpResponse =
-
HttpClient.wrapAndThrowHttpException(getHttpClient().sendGetRequest(new
URL(requestUrl).toURI(), null));
TableViews.TableView idealState =
- JsonUtils.stringToObject(httpResponse.getResponse(),
TableViews.TableView.class);
-
- requestUrl =
getControllerRequestURLBuilder().forExternalView(tableName);
- httpResponse = getHttpClient().sendGetRequest(new
URL(requestUrl).toURI(), null);
+ getOrCreateAdminClient().getTableClient().getIdealState(tableName,
TableViews.TableView.class);
TableViews.TableView externalView =
- JsonUtils.stringToObject(httpResponse.getResponse(),
TableViews.TableView.class);
+
getOrCreateAdminClient().getTableClient().getExternalView(tableName,
TableViews.TableView.class);
Review Comment:
Acknowledged - these response classes (RebalanceResult, PauseStatusDetails,
TableViews.TableView, ConsumingSegmentsInfoMap,
ServerRebalanceJobStatusResponse, etc.) are currently in pinot-controller,
which pinot-java-client cannot depend on. Moving them to pinot-common requires
also moving their transitive dependencies (RebalanceSummaryResult,
RebalancePreCheckerResult, TableRebalanceProgressStats, etc.) - will address in
a follow-up PR dedicated to response class relocation.
##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/BaseClusterIntegrationTestSet.java:
##########
@@ -1028,9 +1030,9 @@ private void
performForceCommitSegmentMovingTest(RebalanceConfig rebalanceConfig
// Check if segments were committed (only if there were consuming segments
to move)
if (originalConsumingSegmentsToMove != null &&
!originalConsumingSegmentsToMove.isEmpty()) {
- response =
sendGetRequest(getControllerRequestURLBuilder().forTableConsumingSegmentsInfo(getTableName()));
ConsumingSegmentInfoReader.ConsumingSegmentsInfoMap
consumingSegmentInfoResponse =
- JsonUtils.stringToObject(response,
ConsumingSegmentInfoReader.ConsumingSegmentsInfoMap.class);
+
getOrCreateAdminClient().getTableClient().getConsumingSegmentsInfo(getTableName(),
Review Comment:
Acknowledged - these response classes (RebalanceResult, PauseStatusDetails,
TableViews.TableView, ConsumingSegmentsInfoMap,
ServerRebalanceJobStatusResponse, etc.) are currently in pinot-controller,
which pinot-java-client cannot depend on. Moving them to pinot-common requires
also moving their transitive dependencies (RebalanceSummaryResult,
RebalancePreCheckerResult, TableRebalanceProgressStats, etc.) - will address in
a follow-up PR dedicated to response class relocation.
##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/logicaltable/KafkaPartitionSubsetChaosIntegrationTest.java:
##########
@@ -594,10 +594,11 @@ private void pauseConsumptionAndWait(String
realtimeTableName)
private void resumeConsumptionAndWait(String realtimeTableName)
throws Exception {
- getControllerRequestClient().resumeConsumption(realtimeTableName);
+
getOrCreateAdminClient().getTableClient().resumeConsumption(realtimeTableName,
null);
TestUtils.waitForCondition(aVoid -> {
try {
- PauseStatusDetails details =
getControllerRequestClient().getPauseStatusDetails(realtimeTableName);
+ PauseStatusDetails details =
+
getOrCreateAdminClient().getTableClient().getPauseStatus(realtimeTableName,
PauseStatusDetails.class);
Review Comment:
Acknowledged - these response classes (RebalanceResult, PauseStatusDetails,
TableViews.TableView, ConsumingSegmentsInfoMap,
ServerRebalanceJobStatusResponse, etc.) are currently in pinot-controller,
which pinot-java-client cannot depend on. Moving them to pinot-common requires
also moving their transitive dependencies (RebalanceSummaryResult,
RebalancePreCheckerResult, TableRebalanceProgressStats, etc.) - will address in
a follow-up PR dedicated to response class relocation.
--
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]