This is an example program that uses the synchronous Kudu Java client APIs to:
-
Create a table
-
Insert some rows
-
Alter the table
-
Scan some rows
-
Delete the table
To test that this example is working using the Kudu binary jar, run the unit tests as follows:
$ mvn test
To build and run, ensure maven is installed and from the java-example directory run:
$ mvn package
$ java -jar target/kudu-java-example-1.0-SNAPSHOT.jar
By default, the example assumes the Kudu cluster has a single master running on
localhost with the default port 7051. To specify a different set of masters for
Kudu cluster, set the property kuduMasters
to a CSV of the master addresses in
the form host:port
, as shown:
$ java -DkuduMasters=master-0:7051,master-1:7051,master-2:7051 -jar target/kudu-java-example-1.0-SNAPSHOT.jar