[
https://issues.apache.org/jira/browse/HBASE-4027?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13067598#comment-13067598
]
Ted Yu commented on HBASE-4027:
-------------------------------
onHeapCache should be used in getBlock():
{code}
+ /* if ((cachedBlock = onHeapCache.getBlock(blockName, caching)) != null) {
+ return cachedBlock;
+ } else */ if ((cachedBlock = offHeapCache.getBlock(blockName, caching)) !=
null) {
+ // onHeapCache.cacheBlock(blockName, cachedBlock);
{code}
Otherwise onHeapCache.cacheBlock() should be commented out in:
{code}
+ public void cacheBlock(String blockName, ByteBuffer buf, boolean inMemory) {
+ onHeapCache.cacheBlock(blockName, buf, inMemory);
+ offHeapCache.cacheBlock(blockName, buf);
+ }
{code}
> Enable direct byte buffers LruBlockCache
> ----------------------------------------
>
> Key: HBASE-4027
> URL: https://issues.apache.org/jira/browse/HBASE-4027
> Project: HBase
> Issue Type: Improvement
> Reporter: Jason Rutherglen
> Assignee: Li Pi
> Priority: Minor
> Attachments: slabcachepatch.diff
>
>
> Java offers the creation of direct byte buffers which are allocated outside
> of the heap.
> They need to be manually free'd, which can be accomplished using an
> documented {{clean}} method.
> The feature will be optional. After implementing, we can benchmark for
> differences in speed and garbage collection observances.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira