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

Jesse Yates commented on HBASE-4448:
------------------------------------

Doug, had the same thoughts you did on whether or not all the classes really 
need to have all the region servers, etc. 

With the reusability, in some cases I have some doubts about what is actually 
practical. In some cases (eg. coproc), they are doing a bunch of configuration 
on the table, which has implications on whether or not the table/cluster can be 
immediately/concurrently reused.

There are a couple things we could do to make usage easier.

(1) A lot of times people are setting the configuration statically, so we want 
to remove that if people are going to reuse it (though different jvms solves 
that for the moment).

(2) Create unique clusters - these would not be cached and really good for 
situations where people are injecting faults, etc.

(3) Add some modularization for table configuration etc - a lot seems to be 
setting up properties for the db, but really making properties that you are 
just testing on some table. This may be a little pie in the sky...

(4) Reset properties method - so are allowed to make changes to a table when 
you use it, but then when done/released, we just reset the properties/config.

> 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, 
> hbase_hbaseTestingUtility_uses_2011_09_22.xlsx
>
>
> 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