eclipse / kapua

Eclipse Public License 2.0
222 stars 160 forks source link

:wrench: [Elasticsearch] Adding configuration parameters to Elasticsearch client #4071

Closed dseurotech closed 1 month ago

dseurotech commented 1 month ago

This PR makes parameters of Elasticsearch rest client configurable at startup time so that the performances can be tuned easier without the need to execute a new build. The parameters are the following:

The way to make these parameters configurable is explained in the Elasticsearch guide, see references below:

Timeouts | Elasticsearch Java API Client [7.17] | Elastic

Number of threads | Elasticsearch Java API Client [7.17] | Elastic

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 0% with 30 lines in your changes missing coverage. Please review.

Project coverage is 16.79%. Comparing base (03becfd) to head (1b11529). Report is 2 commits behind head on develop.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/eclipse/kapua/pull/4071/graphs/tree.svg?width=650&height=150&src=pr&token=1P4N4CApH8&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse)](https://app.codecov.io/gh/eclipse/kapua/pull/4071?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse) ```diff @@ Coverage Diff @@ ## develop #4071 +/- ## ============================================= - Coverage 16.80% 16.79% -0.02% Complexity 22 22 ============================================= Files 2008 2008 Lines 52177 52210 +33 Branches 4398 4399 +1 ============================================= Hits 8770 8770 - Misses 43011 43044 +33 Partials 396 396 ``` | [Files](https://app.codecov.io/gh/eclipse/kapua/pull/4071?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse) | Coverage Δ | | |---|---|---| | [...ent/DatastoreElasticsearchClientConfiguration.java](https://app.codecov.io/gh/eclipse/kapua/pull/4071?src=pr&el=tree&filepath=service%2Fdatastore%2Finternal%2Fsrc%2Fmain%2Fjava%2Forg%2Feclipse%2Fkapua%2Fservice%2Fdatastore%2Finternal%2Fclient%2FDatastoreElasticsearchClientConfiguration.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse#diff-c2VydmljZS9kYXRhc3RvcmUvaW50ZXJuYWwvc3JjL21haW4vamF2YS9vcmcvZWNsaXBzZS9rYXB1YS9zZXJ2aWNlL2RhdGFzdG9yZS9pbnRlcm5hbC9jbGllbnQvRGF0YXN0b3JlRWxhc3RpY3NlYXJjaENsaWVudENvbmZpZ3VyYXRpb24uamF2YQ==) | `0.00% <0.00%> (ø)` | | | [...onfiguration/ElasticsearchClientConfiguration.java](https://app.codecov.io/gh/eclipse/kapua/pull/4071?src=pr&el=tree&filepath=service%2Fcommons%2Felasticsearch%2Fclient-api%2Fsrc%2Fmain%2Fjava%2Forg%2Feclipse%2Fkapua%2Fservice%2Felasticsearch%2Fclient%2Fconfiguration%2FElasticsearchClientConfiguration.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse#diff-c2VydmljZS9jb21tb25zL2VsYXN0aWNzZWFyY2gvY2xpZW50LWFwaS9zcmMvbWFpbi9qYXZhL29yZy9lY2xpcHNlL2thcHVhL3NlcnZpY2UvZWxhc3RpY3NlYXJjaC9jbGllbnQvY29uZmlndXJhdGlvbi9FbGFzdGljc2VhcmNoQ2xpZW50Q29uZmlndXJhdGlvbi5qYXZh) | `0.00% <0.00%> (ø)` | | | [...tting/DatastoreElasticsearchClientSettingsKey.java](https://app.codecov.io/gh/eclipse/kapua/pull/4071?src=pr&el=tree&filepath=service%2Fdatastore%2Finternal%2Fsrc%2Fmain%2Fjava%2Forg%2Feclipse%2Fkapua%2Fservice%2Fdatastore%2Finternal%2Fsetting%2FDatastoreElasticsearchClientSettingsKey.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse#diff-c2VydmljZS9kYXRhc3RvcmUvaW50ZXJuYWwvc3JjL21haW4vamF2YS9vcmcvZWNsaXBzZS9rYXB1YS9zZXJ2aWNlL2RhdGFzdG9yZS9pbnRlcm5hbC9zZXR0aW5nL0RhdGFzdG9yZUVsYXN0aWNzZWFyY2hDbGllbnRTZXR0aW5nc0tleS5qYXZh) | `0.00% <0.00%> (ø)` | | | [...ation/ElasticsearchClientRequestConfiguration.java](https://app.codecov.io/gh/eclipse/kapua/pull/4071?src=pr&el=tree&filepath=service%2Fcommons%2Felasticsearch%2Fclient-api%2Fsrc%2Fmain%2Fjava%2Forg%2Feclipse%2Fkapua%2Fservice%2Felasticsearch%2Fclient%2Fconfiguration%2FElasticsearchClientRequestConfiguration.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse#diff-c2VydmljZS9jb21tb25zL2VsYXN0aWNzZWFyY2gvY2xpZW50LWFwaS9zcmMvbWFpbi9qYXZhL29yZy9lY2xpcHNlL2thcHVhL3NlcnZpY2UvZWxhc3RpY3NlYXJjaC9jbGllbnQvY29uZmlndXJhdGlvbi9FbGFzdGljc2VhcmNoQ2xpZW50UmVxdWVzdENvbmZpZ3VyYXRpb24uamF2YQ==) | `0.00% <0.00%> (ø)` | | | [...h/client/rest/RestElasticsearchClientProvider.java](https://app.codecov.io/gh/eclipse/kapua/pull/4071?src=pr&el=tree&filepath=service%2Fcommons%2Felasticsearch%2Fclient-rest%2Fsrc%2Fmain%2Fjava%2Forg%2Feclipse%2Fkapua%2Fservice%2Felasticsearch%2Fclient%2Frest%2FRestElasticsearchClientProvider.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse#diff-c2VydmljZS9jb21tb25zL2VsYXN0aWNzZWFyY2gvY2xpZW50LXJlc3Qvc3JjL21haW4vamF2YS9vcmcvZWNsaXBzZS9rYXB1YS9zZXJ2aWNlL2VsYXN0aWNzZWFyY2gvY2xpZW50L3Jlc3QvUmVzdEVsYXN0aWNzZWFyY2hDbGllbnRQcm92aWRlci5qYXZh) | `0.00% <0.00%> (ø)` | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/eclipse/kapua/pull/4071/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse)