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

Bryan Duxbury commented on HBASE-407:
-------------------------------------

Yes, I need a SortedMap, not a HashMap, to be able to search for the correct 
regions by name.

I don't know if we need to spend very much time verifying that SoftRefence 
works as we expect it to, but it might make sense to push the client to an OOM 
situation so that we can make sure the logic of nulled references works 
correctly. I wouldn't call it a priority.

I chose to declare the cachedRegionLocations and instantiate it separately for 
cosmetic reasons - who wants to see that many generics in one blob? Is there an 
advantage to making it final?

Are you asking if it's definitely safe to pull references out of the 
tableLocations map? I'd say yes, because we check if the map contains them 
first. The SoftReference itself will always be not null at that point, it's the 
get() result that can be null.

> Client should cache region locations in an LRU structure
> --------------------------------------------------------
>
>                 Key: HBASE-407
>                 URL: https://issues.apache.org/jira/browse/HBASE-407
>             Project: Hadoop HBase
>          Issue Type: Improvement
>          Components: client
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>         Attachments: 407-v2.patch, 407.patch
>
>
> Instead of keeping the region locations cached client side in a TreeMap, we 
> should use an LRU mechanism to help manage memory more dynamically.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to