You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "GSharayu (via GitHub)" <gi...@apache.org> on 2023/02/21 19:58:44 UTC
[GitHub] [pinot] GSharayu commented on a diff in pull request #10303: Add excludeReplacedSegments param into table metadata API
GSharayu commented on code in PR #10303:
URL: https://github.com/apache/pinot/pull/10303#discussion_r1113429711
##########
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:
Apart from consistent push, If possible, we should also add a unit test which verifies /metadata endpoint independently
--
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-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org