eclipse / kapua

Eclipse Public License 2.0
227 stars 160 forks source link

FIX - deleteAllIndexes & refreshAllIndexes methods re-factoring #4096

Closed Agnul97 closed 3 months ago

Agnul97 commented 3 months ago

The deleteAllIndexes method, called in tests, was calling 4 times a low-level ES method that was deleting all the indexes stored. This was accomplished by calling the various deleteAllIndexes in the 4 *repositories classes, that had the same common implementation. I re-factored this implementation in order to delete only the respective repository indexes. Furthermore, I modified the refreshAllIndexes implementation, with the same logic. This fix serves mainly to prepare the codebase to the usage of OpenSearch at the place of ES.

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 6.06061% with 31 lines in your changes missing coverage. Please review.

Project coverage is 16.79%. Comparing base (9d86254) to head (72ef2e7). Report is 25 commits behind head on develop.

Files Patch % Lines
.../elasticsearch/client/ElasticsearchRepository.java 0.00% 6 Missing :warning:
...ticsearch/client/rest/RestElasticsearchClient.java 0.00% 6 Missing :warning:
...e/internal/ChannelInfoElasticsearchRepository.java 0.00% 4 Missing :warning:
...re/internal/ClientInfoElasticsearchRepository.java 0.00% 4 Missing :warning:
...e/datastore/internal/MetricInfoRepositoryImpl.java 0.00% 4 Missing :warning:
...ce/datastore/internal/mediator/DatastoreUtils.java 33.33% 2 Missing and 2 partials :warning:
...store/internal/MessageElasticsearchRepository.java 0.00% 2 Missing :warning:
...search/client/rest/ElasticsearchResourcePaths.java 0.00% 1 Missing :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/eclipse/kapua/pull/4096/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/4096?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse) ```diff @@ Coverage Diff @@ ## develop #4096 +/- ## ============================================= + Coverage 16.75% 16.79% +0.03% Complexity 22 22 ============================================= Files 2016 2019 +3 Lines 52357 52407 +50 Branches 4417 4418 +1 ============================================= + Hits 8773 8800 +27 - Misses 43184 43207 +23 Partials 400 400 ``` | [Files](https://app.codecov.io/gh/eclipse/kapua/pull/4096?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse) | Coverage Δ | | |---|---|---| | [...search/client/rest/ElasticsearchResourcePaths.java](https://app.codecov.io/gh/eclipse/kapua/pull/4096?src=pr&el=tree&filepath=service%2Fcommons%2Felasticsearch%2Fclient-rest%2Fsrc%2Fmain%2Fjava%2Forg%2Feclipse%2Fkapua%2Fservice%2Felasticsearch%2Fclient%2Frest%2FElasticsearchResourcePaths.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse#diff-c2VydmljZS9jb21tb25zL2VsYXN0aWNzZWFyY2gvY2xpZW50LXJlc3Qvc3JjL21haW4vamF2YS9vcmcvZWNsaXBzZS9rYXB1YS9zZXJ2aWNlL2VsYXN0aWNzZWFyY2gvY2xpZW50L3Jlc3QvRWxhc3RpY3NlYXJjaFJlc291cmNlUGF0aHMuamF2YQ==) | `0.00% <0.00%> (ø)` | | | [...store/internal/MessageElasticsearchRepository.java](https://app.codecov.io/gh/eclipse/kapua/pull/4096?src=pr&el=tree&filepath=service%2Fdatastore%2Finternal%2Fsrc%2Fmain%2Fjava%2Forg%2Feclipse%2Fkapua%2Fservice%2Fdatastore%2Finternal%2FMessageElasticsearchRepository.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse#diff-c2VydmljZS9kYXRhc3RvcmUvaW50ZXJuYWwvc3JjL21haW4vamF2YS9vcmcvZWNsaXBzZS9rYXB1YS9zZXJ2aWNlL2RhdGFzdG9yZS9pbnRlcm5hbC9NZXNzYWdlRWxhc3RpY3NlYXJjaFJlcG9zaXRvcnkuamF2YQ==) | `0.00% <0.00%> (ø)` | | | [...e/internal/ChannelInfoElasticsearchRepository.java](https://app.codecov.io/gh/eclipse/kapua/pull/4096?src=pr&el=tree&filepath=service%2Fdatastore%2Finternal%2Fsrc%2Fmain%2Fjava%2Forg%2Feclipse%2Fkapua%2Fservice%2Fdatastore%2Finternal%2FChannelInfoElasticsearchRepository.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse#diff-c2VydmljZS9kYXRhc3RvcmUvaW50ZXJuYWwvc3JjL21haW4vamF2YS9vcmcvZWNsaXBzZS9rYXB1YS9zZXJ2aWNlL2RhdGFzdG9yZS9pbnRlcm5hbC9DaGFubmVsSW5mb0VsYXN0aWNzZWFyY2hSZXBvc2l0b3J5LmphdmE=) | `0.00% <0.00%> (ø)` | | | [...re/internal/ClientInfoElasticsearchRepository.java](https://app.codecov.io/gh/eclipse/kapua/pull/4096?src=pr&el=tree&filepath=service%2Fdatastore%2Finternal%2Fsrc%2Fmain%2Fjava%2Forg%2Feclipse%2Fkapua%2Fservice%2Fdatastore%2Finternal%2FClientInfoElasticsearchRepository.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse#diff-c2VydmljZS9kYXRhc3RvcmUvaW50ZXJuYWwvc3JjL21haW4vamF2YS9vcmcvZWNsaXBzZS9rYXB1YS9zZXJ2aWNlL2RhdGFzdG9yZS9pbnRlcm5hbC9DbGllbnRJbmZvRWxhc3RpY3NlYXJjaFJlcG9zaXRvcnkuamF2YQ==) | `0.00% <0.00%> (ø)` | | | [...e/datastore/internal/MetricInfoRepositoryImpl.java](https://app.codecov.io/gh/eclipse/kapua/pull/4096?src=pr&el=tree&filepath=service%2Fdatastore%2Finternal%2Fsrc%2Fmain%2Fjava%2Forg%2Feclipse%2Fkapua%2Fservice%2Fdatastore%2Finternal%2FMetricInfoRepositoryImpl.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse#diff-c2VydmljZS9kYXRhc3RvcmUvaW50ZXJuYWwvc3JjL21haW4vamF2YS9vcmcvZWNsaXBzZS9rYXB1YS9zZXJ2aWNlL2RhdGFzdG9yZS9pbnRlcm5hbC9NZXRyaWNJbmZvUmVwb3NpdG9yeUltcGwuamF2YQ==) | `0.00% <0.00%> (ø)` | | | [...ce/datastore/internal/mediator/DatastoreUtils.java](https://app.codecov.io/gh/eclipse/kapua/pull/4096?src=pr&el=tree&filepath=service%2Fdatastore%2Finternal%2Fsrc%2Fmain%2Fjava%2Forg%2Feclipse%2Fkapua%2Fservice%2Fdatastore%2Finternal%2Fmediator%2FDatastoreUtils.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse#diff-c2VydmljZS9kYXRhc3RvcmUvaW50ZXJuYWwvc3JjL21haW4vamF2YS9vcmcvZWNsaXBzZS9rYXB1YS9zZXJ2aWNlL2RhdGFzdG9yZS9pbnRlcm5hbC9tZWRpYXRvci9EYXRhc3RvcmVVdGlscy5qYXZh) | `23.97% <33.33%> (-0.58%)` | :arrow_down: | | [.../elasticsearch/client/ElasticsearchRepository.java](https://app.codecov.io/gh/eclipse/kapua/pull/4096?src=pr&el=tree&filepath=service%2Fcommons%2Felasticsearch%2Fclient-api%2Fsrc%2Fmain%2Fjava%2Forg%2Feclipse%2Fkapua%2Fservice%2Felasticsearch%2Fclient%2FElasticsearchRepository.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse#diff-c2VydmljZS9jb21tb25zL2VsYXN0aWNzZWFyY2gvY2xpZW50LWFwaS9zcmMvbWFpbi9qYXZhL29yZy9lY2xpcHNlL2thcHVhL3NlcnZpY2UvZWxhc3RpY3NlYXJjaC9jbGllbnQvRWxhc3RpY3NlYXJjaFJlcG9zaXRvcnkuamF2YQ==) | `0.00% <0.00%> (ø)` | | | [...ticsearch/client/rest/RestElasticsearchClient.java](https://app.codecov.io/gh/eclipse/kapua/pull/4096?src=pr&el=tree&filepath=service%2Fcommons%2Felasticsearch%2Fclient-rest%2Fsrc%2Fmain%2Fjava%2Forg%2Feclipse%2Fkapua%2Fservice%2Felasticsearch%2Fclient%2Frest%2FRestElasticsearchClient.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse#diff-c2VydmljZS9jb21tb25zL2VsYXN0aWNzZWFyY2gvY2xpZW50LXJlc3Qvc3JjL21haW4vamF2YS9vcmcvZWNsaXBzZS9rYXB1YS9zZXJ2aWNlL2VsYXN0aWNzZWFyY2gvY2xpZW50L3Jlc3QvUmVzdEVsYXN0aWNzZWFyY2hDbGllbnQuamF2YQ==) | `0.00% <0.00%> (ø)` | | ... and [47 files with indirect coverage changes](https://app.codecov.io/gh/eclipse/kapua/pull/4096/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse)