eclipse / kapua

Eclipse Public License 2.0
222 stars 160 forks source link

🔧 [Datastore] Datastore caches individually configurable #4076

Closed dseurotech closed 1 month ago

dseurotech commented 1 month ago

This is the develop equivalent of https://github.com/eclipse/kapua/pull/4075

This PR adds the ability to override the default configuration for datastore caches on an individual basis. The following additional parameters can now be used to fine-tune caches:

# Specific caches overrides
# Clients cache overrides (if any value is omitted, the Local cache settings equivalent will be used)
#datastore.cache.clients.local.size.maximum=1100
#datastore.cache.clients.local.expire.after=120
#datastore.cache.clients.local.expire.strategy=TOUCHED
# Channels cache overrides (if any value is omitted, the Local cache settings equivalent will be used)
#datastore.cache.channels.local.size.maximum=1100
#datastore.cache.channels.local.expire.after=120
#datastore.cache.channels.local.expire.strategy=TOUCHED
# Metrics cache overrides (if any value is omitted, the Local cache settings equivalent will be used)
#datastore.cache.metrics.local.size.maximum=1100
#datastore.cache.metrics.local.expire.after=120
#datastore.cache.metrics.local.expire.strategy=TOUCHED
codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 41.37931% with 34 lines in your changes missing coverage. Please review.

Project coverage is 16.81%. Comparing base (296efcd) to head (34ba398).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/eclipse/kapua/pull/4076/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/4076?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse) ```diff @@ Coverage Diff @@ ## develop #4076 +/- ## ============================================= + Coverage 16.79% 16.81% +0.01% Complexity 22 22 ============================================= Files 2008 2010 +2 Lines 52210 52256 +46 Branches 4399 4401 +2 ============================================= + Hits 8770 8788 +18 - Misses 43044 43071 +27 - Partials 396 397 +1 ``` | [Files](https://app.codecov.io/gh/eclipse/kapua/pull/4076?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse) | Coverage Δ | | |---|---|---| | [...a/org/eclipse/kapua/commons/cache/CacheConfig.java](https://app.codecov.io/gh/eclipse/kapua/pull/4076?src=pr&el=tree&filepath=commons%2Fsrc%2Fmain%2Fjava%2Forg%2Feclipse%2Fkapua%2Fcommons%2Fcache%2FCacheConfig.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse#diff-Y29tbW9ucy9zcmMvbWFpbi9qYXZhL29yZy9lY2xpcHNlL2thcHVhL2NvbW1vbnMvY2FjaGUvQ2FjaGVDb25maWcuamF2YQ==) | `100.00% <100.00%> (ø)` | | | [.../org/eclipse/kapua/commons/cache/ExpiryPolicy.java](https://app.codecov.io/gh/eclipse/kapua/pull/4076?src=pr&el=tree&filepath=commons%2Fsrc%2Fmain%2Fjava%2Forg%2Feclipse%2Fkapua%2Fcommons%2Fcache%2FExpiryPolicy.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse#diff-Y29tbW9ucy9zcmMvbWFpbi9qYXZhL29yZy9lY2xpcHNlL2thcHVhL2NvbW1vbnMvY2FjaGUvRXhwaXJ5UG9saWN5LmphdmE=) | `100.00% <100.00%> (ø)` | | | [...s/service/internal/cache/CacheManagerProvider.java](https://app.codecov.io/gh/eclipse/kapua/pull/4076?src=pr&el=tree&filepath=commons%2Fsrc%2Fmain%2Fjava%2Forg%2Feclipse%2Fkapua%2Fcommons%2Fservice%2Finternal%2Fcache%2FCacheManagerProvider.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse#diff-Y29tbW9ucy9zcmMvbWFpbi9qYXZhL29yZy9lY2xpcHNlL2thcHVhL2NvbW1vbnMvc2VydmljZS9pbnRlcm5hbC9jYWNoZS9DYWNoZU1hbmFnZXJQcm92aWRlci5qYXZh) | `60.97% <100.00%> (ø)` | | | [...mons/service/internal/cache/KapuaCacheManager.java](https://app.codecov.io/gh/eclipse/kapua/pull/4076?src=pr&el=tree&filepath=commons%2Fsrc%2Fmain%2Fjava%2Forg%2Feclipse%2Fkapua%2Fcommons%2Fservice%2Finternal%2Fcache%2FKapuaCacheManager.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse#diff-Y29tbW9ucy9zcmMvbWFpbi9qYXZhL29yZy9lY2xpcHNlL2thcHVhL2NvbW1vbnMvc2VydmljZS9pbnRlcm5hbC9jYWNoZS9LYXB1YUNhY2hlTWFuYWdlci5qYXZh) | `67.64% <ø> (-2.63%)` | :arrow_down: | | [...tastore/internal/setting/DatastoreSettingsKey.java](https://app.codecov.io/gh/eclipse/kapua/pull/4076?src=pr&el=tree&filepath=service%2Fdatastore%2Finternal%2Fsrc%2Fmain%2Fjava%2Forg%2Feclipse%2Fkapua%2Fservice%2Fdatastore%2Finternal%2Fsetting%2FDatastoreSettingsKey.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse#diff-c2VydmljZS9kYXRhc3RvcmUvaW50ZXJuYWwvc3JjL21haW4vamF2YS9vcmcvZWNsaXBzZS9rYXB1YS9zZXJ2aWNlL2RhdGFzdG9yZS9pbnRlcm5hbC9zZXR0aW5nL0RhdGFzdG9yZVNldHRpbmdzS2V5LmphdmE=) | `100.00% <100.00%> (ø)` | | | [...va/org/eclipse/kapua/commons/cache/LocalCache.java](https://app.codecov.io/gh/eclipse/kapua/pull/4076?src=pr&el=tree&filepath=commons%2Fsrc%2Fmain%2Fjava%2Forg%2Feclipse%2Fkapua%2Fcommons%2Fcache%2FLocalCache.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse#diff-Y29tbW9ucy9zcmMvbWFpbi9qYXZhL29yZy9lY2xpcHNlL2thcHVhL2NvbW1vbnMvY2FjaGUvTG9jYWxDYWNoZS5qYXZh) | `77.77% <55.55%> (-8.43%)` | :arrow_down: | | [...vice/datastore/internal/DatastoreCacheManager.java](https://app.codecov.io/gh/eclipse/kapua/pull/4076?src=pr&el=tree&filepath=service%2Fdatastore%2Finternal%2Fsrc%2Fmain%2Fjava%2Forg%2Feclipse%2Fkapua%2Fservice%2Fdatastore%2Finternal%2FDatastoreCacheManager.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse#diff-c2VydmljZS9kYXRhc3RvcmUvaW50ZXJuYWwvc3JjL21haW4vamF2YS9vcmcvZWNsaXBzZS9rYXB1YS9zZXJ2aWNlL2RhdGFzdG9yZS9pbnRlcm5hbC9EYXRhc3RvcmVDYWNoZU1hbmFnZXIuamF2YQ==) | `0.00% <0.00%> (ø)` | | | [...apua/commons/setting/AbstractBaseKapuaSetting.java](https://app.codecov.io/gh/eclipse/kapua/pull/4076?src=pr&el=tree&filepath=commons%2Fsrc%2Fmain%2Fjava%2Forg%2Feclipse%2Fkapua%2Fcommons%2Fsetting%2FAbstractBaseKapuaSetting.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse#diff-Y29tbW9ucy9zcmMvbWFpbi9qYXZhL29yZy9lY2xpcHNlL2thcHVhL2NvbW1vbnMvc2V0dGluZy9BYnN0cmFjdEJhc2VLYXB1YVNldHRpbmcuamF2YQ==) | `92.85% <0.00%> (-7.15%)` | :arrow_down: | | [.../datastore/internal/setting/DatastoreSettings.java](https://app.codecov.io/gh/eclipse/kapua/pull/4076?src=pr&el=tree&filepath=service%2Fdatastore%2Finternal%2Fsrc%2Fmain%2Fjava%2Forg%2Feclipse%2Fkapua%2Fservice%2Fdatastore%2Finternal%2Fsetting%2FDatastoreSettings.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse#diff-c2VydmljZS9kYXRhc3RvcmUvaW50ZXJuYWwvc3JjL21haW4vamF2YS9vcmcvZWNsaXBzZS9rYXB1YS9zZXJ2aWNlL2RhdGFzdG9yZS9pbnRlcm5hbC9zZXR0aW5nL0RhdGFzdG9yZVNldHRpbmdzLmphdmE=) | `15.00% <5.55%> (-85.00%)` | :arrow_down: |