Alfredo Serafini
Alfredo Serafini

Reputation: 194

starting apache drill process with java API?

Hi I'm doing some experimentation with Drill for a prototype, and it works ok with "embedded" mode. At the moment we use the maven dependency for drill-jdbc-all and a JDBC with:

Class.forName("org.apache.drill.jdbc.Driver")
val conn = DriverManager.getConnection("jdbc:drill:drillbit=localhost:31010")
[...]

I wonder if there is a way to start a drill instance directly using java API, without the need of launching it from console? I've tried using the jdbc:drill:zk=local connection url also, but cannot find a way to start a local node with zookeeper. I've searched on the github, but without any luck.

Thanks in advance for any suggestion

Upvotes: 1

Views: 432

Answers (1)

ilooner
ilooner

Reputation: 2550

If you want run Drill on a single node completely programmatically you can look at the Drill unit tests for examples. Specifically the unit tests use the ClusterFixture class to run Drill programatically. For an example of how to use the ClusterFixture to launch drill see fifthTest in ExampleTest. Note all this code is in the test part of the Drill project, so you will have to copy this code (and all the other classes it depends on in the test packages) to use it in your project. If your interested in this being exposed as a library please post your thoughts to the Drill mailing list. Information about signing up for the Drill mailing list is here.

Upvotes: 2

Related Questions