You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Yang Zhang <zh...@gmail.com> on 2017/12/19 08:40:35 UTC

Question About preSplit() hook

Hello everyone

          I am using coprocessor of HBase, My work is to split my own index
when RegionSplit.
When I use the preSplit(ObserverContext<RegionCoprocessorEnvironment> c,
byte[] splitRow) , I thought The param splitRow must be some row taht I
puted in my Table, But this time I get  one row That can't be mine(my
rowkey is constructed with long+int but the splitRow is only 3bytes)

        So I want to know how HBase determine the splitRow? Is the splitRow
must be exist in my table? If anybody can help?

Thanks very much!

Re: Question About preSplit() hook

Posted by Ted Yu <yu...@gmail.com>.
If you look at hbase-server/src/main/java/org/apache/hadoop/hbase/
regionserver/SplitTransactionImpl.java where the hook is called, you would
see that splitRow is passed to SplitTransactionImpl ctor.

In SplitRequest, which creates SplitTransactionImpl, calls the row midKey.

Please read HBASE-19331 which gives the background on how the midKey is
computed.



On Tue, Dec 19, 2017 at 12:40 AM, Yang Zhang <zh...@gmail.com>
wrote:

> Hello everyone
>
>           I am using coprocessor of HBase, My work is to split my own index
> when RegionSplit.
> When I use the preSplit(ObserverContext<RegionCoprocessorEnvironment> c,
> byte[] splitRow) , I thought The param splitRow must be some row taht I
> puted in my Table, But this time I get  one row That can't be mine(my
> rowkey is constructed with long+int but the splitRow is only 3bytes)
>
>         So I want to know how HBase determine the splitRow? Is the splitRow
> must be exist in my table? If anybody can help?
>
> Thanks very much!
>