English 中文(简体)
HBase - Admin API
  • 时间:2024-11-03

HBase - Admin API


Previous Page Next Page  

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.cpent 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
1

void createTable(HTableDescriptor desc)

Creates a new table.

2

void createTable(HTableDescriptor desc, byte[][] spptKeys)

Creates a new table with an initial set of empty regions defined by the specified sppt 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.

Class Descriptor

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

    the descriptors of all the column famipes,

    if the table is a catalog table,

    if the table is read only,

    the maximum size of the mem store,

    when the region sppt should occur,

    co-processors associated with it, etc.

Constructors

S.No. Constructor and summary
1

HTableDescriptor(TableName name)

Constructs a table descriptor specifying a TableName object.

Methods and Description

S.No. Methods and Description
1

HTableDescriptor addFamily(HColumnDescriptor family)

Adds a column family to the given descriptor

Advertisements