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


##########
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;
+            }
+            return boundaryType == BoundaryType.UPPER ? 
fileSegmentList.get(fileSegmentList.size() - 1) : fileSegmentList.get(0);

Review Comment:
   为什么非上界的时候取第一个文件呢



##########
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;
+            }
+            return boundaryType == BoundaryType.UPPER ? 
fileSegmentList.get(fileSegmentList.size() - 1) : fileSegmentList.get(0);

Review Comment:
   为什么非上界的时候取第一个文件呢



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