You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by Kevin Shin <ke...@thinkbiganalytics.com> on 2012/08/02 20:01:31 UTC

Testing Coprocessor Methods postSplit() and postWALRestore()

Hi everyone,

I'm working on building unit tests for a Coprocessor class I'm building
with HBase for a Lucene search index.
In writing the unit tests, I can't seem to figure out how to call/test
postSplit() and postWALRestore() from the HBase API.
Specifically, all of the implementations of splitting a region I've run
into have been asynchronous and do not complete (I test with a while loop
checking for increased number of regions)
and I can't think of a way to crash and bring up an HBase Region (Only
close and open, not reopen). If there are classes to create synchronous
splits and crash/reopen an HBase Region, would greatly appreciate the
advice. Thanks!

Cheers,
Kevin

Re: Testing Coprocessor Methods postSplit() and postWALRestore()

Posted by Kevin Shin <ke...@thinkbiganalytics.com>.
Using HBase 0.92.1 and the unit test is using HBaseTestingUtility and
creating mini clusters for testing. Thanks!

On Thu, Aug 2, 2012 at 11:17 AM, Ted Yu <yu...@gmail.com> wrote:

> What version of HBase are you using ?
>
> Thanks
>
> On Thu, Aug 2, 2012 at 11:01 AM, Kevin Shin <
> kevin.shin@thinkbiganalytics.com> wrote:
>
> > Hi everyone,
> >
> > I'm working on building unit tests for a Coprocessor class I'm building
> > with HBase for a Lucene search index.
> > In writing the unit tests, I can't seem to figure out how to call/test
> > postSplit() and postWALRestore() from the HBase API.
> > Specifically, all of the implementations of splitting a region I've run
> > into have been asynchronous and do not complete (I test with a while loop
> > checking for increased number of regions)
> > and I can't think of a way to crash and bring up an HBase Region (Only
> > close and open, not reopen). If there are classes to create synchronous
> > splits and crash/reopen an HBase Region, would greatly appreciate the
> > advice. Thanks!
> >
> > Cheers,
> > Kevin
> >
>

Re: Testing Coprocessor Methods postSplit() and postWALRestore()

Posted by Ted Yu <yu...@gmail.com>.
What version of HBase are you using ?

Thanks

On Thu, Aug 2, 2012 at 11:01 AM, Kevin Shin <
kevin.shin@thinkbiganalytics.com> wrote:

> Hi everyone,
>
> I'm working on building unit tests for a Coprocessor class I'm building
> with HBase for a Lucene search index.
> In writing the unit tests, I can't seem to figure out how to call/test
> postSplit() and postWALRestore() from the HBase API.
> Specifically, all of the implementations of splitting a region I've run
> into have been asynchronous and do not complete (I test with a while loop
> checking for increased number of regions)
> and I can't think of a way to crash and bring up an HBase Region (Only
> close and open, not reopen). If there are classes to create synchronous
> splits and crash/reopen an HBase Region, would greatly appreciate the
> advice. Thanks!
>
> Cheers,
> Kevin
>

Re: Testing Coprocessor Methods postSplit() and postWALRestore()

Posted by Stack <st...@duboce.net>.
On Thu, Aug 2, 2012 at 7:01 PM, Kevin Shin
<ke...@thinkbiganalytics.com> wrote:
> Hi everyone,
>
> I'm working on building unit tests for a Coprocessor class I'm building
> with HBase for a Lucene search index.
> In writing the unit tests, I can't seem to figure out how to call/test
> postSplit() and postWALRestore() from the HBase API.
> Specifically, all of the implementations of splitting a region I've run
> into have been asynchronous and do not complete (I test with a while loop
> checking for increased number of regions)
> and I can't think of a way to crash and bring up an HBase Region (Only
> close and open, not reopen). If there are classes to create synchronous
> splits and crash/reopen an HBase Region, would greatly appreciate the
> advice. Thanks!
>

What if you just stood up a lone HRegion?  See TestHRegion for
examples of how to do it.  You should be able to then invoke the
HRegion methods directly?

St.Ack