Hbase Java API introduction
The correspondence between several main Hbase API classes and data models:
1、 HBaseAdmin
Relationship: org.apache.hadoop.hbase.client.HBaseAdmin
Function: Provides an interface to manage table information of the HBase database. The methods it provides include: creating tables, deleting tables, listing table items, making tables valid or invalid, and adding or deleting table column family members, etc.
2、 HBaseConfiguration
Relationship: org.apache.hadoop.hbase.HBaseConfiguration
Function: Configure HBase
3、 HTableDescriptor
Relationship: org.apache.hadoop.hbase.HTableDescriptor
Function: Contains the name of the table and the column family of the corresponding table
4、 HColumnDescriptor
Relationship: org.apache.hadoop.hbase.HColumnDescriptor
Role: Maintains information about column families, such as version numbers, compression settings, etc. It is usually used when creating a table or adding a column family to a table. Column families cannot be modified directly after they are created, only by deleting and then re-creating them.
When a column family is deleted, the data in the column family will also be deleted at the same time.
5、 HTable
Relationship: org.apache.hadoop.hbase.client.HTable
Function: Can be used to communicate directly with HBase tables. This method is not thread-safe for update operations.
6、 Put
Relationship: org.apache.hadoop.hbase.client.Put
Function: Used to perform add operations on a single row
7、 Get
Relationship: org.apache.hadoop.hbase.client.Get
function: used to obtain relevant information of a single row
8、 Result
Relationship: org.apache.hadoop.hbase.client.Result
Function: Stores the single row value of the table obtained after the Get or Scan operation. Use the methods provided by this class to directly obtain values or various Map structures (key-value pairs)