HBase – Admin API

  • Post author:
  • Post category:HBase
  • Post comments:2 Comments
API

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.

Class HBaseAdmin

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.

Methods and Description

S.No.Methods and Description
1void createTable(HTableDescriptor desc)Creates a new table.
2void createTable(HTableDescriptor desc, byte[][] splitKeys)Creates a new table with an initial set of empty regions defined by the specified split keys.
3void deleteColumn(byte[] tableName, String columnName)Deletes a column from a table.
4void deleteColumn(String tableName, String columnName)Delete a column from a table.
5void deleteTable(String tableName)Deletes a table.

Class Descriptor

This class contains the details about an HBase table such as:

  • the descriptors of all the column families,
  • if the table is a catalog table,
  • if the table is read only,
  • the maximum size of the mem store,
  • when the region split should occur,
  • co-processors associated with it, etc.

Constructors

S.No.Constructor and summary
1HTableDescriptor(TableName name)Constructs a table descriptor specifying a TableName object.

Methods and Description

S.No.Methods and Description
1HTableDescriptor addFamily(HColumnDescriptor family)Adds a column family to the given descriptor

Next Topic:-Click Here

This Post Has 2 Comments

Leave a Reply