import java.io.IOException; // // Sample Hbase table creation // by Anders Brownworth // http://www.anders.com/ import org.apache.hadoop.fs.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.io.*; import org.apache.hadoop.hbase.client.*; public class CreateTable { public static void main( String args[] ) throws IOException { System.out.println( "starting..." ); System.out.println( "getting config..." ); HBaseConfiguration hc = new HBaseConfiguration( new Configuration( ) ); HTableDescriptor ht = new HTableDescriptor( "cdrs" ); // we'll use the call start time as a row key ht.addFamily( new HColumnDescriptor( "number:" ) ); // from and to ht.addFamily( new HColumnDescriptor( "company:" ) ); ht.addFamily( new HColumnDescriptor( "time:" ) ); // billing seconds ht.addFamily( new HColumnDescriptor( "location:" ) ); // rate center city 1, state 1 and city 2, state 2 System.out.println( "connecting..." ); HBaseAdmin hba = new HBaseAdmin( hc ); System.out.println( "creating table..." ); hba.createTable( ht ); System.out.println( "done!" ); } }