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.
Last Article: Sample Code Description
Next Article: Creating a Table
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.