diff --git a/kernel/metadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/service/config/global/GlobalPersistService.java b/kernel/metadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/service/config/global/GlobalPersistService.java index 4b2bf0a320098..e12eed6107cc5 100644 --- a/kernel/metadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/service/config/global/GlobalPersistService.java +++ b/kernel/metadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/service/config/global/GlobalPersistService.java @@ -39,10 +39,10 @@ public interface GlobalPersistService { /** * Persist configurations. * - * @param globalRuleConfigs configurations + * @param globalRuleConfigs global configurations * @return meta data versions */ - Collection persistConfig(T globalRuleConfigs); + Collection persistConfigurations(T globalRuleConfigs); /** * Load configurations. diff --git a/kernel/metadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/service/config/global/GlobalRulePersistService.java b/kernel/metadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/service/config/global/GlobalRulePersistService.java index 3f98350602313..157af02fb39f8 100644 --- a/kernel/metadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/service/config/global/GlobalRulePersistService.java +++ b/kernel/metadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/service/config/global/GlobalRulePersistService.java @@ -62,7 +62,7 @@ public void persist(final Collection globalRuleConfigs) { @SuppressWarnings({"unchecked", "rawtypes"}) @Override - public Collection persistConfig(final Collection globalRuleConfigs) { + public Collection persistConfigurations(final Collection globalRuleConfigs) { Collection result = new LinkedList<>(); Map yamlConfigs = new YamlDataNodeGlobalRuleConfigurationSwapperEngine().swapToYamlRuleConfigurations(globalRuleConfigs); for (Entry entry : yamlConfigs.entrySet()) { diff --git a/kernel/metadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/service/config/global/PropertiesPersistService.java b/kernel/metadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/service/config/global/PropertiesPersistService.java index cdad56251d121..3a37ec786f064 100644 --- a/kernel/metadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/service/config/global/PropertiesPersistService.java +++ b/kernel/metadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/service/config/global/PropertiesPersistService.java @@ -52,7 +52,7 @@ public void persist(final Properties props) { } @Override - public Collection persistConfig(final Properties props) { + public Collection persistConfigurations(final Properties props) { List versions = repository.getChildrenKeys(GlobalNode.getPropsVersionsNode()); String nextActiveVersion = versions.isEmpty() ? DEFAULT_VERSION : String.valueOf(Integer.parseInt(versions.get(0)) + 1); String persistKey = GlobalNode.getPropsVersionNode(nextActiveVersion); diff --git a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/ClusterModeContextManager.java b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/ClusterModeContextManager.java index 05d76eee5a093..0163709741c30 100644 --- a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/ClusterModeContextManager.java +++ b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/ClusterModeContextManager.java @@ -149,12 +149,13 @@ public void removeRuleConfiguration(final String databaseName, final String rule @Override public void alterGlobalRuleConfiguration(final RuleConfiguration toBeAlteredRuleConfig) { GlobalPersistService> globalRuleService = contextManager.getMetaDataContexts().getPersistService().getGlobalRuleService(); - contextManager.getMetaDataContexts().getPersistService().getMetaDataVersionPersistService().switchActiveVersion(globalRuleService.persistConfig(Collections.singleton(toBeAlteredRuleConfig))); + contextManager.getMetaDataContexts().getPersistService().getMetaDataVersionPersistService() + .switchActiveVersion(globalRuleService.persistConfigurations(Collections.singleton(toBeAlteredRuleConfig))); } @Override public void alterProperties(final Properties props) { - Collection versions = contextManager.getMetaDataContexts().getPersistService().getPropsService().persistConfig(props); + Collection versions = contextManager.getMetaDataContexts().getPersistService().getPropsService().persistConfigurations(props); contextManager.getMetaDataContexts().getPersistService().getMetaDataVersionPersistService().switchActiveVersion(versions); } diff --git a/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/StandaloneModeContextManager.java b/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/StandaloneModeContextManager.java index 9d43223e5f5b4..71dd0d792cf8a 100644 --- a/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/StandaloneModeContextManager.java +++ b/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/StandaloneModeContextManager.java @@ -306,7 +306,8 @@ public void removeRuleConfiguration(final String databaseName, final String rule public void alterGlobalRuleConfiguration(final RuleConfiguration toBeAlteredRuleConfig) { contextManager.getConfigurationContextManager().alterGlobalRuleConfiguration(toBeAlteredRuleConfig); GlobalPersistService> globalRuleService = contextManager.getMetaDataContexts().getPersistService().getGlobalRuleService(); - contextManager.getMetaDataContexts().getPersistService().getMetaDataVersionPersistService().switchActiveVersion(globalRuleService.persistConfig(Collections.singleton(toBeAlteredRuleConfig))); + contextManager.getMetaDataContexts().getPersistService().getMetaDataVersionPersistService() + .switchActiveVersion(globalRuleService.persistConfigurations(Collections.singleton(toBeAlteredRuleConfig))); clearServiceCache(); } @@ -314,7 +315,7 @@ public void alterGlobalRuleConfiguration(final RuleConfiguration toBeAlteredRule public void alterProperties(final Properties props) { contextManager.getConfigurationContextManager().alterProperties(props); if (null != contextManager.getMetaDataContexts().getPersistService().getPropsService()) { - Collection versions = contextManager.getMetaDataContexts().getPersistService().getPropsService().persistConfig(props); + Collection versions = contextManager.getMetaDataContexts().getPersistService().getPropsService().persistConfigurations(props); contextManager.getMetaDataContexts().getPersistService().getMetaDataVersionPersistService().switchActiveVersion(versions); } clearServiceCache();