HBase is written in java, therefore it provides java API to communicate with HBase. Java API is the fastest way to communicate with HBase. Given below is the referenced java Admin API that covers the tasks used to manage tables.
HBaseAdmin is a class representing the Admin. This class belongs to the org.apache.hadoop.hbase.client package. Using this class, you can perform the tasks of an administrator. You can get the instance of Admin using Connection.getAdmin() method.
S.No. | Methods and Description |
---|---|
1 | void createTable(HTableDescriptor desc) Creates a new table. |
2 | void createTable(HTableDescriptor desc, byte[][] splitKeys) Creates a new table with an initial set of empty regions defined by the specified split keys. |
3 | void deleteColumn(byte[] tableName, String columnName) Deletes a column from a table. |
4 | void deleteColumn(String tableName, String columnName) Delete a column from a table. |
5 | void deleteTable(String tableName) Deletes a table. |
This class contains the details about an HBase table such as:
S.No. | Constructor and summary |
---|---|
1 | HTableDescriptor(TableName name) Constructs a table descriptor specifying a TableName object. |
S.No. | Methods and Description |
---|---|
1 | HTableDescriptor addFamily(HColumnDescriptor family) Adds a column family to the given descriptor |