truncate_preserve.rb was added by HBASE-5525 which went into 0.95.
So it should be in 0.96

Cheers

On Wed, Feb 25, 2015 at 7:14 AM, Jean-Marc Spaggiari <
[email protected]> wrote:

> Hi Marcelo,
>
> Truncate also removes the regions boundaries. You can use truncate_preserve
> if you want to keep your region splits. Not sure if it's available in
> 0.96...
>
> Also, I don't think you can look at the splits from the shell command...
>
> JM
>
> 2015-02-25 10:09 GMT-05:00 Marcelo Valle (BLOOMBERG/ LONDON) <
> [email protected]>:
>
> > Hi,
> >
> > I have created an HBase table just like that:
> >
> > t = create 'HBaseSerialWritesPOC', 'user_id_ts', {NAME => 'alnfo'},
> > {SPLITS => ['100000000000000000000000', '200000000000000000000000',
> > '300000000000000000000000', '400000000000000000000000',
> > '500000000000000000000000', '600000000000000000000000',
> > '700000000000000000000000', '800000000000000000000000',
> > '900000000000000000000000', 'a00000000000000000000000',
> > 'b00000000000000000000000', 'c00000000000000000000000',
> > 'd00000000000000000000000', 'e00000000000000000000000',
> > 'f00000000000000000000000']}
> >
> > After some tests, I truncated the table.
> >
> > Then I inserted 1 million rows, just to test. I was expecting to have 16
> > regions for this table, but when I checked admin UI, I saw two regions:
> >
> > Table Regions
> > Name       Region Server   Start Key       End Key Requests
> > HBaseSerialWritesPOC,,1424873821297.cf92656f68a16e9696d0fbfe2494219b.
> >   host1           800000190000125396f3f2bb        500625
> >
> HBaseSerialWritesPOC,800000190000125396f3f2bb,1424873821297.696a25e590e3248005c638c0f86c0564.
> > host2   800000190000125396f3f2bb                500621
> >
> > I am new to HBase, so it really means just 2 regions have been created,
> > right? It seems keys have been split in a half, 0000.. To ffff...
> >
> > I disabled, dropped and created the table again using the same command
> > bellow, then I saw 16 regions, as expected.
> >
> > Question 1: Is it possible to check the same thing using hbase shell?
> >
> > Question 2: Is it expected behavior the truncate messing up the splits?
> > What kind of DML operations could change the splits in my table? I am
> using
> > HBase 0.96.1.2.0.10.0-1-hadoop2
> >
> > -Marcelo
>

Reply via email to