You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by yx...@apache.org on 2023/08/23 00:34:39 UTC
[shardingsphere] branch master updated: Remove useless ContextManager.getDataSourceMap() (#28224)
This is an automated email from the ASF dual-hosted git repository.
yx9o 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 88a7cec5ad1 Remove useless ContextManager.getDataSourceMap() (#28224)
88a7cec5ad1 is described below
commit 88a7cec5ad18fcc5da97e7a9f07f9fcb54d447f1
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Wed Aug 23 08:34:32 2023 +0800
Remove useless ContextManager.getDataSourceMap() (#28224)
* Refactor usage of ContextManager
* Refactor usage of ContextManager
* Remove useless ContextManager.getDataSourceMap()
* Refactor ConfigurationContextManager
* Refactor ContextManager
---
.../apache/shardingsphere/mode/manager/ContextManager.java | 11 -----------
.../mode/manager/context/ConfigurationContextManager.java | 2 +-
2 files changed, 1 insertion(+), 12 deletions(-)
diff --git a/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/ContextManager.java b/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/ContextManager.java
index 28c07889387..55a1b9f777f 100644
--- a/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/ContextManager.java
+++ b/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/ContextManager.java
@@ -45,7 +45,6 @@ import org.apache.shardingsphere.mode.manager.switcher.ResourceSwitchManager;
import org.apache.shardingsphere.mode.manager.switcher.SwitchingResource;
import org.apache.shardingsphere.mode.metadata.MetaDataContexts;
-import javax.sql.DataSource;
import java.sql.SQLException;
import java.util.Collections;
import java.util.Map;
@@ -99,16 +98,6 @@ public final class ContextManager implements AutoCloseable {
this.metaDataContexts.set(metaDataContexts);
}
- /**
- * Get data source map.
- *
- * @param databaseName database name
- * @return data source map
- */
- public Map<String, DataSource> getDataSourceMap(final String databaseName) {
- return metaDataContexts.get().getMetaData().getDatabase(databaseName).getResourceMetaData().getStorageUnitMetaData().getDataSources();
- }
-
/**
* Get storage units.
*
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 e44d4f05a0b..c8a30ac4447 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
@@ -64,8 +64,8 @@ import java.util.stream.Collectors;
/**
* Configuration context manager.
*/
-@Slf4j
@RequiredArgsConstructor
+@Slf4j
public final class ConfigurationContextManager {
private final AtomicReference<MetaDataContexts> metaDataContexts;