lhotari commented on code in PR #4038:
URL: https://github.com/apache/bookkeeper/pull/4038#discussion_r1478279917
##########
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) {
+ fileSize = validateAndGetFileChannel().size();
+ }
+ return fileSize;
+ } else {
+ return validateAndGetFileChannel().size();
+ }
+ }
Review Comment:
I was referring to
https://github.com/apache/bookkeeper/blob/22097343ceed1312964ad077cdcd9fbd7e3e026b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BufferedChannel.java#L49-L52
in BufferedChannel class. In the case that the instance is a BufferedChannel
class, perhaps it could use that information?
Is the challenge in that case that the same file could have a
BufferedReadChannel instance and a BufferedChannel instance at the same 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]