This is an automated email from the ASF dual-hosted git repository.

duanzhengqiang 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 ade11bf0cc6 Remove useless codes on DataSourceNodePersistService 
(#31383)
ade11bf0cc6 is described below

commit ade11bf0cc6be86f6d0663608b3412a8607dfd18
Author: Liang Zhang <[email protected]>
AuthorDate: Sat May 25 14:27:42 2024 +0800

    Remove useless codes on DataSourceNodePersistService (#31383)
---
 .../database/DataSourceNodePersistService.java     | 40 ----------------------
 1 file changed, 40 deletions(-)

diff --git 
a/kernel/metadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/service/config/database/DataSourceNodePersistService.java
 
b/kernel/metadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/service/config/database/DataSourceNodePersistService.java
index a1d28fec617..3859fab5834 100644
--- 
a/kernel/metadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/service/config/database/DataSourceNodePersistService.java
+++ 
b/kernel/metadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/service/config/database/DataSourceNodePersistService.java
@@ -28,7 +28,6 @@ import org.apache.shardingsphere.mode.spi.PersistRepository;
 
 import java.util.Collection;
 import java.util.LinkedHashMap;
-import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
@@ -106,45 +105,6 @@ public final class DataSourceNodePersistService {
         
repository.delete(DataSourceMetaDataNode.getDataSourceNodeNode(databaseName, 
dataSourceName));
     }
     
-    /**
-     * Delete data source pool configuration.
-     *
-     * @param databaseName database name
-     * @param dataSourceConfigs to be deleted configurations
-     * @return meta data versions
-     */
-    public Collection<MetaDataVersion> deleteConfigurations(final String 
databaseName, final Map<String, DataSourcePoolProperties> dataSourceConfigs) {
-        Collection<MetaDataVersion> result = new LinkedList<>();
-        for (Entry<String, DataSourcePoolProperties> entry : 
dataSourceConfigs.entrySet()) {
-            String delKey = 
DataSourceMetaDataNode.getDataSourceNodeNode(databaseName, entry.getKey());
-            repository.delete(delKey);
-            result.add(new MetaDataVersion(delKey));
-        }
-        return result;
-    }
-    
-    /**
-     * Persist data source pool configurations.
-     *
-     * @param databaseName database name
-     * @param dataSourceConfigs to be persisted configurations
-     * @return meta data versions
-     */
-    public Collection<MetaDataVersion> persistConfigurations(final String 
databaseName, final Map<String, DataSourcePoolProperties> dataSourceConfigs) {
-        Collection<MetaDataVersion> result = new LinkedList<>();
-        for (Entry<String, DataSourcePoolProperties> entry : 
dataSourceConfigs.entrySet()) {
-            List<String> versions = 
repository.getChildrenKeys(DataSourceMetaDataNode.getDataSourceNodeVersionsNode(databaseName,
 entry.getKey()));
-            String nextActiveVersion = versions.isEmpty() ? 
MetaDataVersion.DEFAULT_VERSION : 
String.valueOf(Integer.parseInt(versions.get(0)) + 1);
-            
repository.persist(DataSourceMetaDataNode.getDataSourceNodeVersionNode(databaseName,
 entry.getKey(), nextActiveVersion),
-                    YamlEngine.marshal(new 
YamlDataSourceConfigurationSwapper().swapToMap(entry.getValue())));
-            if (Strings.isNullOrEmpty(getDataSourceActiveVersion(databaseName, 
entry.getKey()))) {
-                
repository.persist(DataSourceMetaDataNode.getDataSourceNodeActiveVersionNode(databaseName,
 entry.getKey()), MetaDataVersion.DEFAULT_VERSION);
-            }
-            result.add(new 
MetaDataVersion(DataSourceMetaDataNode.getDataSourceNodeNode(databaseName, 
entry.getKey()), getDataSourceActiveVersion(databaseName, entry.getKey()), 
nextActiveVersion));
-        }
-        return result;
-    }
-    
     private String getDataSourceActiveVersion(final String databaseName, final 
String dataSourceName) {
         return 
repository.query(DataSourceMetaDataNode.getDataSourceNodeActiveVersionNode(databaseName,
 dataSourceName));
     }

Reply via email to