You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by jeremy p <at...@gmail.com> on 2014/06/11 23:47:49 UTC
How to specify a compression algorithm when creating a table with the
HBaseAdmin object?
I'm currently creating a table using the HBaseAdmin object. The reason I'm
doing it with the HBaseAdmin object is that I need to pre-split the table
by specifying the start key, end key, and number of regions. I want to use
Snappy compression for this table, however, I haven't seen any way to do
this using the HBaseAdmin object. In all of the examples I've seen,
they're creating the table from the HBase shell. How can I create a table
with the HBaseAdmin object, and have that table use Snappy compression?
--Jeremy
Re: How to specify a compression algorithm when creating a table with
the HBaseAdmin object?
Posted by jeremy p <at...@gmail.com>.
Awesome -- thank you!
--Jeremy
On Thu, Jun 12, 2014 at 4:28 PM, Jean-Marc Spaggiari <
jean-marc@spaggiari.org> wrote:
> The same way you will define the number of versions, the TTL (if any), etc.
> Just look at all the setters to get a sense to what is doable.
>
> We are also going to update the documentation to reflect this.
>
> JM
>
>
> 2014-06-12 19:25 GMT-04:00 jeremy p <at...@gmail.com>:
>
> > Awesome -- thank you both!
> >
> > --Jeremy
> >
> >
> > On Wed, Jun 11, 2014 at 4:34 PM, Subbiah, Suresh <Su...@hp.com>
> > wrote:
> >
> > > Hi Jeremy,
> > >
> > > Here is some code that creates an table using the HBaseAdmin API, with
> a
> > > bunch of options such as compression and specified key boundaries.
> > > http://pastebin.com/KNcv03bj
> > >
> > > The user specified options will be in the StringArrayList tableOptions.
> > >
> > > This is part of the Trafodion code @
> https://github.com/trafodion/core
> > >
> > > This code too follows the model that Jean-Marc has shown.
> > >
> > > Thanks
> > > Suresh
> > >
> > >
> > > -----Original Message-----
> > > From: Jean-Marc Spaggiari [mailto:jean-marc@spaggiari.org]
> > > Sent: Wednesday, June 11, 2014 4:55 PM
> > > To: user
> > > Subject: Re: How to specify a compression algorithm when creating a
> table
> > > with the HBaseAdmin object?
> > >
> > > final HBaseAdmin admin = new HBaseAdmin(config);
> > > HTableDescriptor table = new
> > > HTableDescriptor(TableName.valueOf(TABLE_NAME));
> > > table.addFamily(new
> > > HColumnDescriptor(CF_DEFAULT).setCompressionType(Algorithm.SNAPPY));
> > > admin.createTable(table);
> > >
> > >
> > > 2014-06-11 17:47 GMT-04:00 jeremy p <at...@gmail.com>:
> > >
> > > > I'm currently creating a table using the HBaseAdmin object. The
> > > > reason I'm doing it with the HBaseAdmin object is that I need to
> > > > pre-split the table by specifying the start key, end key, and number
> > > > of regions. I want to use Snappy compression for this table,
> however,
> > > > I haven't seen any way to do this using the HBaseAdmin object. In
> all
> > > > of the examples I've seen, they're creating the table from the HBase
> > > > shell. How can I create a table with the HBaseAdmin object, and have
> > > that table use Snappy compression?
> > > >
> > > > --Jeremy
> > > >
> > >
> >
>
Re: How to specify a compression algorithm when creating a table with
the HBaseAdmin object?
Posted by Jean-Marc Spaggiari <je...@spaggiari.org>.
The same way you will define the number of versions, the TTL (if any), etc.
Just look at all the setters to get a sense to what is doable.
We are also going to update the documentation to reflect this.
JM
2014-06-12 19:25 GMT-04:00 jeremy p <at...@gmail.com>:
> Awesome -- thank you both!
>
> --Jeremy
>
>
> On Wed, Jun 11, 2014 at 4:34 PM, Subbiah, Suresh <Su...@hp.com>
> wrote:
>
> > Hi Jeremy,
> >
> > Here is some code that creates an table using the HBaseAdmin API, with a
> > bunch of options such as compression and specified key boundaries.
> > http://pastebin.com/KNcv03bj
> >
> > The user specified options will be in the StringArrayList tableOptions.
> >
> > This is part of the Trafodion code @ https://github.com/trafodion/core
> >
> > This code too follows the model that Jean-Marc has shown.
> >
> > Thanks
> > Suresh
> >
> >
> > -----Original Message-----
> > From: Jean-Marc Spaggiari [mailto:jean-marc@spaggiari.org]
> > Sent: Wednesday, June 11, 2014 4:55 PM
> > To: user
> > Subject: Re: How to specify a compression algorithm when creating a table
> > with the HBaseAdmin object?
> >
> > final HBaseAdmin admin = new HBaseAdmin(config);
> > HTableDescriptor table = new
> > HTableDescriptor(TableName.valueOf(TABLE_NAME));
> > table.addFamily(new
> > HColumnDescriptor(CF_DEFAULT).setCompressionType(Algorithm.SNAPPY));
> > admin.createTable(table);
> >
> >
> > 2014-06-11 17:47 GMT-04:00 jeremy p <at...@gmail.com>:
> >
> > > I'm currently creating a table using the HBaseAdmin object. The
> > > reason I'm doing it with the HBaseAdmin object is that I need to
> > > pre-split the table by specifying the start key, end key, and number
> > > of regions. I want to use Snappy compression for this table, however,
> > > I haven't seen any way to do this using the HBaseAdmin object. In all
> > > of the examples I've seen, they're creating the table from the HBase
> > > shell. How can I create a table with the HBaseAdmin object, and have
> > that table use Snappy compression?
> > >
> > > --Jeremy
> > >
> >
>
Re: How to specify a compression algorithm when creating a table with
the HBaseAdmin object?
Posted by jeremy p <at...@gmail.com>.
Awesome -- thank you both!
--Jeremy
On Wed, Jun 11, 2014 at 4:34 PM, Subbiah, Suresh <Su...@hp.com>
wrote:
> Hi Jeremy,
>
> Here is some code that creates an table using the HBaseAdmin API, with a
> bunch of options such as compression and specified key boundaries.
> http://pastebin.com/KNcv03bj
>
> The user specified options will be in the StringArrayList tableOptions.
>
> This is part of the Trafodion code @ https://github.com/trafodion/core
>
> This code too follows the model that Jean-Marc has shown.
>
> Thanks
> Suresh
>
>
> -----Original Message-----
> From: Jean-Marc Spaggiari [mailto:jean-marc@spaggiari.org]
> Sent: Wednesday, June 11, 2014 4:55 PM
> To: user
> Subject: Re: How to specify a compression algorithm when creating a table
> with the HBaseAdmin object?
>
> final HBaseAdmin admin = new HBaseAdmin(config);
> HTableDescriptor table = new
> HTableDescriptor(TableName.valueOf(TABLE_NAME));
> table.addFamily(new
> HColumnDescriptor(CF_DEFAULT).setCompressionType(Algorithm.SNAPPY));
> admin.createTable(table);
>
>
> 2014-06-11 17:47 GMT-04:00 jeremy p <at...@gmail.com>:
>
> > I'm currently creating a table using the HBaseAdmin object. The
> > reason I'm doing it with the HBaseAdmin object is that I need to
> > pre-split the table by specifying the start key, end key, and number
> > of regions. I want to use Snappy compression for this table, however,
> > I haven't seen any way to do this using the HBaseAdmin object. In all
> > of the examples I've seen, they're creating the table from the HBase
> > shell. How can I create a table with the HBaseAdmin object, and have
> that table use Snappy compression?
> >
> > --Jeremy
> >
>
RE: How to specify a compression algorithm when creating a table
with the HBaseAdmin object?
Posted by "Subbiah, Suresh" <Su...@hp.com>.
Hi Jeremy,
Here is some code that creates an table using the HBaseAdmin API, with a bunch of options such as compression and specified key boundaries.
http://pastebin.com/KNcv03bj
The user specified options will be in the StringArrayList tableOptions.
This is part of the Trafodion code @ https://github.com/trafodion/core
This code too follows the model that Jean-Marc has shown.
Thanks
Suresh
-----Original Message-----
From: Jean-Marc Spaggiari [mailto:jean-marc@spaggiari.org]
Sent: Wednesday, June 11, 2014 4:55 PM
To: user
Subject: Re: How to specify a compression algorithm when creating a table with the HBaseAdmin object?
final HBaseAdmin admin = new HBaseAdmin(config);
HTableDescriptor table = new
HTableDescriptor(TableName.valueOf(TABLE_NAME));
table.addFamily(new
HColumnDescriptor(CF_DEFAULT).setCompressionType(Algorithm.SNAPPY));
admin.createTable(table);
2014-06-11 17:47 GMT-04:00 jeremy p <at...@gmail.com>:
> I'm currently creating a table using the HBaseAdmin object. The
> reason I'm doing it with the HBaseAdmin object is that I need to
> pre-split the table by specifying the start key, end key, and number
> of regions. I want to use Snappy compression for this table, however,
> I haven't seen any way to do this using the HBaseAdmin object. In all
> of the examples I've seen, they're creating the table from the HBase
> shell. How can I create a table with the HBaseAdmin object, and have that table use Snappy compression?
>
> --Jeremy
>
Re: How to specify a compression algorithm when creating a table with
the HBaseAdmin object?
Posted by Jean-Marc Spaggiari <je...@spaggiari.org>.
final HBaseAdmin admin = new HBaseAdmin(config);
HTableDescriptor table = new
HTableDescriptor(TableName.valueOf(TABLE_NAME));
table.addFamily(new
HColumnDescriptor(CF_DEFAULT).setCompressionType(Algorithm.SNAPPY));
admin.createTable(table);
2014-06-11 17:47 GMT-04:00 jeremy p <at...@gmail.com>:
> I'm currently creating a table using the HBaseAdmin object. The reason I'm
> doing it with the HBaseAdmin object is that I need to pre-split the table
> by specifying the start key, end key, and number of regions. I want to use
> Snappy compression for this table, however, I haven't seen any way to do
> this using the HBaseAdmin object. In all of the examples I've seen,
> they're creating the table from the HBase shell. How can I create a table
> with the HBaseAdmin object, and have that table use Snappy compression?
>
> --Jeremy
>