-
Notifications
You must be signed in to change notification settings - Fork 251
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
refactor: separate sql stores from datasources #4381
refactor: separate sql stores from datasources #4381
Conversation
@@ -60,7 +61,7 @@ | |||
|
|||
@Override | |||
public void initialize(ServiceExtensionContext context) { | |||
var dataSourceName = context.getConfig().getString(DATASOURCE_SETTING_NAME, DataSourceRegistry.DEFAULT_DATASOURCE); | |||
var dataSourceName = DataSourceName.getDataSourceName(DATASOURCE_NAME, DATASOURCE_SETTING_NAME, context.getConfig(), context.getMonitor()); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
DataSourceName.getDataSourceName
@@ -61,7 +62,7 @@ | |||
|
|||
@Override | |||
public void initialize(ServiceExtensionContext context) { | |||
var dataSourceName = context.getConfig().getString(DATASOURCE_SETTING_NAME, DataSourceRegistry.DEFAULT_DATASOURCE); | |||
var dataSourceName = DataSourceName.getDataSourceName(DATASOURCE_NAME, DATASOURCE_SETTING_NAME, context.getConfig(), context.getMonitor()); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
DataSourceName.getDataSourceName
@@ -61,7 +62,7 @@ | |||
|
|||
@Override | |||
public void initialize(ServiceExtensionContext context) { | |||
var dataSourceName = context.getConfig().getString(DATASOURCE_SETTING_NAME, DataSourceRegistry.DEFAULT_DATASOURCE); | |||
var dataSourceName = DataSourceName.getDataSourceName(DATASOURCE_NAME, DATASOURCE_SETTING_NAME, context.getConfig(), context.getMonitor()); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
DataSourceName.getDataSourceName
@@ -60,7 +66,8 @@ | |||
|
|||
@Override | |||
public void initialize(ServiceExtensionContext context) { | |||
var dataSourceName = getDataSourceName(context); | |||
var dataSourceName = DataSourceName.getDataSourceName(DATASOURCE_NAME, DATASOURCE_SETTING_NAME, context.getConfig(), context.getMonitor()); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
DataSourceName.getDataSourceName
@@ -56,7 +60,8 @@ | |||
|
|||
@Override | |||
public void initialize(ServiceExtensionContext context) { | |||
var dataSourceName = getDataSourceName(context); | |||
var dataSourceName = DataSourceName.getDataSourceName(DATASOURCE_NAME, DATASOURCE_SETTING_NAME, context.getConfig(), context.getMonitor()); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
DataSourceName.getDataSourceName
@@ -60,7 +64,8 @@ | |||
|
|||
@Override | |||
public void initialize(ServiceExtensionContext context) { | |||
var dataSourceName = getDataSourceName(context); | |||
var dataSourceName = DataSourceName.getDataSourceName(DATASOURCE_NAME, DATASOURCE_SETTING_NAME, context.getConfig(), context.getMonitor()); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
DataSourceName.getDataSourceName
@@ -70,7 +75,8 @@ | |||
|
|||
@Provider | |||
public AccessTokenDataStore dataPlaneStore(ServiceExtensionContext context) { | |||
var dataSourceName = getDataSourceName(context); | |||
var dataSourceName = DataSourceName.getDataSourceName(DATASOURCE_NAME, DATASOURCE_SETTING_NAME, context.getConfig(), context.getMonitor()); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
DataSourceName.getDataSourceName
@@ -69,7 +74,8 @@ | |||
|
|||
@Provider | |||
public DataPlaneStore dataPlaneStore(ServiceExtensionContext context) { | |||
var dataSourceName = getDataSourceName(context); | |||
var dataSourceName = DataSourceName.getDataSourceName(DATASOURCE_NAME, DATASOURCE_SETTING_NAME, context.getConfig(), context.getMonitor()); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
DataSourceName.getDataSourceName
@@ -70,7 +76,8 @@ | |||
|
|||
@Provider | |||
public DataPlaneInstanceStore dataPlaneInstanceStore(ServiceExtensionContext context) { | |||
var dataSourceName = getDataSourceName(context); | |||
var dataSourceName = DataSourceName.getDataSourceName(DATASOURCE_NAME, DATASOURCE_SETTING_NAME, context.getConfig(), context.getMonitor()); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
DataSourceName.getDataSourceName
@@ -60,7 +65,8 @@ | |||
|
|||
@Provider | |||
public PolicyMonitorStore policyMonitorStore(ServiceExtensionContext context) { | |||
var dataSourceName = context.getConfig().getString(DATASOURCE_SETTING_NAME, DEFAULT_DATASOURCE); | |||
var dataSourceName = DataSourceName.getDataSourceName(DATASOURCE_NAME, DATASOURCE_SETTING_NAME, context.getConfig(), context.getMonitor()); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
DataSourceName.getDataSourceName
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #4381 +/- ##
==========================================
+ Coverage 71.74% 74.91% +3.16%
==========================================
Files 919 1072 +153
Lines 18457 21453 +2996
Branches 1037 1173 +136
==========================================
+ Hits 13242 16071 +2829
- Misses 4756 4859 +103
- Partials 459 523 +64 ☔ View full report in Codecov by Sentry. |
What this PR changes/adds
Separate stores and datasources configurations, making configuration easier and clearer:
edc.datasource
represents the datasource configuration, that by default requires only onedefault
datasource, but there's the possibility to define multiple of themedc.sql.store.<name>.datasource
will associate the store to a datasource, that by default will bedefault
this will not break the existent configuration, but a
warning
log will be printed to spur adopters to migrate.Why it does that
simplify configuration
Further notes
CommonsConnectionPoolServiceExtension
Linked Issue(s)
Closes #3811
Please be sure to take a look at the contributing guidelines and our etiquette for pull requests.