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 2021/06/29 07:42:51 UTC
[GitHub] [hbase] jojochuang commented on a change in pull request #3434: HBASE-21946 Use ByteBuffer pread instead of byte[] pread in HFileBlock when applicable
jojochuang commented on a change in pull request #3434:
URL: https://github.com/apache/hbase/pull/3434#discussion_r660361583
##########
File path: hbase-common/src/main/java/org/apache/hadoop/hbase/io/util/BlockIOUtils.java
##########
@@ -207,6 +234,17 @@ public static boolean readWithExtra(ByteBuff buf, FSDataInputStream dis, int nec
*/
public static boolean preadWithExtra(ByteBuff buff, FSDataInputStream dis, long position,
int necessaryLen, int extraLen) throws IOException {
+ boolean preadbytebuffer = dis.hasCapability("in:preadbytebuffer");
Review comment:
I suppose the overhead is relatively low. I had thought about moving to where the input stream is created, but it would require pretty extensive refactoring.
Internally, hasCapability() uses switch statement to compare the capability string and it should be quite efficient.
I can explore this suggestion later.
--
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: issues-unsubscribe@hbase.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org