Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disabling datastore feature parameter #2963

Merged
merged 4 commits into from
May 14, 2020
Merged

Conversation

riccardomodanese
Copy link
Contributor

@riccardomodanese riccardomodanese commented May 5, 2020

Signed-off-by: riccardomodanese riccardo.modanese@eurotech.com
Added a feature to disable completely the datastore feature from the broker.
The idea is to allow Kapua to start and run without any exception in a deploy without any datastore.
This is controlled by an environment variable:

  • KAPUA_DATASTORE_DISABLE if true the broker doesn't create any datastore related object (and so doesn't try to connect to it)

Related Issue
none

Description of the solution adopted
none

Screenshots
none

Any side note on the changes made
In this PR there's also some updates to the code originally merged with #2947. Specifically:

  • isAvailableService() has been renamed to isServiceEnabled()
  • isAvailableProperty() has been renamed to isPropertyEnabled()
  • isServiceEnabled() has been moved from AbstractKapuaConfigurableService to AbstractKapuaService
  • When reading configuration for a disabled service, now KapuaServiceDisabledException is thrown instead of silently return null

@riccardomodanese riccardomodanese requested review from Coduz and lorthirk May 5, 2020 12:34
@riccardomodanese
Copy link
Contributor Author

@lorthirk should we add a similar feature in the console and rest api also?

@riccardomodanese riccardomodanese added the Enhancement This PR/Issue improves an part of Kapua label May 5, 2020
Copy link

@lorthirk lorthirk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means that <!-- BEGIN DATASTORE PERSISTENCE --> and <!-- END DATASTORE PERSISTENCE --> comments have now special semantics. Are we sure we want to do this? I suspect that someone could not understand this by just looking at the file. Maybe we should at least document this somewhere?

@lorthirk lorthirk marked this pull request as draft May 5, 2020 13:58
Signed-off-by: riccardomodanese <riccardo.modanese@eurotech.com>
@lorthirk lorthirk force-pushed the feature-datastoreDisable branch 2 times, most recently from 94140a8 to 27f595d Compare May 11, 2020 14:44
@codecov
Copy link

codecov bot commented May 12, 2020

Codecov Report

Merging #2963 into develop will decrease coverage by 0.08%.
The diff coverage is 15.68%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #2963      +/-   ##
=============================================
- Coverage      56.19%   56.11%   -0.09%     
- Complexity      2591     2594       +3     
=============================================
  Files           1061     1062       +1     
  Lines          23002    23042      +40     
  Branches        2064     2064              
=============================================
+ Hits           12926    12930       +4     
- Misses          9123     9140      +17     
- Partials         953      972      +19     
Impacted Files Coverage Δ Complexity Δ
...ervice/internal/KapuaServiceDisabledException.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...store/internal/ChannelInfoRegistryServiceImpl.java 73.19% <0.00%> (-9.37%) 12.00 <7.00> (+1.00) ⬇️
...astore/internal/ClientInfoRegistryServiceImpl.java 72.63% <0.00%> (-9.52%) 12.00 <7.00> (+1.00) ⬇️
...ce/datastore/internal/MessageStoreServiceImpl.java 52.63% <0.00%> (-0.56%) 11.00 <1.00> (+1.00) ⬇️
...astore/internal/MetricInfoRegistryServiceImpl.java 73.19% <0.00%> (-9.37%) 12.00 <7.00> (+1.00) ⬇️
...onfiguration/AbstractKapuaConfigurableService.java 76.87% <30.00%> (-1.22%) 0.00 <0.00> (ø)
...commons/service/internal/AbstractKapuaService.java 75.00% <100.00%> (+2.27%) 0.00 <0.00> (ø)
...c/main/java/org/eclipse/kapua/KapuaErrorCodes.java 100.00% <100.00%> (ø) 1.00 <0.00> (ø)
...atastore/internal/setting/DatastoreSettingKey.java 100.00% <100.00%> (ø) 3.00 <0.00> (ø)
...obDeviceManagementOperationManagerServiceImpl.java 73.17% <0.00%> (-6.10%) 13.00% <0.00%> (-1.00%)
... and 7 more

Claudio Mezzasalma added 3 commits May 12, 2020 17:04
Signed-off-by: Claudio Mezzasalma <claudio.mezzasalma@eurotech.com>
Signed-off-by: Claudio Mezzasalma <claudio.mezzasalma@eurotech.com>
Signed-off-by: Claudio Mezzasalma <claudio.mezzasalma@eurotech.com>
@lorthirk lorthirk force-pushed the feature-datastoreDisable branch from 7e9ba8f to a96050b Compare May 12, 2020 15:10
@lorthirk lorthirk marked this pull request as ready for review May 13, 2020 07:44
@Coduz Coduz merged commit 1713769 into develop May 14, 2020
@Coduz Coduz deleted the feature-datastoreDisable branch May 14, 2020 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement This PR/Issue improves an part of Kapua
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants