yuz10 commented on code in PR #7346:
URL: https://github.com/apache/rocketmq/pull/7346#discussion_r1322887785
##########
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:
这里应该是排序好了的,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:
这里应该是排序好了的,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]