Skip to content

필사 모드: HBase Client API Basics

English
0%
정확도 0%
💡 왼쪽 원문을 읽으면서 오른쪽에 따라 써보세요. Tab 키로 힌트를 받을 수 있습니다.
원문 렌더가 준비되기 전까지 텍스트 가이드로 표시합니다.

Overview

Let's explore the types of HBase Client APIs used to interact with HBase.

HBase Client Download

By visiting this link [HBase Client Maven Download Link](https://mvnrepository.com/artifact/org.apache.hbase/hbase-client), you can find the Maven repository for adding the HBase Client to your pom.xml.

Connection Setup

pom.xml

If you have set up your project with Maven, you can add the dependency to pom.xml as shown below.

HBase Client version 2.5.2 was selected.

Preparing hbase-site.xml

To use HBase, the process needs to know the HBase server information. Since HBase cluster metadata is managed through Zookeeper, you only need the Zookeeper quorum information.

There are two methods for this, and we will look at both.

1. Dynamically create a configuration containing the Zookeeper Quorum information.

2. Add hbase-site.xml to the class-path.

Manually entering zookeeper quorum information

Configuration config = HBaseConfiguration.create();

config.set("hbase.zookeeper.quorum", "ubuntu01,ubuntu02,ubuntu03");

Connection conn =ConnectionFactory.createConnection(config);

Table table = conn.getTableBuilder(TableName.valueOf("default","testtable"), null).build();

HTableDescriptor ds = table.getTableDescriptor();

System.out.println(ds.getNameAsString());

Uploading hbase-site.xml

You can place hbase-site.xml in the project's resources folder and add it to the class_path.

By doing this, you can remove the line `config.set("hbase.zookeeper.quorum", "ubuntu01,ubuntu02,ubuntu03");`.

This is because it uses the quorum information from inside hbase-site.xml. This approach is also more recommended.

Quiz

Learn the basics of the HBase Client API used to interact with HBase.

If you have set up your project with Maven, you can add the dependency to pom.xml as shown below.

HBase Client version 2.5.2 was selected.

To use HBase, the process needs to know the HBase server information. Since HBase cluster metadata

is managed through Zookeeper, you only need the Zookeeper quorum information. There are two

methods for this, and we will look at both.

현재 단락 (1/23)

Let's explore the types of HBase Client APIs used to interact with HBase.

작성 글자: 0원문 글자: 1,828작성 단락: 0/23