You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "tibrewalpratik17 (via GitHub)" <gi...@apache.org> on 2023/03/01 17:28:03 UTC
[GitHub] [pinot] tibrewalpratik17 opened a new pull request, #10363: Add additional metadata from Zookeeper in all segments metadata response
tibrewalpratik17 opened a new pull request, #10363:
URL: https://github.com/apache/pinot/pull/10363
`/segments/{tableName}/metadata` returns the metadata for all table segments from server. This misses out on Zookeeper metadata like `downloadUrl`, `segmentPartitionMetadata` which can be obtained only by hitting this API `/segments/{tableName}/{segmentName}/metadata` for each segment separately.
--
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
[GitHub] [pinot] Jackie-Jiang commented on a diff in pull request #10363: Add controller API to fetch all segment zookeeper metadata for a table
Posted by "Jackie-Jiang (via GitHub)" <gi...@apache.org>.
Jackie-Jiang commented on code in PR #10363:
URL: https://github.com/apache/pinot/pull/10363#discussion_r1125223147
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentRestletResource.java:
##########
@@ -901,6 +902,37 @@ public String getServerMetadata(
return segmentsMetadata;
}
+ @GET
+ @Path("segments/{tableName}/zkmetadata")
+ @Produces(MediaType.APPLICATION_JSON)
+ @ApiOperation(value = "Get the zookeeper metadata for all table segments", notes = "Get the zookeeper metadata for "
+ + "all table segments")
+ public Map<String, Map<String, Object>> getZookeeperMetadata(
+ @ApiParam(value = "Name of the table", required = true) @PathParam("tableName") String tableName,
+ @ApiParam(value = "OFFLINE|REALTIME") @QueryParam("type") String tableTypeStr)
+ throws JsonProcessingException {
+ LOGGER.info("Received a request to fetch zookeeper metadata for all segments for table {}", tableName);
+ TableType tableType = Constants.validateTableType(tableTypeStr);
+
+ List<String> tableNamesWithType =
+ ResourceUtils.getExistingTableNamesWithType(_pinotHelixResourceManager, tableName, tableType, LOGGER);
+ String tableNameWithType;
+ if (tableNamesWithType.size() == 1) {
+ tableNameWithType = tableNamesWithType.get(0);
+ } else {
+ tableNameWithType = TableNameBuilder.OFFLINE.tableNameWithType(tableName);
+ }
+ Map<String, Map<String, Object>> segmentToMetadataMap = new HashMap<>();
+ List<SegmentZKMetadata> segmentZKMetadataList =
+ _pinotHelixResourceManager.getSegmentsZKMetadata(tableNameWithType);
+
+ for (SegmentZKMetadata segmentZKMetadata : segmentZKMetadataList) {
+ Map<String, Object> segmentZKMetadataObject = new HashMap<>(segmentZKMetadata.toMap());
Review Comment:
No need to make a shallow copy of the map. The return type is always `Map<String, String>`
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentRestletResource.java:
##########
@@ -901,6 +902,37 @@ public String getServerMetadata(
return segmentsMetadata;
}
+ @GET
+ @Path("segments/{tableName}/zkmetadata")
+ @Produces(MediaType.APPLICATION_JSON)
+ @ApiOperation(value = "Get the zookeeper metadata for all table segments", notes = "Get the zookeeper metadata for "
+ + "all table segments")
+ public Map<String, Map<String, Object>> getZookeeperMetadata(
+ @ApiParam(value = "Name of the table", required = true) @PathParam("tableName") String tableName,
+ @ApiParam(value = "OFFLINE|REALTIME") @QueryParam("type") String tableTypeStr)
+ throws JsonProcessingException {
+ LOGGER.info("Received a request to fetch zookeeper metadata for all segments for table {}", tableName);
+ TableType tableType = Constants.validateTableType(tableTypeStr);
+
+ List<String> tableNamesWithType =
+ ResourceUtils.getExistingTableNamesWithType(_pinotHelixResourceManager, tableName, tableType, LOGGER);
+ String tableNameWithType;
+ if (tableNamesWithType.size() == 1) {
+ tableNameWithType = tableNamesWithType.get(0);
+ } else {
+ tableNameWithType = TableNameBuilder.OFFLINE.tableNameWithType(tableName);
+ }
Review Comment:
This is equivalent to
```suggestion
String tableNameWithType =
ResourceUtils.getExistingTableNamesWithType(_pinotHelixResourceManager, tableName, tableType, LOGGER).get(0);
```
Because when getting the existing table, we always put OFFLINE in front of REALTIME if both exist
--
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
[GitHub] [pinot] Jackie-Jiang merged pull request #10363: Add controller API to fetch all segment zookeeper metadata for a table
Posted by "Jackie-Jiang (via GitHub)" <gi...@apache.org>.
Jackie-Jiang merged PR #10363:
URL: https://github.com/apache/pinot/pull/10363
--
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
[GitHub] [pinot] Jackie-Jiang commented on a diff in pull request #10363: Add controller API to fetch all segment zookeeper metadata for a table
Posted by "Jackie-Jiang (via GitHub)" <gi...@apache.org>.
Jackie-Jiang commented on code in PR #10363:
URL: https://github.com/apache/pinot/pull/10363#discussion_r1122370238
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentRestletResource.java:
##########
@@ -901,6 +903,37 @@ public String getServerMetadata(
return segmentsMetadata;
}
+ @GET
+ @Path("segments/{tableName}/zkmetadata")
+ @Produces(MediaType.APPLICATION_JSON)
+ @ApiOperation(value = "Get the zookeeper metadata for all table segments",
+ notes = "Get the zookeeper metadata for all table segments")
+ public String getZookeeperMetadata(
+ @ApiParam(value = "Name of the table", required = true) @PathParam("tableName") String tableName,
+ @ApiParam(value = "OFFLINE|REALTIME") @QueryParam("type") String tableTypeStr)
+ throws JsonProcessingException {
+ LOGGER.info("Received a request to fetch zookeeper metadata for all segments for table {}", tableName);
+ TableType tableType = Constants.validateTableType(tableTypeStr);
+
+ List<String> tableNamesWithType =
+ ResourceUtils.getExistingTableNamesWithType(_pinotHelixResourceManager, tableName, tableType, LOGGER);
+ Map<String, JsonNode> tableTypeToSegmentMetadata = new HashMap<>();
+ for (String tableNameWithType: tableNamesWithType) {
+ List<String> segments =
+ _pinotHelixResourceManager.getSegmentsFor(tableNameWithType, false);
Review Comment:
You may use `getSegmentsZKMetadata()` to batch read all ZK metadata for a table, which is more efficient
--
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
[GitHub] [pinot] tibrewalpratik17 commented on pull request #10363: Add additional metadata from Zookeeper in all segments metadata response
Posted by "tibrewalpratik17 (via GitHub)" <gi...@apache.org>.
tibrewalpratik17 commented on PR #10363:
URL: https://github.com/apache/pinot/pull/10363#issuecomment-1450797513
Sure sounds good. Let me add a new API instead.
--
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
[GitHub] [pinot] Jackie-Jiang commented on a diff in pull request #10363: Add controller API to fetch all segment zookeeper metadata for a table
Posted by "Jackie-Jiang (via GitHub)" <gi...@apache.org>.
Jackie-Jiang commented on code in PR #10363:
URL: https://github.com/apache/pinot/pull/10363#discussion_r1124948166
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentRestletResource.java:
##########
@@ -901,6 +903,35 @@ public String getServerMetadata(
return segmentsMetadata;
}
+ @GET
+ @Path("segments/{tableName}/zkmetadata")
+ @Produces(MediaType.APPLICATION_JSON)
+ @ApiOperation(value = "Get the zookeeper metadata for all table segments", notes = "Get the zookeeper metadata for "
+ + "all table segments")
+ public String getZookeeperMetadata(
+ @ApiParam(value = "Name of the table", required = true) @PathParam("tableName") String tableName,
+ @ApiParam(value = "OFFLINE|REALTIME") @QueryParam("type") String tableTypeStr)
+ throws JsonProcessingException {
+ LOGGER.info("Received a request to fetch zookeeper metadata for all segments for table {}", tableName);
+ TableType tableType = Constants.validateTableType(tableTypeStr);
+
+ List<String> tableNamesWithType =
+ ResourceUtils.getExistingTableNamesWithType(_pinotHelixResourceManager, tableName, tableType, LOGGER);
+ Map<String, JsonNode> tableTypeToSegmentMetadata = new HashMap<>();
+ for (String tableNameWithType : tableNamesWithType) {
+ List<SegmentZKMetadata> segmentZKMetadataList =
+ _pinotHelixResourceManager.getSegmentsZKMetadata(tableNameWithType);
+ Map<String, JsonNode> segmentToMetadataMap = new HashMap<>();
+ for (SegmentZKMetadata segmentZKMetadata : segmentZKMetadataList) {
+ segmentToMetadataMap.put(segmentZKMetadata.getSegmentName(), JsonUtils.objectToJsonNode(segmentZKMetadata));
Review Comment:
`SegmentZKMetadata` is not designed to be JSON serializable. We can use `toMap() ` extract the values.
```suggestion
segmentToMetadataMap.put(segmentZKMetadata.getSegmentName(), segmentZKMetadata.toMap());
```
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentRestletResource.java:
##########
@@ -901,6 +903,35 @@ public String getServerMetadata(
return segmentsMetadata;
}
+ @GET
+ @Path("segments/{tableName}/zkmetadata")
+ @Produces(MediaType.APPLICATION_JSON)
+ @ApiOperation(value = "Get the zookeeper metadata for all table segments",
+ notes = "Get the zookeeper metadata for all table segments")
+ public String getZookeeperMetadata(
+ @ApiParam(value = "Name of the table", required = true) @PathParam("tableName") String tableName,
+ @ApiParam(value = "OFFLINE|REALTIME") @QueryParam("type") String tableTypeStr)
+ throws JsonProcessingException {
+ LOGGER.info("Received a request to fetch zookeeper metadata for all segments for table {}", tableName);
+ TableType tableType = Constants.validateTableType(tableTypeStr);
+
+ List<String> tableNamesWithType =
+ ResourceUtils.getExistingTableNamesWithType(_pinotHelixResourceManager, tableName, tableType, LOGGER);
+ Map<String, JsonNode> tableTypeToSegmentMetadata = new HashMap<>();
Review Comment:
Seems we have different return type for different API. Since this one is for metadata, maybe keep it the same as server metadata API? Basically only return the metadata for the first table if table type is not provided
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentRestletResource.java:
##########
@@ -901,6 +903,35 @@ public String getServerMetadata(
return segmentsMetadata;
}
+ @GET
+ @Path("segments/{tableName}/zkmetadata")
+ @Produces(MediaType.APPLICATION_JSON)
+ @ApiOperation(value = "Get the zookeeper metadata for all table segments", notes = "Get the zookeeper metadata for "
+ + "all table segments")
+ public String getZookeeperMetadata(
+ @ApiParam(value = "Name of the table", required = true) @PathParam("tableName") String tableName,
+ @ApiParam(value = "OFFLINE|REALTIME") @QueryParam("type") String tableTypeStr)
+ throws JsonProcessingException {
+ LOGGER.info("Received a request to fetch zookeeper metadata for all segments for table {}", tableName);
+ TableType tableType = Constants.validateTableType(tableTypeStr);
+
+ List<String> tableNamesWithType =
+ ResourceUtils.getExistingTableNamesWithType(_pinotHelixResourceManager, tableName, tableType, LOGGER);
+ Map<String, JsonNode> tableTypeToSegmentMetadata = new HashMap<>();
+ for (String tableNameWithType : tableNamesWithType) {
+ List<SegmentZKMetadata> segmentZKMetadataList =
+ _pinotHelixResourceManager.getSegmentsZKMetadata(tableNameWithType);
+ Map<String, JsonNode> segmentToMetadataMap = new HashMap<>();
+ for (SegmentZKMetadata segmentZKMetadata : segmentZKMetadataList) {
+ segmentToMetadataMap.put(segmentZKMetadata.getSegmentName(), JsonUtils.objectToJsonNode(segmentZKMetadata));
+ }
+ tableTypeToSegmentMetadata
+ .put(Objects.requireNonNull(TableNameBuilder.getTableTypeFromTableName(tableNameWithType)).toString(),
+ JsonUtils.objectToJsonNode(segmentToMetadataMap));
+ }
+ return JsonUtils.objectToPrettyString(tableTypeToSegmentMetadata);
Review Comment:
We can directly return `Map<String, Map<String, String>>` here
--
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
[GitHub] [pinot] tibrewalpratik17 commented on a diff in pull request #10363: Add controller API to fetch all segment zookeeper metadata for a table
Posted by "tibrewalpratik17 (via GitHub)" <gi...@apache.org>.
tibrewalpratik17 commented on code in PR #10363:
URL: https://github.com/apache/pinot/pull/10363#discussion_r1125110092
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentRestletResource.java:
##########
@@ -901,6 +903,35 @@ public String getServerMetadata(
return segmentsMetadata;
}
+ @GET
+ @Path("segments/{tableName}/zkmetadata")
+ @Produces(MediaType.APPLICATION_JSON)
+ @ApiOperation(value = "Get the zookeeper metadata for all table segments",
+ notes = "Get the zookeeper metadata for all table segments")
+ public String getZookeeperMetadata(
+ @ApiParam(value = "Name of the table", required = true) @PathParam("tableName") String tableName,
+ @ApiParam(value = "OFFLINE|REALTIME") @QueryParam("type") String tableTypeStr)
+ throws JsonProcessingException {
+ LOGGER.info("Received a request to fetch zookeeper metadata for all segments for table {}", tableName);
+ TableType tableType = Constants.validateTableType(tableTypeStr);
+
+ List<String> tableNamesWithType =
+ ResourceUtils.getExistingTableNamesWithType(_pinotHelixResourceManager, tableName, tableType, LOGGER);
+ Map<String, JsonNode> tableTypeToSegmentMetadata = new HashMap<>();
Review Comment:
Made it to return one table info
--
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
[GitHub] [pinot] tibrewalpratik17 commented on a diff in pull request #10363: Add controller API to fetch all segment zookeeper metadata for a table
Posted by "tibrewalpratik17 (via GitHub)" <gi...@apache.org>.
tibrewalpratik17 commented on code in PR #10363:
URL: https://github.com/apache/pinot/pull/10363#discussion_r1125010440
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentRestletResource.java:
##########
@@ -901,6 +903,35 @@ public String getServerMetadata(
return segmentsMetadata;
}
+ @GET
+ @Path("segments/{tableName}/zkmetadata")
+ @Produces(MediaType.APPLICATION_JSON)
+ @ApiOperation(value = "Get the zookeeper metadata for all table segments",
+ notes = "Get the zookeeper metadata for all table segments")
+ public String getZookeeperMetadata(
+ @ApiParam(value = "Name of the table", required = true) @PathParam("tableName") String tableName,
+ @ApiParam(value = "OFFLINE|REALTIME") @QueryParam("type") String tableTypeStr)
+ throws JsonProcessingException {
+ LOGGER.info("Received a request to fetch zookeeper metadata for all segments for table {}", tableName);
+ TableType tableType = Constants.validateTableType(tableTypeStr);
+
+ List<String> tableNamesWithType =
+ ResourceUtils.getExistingTableNamesWithType(_pinotHelixResourceManager, tableName, tableType, LOGGER);
+ Map<String, JsonNode> tableTypeToSegmentMetadata = new HashMap<>();
Review Comment:
Just confirming if table type is not provided, then we return only OFFLINE table metadata right?
--
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
[GitHub] [pinot] tibrewalpratik17 commented on a diff in pull request #10363: Add controller API to fetch all segment zookeeper metadata for a table
Posted by "tibrewalpratik17 (via GitHub)" <gi...@apache.org>.
tibrewalpratik17 commented on code in PR #10363:
URL: https://github.com/apache/pinot/pull/10363#discussion_r1124310137
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentRestletResource.java:
##########
@@ -901,6 +903,35 @@ public String getServerMetadata(
return segmentsMetadata;
}
+ @GET
+ @Path("segments/{tableName}/zkmetadata")
+ @Produces(MediaType.APPLICATION_JSON)
+ @ApiOperation(value = "Get the zookeeper metadata for all table segments",
+ notes = "Get the zookeeper metadata for all table segments")
+ public String getZookeeperMetadata(
+ @ApiParam(value = "Name of the table", required = true) @PathParam("tableName") String tableName,
+ @ApiParam(value = "OFFLINE|REALTIME") @QueryParam("type") String tableTypeStr)
+ throws JsonProcessingException {
+ LOGGER.info("Received a request to fetch zookeeper metadata for all segments for table {}", tableName);
+ TableType tableType = Constants.validateTableType(tableTypeStr);
+
+ List<String> tableNamesWithType =
+ ResourceUtils.getExistingTableNamesWithType(_pinotHelixResourceManager, tableName, tableType, LOGGER);
+ Map<String, JsonNode> tableTypeToSegmentMetadata = new HashMap<>();
Review Comment:
I tried to keep it in parity with how we return for other requests using OFFLINE and REALTIME as key, e.g. for list of segments. Let me know if we are planning to return `tableNameWithType` instead going forward.
--
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
[GitHub] [pinot] codecov-commenter commented on pull request #10363: Add additional metadata from Zookeeper in all segments metadata response
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #10363:
URL: https://github.com/apache/pinot/pull/10363#issuecomment-1450647944
# [Codecov](https://codecov.io/gh/apache/pinot/pull/10363?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#10363](https://codecov.io/gh/apache/pinot/pull/10363?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (909c21a) into [master](https://codecov.io/gh/apache/pinot/commit/246f4db352b282d576be44348b5652638894e8e4?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (246f4db) will **increase** coverage by `0.04%`.
> The diff coverage is `92.85%`.
```diff
@@ Coverage Diff @@
## master #10363 +/- ##
============================================
+ Coverage 70.26% 70.30% +0.04%
Complexity 5940 5940
============================================
Files 2035 2035
Lines 110228 110241 +13
Branches 16748 16749 +1
============================================
+ Hits 77447 77505 +58
+ Misses 27353 27317 -36
+ Partials 5428 5419 -9
```
| Flag | Coverage Δ | |
|---|---|---|
| integration1 | `24.51% <0.00%> (+0.05%)` | :arrow_up: |
| integration2 | `24.46% <92.85%> (+0.03%)` | :arrow_up: |
| unittests1 | `67.77% <ø> (+0.01%)` | :arrow_up: |
| unittests2 | `13.77% <0.00%> (+0.01%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/pinot/pull/10363?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...che/pinot/controller/util/TableMetadataReader.java](https://codecov.io/gh/apache/pinot/pull/10363?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29udHJvbGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29udHJvbGxlci91dGlsL1RhYmxlTWV0YWRhdGFSZWFkZXIuamF2YQ==) | `70.37% <92.85%> (+6.95%)` | :arrow_up: |
| [...ache/pinot/core/operator/docidsets/OrDocIdSet.java](https://codecov.io/gh/apache/pinot/pull/10363?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9vcGVyYXRvci9kb2NpZHNldHMvT3JEb2NJZFNldC5qYXZh) | `86.36% <0.00%> (-11.37%)` | :arrow_down: |
| [...transform/function/IsNotNullTransformFunction.java](https://codecov.io/gh/apache/pinot/pull/10363?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9vcGVyYXRvci90cmFuc2Zvcm0vZnVuY3Rpb24vSXNOb3ROdWxsVHJhbnNmb3JtRnVuY3Rpb24uamF2YQ==) | `65.51% <0.00%> (-6.90%)` | :arrow_down: |
| [...ct/raw/RawIntSingleColumnDistinctOnlyExecutor.java](https://codecov.io/gh/apache/pinot/pull/10363?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9xdWVyeS9kaXN0aW5jdC9yYXcvUmF3SW50U2luZ2xlQ29sdW1uRGlzdGluY3RPbmx5RXhlY3V0b3IuamF2YQ==) | `81.48% <0.00%> (-3.71%)` | :arrow_down: |
| [...ot/query/runtime/executor/RoundRobinScheduler.java](https://codecov.io/gh/apache/pinot/pull/10363?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtcXVlcnktcnVudGltZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvcXVlcnkvcnVudGltZS9leGVjdXRvci9Sb3VuZFJvYmluU2NoZWR1bGVyLmphdmE=) | `86.90% <0.00%> (-3.58%)` | :arrow_down: |
| [...lter/predicate/NotInPredicateEvaluatorFactory.java](https://codecov.io/gh/apache/pinot/pull/10363?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9vcGVyYXRvci9maWx0ZXIvcHJlZGljYXRlL05vdEluUHJlZGljYXRlRXZhbHVhdG9yRmFjdG9yeS5qYXZh) | `73.94% <0.00%> (-3.53%)` | :arrow_down: |
| [...nction/DistinctCountBitmapAggregationFunction.java](https://codecov.io/gh/apache/pinot/pull/10363?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9xdWVyeS9hZ2dyZWdhdGlvbi9mdW5jdGlvbi9EaXN0aW5jdENvdW50Qml0bWFwQWdncmVnYXRpb25GdW5jdGlvbi5qYXZh) | `47.15% <0.00%> (-2.08%)` | :arrow_down: |
| [.../predicate/NotEqualsPredicateEvaluatorFactory.java](https://codecov.io/gh/apache/pinot/pull/10363?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9vcGVyYXRvci9maWx0ZXIvcHJlZGljYXRlL05vdEVxdWFsc1ByZWRpY2F0ZUV2YWx1YXRvckZhY3RvcnkuamF2YQ==) | `66.07% <0.00%> (-0.90%)` | :arrow_down: |
| [...core/startree/operator/StarTreeFilterOperator.java](https://codecov.io/gh/apache/pinot/pull/10363?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9zdGFydHJlZS9vcGVyYXRvci9TdGFyVHJlZUZpbHRlck9wZXJhdG9yLmphdmE=) | `87.50% <0.00%> (-0.66%)` | :arrow_down: |
| [...ache/pinot/common/metadata/ZKMetadataProvider.java](https://codecov.io/gh/apache/pinot/pull/10363?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vbWV0YWRhdGEvWktNZXRhZGF0YVByb3ZpZGVyLmphdmE=) | `67.53% <0.00%> (-0.53%)` | :arrow_down: |
| ... and [21 more](https://codecov.io/gh/apache/pinot/pull/10363?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
--
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
[GitHub] [pinot] tibrewalpratik17 commented on a diff in pull request #10363: Add controller API to fetch all segment zookeeper metadata for a table
Posted by "tibrewalpratik17 (via GitHub)" <gi...@apache.org>.
tibrewalpratik17 commented on code in PR #10363:
URL: https://github.com/apache/pinot/pull/10363#discussion_r1125110575
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentRestletResource.java:
##########
@@ -901,6 +903,35 @@ public String getServerMetadata(
return segmentsMetadata;
}
+ @GET
+ @Path("segments/{tableName}/zkmetadata")
+ @Produces(MediaType.APPLICATION_JSON)
+ @ApiOperation(value = "Get the zookeeper metadata for all table segments", notes = "Get the zookeeper metadata for "
+ + "all table segments")
+ public String getZookeeperMetadata(
+ @ApiParam(value = "Name of the table", required = true) @PathParam("tableName") String tableName,
+ @ApiParam(value = "OFFLINE|REALTIME") @QueryParam("type") String tableTypeStr)
+ throws JsonProcessingException {
+ LOGGER.info("Received a request to fetch zookeeper metadata for all segments for table {}", tableName);
+ TableType tableType = Constants.validateTableType(tableTypeStr);
+
+ List<String> tableNamesWithType =
+ ResourceUtils.getExistingTableNamesWithType(_pinotHelixResourceManager, tableName, tableType, LOGGER);
+ Map<String, JsonNode> tableTypeToSegmentMetadata = new HashMap<>();
+ for (String tableNameWithType : tableNamesWithType) {
+ List<SegmentZKMetadata> segmentZKMetadataList =
+ _pinotHelixResourceManager.getSegmentsZKMetadata(tableNameWithType);
+ Map<String, JsonNode> segmentToMetadataMap = new HashMap<>();
+ for (SegmentZKMetadata segmentZKMetadata : segmentZKMetadataList) {
+ segmentToMetadataMap.put(segmentZKMetadata.getSegmentName(), JsonUtils.objectToJsonNode(segmentZKMetadata));
+ }
+ tableTypeToSegmentMetadata
+ .put(Objects.requireNonNull(TableNameBuilder.getTableTypeFromTableName(tableNameWithType)).toString(),
+ JsonUtils.objectToJsonNode(segmentToMetadataMap));
+ }
+ return JsonUtils.objectToPrettyString(tableTypeToSegmentMetadata);
Review Comment:
Returning Map<String, Map<String, Object>> similar to what we return for server Metadata
--
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
[GitHub] [pinot] Jackie-Jiang commented on a diff in pull request #10363: Add controller API to fetch all segment zookeeper metadata for a table
Posted by "Jackie-Jiang (via GitHub)" <gi...@apache.org>.
Jackie-Jiang commented on code in PR #10363:
URL: https://github.com/apache/pinot/pull/10363#discussion_r1123936184
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentRestletResource.java:
##########
@@ -901,6 +903,35 @@ public String getServerMetadata(
return segmentsMetadata;
}
+ @GET
+ @Path("segments/{tableName}/zkmetadata")
+ @Produces(MediaType.APPLICATION_JSON)
+ @ApiOperation(value = "Get the zookeeper metadata for all table segments",
+ notes = "Get the zookeeper metadata for all table segments")
+ public String getZookeeperMetadata(
+ @ApiParam(value = "Name of the table", required = true) @PathParam("tableName") String tableName,
+ @ApiParam(value = "OFFLINE|REALTIME") @QueryParam("type") String tableTypeStr)
+ throws JsonProcessingException {
+ LOGGER.info("Received a request to fetch zookeeper metadata for all segments for table {}", tableName);
+ TableType tableType = Constants.validateTableType(tableTypeStr);
+
+ List<String> tableNamesWithType =
+ ResourceUtils.getExistingTableNamesWithType(_pinotHelixResourceManager, tableName, tableType, LOGGER);
+ Map<String, JsonNode> tableTypeToSegmentMetadata = new HashMap<>();
Review Comment:
Suggest putting the table name as the key, or just allow querying a single table (same as server metadata)
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentRestletResource.java:
##########
@@ -901,6 +903,35 @@ public String getServerMetadata(
return segmentsMetadata;
}
+ @GET
+ @Path("segments/{tableName}/zkmetadata")
+ @Produces(MediaType.APPLICATION_JSON)
+ @ApiOperation(value = "Get the zookeeper metadata for all table segments",
+ notes = "Get the zookeeper metadata for all table segments")
+ public String getZookeeperMetadata(
+ @ApiParam(value = "Name of the table", required = true) @PathParam("tableName") String tableName,
Review Comment:
Please apply the [Pinot Style](https://docs.pinot.apache.org/developers/developers-and-contributors/code-setup#setup-ide) and reformat the changes
--
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