Got it

HBase REST API Invoking Example

Latest reply: Jan 19, 2022 10:53:13 408 3 3 0 0

Hello everyone, 

I believe you can learn how to deal with HBase REST API Invoking Example from my case.

Introduction to HBase

HBase is a highly reliable, high-performance, column-oriented, and scalable distributed storage system. HBase is designed to address the limitations of relational databases in processing massive data.

The HBase application scenario has the following features:

  • Processes massive amounts of data (TB or petabyte-level or above).

  • High throughput.

  • Efficient random reads in massive amounts of data.

  • It has good retractability.

  • Ability to handle both structured and unstructured data.

  • Does not need to fully possess the ACID features of traditional relational databases.Acid features refer to atomicity, consistency, isolation, and durability.

  • Tables in HBase have the following features:

  1.  Large: A table can have hundreds of millions of rows and millions of columns.

  2.  Column-oriented: Column (family)-oriented storage and permission control. Columns (family) can be retrieved independently.

  3.  Sparse: A null column does not occupy storage space. Therefore, a table can be sparsely designed.

Sample Background

Assume that a user develops an application and invokes the HBase through the REST interface. The operations involved in the code sample are as follows:

  1. Obtain and authenticate authentication information.

  2. Obtain the HBase version of the cluster.

  3. This command is used to obtain information about all existing HBase tables.

  4. Namespace-related operations.

  5. Table-related operations.

Procedure for Invoking the Windows Environment Sample

  1. Prepare the environment. For details, see the first lesson.

  2. The difference between the time and the cluster time cannot exceed 5 minutes.

  3. Check whether the C:\Windows\System32\drivers\etc\hosts file contains the domain name and IP address mapping information of all cluster nodes.

  4. Open the hbase-rest-example directory in the sample code of the IDEA. By default, the dependency is automatically downloaded. If the directory is not downloaded, right-click the pom.xml file in the directory and choose Add As Maven Project. Wait until the project automatically downloads the dependency.

  5. Download the user authentication credentials from Manager, decompress the user.keytab and krb5.conf files, and save the two files to the resources/conf directory of the project.

  6. Right-click the resources directory and choose Mark Directory as > Resources Root from the shortcut menu.

  7. Log in to FusionInsight Manager and check whether the Rest instance is installed on HBase.

  8. Modify the authentication user name and cluster connection information in the code.

  9. Open the HBaseRestTest.java file and right-click Run to start the sample code.

Debugging Procedure in the Linux Environment

  1. Completing the Windows Environment Sample Call Procedure

  2. Check whether the time difference between the Linux environment and the cluster is less than or equal to 5 minutes.

  3. Check whether the JDK version in the Linux environment is 1.8.

  4. Check whether the /etc/hosts file in the Linux environment contains the domain name and IP address mapping information of all cluster nodes.

  5. Create a sample execution path, for example, /opt/hbase_rest_test.

  6. Upload the hbase-rest-example-2.2.3-hw-ei-302002.jar package in the target directory generated in the Windows environment to the /opt/hbase_rest_test directory.

  7. Upload the conf directory in the resources directory of the sample project to /opt/hbase_rest_test.

  8. Use the plug-in to generate the dependency directory lib in the IDEA and upload it to /opt/hbase_rest_test.

  9. Run the following command to verify the sample code running in the Linux environment

java -cp /opt/hbase_rest_test/:/opt/hbase_rest_test/lib/*:/opt/hbase_rest_test/hbase-rest-example-2.2.3-hw-ei-302002.jar com.huawei.bigdata.hbase.examples.HBaseRestTest

I hope it is helpful to you!


  • x
  • convention:

little_fish
Admin Created Mar 30, 2021 09:48:48

Thank you.
View more
  • x
  • convention:

olive.zhao
Admin Created Jan 14, 2022 01:01:55

Thanks for your sharing!
View more
  • x
  • convention:

user_4358465
Created Jan 19, 2022 10:53:13

Well detailed. Thanks for sharing it!
View more
  • x
  • convention:

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.
Information Protection Guide
Thanks for using Huawei Enterprise Support Community! We will help you learn how we collect, use, store and share your personal information and the rights you have in accordance with Privacy Policy and User Agreement.