Hi,
I have written a java code to create a TABLE in hbase.I have exported code from my eclipse to HDFS using hue. learnhbase.jar.Now I want to execute this code.
Could you please let me know how to execute it.
I have tried HADOOP JAR learnhbase.jar learnhbase.createtable but I have got class not found exception.
package learnhbase;
import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.util.Bytes;
public class CreateTable {
public static void main (String[] args) throws IOException{
//get configuration
Configuration conf = HBaseConfiguration.create();
// Instantiating hbase admin class
//HBaseAdmin admin = new HBaseAdmin(conf);
//Instantiating table descriptor class
HTable hTable = new HTable(conf, “CHARAN”);
System.out.println("Table is: " + Bytes.toString(hTable.getTableName()));
hTable.close();
}
}