Package org.apache.hadoop.hbase.client

Examples of org.apache.hadoop.hbase.client.HBaseAdmin.listTables()


    final String HBASE_TABLE_NAME = "HiveExternalTable";
    HTableDescriptor htableDesc = new HTableDescriptor(HBASE_TABLE_NAME.getBytes());
    HColumnDescriptor hcolDesc = new HColumnDescriptor("cf".getBytes());
    htableDesc.addFamily(hcolDesc);
    HBaseAdmin hbaseAdmin = new HBaseAdmin(hbaseConf);
    if(Arrays.asList(hbaseAdmin.listTables()).contains(htableDesc)){
      // if table is already in there, don't recreate.
      return;
    }
    hbaseAdmin.createTable(htableDesc);
    HTable htable = new HTable(hbaseConf, HBASE_TABLE_NAME);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.