druid-client icon indicating copy to clipboard operation
druid-client copied to clipboard

Can not build project

Open rongnguyen opened this issue 8 years ago • 11 comments

There are three compile errors:

  1. The constructor DruidNode(String, null, null) is undefined
JsonConfigProvider.bindInstance(binder, Key.get(DruidNode.class, Self.class),
								new DruidNode("druid-client", null, null));
  1. The constructor DirectDruidClient(QueryToolChestWarehouse, QueryWatcher, ObjectMapper, HttpClient, String, ServiceEmitter) is undefined
final DirectDruidClient directDruidClient = new DirectDruidClient(WAREHOUSE, WATCHER, SMILE_MAPPER, httpClient,
				host, SERVICE_EMITTER);
  1. The constructor DirectDruidClient(QueryToolChestWarehouse, QueryWatcher, ObjectMapper, HttpClient, String, ServiceEmitter) is undefined
final DirectDruidClient directDruidClient = new DirectDruidClient(WAREHOUSE, WATCHER, SMILE_MAPPER, httpClient,
				host, SERVICE_EMITTER);

Please review it! (Thank for great project)

rongnguyen avatar Jan 10 '18 04:01 rongnguyen

Yes. Have the same issue in main branch as well. Seems it's due to the api change in the upstream druid-server. May need to update the client as well .Thanks

Seems the DirectDruidClient constructor needs a new string parameter named scheme, it's http or https based on the server port config. In client, I guess we need to pass in the parameter based on the broker config. Hope somebody who is familiar with the druid source can confirm and fix it .Thanks.

  public DirectDruidClient(
      QueryToolChestWarehouse warehouse,
      QueryWatcher queryWatcher,
      ObjectMapper objectMapper,
      HttpClient httpClient,
      String scheme,
      String host,
      ServiceEmitter emitter
  )
final DirectDruidClient directDruidClient = new DirectDruidClient(
            WAREHOUSE,
            WATCHER,
            SMILE_MAPPER,
            httpClient,
            "http",
            host,
            SERVICE_EMITTER
    );

xuelvming avatar Jan 22 '18 03:01 xuelvming

Seems the DirectDruidClient constructor needs a new string parameter named scheme, it's http or https based on the server port config. In client, I guess we need to pass in the parameter based on the broker config. Hope somebody who is familiar with the druid source can confirm and fix it .Thanks.

  public DirectDruidClient(
      QueryToolChestWarehouse warehouse,
      QueryWatcher queryWatcher,
      ObjectMapper objectMapper,
      HttpClient httpClient,
      String scheme,
      String host,
      ServiceEmitter emitter
  )
final DirectDruidClient directDruidClient = new DirectDruidClient(
            WAREHOUSE,
            WATCHER,
            SMILE_MAPPER,
            httpClient,
            "http",
            host,
            SERVICE_EMITTER
    );

xuelvming avatar Jan 22 '18 03:01 xuelvming

Can someone please fix this ASAP?

Janesh avatar Feb 28 '18 18:02 Janesh

Hi @Janesh this repository is just an example of how you might use internal unstable Druid APIs, and it isn't officially supported. If you are looking for something more stable then try Druid SQL (http://druid.io/docs/latest/querying/sql.html) -- which includes a JDBC driver -- or the Druid native JSON API.

gianm avatar Feb 28 '18 20:02 gianm

@gianm - Thanks for the clarification. How about using the druid-processing API directly (i.e using classes like https://github.com/druid-io/druid/blob/master/processing/src/main/java/io/druid/query/Druids.java, https://github.com/druid-io/druid/blob/master/processing/src/main/java/io/druid/query/Query.java etc)? Is the druid-processing API stable for external client use? Or, is it better for Java clients to use the SQL queries? The 3rd option being direct JSON request-response from Java. Any guidance is much appreciated.

Janesh avatar Feb 28 '18 21:02 Janesh

Hi @Janesh, none of the query stuff in druid-processing is considered a stable API. They will work, but if you use them then you will often need to fix compile breakages due to API changes.

The three stable APIs for external clients are all either web or jdbc based.

  • Native queries using HTTP (http://druid.io/docs/latest/querying/querying.html)
  • SQL using HTTP (http://druid.io/docs/latest/querying/sql.html)
  • SQL using JDBC through Avatica (http://druid.io/docs/latest/querying/sql.html)

gianm avatar Mar 01 '18 00:03 gianm

@gianm - Thank you so much for clarifying this :-). Really appreciate your help 👍

Janesh avatar Mar 01 '18 02:03 Janesh

@Janesh happy to help

gianm avatar Mar 01 '18 03:03 gianm

@gianm thanks for your support. A "working" java client like this would be very useful and make a great addition to the Druid ecosystem.

fmarelli avatar Mar 01 '18 07:03 fmarelli

Hi @fmarelli, I agree in principle although currently we are focusing our efforts on supporting JSON/HTTP clients and on the SQL layer. If only we had infinite resources :)

In the meantime I hope you find what you are looking for.

gianm avatar Mar 01 '18 08:03 gianm

HI @gianm I fully understand where you are coming from. I've been effectively using Druid with jdbc SQL in the last few months, thanks for the great work. Cheers

fmarelli avatar Mar 01 '18 08:03 fmarelli