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

Doug Meil commented on HBASE-4448:
----------------------------------

Attached a prototype of HBaseTestingUtilityFactory.  This is not ready for 
prime time yet, but I'd like to solicit comments for the general idea.  

Noted issues:  there needs to be a configurable "wait" period when the 
ref-counts get to zero.  That should be set from the build, but how?  System 
property?  The reason is that while this pattern can be useful for many cases, 
it won't be suitable for all.  Therefore, there could be periods of non-use 
when another test is running, and we don't want to be too aggressive in tearing 
down the instances otherwise we'll be back where we started.

> HBaseTestingUtilityFactory - pattern for re-using HBaseTestingUtility 
> instances across unit tests
> -------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-4448
>                 URL: https://issues.apache.org/jira/browse/HBASE-4448
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Doug Meil
>            Assignee: Doug Meil
>            Priority: Minor
>         Attachments: HBaseTestingUtilityFactory.java
>
>
> Setting up and tearing down HBaseTestingUtility instances in unit tests is 
> very expensive.  On my MacBook it takes about 10 seconds to set up a 
> MiniCluster, and 7 seconds to tear it down.  When multiplied by the number of 
> test classes that use this facility, that's a lot of time in the build.
> This factory assumes that the JVM is being re-used across test classes in the 
> build, otherwise this pattern won't work. 
> I don't think this is appropriate for every use, but I think it can be 
> applicable in a great many cases - especially where developers just want a 
> simple MiniCluster with 1 slave.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to