You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2019/08/13 07:27:14 UTC

[GitHub] [hbase] openinx commented on a change in pull request #479: HBASE-22802 Avoid temp ByteBuffer allocation in FileIOEngine#read

openinx commented on a change in pull request #479: HBASE-22802 Avoid temp ByteBuffer allocation in FileIOEngine#read
URL: https://github.com/apache/hbase/pull/479#discussion_r313250391
 
 

 ##########
 File path: hbase-common/src/main/java/org/apache/hadoop/hbase/nio/ByteBuff.java
 ##########
 @@ -450,10 +451,37 @@ public boolean release() {
    */
   public abstract int read(ReadableByteChannel channel) throws IOException;
 
+  /**
+   * Reads bytes from FileChannel into this ByteBuff
+   */
+  public abstract int read(FileChannel channel, long offset) throws IOException;
+
+  /**
+   * Write this ByteBuff's data into target file
+   */
+  public abstract int write(FileChannel channel, long offset) throws IOException;
+
+  /**
+   * function interface for Channel read
+   */
+  @FunctionalInterface
+  interface ChannelReader {
+    int read(ReadableByteChannel channel, ByteBuffer buf, long offset) throws IOException;
 
 Review comment:
   The ReadableByteChannel channel  cannot accept the argument with offset position ?  Looks strange here we provide a offset argument...

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services