提交 6208b9cb 编写于 作者: P peng-yongsheng

Change the file name.

上级 60f94213
......@@ -90,14 +90,14 @@ public enum OffsetManager {
String offsetRecord = offset.serialize();
if (!lastOffsetRecord.equals(offsetRecord)) {
if (offsetFile.length() >= BufferFileConfig.BUFFER_OFFSET_MAX_FILE_SIZE) {
exchangeFile();
nextFile();
}
FileUtils.INSTANCE.writeAppendToLast(offsetFile, randomAccessFile, offsetRecord);
lastOffsetRecord = offsetRecord;
}
}
private void exchangeFile() {
private void nextFile() {
String timeBucket = String.valueOf(TimeBucketUtils.INSTANCE.getSecondTimeBucket(System.currentTimeMillis()));
String offsetFileName = OFFSET_FILE_PREFIX + "_" + timeBucket + "." + Const.FILE_SUFFIX;
File newOffsetFile = new File(SegmentBufferConfig.BUFFER_PATH + offsetFileName);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册