You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Weichen YE <ye...@gmail.com> on 2014/09/28 03:54:08 UTC

Is there any way to truncate the hbase table but keep all the regions

Hello all,

        I just want to delete all the data in the table, but keep the
schema and all regions. If I use Delete API to do this, it seem too slow.
If I use Truncate, the new table has only one regions and I need to do the
pre-splitting every time once again.

       Is there any feature like "clean/clear" which can help me delete all
rows in the table , with a speed like "truncate", but keep all the regions
of the table?

Re: Is there any way to truncate the hbase table but keep all the regions

Posted by Sean Busbey <bu...@cloudera.com>.
The patches you're looking for are under HBASE-5525. It's all shell-side
changes so it should be relatively easy to get working.

On Sat, Sep 27, 2014 at 9:13 PM, Weichen YE <ye...@gmail.com> wrote:

> Hi,Jean-Marc,
>
>       Thank you very much for you reply. You really solve my problem !
>        I`m using HBase0.94.2-cdh4.2.0, in this version I got only
> "truncate". But I still have a test cluster which is HBase0.98.1-cdh5.1.0,
> I found the "truncate_preserve" in Hbase0.98.
>
>        Next step I`ll going to find some JIRA patch for "truncate_preserve"
> and backport to my 0.94 cluster.
>



-- 
Sean

Re: Is there any way to truncate the hbase table but keep all the regions

Posted by Sean Busbey <bu...@cloudera.com>.
patch for 0.94 posted on HBASE-12113

On Sun, Sep 28, 2014 at 12:03 AM, lars hofhansl <la...@apache.org> wrote:

> If you have a patch I am happy to commit it to 0.94 (if it's not too
> invasive).
>
> -- Lars
>
>
>
> ________________________________
>  From: Weichen YE <ye...@gmail.com>
> To: "user@hbase.apache.org" <us...@hbase.apache.org>
> Sent: Saturday, September 27, 2014 7:13 PM
> Subject: Re: Is there any way to truncate the hbase table but keep all the
> regions
>
>
> Hi,Jean-Marc,
>
>       Thank you very much for you reply. You really solve my problem !
>        I`m using HBase0.94.2-cdh4.2.0, in this version I got only
> "truncate". But I still have a test cluster which is HBase0.98.1-cdh5.1.0,
> I found the "truncate_preserve" in Hbase0.98.
>
>        Next step I`ll going to find some JIRA patch for "truncate_preserve"
> and backport to my 0.94 cluster.
>



-- 
Sean

Re: Is there any way to truncate the hbase table but keep all the regions

Posted by lars hofhansl <la...@apache.org>.
If you have a patch I am happy to commit it to 0.94 (if it's not too invasive).

-- Lars



________________________________
 From: Weichen YE <ye...@gmail.com>
To: "user@hbase.apache.org" <us...@hbase.apache.org> 
Sent: Saturday, September 27, 2014 7:13 PM
Subject: Re: Is there any way to truncate the hbase table but keep all the regions
 

Hi,Jean-Marc,

      Thank you very much for you reply. You really solve my problem !
       I`m using HBase0.94.2-cdh4.2.0, in this version I got only
"truncate". But I still have a test cluster which is HBase0.98.1-cdh5.1.0,
I found the "truncate_preserve" in Hbase0.98.

       Next step I`ll going to find some JIRA patch for "truncate_preserve"
and backport to my 0.94 cluster.

Re: Is there any way to truncate the hbase table but keep all the regions

Posted by Weichen YE <ye...@gmail.com>.
Hi,Jean-Marc,

      Thank you very much for you reply. You really solve my problem !
       I`m using HBase0.94.2-cdh4.2.0, in this version I got only
"truncate". But I still have a test cluster which is HBase0.98.1-cdh5.1.0,
I found the "truncate_preserve" in Hbase0.98.

       Next step I`ll going to find some JIRA patch for "truncate_preserve"
and backport to my 0.94 cluster.

Re: Is there any way to truncate the hbase table but keep all the regions

Posted by Jean-Marc Spaggiari <je...@spaggiari.org>.
Hi Weichen,

Which HBase version do you use?

You have "truncate_preserve" from the shell on recent versions.

JM

2014-09-27 21:54 GMT-04:00 Weichen YE <ye...@gmail.com>:

> Hello all,
>
>         I just want to delete all the data in the table, but keep the
> schema and all regions. If I use Delete API to do this, it seem too slow.
> If I use Truncate, the new table has only one regions and I need to do the
> pre-splitting every time once again.
>
>        Is there any feature like "clean/clear" which can help me delete all
> rows in the table , with a speed like "truncate", but keep all the regions
> of the table?
>