Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Application scenario and connection Analysis of HBase Java Client Internal Thread Pool

Shulou Source: shulou.com Published: 2022-06-01 20:45:42 10月03日 Update

This article mainly introduces "HBase Java Client internal thread pool application scenario and connection analysis". In daily operation, I believe many people have doubts about HBase Java Client internal thread pool application scenario and connection analysis. The editor consulted all kinds of materials and sorted out simple and useful operation methods. I hope it will be helpful to answer the doubts of "HBase Java Client internal thread pool application scenario and connection analysis". Next, please follow the editor to study!

Thread pool related content is only used for calling batch related methods.

The following figure shows the internal parameters of the Dao object connection object

Construct Connection

In the distributed environment, the client needs to access the HBase through the address and port of the ZooKeeper to obtain the current active Master and the required RegionServer address. Therefore, you need to configure the address and port of ZooKeeper with the HBaseCongifiguration class before using the Connection class to establish a connection.

About the code connection is the singleton mode

@ Bean

Public Connection instance () throws Exception {

Configuration config = HBaseConfiguration.create ()

Config.set (HConstants.ZOOKEEPER_QUORUM, zooKeeper)

Config.set (HConstants.ZOOKEEPER_CLIENT_PORT, "2181")

Config.set (HConstants.ZOOKEEPER_ZNODE_PARENT, nodeParent)

Return ConnectionFactory.createConnection (config, Executors.newFixedThreadPool (20);}

Thread pools are created for batch operations

Gets the Table object if the thread pool pool parameter is not passed. Will generate one by default.

How to find region based on rowkey?

At this point, the study on "HBase Java Client internal thread pool application scenario and connection analysis" is over. I hope to be able to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Threads scenarios analysis applications learning addresses objects parameters methods more ports help utility next following figure code content distributed client client Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Shulou Tech Info macOS Shulou Information Microsoft