You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/02/07 19:09:32 UTC

[GitHub] [pinot] Jackie-Jiang commented on a change in pull request #8128: Improve segment metadata fetch API

Jackie-Jiang commented on a change in pull request #8128:
URL: https://github.com/apache/pinot/pull/8128#discussion_r800973010



##########
File path: pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentRestletResource.java
##########
@@ -290,9 +290,23 @@
       @ApiParam(value = "Name of the table", required = true) @PathParam("tableName") String tableName,
       @ApiParam(value = "Name of the segment", required = true) @PathParam("segmentName") @Encoded String segmentName) {
     segmentName = URIUtils.decode(segmentName);
-    TableType tableType = SegmentName.isRealtimeSegmentName(segmentName) ? TableType.REALTIME : TableType.OFFLINE;
-    String tableNameWithType =
-        ResourceUtils.getExistingTableNamesWithType(_pinotHelixResourceManager, tableName, tableType, LOGGER).get(0);
+    String tableNameWithType = tableName;

Review comment:
       What I meant is to directly try reading the metadata without checking the table existence
   ```
       Map<String, String> segmentMetadata = null;
       if (TableNameBuilder.getTableTypeFromTableName(tableName) != null) {
         segmentMetadata = getSegmentMetadataInternal(tableName, segmentName);
       } else {
         segmentMetadata = getSegmentMetadataInternal(TableNameBuilder.OFFLINE.tableNameWithType(tableName), segmentName);
         if (segmentMetadata == null) {
           segmentMetadata = getSegmentMetadataInternal(TableNameBuilder.REALTIME.tableNameWithType(tableName), segmentName);
         }
       }
       if (segmentMetadata != null) {
         ...
   ```




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