lnbest0707-uber commented on code in PR #15957: URL: https://github.com/apache/pinot/pull/15957#discussion_r2117062421
########## pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/realtime/PinotLLCRealtimeSegmentManager.java: ########## @@ -276,20 +276,47 @@ public List<PartitionGroupConsumptionStatus> getPartitionGroupConsumptionStatusL } // Create a {@link PartitionGroupConsumptionStatus} for each latest segment - StreamPartitionMsgOffsetFactory offsetFactory = - StreamConsumerFactoryProvider.create(streamConfigs.get(0)).createStreamMsgOffsetFactory(); - for (Map.Entry<Integer, LLCSegmentName> entry : partitionGroupIdToLatestSegment.entrySet()) { - int partitionGroupId = entry.getKey(); - LLCSegmentName llcSegmentName = entry.getValue(); - SegmentZKMetadata segmentZKMetadata = - getSegmentZKMetadata(streamConfigs.get(0).getTableNameWithType(), llcSegmentName.getSegmentName()); - PartitionGroupConsumptionStatus partitionGroupConsumptionStatus = - new PartitionGroupConsumptionStatus(partitionGroupId, llcSegmentName.getSequenceNumber(), - offsetFactory.create(segmentZKMetadata.getStartOffset()), - segmentZKMetadata.getEndOffset() == null ? null : offsetFactory.create(segmentZKMetadata.getEndOffset()), - segmentZKMetadata.getStatus().toString()); - partitionGroupConsumptionStatusList.add(partitionGroupConsumptionStatus); + String tableNameWithType = streamConfigs.get(0).getTableNameWithType(); + int numStreams = streamConfigs.size(); + if (numStreams == 1) { Review Comment: Looks like the multi-streams section logic is fully compatible with this single stream. We could potentially merge it? ########## pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/RealtimeSegmentDataManager.java: ########## @@ -1620,9 +1620,20 @@ public RealtimeSegmentDataManager(SegmentZKMetadata segmentZKMetadata, TableConf // TODO Validate configs IndexingConfig indexingConfig = _tableConfig.getIndexingConfig(); _partitionGroupId = llcSegmentName.getPartitionGroupId(); - _streamPatitionGroupId = IngestionConfigUtils.getStreamPartitionIdFromPinotPartitionId(_partitionGroupId); - _streamConfig = new StreamConfig(_tableNameWithType, IngestionConfigUtils.getStreamConfigMaps(_tableConfig) - .get(IngestionConfigUtils.getStreamConfigIndexFromPinotPartitionId(_partitionGroupId))); + List<Map<String, String>> streamConfigMaps = IngestionConfigUtils.getStreamConfigMaps(_tableConfig); + int numStreams = streamConfigMaps.size(); + if (numStreams == 1) { + // Single stream Review Comment: Same here, why do we extract the `numStreams == 1` case -- 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-unsubscr...@pinot.apache.org 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