You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2022/05/15 07:04:43 UTC

[shardingsphere] branch master updated: Use frontend database type for metaDataContextsBuilder.addSystemDatabases (#17668)

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 afb67964c3a Use frontend database type for metaDataContextsBuilder.addSystemDatabases (#17668)
afb67964c3a is described below

commit afb67964c3a617ff3c337fbbb3eb87aaae7d9de8
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Sun May 15 15:04:37 2022 +0800

    Use frontend database type for metaDataContextsBuilder.addSystemDatabases (#17668)
---
 .../apache/shardingsphere/mode/metadata/MetaDataContextsBuilder.java    | 2 +-
 .../mode/manager/cluster/ClusterContextManagerBuilder.java              | 2 +-
 .../shardingsphere/mode/manager/memory/MemoryContextManagerBuilder.java | 2 +-
 .../mode/manager/standalone/StandaloneContextManagerBuilder.java        | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/shardingsphere-mode/shardingsphere-mode-core/src/main/java/org/apache/shardingsphere/mode/metadata/MetaDataContextsBuilder.java b/shardingsphere-mode/shardingsphere-mode-core/src/main/java/org/apache/shardingsphere/mode/metadata/MetaDataContextsBuilder.java
index 23ccc22a2ba..0aa43d613ec 100644
--- a/shardingsphere-mode/shardingsphere-mode-core/src/main/java/org/apache/shardingsphere/mode/metadata/MetaDataContextsBuilder.java
+++ b/shardingsphere-mode/shardingsphere-mode-core/src/main/java/org/apache/shardingsphere/mode/metadata/MetaDataContextsBuilder.java
@@ -88,7 +88,7 @@ public final class MetaDataContextsBuilder {
     }
     
     /**
-     * Add system schemas.
+     * Add system databases.
      *
      * @param databaseType database type
      */
diff --git a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/ClusterContextManagerBuilder.java b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/ClusterContextManagerBuilder.java
index 405d6693a91..74a57f228f9 100644
--- a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/ClusterContextManagerBuilder.java
+++ b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/ClusterContextManagerBuilder.java
@@ -140,7 +140,7 @@ public final class ClusterContextManagerBuilder implements ContextManagerBuilder
             }
             result.addDatabase(entry.getKey(), databaseType, entry.getValue(), props);
         }
-        result.addSystemDatabases(databaseType);
+        result.addSystemDatabases(DatabaseTypeEngine.getFrontendDatabaseType(databaseConfigMap, new ConfigurationProperties(props)));
         return result;
     }
     
diff --git a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-memory-mode/shardingsphere-memory-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/memory/MemoryContextManagerBuilder.java b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-memory-mode/shardingsphere-memory-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/memory/MemoryContextManagerBuilder.java
index 6e8f702d814..4d4f55a712c 100644
--- a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-memory-mode/shardingsphere-memory-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/memory/MemoryContextManagerBuilder.java
+++ b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-memory-mode/shardingsphere-memory-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/memory/MemoryContextManagerBuilder.java
@@ -54,7 +54,7 @@ public final class MemoryContextManagerBuilder implements ContextManagerBuilder
         for (Entry<String, ? extends DatabaseConfiguration> entry : parameter.getDatabaseConfigs().entrySet()) {
             metaDataContextsBuilder.addDatabase(entry.getKey(), databaseType, entry.getValue(), parameter.getProps());
         }
-        metaDataContextsBuilder.addSystemDatabases(databaseType);
+        metaDataContextsBuilder.addSystemDatabases(DatabaseTypeEngine.getFrontendDatabaseType(parameter.getDatabaseConfigs(), new ConfigurationProperties(parameter.getProps())));
         MetaDataContexts metaDataContexts = metaDataContextsBuilder.build(null);
         InstanceContext instanceContext = buildInstanceContext(parameter);
         generateTransactionConfigurationFile(instanceContext, metaDataContexts);
diff --git a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/StandaloneContextManagerBuilder.java b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/StandaloneContextManagerBuilder.java
index 1ae3e2f1cbc..ccbb3a6d384 100644
--- a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/StandaloneContextManagerBuilder.java
+++ b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/StandaloneContextManagerBuilder.java
@@ -84,7 +84,7 @@ public final class StandaloneContextManagerBuilder implements ContextManagerBuil
             }
             builder.addDatabase(entry.getKey(), databaseType, entry.getValue(), props);
         }
-        builder.addSystemDatabases(databaseType);
+        builder.addSystemDatabases(DatabaseTypeEngine.getFrontendDatabaseType(databaseConfigMap, new ConfigurationProperties(props)));
         return builder.build(metaDataPersistService);
     }