yuanbenson commented on code in PR #10303:
URL: https://github.com/apache/pinot/pull/10303#discussion_r1113523394
##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/MergeRollupMinionClusterIntegrationTest.java:
##########
@@ -626,6 +625,23 @@ public void testOfflineTableSingleLevelRollup()
assertTrue(MetricValueUtils.gaugeExists(_controllerStarter.getControllerMetrics(),
"mergeRollupTaskDelayInNumBuckets.myTable2_OFFLINE.150days"));
+
+ JsonNode metadataResponseWithReplacedSegments =
JsonUtils.stringToJsonNode(sendGetRequest(
+ _controllerBaseApiUrl + "/tables/" + SINGLE_LEVEL_ROLLUP_TEST_TABLE
+ + "/metadata?excludeReplacedSegments=false"));
+ JsonNode metadataResponseWithoutReplacedSegments =
JsonUtils.stringToJsonNode(sendGetRequest(
+ _controllerBaseApiUrl + "/tables/" + SINGLE_LEVEL_ROLLUP_TEST_TABLE
+ + "/metadata?excludeReplacedSegments=true"));
+
+ String tableNameWithType =
TableNameBuilder.OFFLINE.tableNameWithType(SINGLE_LEVEL_ROLLUP_TEST_TABLE);
+ assertEquals(_helixResourceManager.getSegmentsFor(tableNameWithType,
true).size(),
+ metadataResponseWithoutReplacedSegments.get("numSegments").asInt());
+ assertEquals(_helixResourceManager.getSegmentsFor(tableNameWithType,
false).size(),
+ metadataResponseWithReplacedSegments.get("numSegments").asInt());
+
+ int numRowsFromMetadataWithoutReplacedSegments =
metadataResponseWithoutReplacedSegments.get("numRows").asInt();
+ assertNotEquals(metadataResponseWithReplacedSegments,
metadataResponseWithoutReplacedSegments);
+ assertEquals(numRowsAfterMergeTasks,
numRowsFromMetadataWithoutReplacedSegments);
Review Comment:
There is already existing test
https://github.com/apache/pinot/blob/master/pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/OfflineClusterIntegrationTest.java#L2621
for /metadata endpoint. However, I had trouble modifying the code to allow
additional segments upload in which to trigger the consistent data push
protocol with and thought `MergeRollupMinionClusterIntegrationTest` is the most
convenient place to test this new param.
--
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]