0

In cassandra hector API allow to create table on a selected cluster as follows. I want to do the same thing using HBase, can someone please help me out?

This is how it can done using Cassandra :

public void createColumnFamily(Cluster cluster, String tableName,
                                   String columnFamilyName,
                                   StreamDefinition streamDefinition) {
    }
mashuai
  • 561
  • 3
  • 10
Chamika Kasun
  • 96
  • 3
  • 16

1 Answers1

0

There is no such concept of cluster namespace in HBase. You can simple create a table in HBase using methods of HBaseAdmin class.

HBaseConfiguration conf = HBaseConfiguration.create();
HBaseAdmin admin = new HBaseAdmin(conf);
HTableDescriptor tableDescriptor = new HTableDescriptor(tableName);// maps to keyspace name of cassandra.
HColumnDescriptor hColumnDescriptor = new HColumnDescriptor(columnFamilyName);// maps to column family name of cassandra.
tableDescriptor.addFamily(hColumnDescriptor);

admin.createTable(hTableDescriptor);
kkmishra
  • 699
  • 4
  • 10