HBase Admin API – Class Descriptor & Class HBaseAdmin
Keeping you updated with latest technology trends, Join DataFlair on Telegram
1. Objective – HBase Admin API
In this HBase tutorial, “HBase Admin API” we will introduce the class which represents the Admin in HBase, called as HBase Admin API. We will also cover the role of Class Descriptor in HBase. Here, along with the methods as well as their relevant descriptions. Also, we will see HBase admin example.
So, let’s start HBase Admin API tutorial.
2. What is HBase Admin API?
HBase permits Java API in communicating with HBase because HBase is written in Java. However, the fastest way to communicate with HBase is Java API. So, here, we are describing the referenced Java Admin API below, that covers the tasks used for managing tables.
Let’s see HBase Security: Kerberos Authentication & Authorization
3. Class HBaseAdmin
A class which represents the Admin in HBase is HBaseAdmin. Basically, it is affiliated to the org.apache.hadoop.hbase.client package. However, a user can perform the tasks of an administrator, Using this class. Also by using Connection.getAdmin() method, they can get the instance of Admin.
a. Methods and Description
i. void createTable(HTableDescriptor desc)
In order to create a new table, we use this method.
ii. void createTable(HTableDescriptor desc, byte splitKeys)
However, it also creates a new table along with the initial set of empty regions which is defined by the specified split keys.
iii. void deleteColumn(byte tableName, String columnName)
Basically, to delete a column from a table, we use this method.
iv. void deleteColumn(String tableName, String columnName)
This method helps to delete a column from a table.
v. void deleteTable(String tableName)
The method, ‘void deleteTable” deletes a table.
Explore HBase Shell & Commands – Usage & Starting HBase Shell
4. Class Descriptor in HBase Admin API
As per its name, it consists of the details about an HBase table, like:
- About the descriptors of all the column families.
- Whether the table is a catalog table.
- Is the table is read-only?
- About the maximum size of the mem store.
- Also, it tells when the region split should occur.
- About the co-processors associated with it.
a. Constructor and Summary
Basically, it constructs a table descriptor specifying a TableName object.
b. Methods and Description
HTableDescriptor addFamily(HColumnDescriptor family)
In order to add a column family to the given descriptor, we use it.
Let’s learn HBase Commands
So, this was all about HBase Admin API.
5. Conclusion: HBase Admin API
Hence, in this HBase Administration tutorial, we have seen the whole concept of HBase Admin API. Next, we will see HBase Client API. However, if any doubt occurs, regarding HBase Admin API, feel free to ask. We will definitely get back to you.
See also –
Table Management Commands in HBase