Awesome -- thank you both!

--Jeremy


On Wed, Jun 11, 2014 at 4:34 PM, Subbiah, Suresh <[email protected]>
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:[email protected]]
> 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 <[email protected]>:
>
> > 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
> >
>

Reply via email to