<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Simple way to create a new table using java in hbase? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Simple-way-to-create-a-new-table-using-java-in-hbase/m-p/167493#M29692</link>
    <description>&lt;P&gt;Import the below APIs and try in the lines of below:&lt;/P&gt;&lt;P&gt;import org.apache.hadoop.hbase.TableName;&lt;/P&gt;&lt;P&gt;import org.apache.hadoop.hbase.HBaseConfiguration;&lt;/P&gt;&lt;P&gt;import org.apache.hadoop.conf.Configuration;&lt;/P&gt;&lt;P&gt;import org.apache.hadoop.hbase.client.Table;&lt;/P&gt;&lt;P&gt;private static final TableName TABLENAME = TableName.valueOf(“NewTable”);&lt;/P&gt;&lt;P&gt;Table table= null;&lt;/P&gt;&lt;P&gt;Configuration config= HBaseConfiguration.create();&lt;/P&gt;&lt;P&gt;Connection connection == ConnectionFactory.createConnection(config);&lt;/P&gt;&lt;P&gt;table = connection.getTable(TABLENAME);&lt;/P&gt;</description>
    <pubDate>Wed, 08 Jun 2016 00:45:17 GMT</pubDate>
    <dc:creator>ganne</dc:creator>
    <dc:date>2016-06-08T00:45:17Z</dc:date>
    <item>
      <title>Simple way to create a new table using java in hbase?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Simple-way-to-create-a-new-table-using-java-in-hbase/m-p/167488#M29687</link>
      <description>&lt;P&gt;Is there a simple way to create a table with java in a new deploy of ambari hortonworks 2.4? Libs that I need?&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2016 23:30:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Simple-way-to-create-a-new-table-using-java-in-hbase/m-p/167488#M29687</guid>
      <dc:creator>albertdom_ba2</dc:creator>
      <dc:date>2016-05-25T23:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: Simple way to create a new table using java in hbase?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Simple-way-to-create-a-new-table-using-java-in-hbase/m-p/167489#M29688</link>
      <description>&lt;P&gt;You can find example in refguide (http://hbase.apache.org/book.html#rowkey.regionsplits) :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;createTable(Admin admin, HTableDescriptor table, byte[][] splits)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Dependencies include hbase-client jar, hbase-protocol jar&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2016 23:33:01 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Simple-way-to-create-a-new-table-using-java-in-hbase/m-p/167489#M29688</guid>
      <dc:creator>tyu</dc:creator>
      <dc:date>2016-05-25T23:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: Simple way to create a new table using java in hbase?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Simple-way-to-create-a-new-table-using-java-in-hbase/m-p/167490#M29689</link>
      <description>&lt;P&gt;Search for ".createTable(" in &lt;A href="http://hbase.apache.org/book.html" target="_blank"&gt;http://hbase.apache.org/book.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Example 32. Java API&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2016 23:34:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Simple-way-to-create-a-new-table-using-java-in-hbase/m-p/167490#M29689</guid>
      <dc:creator>tyu</dc:creator>
      <dc:date>2016-05-25T23:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: Simple way to create a new table using java in hbase?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Simple-way-to-create-a-new-table-using-java-in-hbase/m-p/167491#M29690</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/10717/albertdomba2.html" nodeid="10717"&gt;@Albert Domingo Labernia&lt;/A&gt;&lt;P&gt;CreateHBaseTable.java&lt;/P&gt;&lt;PRE&gt;import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.client.HBaseAdmin;

public class CreateHBaseTable
{
  public static void main(String[] args) throws IOException
  {
    HBaseConfiguration hconfig = new HBaseConfiguration(new Configuration());
    HTableDescriptor htable = new HTableDescriptor("Test"); 
    htable.addFamily( new HColumnDescriptor("id"));
    htable.addFamily( new HColumnDescriptor("Name"));
    System.out.println( "Connecting..." );
    HBaseAdmin hbase_admin = new HBaseAdmin( hconfig );
    System.out.println( "Creating Table..." );
    hbase_admin.createTable( htable );
    System.out.println("Done!");
  }
}&lt;/PRE&gt;&lt;PRE&gt;export HADOOP_CLASSPATH= $HADOOP_PATH:`hbase classpath`&lt;/PRE&gt;&lt;PRE&gt; javac -cp `hbase classpath` CreateHBaseTable.java 
 java -cp `hbase classpath` CreateHBaseTable&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 May 2016 23:37:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Simple-way-to-create-a-new-table-using-java-in-hbase/m-p/167491#M29690</guid>
      <dc:creator>jyadav</dc:creator>
      <dc:date>2016-05-25T23:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: Simple way to create a new table using java in hbase?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Simple-way-to-create-a-new-table-using-java-in-hbase/m-p/167492#M29691</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/2528/jyadav.html" nodeid="2528"&gt;@Jitendra Yadav&lt;/A&gt; Your example works fine, thanks a lot.
And tanks for the info too &lt;A rel="user" href="https://community.cloudera.com/users/532/tyu.html" nodeid="532"&gt;@Ted Yu&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2016 21:53:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Simple-way-to-create-a-new-table-using-java-in-hbase/m-p/167492#M29691</guid>
      <dc:creator>albertdom_ba2</dc:creator>
      <dc:date>2016-06-01T21:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: Simple way to create a new table using java in hbase?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Simple-way-to-create-a-new-table-using-java-in-hbase/m-p/167493#M29692</link>
      <description>&lt;P&gt;Import the below APIs and try in the lines of below:&lt;/P&gt;&lt;P&gt;import org.apache.hadoop.hbase.TableName;&lt;/P&gt;&lt;P&gt;import org.apache.hadoop.hbase.HBaseConfiguration;&lt;/P&gt;&lt;P&gt;import org.apache.hadoop.conf.Configuration;&lt;/P&gt;&lt;P&gt;import org.apache.hadoop.hbase.client.Table;&lt;/P&gt;&lt;P&gt;private static final TableName TABLENAME = TableName.valueOf(“NewTable”);&lt;/P&gt;&lt;P&gt;Table table= null;&lt;/P&gt;&lt;P&gt;Configuration config= HBaseConfiguration.create();&lt;/P&gt;&lt;P&gt;Connection connection == ConnectionFactory.createConnection(config);&lt;/P&gt;&lt;P&gt;table = connection.getTable(TABLENAME);&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2016 00:45:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Simple-way-to-create-a-new-table-using-java-in-hbase/m-p/167493#M29692</guid>
      <dc:creator>ganne</dc:creator>
      <dc:date>2016-06-08T00:45:17Z</dc:date>
    </item>
  </channel>
</rss>

