Updated on 2022-09-14 GMT+08:00

Establish Connections

Function

Create a KuduClient object using the KuduClient.KuduClientBuilder(KUDU_MASTERS).build() method. The input parameter KUDU_MASTERS indicates the master address list of the Kudu cluster. If there are multiple master nodes, separate them with commas (,).

Sample Code

The following is a code snippet for establishing a connection:

// Create the Kudu connection object. 
KuduClient client = new KuduClient.KuduClientBuilder(KUDU_MASTERS).build(); 

In the sample code, KUDU_MASTERS indicates the masters address list of the Kudu cluster, for example, 192.168.0.100:7051, 192.168.0.101:7051, 192.168.0.102:7051. The format is address:port number. Use commas (,) to separate different addresses. The persistent connection object is recommended for production.