Jackie-Jiang commented on a change in pull request #6567: URL: https://github.com/apache/incubator-pinot/pull/6567#discussion_r573404392
########## File path: pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentUploadDownloadRestletResource.java ########## @@ -245,21 +245,28 @@ private SuccessResponse uploadSegment(@Nullable String tableName, FormDataMultiP LOGGER.info("Uploading a segment {} to table: {}, push type {}, (Derived from segment metadata)", segmentName, tableName, uploadType); } - String offlineTableName = TableNameBuilder.OFFLINE.tableNameWithType(rawTableName); + String tableNameWithType; Review comment: The `tableName` passed in might be with type suffix. If it already has type embedded, directly use that type. ########## File path: pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentUploadDownloadRestletResource.java ########## @@ -245,21 +245,28 @@ private SuccessResponse uploadSegment(@Nullable String tableName, FormDataMultiP LOGGER.info("Uploading a segment {} to table: {}, push type {}, (Derived from segment metadata)", segmentName, tableName, uploadType); } - String offlineTableName = TableNameBuilder.OFFLINE.tableNameWithType(rawTableName); + String tableNameWithType; Review comment: Since we are going to allow uploading segments to both offline and real-time tables, we should use `tableNameWithType` in methods such as `completeZkOperations` etc to avoid identifying the table type again ########## File path: pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java ########## @@ -1649,63 +1649,81 @@ public void addNewSegment(String tableName, SegmentMetadata segmentMetadata, Str public void addNewSegment(String tableName, SegmentMetadata segmentMetadata, String downloadUrl, @Nullable String crypter) { String segmentName = segmentMetadata.getName(); - String offlineTableName = TableNameBuilder.OFFLINE.tableNameWithType(tableName); - + String tableNameWithType; + InstancePartitionsType instancePartitionsType; // NOTE: must first set the segment ZK metadata before assigning segment to instances because segment assignment // might need them to determine the partition of the segment, and server will need them to download the segment OfflineSegmentZKMetadata offlineSegmentZKMetadata = new OfflineSegmentZKMetadata(); ZKMetadataUtils.updateSegmentMetadata(offlineSegmentZKMetadata, segmentMetadata); offlineSegmentZKMetadata.setDownloadUrl(downloadUrl); offlineSegmentZKMetadata.setCrypterName(crypter); offlineSegmentZKMetadata.setPushTime(System.currentTimeMillis()); + + if (isRealtimeOnlyTable(tableName)) { + tableNameWithType = TableNameBuilder.REALTIME.tableNameWithType(tableName); + instancePartitionsType = InstancePartitionsType.CONSUMING; Review comment: This should be COMPLETED ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org