[
https://issues.apache.org/jira/browse/HBASE-22802?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16901699#comment-16901699
]
chenxu commented on HBASE-22802:
--------------------------------
{quote}Says we must consider the two issues for FileIOEngine : release the BB
from ByteBuffAllocator & when we can do the block eviction
{quote}
1. release the BB from ByteBuffAllocator
as Anoop mentioned, I think the BB’s release flow is already in place, At
least at the RPC level
2. when we can do the block eviction
in case of ByteBufferIOEngine, block eviction happened when the following
conditions are satisfied(may be not right, please correct me)
(1) block evicted from backingMap (BucketEntry#markAsEvicted called)
(2) no rpc reference to the shared memory(ByteBuff)
in case of FileIOEngine, the BB allocated from ByteBuffAllocator is not a
shared memory anymore, So we just need to satisfy condition 1.
> Avoid temp ByteBuffer allocation in FileIOEngine#read
> -----------------------------------------------------
>
> Key: HBASE-22802
> URL: https://issues.apache.org/jira/browse/HBASE-22802
> Project: HBase
> Issue Type: Improvement
> Components: BucketCache
> Reporter: chenxu
> Priority: Major
> Attachments: profile_mem_alloc.png
>
>
> a temp ByteBuffer was allocated each time FileIOEngine#read was called
> {code:java}
> public Cacheable read(BucketEntry be) throws IOException {
> long offset = be.offset();
> int length = be.getLength();
> Preconditions.checkArgument(length >= 0, "Length of read can not be less
> than 0.");
> ByteBuffer dstBuffer = ByteBuffer.allocate(length);
> ...
> }
> {code}
> we can avoid this by use of ByteBuffAllocator#allocate(length) after
> HBASE-21879
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)