[
https://issues.apache.org/jira/browse/HBASE-20214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16402437#comment-16402437
]
BELUGA BEHR commented on HBASE-20214:
-------------------------------------
The method {{public HDFSBlocksDistribution getBlockDistribution(RegionInfo
hri)}} implements the common "if cached, return; otherwise create, cache and
return" pattern. However, we are using a Guava {{LoadingCache}} which does
this for us by
[design|https://google.github.io/guava/releases/19.0/api/docs/com/google/common/cache/LoadingCache.html#get(K)]
so we can remove the existing logic to do this manually. Also, the HBase
cache {{load}} method throws away Exceptions and returns a default value if
there is a problem, so the code don't need to worry about catching an exception
emanating from the cache.
> Review of RegionLocationFinder Class
> ------------------------------------
>
> Key: HBASE-20214
> URL: https://issues.apache.org/jira/browse/HBASE-20214
> Project: HBase
> Issue Type: Improvement
> Components: Balancer, master
> Affects Versions: 2.0.0
> Reporter: BELUGA BEHR
> Assignee: BELUGA BEHR
> Priority: Minor
> Attachments: HBASE-20214.1.patch
>
>
> # Use SLF4J parameter logging
> # Remove superfluous code
> # Replace code with re-usable libraries where possible
> # Use different data structure
> # Small perf improvements
> # Fix some checkstyle
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)