From f8a68ef19e8f8cdba0bcf99c501b79db44f4c57d Mon Sep 17 00:00:00 2001 From: horizonzy Date: Thu, 10 Aug 2023 10:59:31 +0800 Subject: [PATCH] Address the comments. --- .../java/org/apache/bookkeeper/bookie/BufferedChannel.java | 2 +- .../org/apache/bookkeeper/bookie/BufferedReadChannel.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BufferedChannel.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BufferedChannel.java index 99bc1bf9bb6..3197165827a 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BufferedChannel.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BufferedChannel.java @@ -86,7 +86,7 @@ public BufferedChannel(ByteBufAllocator allocator, FileChannel fc, int capacity, public BufferedChannel(ByteBufAllocator allocator, FileChannel fc, int writeCapacity, int readCapacity, long unpersistedBytesBound) throws IOException { - super(fc, readCapacity, false); + super(fc, readCapacity); this.writeCapacity = writeCapacity; this.position = fc.position(); this.writeBufferStartPosition.set(position); diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BufferedReadChannel.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BufferedReadChannel.java index 94d5101821c..d6b4d7ea65a 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BufferedReadChannel.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BufferedReadChannel.java @@ -46,6 +46,10 @@ public class BufferedReadChannel extends BufferedChannelBase { private long fileSize = -1; private final boolean sealed; + public BufferedReadChannel(FileChannel fileChannel, int readCapacity) { + this(fileChannel, readCapacity, false); + } + public BufferedReadChannel(FileChannel fileChannel, int readCapacity, boolean sealed) { super(fileChannel); this.sealed = sealed;