hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vaibhav Puranik <vpura...@gmail.com>
Subject Re: how to add table
Date Wed, 08 Jul 2009 14:24:53 GMT
Fleming,

We are trying to use HBase 0.20.
Your answer is very helpful. Looks like Table creation is not changed in
0.20.

But what do you mean by - "Don't forget to put your zookeeper
configure(zoo.cfg) with your java class"?
Can you please elaborate?

Regards,
Vaibhav
Gumgum Inc.


On Tue, Jul 7, 2009 at 10:56 PM, <y_823910@tsmc.com> wrote:

> Hi,
>
> I use java code to create a table.
> Following sample I create table with one family.
> Don't forget to put your zookeeper configure(zoo.cfg) with your java class.
> Hope it is useful for you.
>
>
> Fleming
>
>
> ---------------------------------------------------------------------------------------------------
> CreatHBaseTable("test","COLUMNS");
>
> public static void CreatHBaseTable(String TableName,String ColumnFamily){
>            config = new HBaseConfiguration();
>                        HBaseAdmin hbaseAdmin;
>            try {
>                  hbaseAdmin = new HBaseAdmin(config);
>
>                  HColumnDescriptor column = new
> HColumnDescriptor(ColumnFamily);
>                  //table descriptor
>                HTableDescriptor table = new HTableDescriptor(TableName);
>                  //add column into table
>                  table.addFamily(column);
>                  hbaseAdmin.createTable(table);
>            } catch (MasterNotRunningException e1) {
>                  // TODO Auto-generated catch block
>                  e1.printStackTrace();
>            } catch (IOException e) {
>                  // TODO Auto-generated catch block
>                  e.printStackTrace();
>            }
>
>            System.out.println("create "+TableName +" ok");
>
>      }
>
>
>
>
>
>
>                      Muhammad Mudassar
>                      <mudassark7@gmail        To:
> hbase-user@hadoop.apache.org
>                      .com>                    cc:      (bcc: Y_823910/TSMC)
>                                               Subject: how to add table
>                      2009/07/08 01:35
>                      PM
>                      Please respond to
>                      hbase-user
>
>
>
>
>
>
> Hi,
>
> I have just started to work with hbase can any body here tell me how to add
> a table to the hbase.
>
>
> thanks
>
> Muhammad Mudassar
>
>
>
>
>
>  ---------------------------------------------------------------------------
>                                                         TSMC PROPERTY
>  This email communication (and any attachments) is proprietary information
>  for the sole use of its
>  intended recipient. Any unauthorized review, use or distribution by anyone
>  other than the intended
>  recipient is strictly prohibited.  If you are not the intended recipient,
>  please notify the sender by
>  replying to this email, and then delete this email and any copies of it
>  immediately. Thank you.
>
>  ---------------------------------------------------------------------------
>
>
>
>

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