merlimat commented on code in PR #4038:
URL: https://github.com/apache/bookkeeper/pull/4038#discussion_r1485622225
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BufferedReadChannel.java:
##########
@@ -64,10 +71,22 @@ public int read(ByteBuf dest, long pos) throws IOException {
return read(dest, pos, dest.writableBytes());
}
+ @Override
+ public long size() throws IOException {
+ if (sealed) {
+ if (fileSize == -1) {
Review Comment:
nit: if the file is already "sealed", should we read the size in the
constructor? This way we wouldn't have any concurrency issues here if 2 threads
call `size()` at the size time.
--
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]