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

stack commented on HBASE-12295:
-------------------------------

I had a nice chat with [~mbertozzi] on how to figure when we can let go of 
offheap bucketcache blocks.

Would the following work?

Add a {{done}} or {{release}} method on serverside Cells. It is called when the 
Cell has been used up; i.e. the Cell has been dumped out on the RPC. It is a 
noop unless Cell is an instance of RefCountedDBBBackedCell. In this case, we 
decrement our refcounter.  How we get to our refcounter you say? Well, a 
RefCountedDBBBackedCell is backed by a byte array. Let the refcounter be at 
location zero in the backing byte array (In the BucketCache case, this would be 
offset zero in a bucket I believe -- haven't checked). Changing refcount would 
have to be threadsafe so synchronize on the backing DBB doing any access would 
be a coarse first cut means of doing this.  When we make Cells -- in 
HFileScannerImpl -- we'd have to ask the HFileBlock, what type it was... and if 
a refcounting block, we'd make RefCountedDBBBackedCell and up the refcount per 
one made (could try and do bit increment/decrement so don't have to parse as an 
int each time we want to increment).



> Prevent block eviction under us if reads are in progress from the BBs
> ---------------------------------------------------------------------
>
>                 Key: HBASE-12295
>                 URL: https://issues.apache.org/jira/browse/HBASE-12295
>             Project: HBase
>          Issue Type: Sub-task
>          Components: regionserver, Scanners
>            Reporter: ramkrishna.s.vasudevan
>            Assignee: ramkrishna.s.vasudevan
>             Fix For: 2.0.0
>
>         Attachments: HBASE-12295.pdf, HBASE-12295_1.patch, HBASE-12295_1.pdf, 
> HBASE-12295_2.patch, HBASE-12295_4.patch, HBASE-12295_trunk.patch
>
>
> While we try to serve the reads from the BBs directly from the block cache, 
> we need to ensure that the blocks does not get evicted under us while 
> reading.  This JIRA is to discuss and implement a strategy for the same.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to