You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Mohamed Ghareb <m....@tedata.net> on 2014/02/17 12:28:38 UTC

presplitting regions

Kindly when I create new tables with presplitting region,
I need to use the firstrow & lastrow argument, my question if my key is number "integer" can I put start & end row with decimal number or I need to convert it to hexadecimal number
hbase org.apache.hadoop.hbase.util.RegionSplitter tablename HexStringSplit --firstrow 9990 --lastrow 3000000 -c 5

Re: presplitting regions

Posted by Stack <st...@duboce.net>.
You want to stay decimal?  Looks like your start and end keys have a
different count of digits so you should zero pad the first so both have
same count else your keys will sort in a way that may surprise.  How  many
regions do you want?  If you want to remain decimal, why not just do it by
hand and pass the set of regions on table creation?  If you mess up, delete
the table and start over.

Regards RegionSplitter, it has pretty good
http://hbase.apache.org/devapidocs/org/apache/hadoop/hbase/util/RegionSplitter.html.
 See the main description for what it does.  Is that what you want?
 HexSplitter generates hex keys.  UniformSplit might work for you but it is
doing byte 'math' so might make for some 'interesting' results.

St.Ack


On Wed, Feb 19, 2014 at 2:53 AM, Mohamed Ghareb <m....@tedata.net>wrote:

> Ok my row key will be start from 9990000000000 and end in 3000000000000000
>
> -----Original Message-----
> From: saint.ack@gmail.com [mailto:saint.ack@gmail.com] On Behalf Of Stack
> Sent: Wednesday, February 19, 2014 12:29 AM
> To: Hbase-User
> Subject: Re: presplitting regions
>
> What are you trying to do?  Do you want hex keys or decimal keys?  Usually
> you'll want keys fixed-length and zero-padded if you don't want to be
> surprised by how they sort.
>
> St.Ack
>
>
> On Mon, Feb 17, 2014 at 3:28 AM, Mohamed Ghareb <m.ghareeb@tedata.net
> >wrote:
>
> > Kindly when I create new tables with presplitting region, I need to
> > use the firstrow & lastrow argument, my question if my key is number
> > "integer" can I put start & end row with decimal number or I need to
> > convert it to hexadecimal number hbase
> > org.apache.hadoop.hbase.util.RegionSplitter tablename HexStringSplit
> > --firstrow 9990 --lastrow 3000000 -c 5
> >
>

RE: presplitting regions

Posted by Mohamed Ghareb <m....@tedata.net>.
Ok my row key will be start from 9990000000000 and end in 3000000000000000 

-----Original Message-----
From: saint.ack@gmail.com [mailto:saint.ack@gmail.com] On Behalf Of Stack
Sent: Wednesday, February 19, 2014 12:29 AM
To: Hbase-User
Subject: Re: presplitting regions

What are you trying to do?  Do you want hex keys or decimal keys?  Usually you'll want keys fixed-length and zero-padded if you don't want to be surprised by how they sort.

St.Ack


On Mon, Feb 17, 2014 at 3:28 AM, Mohamed Ghareb <m....@tedata.net>wrote:

> Kindly when I create new tables with presplitting region, I need to 
> use the firstrow & lastrow argument, my question if my key is number 
> "integer" can I put start & end row with decimal number or I need to 
> convert it to hexadecimal number hbase 
> org.apache.hadoop.hbase.util.RegionSplitter tablename HexStringSplit 
> --firstrow 9990 --lastrow 3000000 -c 5
>

Re: presplitting regions

Posted by Stack <st...@duboce.net>.
What are you trying to do?  Do you want hex keys or decimal keys?  Usually
you'll want keys fixed-length and zero-padded if you don't want to be
surprised by how they sort.

St.Ack


On Mon, Feb 17, 2014 at 3:28 AM, Mohamed Ghareb <m....@tedata.net>wrote:

> Kindly when I create new tables with presplitting region,
> I need to use the firstrow & lastrow argument, my question if my key is
> number "integer" can I put start & end row with decimal number or I need to
> convert it to hexadecimal number
> hbase org.apache.hadoop.hbase.util.RegionSplitter tablename HexStringSplit
> --firstrow 9990 --lastrow 3000000 -c 5
>

Re: presplitting regions

Posted by Ted Yu <yu...@gmail.com>.
Your first and last row strings would be converted to BigInteger with radix
16.
So please convert them to hexadecimal string.

Cheers


On Mon, Feb 17, 2014 at 5:28 AM, Mohamed Ghareb <m....@tedata.net>wrote:

> Kindly when I create new tables with presplitting region,
> I need to use the firstrow & lastrow argument, my question if my key is
> number "integer" can I put start & end row with decimal number or I need to
> convert it to hexadecimal number
> hbase org.apache.hadoop.hbase.util.RegionSplitter tablename HexStringSplit
> --firstrow 9990 --lastrow 3000000 -c 5
>