使用 java API 启动 apache 钻取进程?

starting apache drill process with java API?

你好,我正在用 Drill 做一些原型实验,它在 "embedded" 模式下工作正常。 目前我们使用 drill-jdbc-all 的 Maven 依赖项和 JDBC with:

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

我想知道是否有一种方法可以直接使用 java API 启动 drill 实例,而不需要从控制台启动它? 我也尝试过使用 jdbc:drill:zk=local 连接 url,但找不到使用 zookeeper 启动本地节点的方法。我在 github 上搜索过,但一无所获。

提前感谢您的任何建议

如果您想要 运行 完全以编程方式在单个节点上进行钻取,您可以查看钻取单元测试以获取示例。具体来说,单元测试使用 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.