yuz10 commented on code in PR #7346:
URL: https://github.com/apache/rocketmq/pull/7346#discussion_r1322278818
##########
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:
LOWER的时候,过滤条件为<=timestamp,过滤后为空说明所有segment都大于timestamp,所以取第一个segment
##########
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:
LOWER的时候,过滤条件为<=timestamp,过滤后为空说明所有segment都大于timestamp,所以取第一个segment
--
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]