fuyou001 commented on code in PR #6229:
URL: https://github.com/apache/rocketmq/pull/6229#discussion_r1137990309
##########
store/src/main/java/org/apache/rocketmq/store/MappedFileQueue.java:
##########
@@ -380,39 +383,31 @@ public int deleteExpiredFileByTime(final long expiredTime,
int mfsLength = mfs.length - 1;
int deleteCount = 0;
List<MappedFile> files = new ArrayList<>();
- int skipFileNum = 0;
- if (null != mfs) {
- //do check before deleting
- checkSelf();
- for (int i = 0; i < mfsLength; i++) {
- MappedFile mappedFile = (MappedFile) mfs[i];
- long liveMaxTimestamp = mappedFile.getLastModifiedTimestamp()
+ expiredTime;
- if (System.currentTimeMillis() >= liveMaxTimestamp ||
cleanImmediately) {
- if (skipFileNum > 0) {
- log.info("Delete CommitLog {} but skip {} files",
mappedFile.getFileName(), skipFileNum);
- }
- if (mappedFile.destroy(intervalForcibly)) {
- files.add(mappedFile);
- deleteCount++;
- if (files.size() >= deleteFileBatchMax) {
- break;
- }
+ for (int i = 0; i < mfsLength; i++) {
+ MappedFile mappedFile = (MappedFile) mfs[i];
+ long liveMaxTimestamp = mappedFile.getLastModifiedTimestamp() +
expiredTime;
+ if (System.currentTimeMillis() >= liveMaxTimestamp ||
cleanImmediately) {
+ if (mappedFile.destroy(intervalForcibly)) {
+ files.add(mappedFile);
Review Comment:
files rename deleteFiles?
--
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]