[ https://issues.apache.org/jira/browse/HBASE-16783?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15568685#comment-15568685 ]
ramkrishna.s.vasudevan commented on HBASE-16783: ------------------------------------------------ Everything said above can be donenow but am stuck in one place that {code} byte[] b = new byte[headerSerializedSize + headerVintSize + resultSerializedSize + resultVintSize + Bytes.SIZEOF_INT]; {code} Now here we could know all the other sizes except 'headerSerializedSize '. The only problem is that 'headerSerializedSize' is the value that is found after cellBlockMeta size is added. This could range anywhere between 4 and 8. So this is where am not sure how to limit the headerBuffer to this size. If we always allocate 8 bytes for the headerSerializedSize then it could be problem. (it takes 8 bytes when we have cellblockMeta size == Integer.max_value. Not possible practically but still we need to support? Or am i missing something?). > Use ByteBufferPool for the header and message during Rpc response > ----------------------------------------------------------------- > > Key: HBASE-16783 > URL: https://issues.apache.org/jira/browse/HBASE-16783 > Project: HBase > Issue Type: Improvement > Reporter: ramkrishna.s.vasudevan > Assignee: ramkrishna.s.vasudevan > Priority: Minor > Attachments: HBASE-16783.patch, HBASE-16783_1.patch > > > With ByteBufferPool in place we could avoid the byte[] creation in > RpcServer#createHeaderAndMessageBytes and try using the Buffer from the pool > rather than creating byte[] every time. -- This message was sent by Atlassian JIRA (v6.3.4#6332)