joeCarf commented on code in PR #7346:
URL: https://github.com/apache/rocketmq/pull/7346#discussion_r1322311917


##########
tieredstore/src/main/java/org/apache/rocketmq/tieredstore/file/TieredFlatFile.java:
##########
@@ -365,7 +365,10 @@ protected TieredFileSegment getFileByTime(long timestamp, 
BoundaryType boundaryT
             if (!segmentList.isEmpty()) {
                 return boundaryType == BoundaryType.UPPER ? segmentList.get(0) 
: segmentList.get(segmentList.size() - 1);
             }
-            return fileSegmentList.isEmpty() ? null : 
fileSegmentList.get(fileSegmentList.size() - 1);
+            if (fileSegmentList.isEmpty()) {
+                return null;
+            }

Review Comment:
   `fileSegmentList`并非排序过滤后的,`segmentList`才是



##########
tieredstore/src/main/java/org/apache/rocketmq/tieredstore/file/TieredFlatFile.java:
##########
@@ -365,7 +365,10 @@ protected TieredFileSegment getFileByTime(long timestamp, 
BoundaryType boundaryT
             if (!segmentList.isEmpty()) {
                 return boundaryType == BoundaryType.UPPER ? segmentList.get(0) 
: segmentList.get(segmentList.size() - 1);
             }
-            return fileSegmentList.isEmpty() ? null : 
fileSegmentList.get(fileSegmentList.size() - 1);
+            if (fileSegmentList.isEmpty()) {
+                return null;
+            }

Review Comment:
   `fileSegmentList`并非排序过滤后的,`segmentList`才是



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to