Updated on 2023-04-28 GMT+08:00

Scenario Description

This section applies to MRS 3.2.0 or later.

Typical Scenario Description

Use Flink API jobs to read data from and write data to HBase.

Data Preparation

Prepare the HBase configuration file and download the cluster configuration on FusionInsight Manager to obtain the hbase-site.xml file.

Development Guideline

  1. Writes data to HBase:
    1. Specify the parent directory of the hbase-site.xml file. Flink Sink can obtain the HBase connection.
    2. Use the connection to determine whether a table exists. If it does not, create one.
    3. Convert received data into Put objects and writes the Put objects to HBase.
  2. Reads data from HBase:
    1. Specify the parent directory of the hbase-site.xml file. Flink Source can obtain the HBase connection.
    2. Use the connection to determine whether a table exists. If it does not, the job fails. In this case, you need to create a table in HBase shell or an upstream job.
    3. Read data from HBase, converts result data into Row objects, and sends the Row objects to downstream operators.