Jackie-Jiang commented on a change in pull request #6239: URL: https://github.com/apache/incubator-pinot/pull/6239#discussion_r520825806
########## File path: pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/minion/generator/RealtimeToOfflineSegmentsTaskGenerator.java ########## @@ -287,21 +284,14 @@ private long getWatermarkMs(String realtimeTableName, List<LLCRealtimeSegmentZKM long watermarkMs; // Find the smallest time from all segments - RealtimeSegmentZKMetadata minSegmentZkMetadata = null; + long minStartTimeMs = Long.MAX_VALUE; for (LLCRealtimeSegmentZKMetadata realtimeSegmentZKMetadata : completedSegmentsMetadata) { - if (minSegmentZkMetadata == null || realtimeSegmentZKMetadata.getStartTime() < minSegmentZkMetadata - .getStartTime()) { - minSegmentZkMetadata = realtimeSegmentZKMetadata; - } + minStartTimeMs = Math.min(minStartTimeMs, realtimeSegmentZKMetadata.getStartTimeMs()); } Review comment: It's not really possible with the current code, but added it in case the code changes in the future ---------------------------------------------------------------- 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