@@ -0,0 +1,1440 @@
+package com.test.habse.examples;%0A%0Aimport org.apache.commons.configuration.ConfigurationException;%0Aimport org.apache.commons.configuration.PropertiesConfiguration;%0A%0Aimport org.apache.hadoop.hbase.HTableDescriptor;%0Aimport org.apache.hadoop.hbase.TableName;%0Aimport org.apache.hadoop.hbase.client.Connection;%0Aimport org.apache.hadoop.hbase.client.ConnectionFactory;%0A%0Aimport org.apache.log4j.Level;%0Aimport org.apache.log4j.Logger;%0A%0Aimport java.io.IOException;%0A%0Apublic class HBaseCreateTableIfNotExist %7B%0A    private static final Logger log = Logger.getLogger(HBaseCreateTableIfNotExist.class);%0A%0A    public static void main(String%5B%5D args) throws ConfigurationException, IOException %7B%0A        PropertiesConfiguration conf = new PropertiesConfiguration(%22hbase.properties%22);%0A        TableName tableName = TableName.valueOf(conf.getString(%22table.name%22));%0A%0A        log.setLevel(Level.DEBUG);%0A        log.debug(%22Create HBase connection%22);%0A        Connection conn = ConnectionFactory.createConnection();%0A%0A        if (!conn.getAdmin().tableExists(tableName)) %7B%0A            log.debug(String.format(%22Table %5B%25s%5D doesn't exist. Creating table...%22, tableName.getNameAsString()));%0A            HTableDescriptor desc = new HTableDescriptor(tableName);%0A            conn.getAdmin().createTable(desc);%0A        %7D else %7B%0A            log.debug(String.format(%22Table %5B%25s%5D already exist. Exit%22, tableName.getNameAsString()));%0A            System.exit(0);%0A        %7D%0A    %7D%0A%7D%0A

Add HBase table creation java example