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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to