Skip to content

Commit

Permalink
init: Initialization preparations
Browse files Browse the repository at this point in the history
  • Loading branch information
wanghuaiyuan committed Jan 13, 2025
1 parent b22866b commit 09d2315
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public CompletableFuture<ByteBuffer> readAsync(long offset, int length) {

if (index < 0) {
log.error("FlatAppendFile#readAsync offset={} is lower than minimum offset:{}", offset, fileSegmentList.get(0).getBaseOffset());
return CompletableFuture.completedFuture(null);
throw new IndexOutOfBoundsException("offset is lower than minimum offset");
}

FileSegment fileSegment1 = fileSegmentList.get(index);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ public CompletableFuture<Long> getMinOffsetFromFileAsync() {
.thenApply(buffer -> {
firstOffset.set(MessageFormatUtil.getQueueOffset(buffer));
return firstOffset.get();
}).exceptionally(e -> {
log.error("Get min offset from file failed, filePath={}", filePath, e);
return GET_OFFSET_ERROR;
});
}

Expand Down

0 comments on commit 09d2315

Please sign in to comment.