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
>