You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by yo...@apache.org on 2022/08/02 06:26:09 UTC
[bookkeeper] 16/22: Make BookieFileChannel interface public (#3396)
This is an automated email from the ASF dual-hosted git repository.
yong pushed a commit to branch branch-4.15
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
commit 4c1538a06aa3114d786e39dcc1825fc35838e635
Author: Hang Chen <ch...@apache.org>
AuthorDate: Wed Jul 13 22:39:13 2022 +0800
Make BookieFileChannel interface public (#3396)
### Motivation
The `BookieFileChannel` is package public, and can't be implemented out of the `org.apache.bookkeeper.bookie` package.
We should make it public
### Modification
Make `BookieFileChannel` and `DefaultFileChannel` public
(cherry picked from commit 07e79408240c564fe05e36eaee119bf89b26ce90)
---
.../main/java/org/apache/bookkeeper/bookie/BookieFileChannel.java | 2 +-
.../main/java/org/apache/bookkeeper/bookie/DefaultFileChannel.java | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieFileChannel.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieFileChannel.java
index 6ab77bb88d..8bcde418dc 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieFileChannel.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieFileChannel.java
@@ -28,7 +28,7 @@ import java.nio.channels.FileChannel;
* A FileChannel for the JournalChannel read and write, we can use this interface to extend the FileChannel
* which we use in the JournalChannel.
*/
-interface BookieFileChannel {
+public interface BookieFileChannel {
/**
* An interface for get the FileChannel from the provider.
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/DefaultFileChannel.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/DefaultFileChannel.java
index 2829685d6f..3c581b489b 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/DefaultFileChannel.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/DefaultFileChannel.java
@@ -29,7 +29,11 @@ import java.io.RandomAccessFile;
import java.nio.channels.FileChannel;
import org.apache.bookkeeper.conf.ServerConfiguration;
-class DefaultFileChannel implements BookieFileChannel {
+/**
+ * Default FileChannel for bookie to read and write.
+ *
+ */
+public class DefaultFileChannel implements BookieFileChannel {
private final File file;
private RandomAccessFile randomAccessFile;
private final ServerConfiguration configuration;