[ 
https://issues.apache.org/jira/browse/HBASE-21917?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16775177#comment-16775177
 ] 

Anoop Sam John commented on HBASE-21917:
----------------------------------------

bq.so we may need to copy few bytes from ByteBuff (NOT nio.ByteBuffer) each 
time to update the checksum
Well one thing which can help here.  See ByteBuff#asSubByteBuffer(int offset, 
int length, ObjectIntPair<ByteBuffer> pair).
This API will convert a ByteBuff into an NIO BB.  When it is an MBB, and we 
need one NIO BB from it from offset to len, it can so happen that this region 
of bytes in a single BB.  If so this API will not do any copy but directly give 
that individual BB.  Only when the region crosses 2 BB, we will end up in 
copying.   In BC we have 4 MB sized BBs and what we need as part of HFile block 
is 64 KB, the chances that this across BBs block may not be that big!  
Will see the patch now

> Make the HFileBlock#validateChecksum can accept ByteBuff as an input.
> ---------------------------------------------------------------------
>
>                 Key: HBASE-21917
>                 URL: https://issues.apache.org/jira/browse/HBASE-21917
>             Project: HBase
>          Issue Type: Sub-task
>            Reporter: Zheng Hu
>            Assignee: Zheng Hu
>            Priority: Major
>         Attachments: HBASE-21917.v1.patch, HBASE-21917.v2.patch, 
> HBASE-21917.v3.patch, HBASE-21917.v4.patch
>
>
> I've tried to make a patch for HBASE-21879, most of work seems to be fine, 
> but the trouble is: 
> HFileBlock#validateChecksum can only accept ByteBuffer as its input, while 
> after the HBASE-21916, we will use an ourself-defined ByteBuff (which can be 
> SingleByteBuff or MultiByteBuff). 
> Now, need to create our own ByteBuff checksum validation method, should not 
> be so hard but an separate issue will be more clearer.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to