Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Implementation:Heibaiying BigData Notes HBaseConfiguration Create

From Leeroopedia


Knowledge Sources
Domains NoSQL, Big_Data
Last Updated 2026-02-10 10:00 GMT

Overview

Concrete tool for configuring an HBase client connection through ZooKeeper provided by org.apache.hadoop.hbase.HBaseConfiguration.

Description

The HBaseConfiguration.create() static method returns a Hadoop Configuration object that is pre-initialized with HBase default settings. The returned configuration object is then customized by setting the ZooKeeper quorum hosts and client port, which are the minimum required parameters for an HBase client to locate the cluster.

In the BigData-Notes reference implementation, this configuration is created once inside a static initializer block in HBaseUtils, ensuring it is available for the lifetime of the application.

Usage

Call HBaseConfiguration.create() at application startup, set the ZooKeeper connection properties, and pass the resulting Configuration to ConnectionFactory.createConnection().

Code Reference

Source Location

code/Hbase/hbase-java-api-2.x/src/main/java/com/heibaiying/HBaseUtils.java (Lines 18-28)

Signature

// Factory method from HBaseConfiguration
public static Configuration create();

// Setting connection properties on the returned Configuration
configuration.set("hbase.zookeeper.property.clientPort", "2181");
configuration.set("hbase.zookeeper.quorum", "hadoop001");

Import

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;

I/O Contract

Inputs

Name Type Required Description
(none) -- -- The create() factory method takes no arguments. Configuration properties are set after creation.
hbase.zookeeper.property.clientPort String Yes The port on which ZooKeeper listens for client connections (typically "2181").
hbase.zookeeper.quorum String Yes Comma-separated list of ZooKeeper host names or IP addresses (e.g., "hadoop001" or "zk1,zk2,zk3").

Outputs

Name Type Description
configuration org.apache.hadoop.conf.Configuration A Hadoop Configuration object populated with HBase defaults and the specified ZooKeeper connection properties.

Usage Examples

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;

// Create a Configuration pre-loaded with HBase defaults
Configuration configuration = HBaseConfiguration.create();

// Set the ZooKeeper client port
configuration.set("hbase.zookeeper.property.clientPort", "2181");

// Set the ZooKeeper quorum (comma-separated for multi-node ensembles)
configuration.set("hbase.zookeeper.quorum", "hadoop001");

// The configuration is now ready to be passed to ConnectionFactory

Related Pages

Implements Principle

Requires Environment

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment