Closed anskarl closed 5 years ago
Thanks for the efforts. Great to have support for HA Druid added. Awaiting the PR so we can review the code changes
Thanks @anskarl
Looks very good and thank you for the extensive proposal. I'm also fine with merging DruidHttpClient and DruidAdvancedHttpClient. This will make maintenance easier, the only issue here will be to come up with some general purpose configuration.
Compared to the initial POC, I have performed the following changes:
request-retries-per-host
and retry-delay
are renamed to query-retries
and query-retry-delay
, respectivelyI will make a PR to review the changes.
I am not sure if it is ideal to keep only one client (at least for the next release). Regarding the configuration, I think that it may need some additional changes. For example hosts parameter may move into client configuration and therefore only the DruidAdvancedHttpClient will accept multiple hosts, while the current one will accept only a single host parameter.
I am closing the issue, since the corresponding PR has been merged.
The current implementation of DruidClient (Druid v2.1.1) uses the connection-level client-side API (
outgoingConnectionHttp
andoutgoingConnectionHttps
). There are several limitations with the current implementation, most important ones are described below:I would like to propose an internal API change and an additional implementation of client with advanced features:
application.conf
) and can be migrated easily.DruidAdvancedHttpClient
, to address the aforementioned issues.Main features of the Advanced Http client
Proposed changes
reference.conf
orapplication.conf
files) accepts a sequence of druid hosts along with their port number. For example single host is defined ashosts="127.0.0.1:8082"
, while multiple hosts are defined in a comma separated formathosts=10.10.0.1:8082,10.10.0.2:8082
.DruidConfig invokes (using reflection) the desired implementation of a client. For example,
client-backend = "ing.wbaa.druid.client.DruidAdvancedHttpClient"
forDruidAdvancedHttpClient
,client-backend = "ing.wbaa.druid.client.DruidHttpClient"
for standard DruidHttpClient andclient-backend = "my.package.name.to.SomeCustomDruidClient"
for any other custom client that implements the DruidClient trait.Tests
To demonstrate and test the new implementation I also added the following:
The testing environment can be setup as below:
It is a work in progress, but all the proposed features are complete (I would like to write docs and do some code cleanups). The complete implementation of can be found in https://github.com/anskarl/scruid/commit/6685179dbc9b197cb329b593ef8663a13604b15d
I am looking forward to your comments :)