Return-Path: X-Original-To: apmail-hbase-user-archive@www.apache.org Delivered-To: apmail-hbase-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1A06F11E03 for ; Thu, 12 Jun 2014 23:28:58 +0000 (UTC) Received: (qmail 93276 invoked by uid 500); 12 Jun 2014 23:28:56 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 93204 invoked by uid 500); 12 Jun 2014 23:28:56 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 93194 invoked by uid 99); 12 Jun 2014 23:28:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jun 2014 23:28:56 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [209.85.220.172] (HELO mail-vc0-f172.google.com) (209.85.220.172) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jun 2014 23:28:52 +0000 Received: by mail-vc0-f172.google.com with SMTP id hy10so1543156vcb.31 for ; Thu, 12 Jun 2014 16:28:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=4YBpyW/F3nN8DqcBMR5xDE+NdIk9mL1pYMVxt6sq0nw=; b=WCBfhPG1LOgoZ5zOU1HHswh+6Iq4j5eOpoZZaDOxfD7tY64HwJNNKVjLnRLnyZZDy0 ub9kB0wbMe5ZV2t8M05LwKsdGcCSO7OmBcyr4hEk00S0ELZjoUa8q42Bmk7YKfuSqlUy tqjyrTsGzACNN28uCEi/MhB038qRjz1qkyZl2YdAHjj4Lh7Qgueo2pgeZL3nTv5LXG+C fiEyp0Gk9Abz0ZyYlKs90F50mQoGYY4CGm3chGQGdg+mAP4m1BPKdmbpM2dg0nX60dqt 2nydLK85zBEijO59SDhq4tsUi17W1AmktIxpRKrudlsAwev4wpFnoXY5L0XhQIoagzgU xUXQ== X-Gm-Message-State: ALoCoQmQogJCnQbIj76T2Bs9e0rRwrMHI2S06yiSJYSNTQ1tAj9QqbDE7BM9GyvXCw/r6kbEsQ6E X-Received: by 10.221.47.9 with SMTP id uq9mr83599vcb.48.1402615711153; Thu, 12 Jun 2014 16:28:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.4.226 with HTTP; Thu, 12 Jun 2014 16:28:11 -0700 (PDT) In-Reply-To: References: <7BBEF84240F4764EAF26754ED37575165A81F3D3@G4W3302.americas.hpqcorp.net> From: Jean-Marc Spaggiari Date: Thu, 12 Jun 2014 19:28:11 -0400 Message-ID: Subject: Re: How to specify a compression algorithm when creating a table with the HBaseAdmin object? To: user Content-Type: multipart/alternative; boundary=001a11337ec838545904fbabeba6 X-Virus-Checked: Checked by ClamAV on apache.org --001a11337ec838545904fbabeba6 Content-Type: text/plain; charset=UTF-8 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 : > Awesome -- thank you both! > > --Jeremy > > > On Wed, Jun 11, 2014 at 4:34 PM, Subbiah, Suresh > 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 : > > > > > 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 > > > > > > --001a11337ec838545904fbabeba6--