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

zhangliang 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 7a45fbd7cb4 Refactor SQLE2EProxyContainerConfigurationFactory (#36440)
7a45fbd7cb4 is described below

commit 7a45fbd7cb443dde806ec9e1c2220a7bddc052ab
Author: Liang Zhang <[email protected]>
AuthorDate: Mon Sep 1 01:49:10 2025 +0800

    Refactor SQLE2EProxyContainerConfigurationFactory (#36440)
    
    * Refactor SQLE2EProxyContainerConfigurationFactory
    
    * Refactor SQLE2EProxyContainerConfigurationFactory
---
 .../SQLE2EProxyContainerConfigurationFactory.java    | 20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)

diff --git 
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/env/container/config/SQLE2EProxyContainerConfigurationFactory.java
 
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/env/container/config/SQLE2EProxyContainerConfigurationFactory.java
index 3fefeebc9d6..70735f57712 100644
--- 
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/env/container/config/SQLE2EProxyContainerConfigurationFactory.java
+++ 
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/env/container/config/SQLE2EProxyContainerConfigurationFactory.java
@@ -59,14 +59,11 @@ public final class SQLE2EProxyContainerConfigurationFactory 
{
     
     private static String getGlobalYamlPath(final String scenario, final 
String modeType, final DatabaseType databaseType) {
         String governanceCenterType = getGovernanceCenterType(modeType);
-        if (isGovernanceCenterGlobalYamlExists(scenario, modeType, 
governanceCenterType)) {
-            return 
String.format("/env/scenario/%s/proxy/mode/%s/%s/global.yaml", scenario, 
modeType, governanceCenterType);
-        }
         if (isDialectScenarioGlobalYamlExists(scenario, modeType, 
governanceCenterType, databaseType)) {
-            return 
String.format("/env/scenario/%s/proxy/mode/%s/%s/global.yaml", scenario, 
modeType, databaseType.getType().toLowerCase());
+            return 
String.format("/env/scenario/%s/proxy/mode/%s/%s/%s/global.yaml", scenario, 
modeType, databaseType.getType().toLowerCase(), governanceCenterType);
         }
-        if (isScenarioGlobalYamlExists(scenario, modeType)) {
-            return String.format("/env/scenario/%s/proxy/mode/%s/global.yaml", 
scenario, modeType);
+        if (isGovernanceCenterGlobalYamlExists(scenario, modeType, 
governanceCenterType)) {
+            return 
String.format("/env/scenario/%s/proxy/mode/%s/%s/global.yaml", scenario, 
modeType, governanceCenterType);
         }
         return String.format("/env/common/%s/proxy/conf/%s/global.yaml", 
modeType, governanceCenterType);
     }
@@ -79,19 +76,14 @@ public final class SQLE2EProxyContainerConfigurationFactory 
{
         return governanceCenter.toLowerCase();
     }
     
-    private static boolean isGovernanceCenterGlobalYamlExists(final String 
scenario, final String modeType, final String governanceCenterType) {
-        URL url = 
Thread.currentThread().getContextClassLoader().getResource(String.format("env/scenario/%s/proxy/mode/%s/%s/global.yaml",
 scenario, modeType, governanceCenterType));
-        return null != url;
-    }
-    
     private static boolean isDialectScenarioGlobalYamlExists(final String 
scenario, final String modeType, final String governanceCenterType, final 
DatabaseType databaseType) {
         URL url = Thread.currentThread().getContextClassLoader().getResource(
-                
String.format("env/scenario/%s/proxy/mode/%s/%s/%s/global.yaml", scenario, 
modeType, governanceCenterType, databaseType.getType().toLowerCase()));
+                
String.format("env/scenario/%s/proxy/mode/%s/%s/%s/global.yaml", scenario, 
modeType, databaseType.getType().toLowerCase(), governanceCenterType));
         return null != url;
     }
     
-    private static boolean isScenarioGlobalYamlExists(final String scenario, 
final String modeType) {
-        URL url = 
Thread.currentThread().getContextClassLoader().getResource(String.format("env/scenario/%s/proxy/mode/%s/global.yaml",
 scenario, modeType));
+    private static boolean isGovernanceCenterGlobalYamlExists(final String 
scenario, final String modeType, final String governanceCenterType) {
+        URL url = 
Thread.currentThread().getContextClassLoader().getResource(String.format("env/scenario/%s/proxy/mode/%s/%s/global.yaml",
 scenario, modeType, governanceCenterType));
         return null != url;
     }
 }

Reply via email to