hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Samir Ahmic <ahmic.sa...@gmail.com>
Subject Re: Table copies in hbase
Date Thu, 21 Jan 2016 08:22:44 GMT
Yes you can use HTableDescriptor to get table description from existing
table and use it for creating new table. Also you can try to create script
using hbase shell to do same.

Regards
Samir

On Thu, Jan 21, 2016 at 5:02 AM, Sumit Nigam <sumit_only@yahoo.com.invalid>
wrote:

> Thank you Samir.
>
> In my case there is a possibility that I am not aware of column families
> upfront. Is there an easy way to programatically query for source table
> column families and create a target table with the same column families?
>
> I think I could use HTableDescriptor to get all column families for source
> table and create the destination table with them and then set pre-splits.
> Right?But is there any other way to do the same?
>
> Thanks again,
> Sumit
>
>
>       From: Samir Ahmic <ahmic.samir@gmail.com>
>  To: user@hbase.apache.org
>  Sent: Wednesday, January 20, 2016 5:40 PM
>  Subject: Re: Table copies in hbase
>
> By cloning snapshot you will have same number of regions in source and
> destination table. If you want more pre-split in destination table then you
> will have to use CopyTable tool. Simply create new table with same column
> families as destination table and pre-split it with number of regions you
> want then run CopyTable tool.
>
>
>
> Regards
> Samir
>
> On Wed, Jan 20, 2016 at 12:24 PM, Ted Yu <yuzhihong@gmail.com> wrote:
>
> > There is also backup / restore (work in progress):
> >
> > https://issues.apache.org/jira/browse/HBASE-7912
> >
> > FYI
> >
> > On Wed, Jan 20, 2016 at 2:12 AM, Samir Ahmic <ahmic.samir@gmail.com>
> > wrote:
> >
> > > Hi Sumit,
> > > IMHO snapshots are easiest way to copy tables you need just to steps:
> > >
> > > 1. create snapshot
> > > 2.  clone snapshot to another table
> > >
> > > What version of hbase you are using? Regarding you question what will
> > > happen in case operation fails in case of cloning snapshot i have never
> > > experience such event if snapshot was not corrupted. In case of
> CopyTable
> > > mr i assume that data will be partially copied. In any case your source
> > > tables will be OK.
> > >
> > >
> > > Regards
> > > Samir
> > >
> > > On Wed, Jan 20, 2016 at 7:51 AM, Sumit Nigam
> > <sumit_only@yahoo.com.invalid
> > > >
> > > wrote:
> > >
> > > > Hi,
> > > > I have a a few tables in hbase which I would like to create copies
> of.
> > > The
> > > > tables will be in same cluster.
> > > > I wanted to know based on experience, which one of the options is
> > better:
> > > > 1. copyTable2. snapshot3. Any other?
> > > > Besides efficiency aspect, I am also interested in knowing what
> happens
> > > > when the operation fails midway copying from snapshot to destination
> > > table.
> > > > Or when it fails midway copying to destination table in copyTable
> > option.
> > > > Would data be left in inconsistent state?
> > > > Thanks,Sumit
> > >
> >
>
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message