This is an automated email from the ASF dual-hosted git repository.
sunnianjun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 1eb799d8d64 Fix sonar issue of ConfigurationContextManager (#27390)
1eb799d8d64 is described below
commit 1eb799d8d64272e191cee911129bc4a974712571
Author: Liang Zhang <[email protected]>
AuthorDate: Sun Jul 23 22:26:30 2023 +0800
Fix sonar issue of ConfigurationContextManager (#27390)
---
.../mode/manager/context/ConfigurationContextManager.java | 3 +--
.../coordinator/subscriber/NewConfigurationChangedSubscriber.java | 4 ++--
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git
a/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/context/ConfigurationContextManager.java
b/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/context/ConfigurationContextManager.java
index ec5bfd6d966..af5066d6fd4 100644
---
a/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/context/ConfigurationContextManager.java
+++
b/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/context/ConfigurationContextManager.java
@@ -92,11 +92,10 @@ public final class ConfigurationContextManager {
* Alter storage unit.
*
* @param databaseName database name
- * @param storageUnitName storage unit name
* @param dataSourceProps data source properties
*/
@SuppressWarnings("rawtypes")
- public synchronized void alterStorageUnit(final String databaseName, final
String storageUnitName, final Map<String, DataSourceProperties>
dataSourceProps) {
+ public synchronized void alterStorageUnit(final String databaseName, final
Map<String, DataSourceProperties> dataSourceProps) {
try {
Collection<ResourceHeldRule> staleResourceHeldRules =
getStaleResourceHeldRules(databaseName);
staleResourceHeldRules.forEach(ResourceHeldRule::closeStaleResource);
diff --git
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/NewConfigurationChangedSubscriber.java
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/NewConfigurationChangedSubscriber.java
index 49a9f10edf5..349542fc3d6 100644
---
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/NewConfigurationChangedSubscriber.java
+++
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/NewConfigurationChangedSubscriber.java
@@ -65,8 +65,8 @@ public final class NewConfigurationChangedSubscriber {
if
(!event.getActiveVersion().equals(contextManager.getMetaDataContexts().getPersistService().getMetaDataVersionPersistService().getActiveVersionByFullPath(event.getActiveVersionKey())))
{
return;
}
-
contextManager.getConfigurationContextManager().alterStorageUnit(event.getDatabaseName(),
event.getStorageUnitName(),
-
contextManager.getMetaDataContexts().getPersistService().getDataSourceUnitService().load(event.getDatabaseName(),
event.getStorageUnitName()));
+ contextManager.getConfigurationContextManager().alterStorageUnit(
+ event.getDatabaseName(),
contextManager.getMetaDataContexts().getPersistService().getDataSourceUnitService().load(event.getDatabaseName(),
event.getStorageUnitName()));
}
/**