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

Matteo Bertozzi commented on HBASE-7786:
----------------------------------------

{quote}
{code}
Used only by tests and SplitTransaction to reopen the region.
You should use createHRegion() or openHRegion()
{code}
Is it possible to get rid of it instead? It just does redirect to different 
method, might as well have it in the tests themselves.
{quote}
Nah... the idea was naving initialize() private, since the user should not know 
about that... but a couple of tests uses the constructor new HRegion() { 
@override method() } to slightly change the behaviour... I guess I can mock it, 
or set the REGION_IMPL but it makes the test less readable.

{quote}
HRegion createDaughterRegion(final HRegionInfo hri, final Path daughterTmpDir)
Is this used anywhere except for the other overload?
{quote}
This is used only by the split code, and inside HRegion just to make 
newHRegion() private
                
> Consolidate HRegion creation/opening API
> ----------------------------------------
>
>                 Key: HBASE-7786
>                 URL: https://issues.apache.org/jira/browse/HBASE-7786
>             Project: HBase
>          Issue Type: Bug
>          Components: regionserver
>    Affects Versions: 0.96.0
>            Reporter: Matteo Bertozzi
>            Assignee: Matteo Bertozzi
>         Attachments: HBASE-7786-v0.patch, HBASE-7786-v1.patch
>
>
> Currently we have 4 ways to instantiate an HRegion.
>  * HRegion.createHRegion()
>  * HRegion.openHRegion()
>  * HRegion.newHRegion() + r.initialize()
>  * new HRegion() + r.initialize()
> Aside from tests and HMerge and SplitTransaction code everyone use 
> createHRegion() and openHRegion(). To avoid errors due to missing 
> initialization calls I think we should limit the access to newHRegion() and 
> the constructor.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to