You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2025/09/23 16:09:59 UTC
(shardingsphere) branch master updated: Rename variable name from governanceCenter to regCenterType (#36679)
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 02ed95ebb97 Rename variable name from governanceCenter to regCenterType (#36679)
02ed95ebb97 is described below
commit 02ed95ebb972834e4cdbd7ca824209233d8e5ed8
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Wed Sep 24 00:09:52 2025 +0800
Rename variable name from governanceCenter to regCenterType (#36679)
---
.../engine/ShowProcessListE2EIT.java | 2 +-
.../env/ShowProcessListEnvironment.java | 4 +--
.../src/test/resources/env/e2e-env.properties | 4 +--
.../SQLE2EProxyContainerConfigurationFactory.java | 36 +++++++++++-----------
4 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/test/e2e/operation/showprocesslist/src/test/java/org/apache/shardingsphere/test/e2e/operation/showprocesslist/engine/ShowProcessListE2EIT.java b/test/e2e/operation/showprocesslist/src/test/java/org/apache/shardingsphere/test/e2e/operation/showprocesslist/engine/ShowProcessListE2EIT.java
index 0979b83a61b..de14131d1d5 100644
--- a/test/e2e/operation/showprocesslist/src/test/java/org/apache/shardingsphere/test/e2e/operation/showprocesslist/engine/ShowProcessListE2EIT.java
+++ b/test/e2e/operation/showprocesslist/src/test/java/org/apache/shardingsphere/test/e2e/operation/showprocesslist/engine/ShowProcessListE2EIT.java
@@ -124,7 +124,7 @@ class ShowProcessListE2EIT {
Collection<Arguments> result = new LinkedList<>();
for (String each : ENV.getScenarios()) {
for (String mode : ENV.getModes()) {
- for (String governanceType : ENV.getGovernanceCenters()) {
+ for (String governanceType : ENV.getRegCenterTypes()) {
result.add(Arguments.of(new ShowProcessListTestParameter(TypedSPILoader.getService(DatabaseType.class, "MySQL"), each, mode, governanceType)));
}
}
diff --git a/test/e2e/operation/showprocesslist/src/test/java/org/apache/shardingsphere/test/e2e/operation/showprocesslist/env/ShowProcessListEnvironment.java b/test/e2e/operation/showprocesslist/src/test/java/org/apache/shardingsphere/test/e2e/operation/showprocesslist/env/ShowProcessListEnvironment.java
index 6c645392bad..a6a84605d53 100644
--- a/test/e2e/operation/showprocesslist/src/test/java/org/apache/shardingsphere/test/e2e/operation/showprocesslist/env/ShowProcessListEnvironment.java
+++ b/test/e2e/operation/showprocesslist/src/test/java/org/apache/shardingsphere/test/e2e/operation/showprocesslist/env/ShowProcessListEnvironment.java
@@ -41,14 +41,14 @@ public final class ShowProcessListEnvironment {
private final Collection<String> scenarios;
- private final Collection<String> governanceCenters;
+ private final Collection<String> regCenterTypes;
private ShowProcessListEnvironment() {
props = loadProperties();
itEnvType = ShowProcessListEnvTypeEnum.valueOf(props.getProperty("showprocesslist.e2e.env.type", ShowProcessListEnvTypeEnum.NONE.name()).toUpperCase());
modes = Splitter.on(",").trimResults().splitToList(props.getProperty("showprocesslist.e2e.artifact.modes", "Standalone,Cluster"));
scenarios = getScenarios(props);
- governanceCenters = Splitter.on(",").trimResults().splitToList(props.getProperty("showprocesslist.e2e.governance.centers"));
+ regCenterTypes = Splitter.on(",").trimResults().splitToList(props.getProperty("showprocesslist.e2e.regcenter"));
}
/**
diff --git a/test/e2e/operation/showprocesslist/src/test/resources/env/e2e-env.properties b/test/e2e/operation/showprocesslist/src/test/resources/env/e2e-env.properties
index 31dcba40dcf..a6cfcdfbd5a 100644
--- a/test/e2e/operation/showprocesslist/src/test/resources/env/e2e-env.properties
+++ b/test/e2e/operation/showprocesslist/src/test/resources/env/e2e-env.properties
@@ -21,5 +21,5 @@ showprocesslist.e2e.env.type=NONE
showprocesslist.e2e.scenarios=cluster_jdbc_proxy
# showprocesslist.e2e.artifact.modes=Standalone,Cluster
showprocesslist.e2e.artifact.modes=Standalone,Cluster
-# showprocesslist.e2e.governance.center=Zookeeper
-showprocesslist.e2e.governance.centers=Zookeeper
+# showprocesslist.e2e.regcenter=Zookeeper
+showprocesslist.e2e.regcenter=Zookeeper
diff --git a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/env/container/config/SQLE2EProxyContainerConfigurationFactory.java b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/env/container/config/SQLE2EProxyContainerConfigurationFactory.java
index f0813f4a46f..6ddf50524d8 100644
--- a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/env/container/config/SQLE2EProxyContainerConfigurationFactory.java
+++ b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/env/container/config/SQLE2EProxyContainerConfigurationFactory.java
@@ -41,49 +41,49 @@ public final class SQLE2EProxyContainerConfigurationFactory {
* Create instance of adaptor container configuration.
*
* @param scenario scenario
- * @param modeType modeType
+ * @param mode mode
* @param databaseType database type
* @return created instance
*/
- public static AdaptorContainerConfiguration newInstance(final String scenario, final String modeType, final DatabaseType databaseType) {
- return new AdaptorContainerConfiguration(scenario, new LinkedList<>(), getMountedResources(scenario, modeType, databaseType), AdapterContainerUtils.getAdapterContainerImage(), "");
+ public static AdaptorContainerConfiguration newInstance(final String scenario, final String mode, final DatabaseType databaseType) {
+ return new AdaptorContainerConfiguration(scenario, new LinkedList<>(), getMountedResources(scenario, mode, databaseType), AdapterContainerUtils.getAdapterContainerImage(), "");
}
- private static Map<String, String> getMountedResources(final String scenario, final String modeType, final DatabaseType databaseType) {
+ private static Map<String, String> getMountedResources(final String scenario, final String mode, final DatabaseType databaseType) {
Map<String, String> result = new HashMap<>(3, 1F);
- result.put(getGlobalYamlPath(scenario, modeType, databaseType), ProxyContainerConstants.CONFIG_PATH_IN_CONTAINER + "global.yaml");
+ result.put(getGlobalYamlPath(scenario, mode, databaseType), ProxyContainerConstants.CONFIG_PATH_IN_CONTAINER + "global.yaml");
result.put(String.format("/env/scenario/%s/proxy/conf/%s", scenario, databaseType.getType().toLowerCase()), ProxyContainerConstants.CONFIG_PATH_IN_CONTAINER);
result.put("/env/common/logback.xml", ProxyContainerConstants.CONFIG_PATH_IN_CONTAINER + "logback.xml");
return result;
}
- private static String getGlobalYamlPath(final String scenario, final String modeType, final DatabaseType databaseType) {
- String regCenterType = getRegistryCenterType(modeType);
- if (isDialectScenarioGlobalYamlExists(scenario, modeType, regCenterType, databaseType)) {
- return String.format("/env/scenario/%s/proxy/mode/%s/%s/%s/global.yaml", scenario, modeType, databaseType.getType().toLowerCase(), regCenterType);
+ private static String getGlobalYamlPath(final String scenario, final String mode, final DatabaseType databaseType) {
+ String regCenterType = getRegistryCenterType(mode);
+ if (isDialectScenarioGlobalYamlExists(scenario, mode, regCenterType, databaseType)) {
+ return String.format("/env/scenario/%s/proxy/mode/%s/%s/%s/global.yaml", scenario, mode, databaseType.getType().toLowerCase(), regCenterType);
}
- if (isGovernanceCenterGlobalYamlExists(scenario, modeType, regCenterType)) {
- return String.format("/env/scenario/%s/proxy/mode/%s/%s/global.yaml", scenario, modeType, regCenterType);
+ if (isRegistryCenterGlobalYamlExists(scenario, mode, regCenterType)) {
+ return String.format("/env/scenario/%s/proxy/mode/%s/%s/global.yaml", scenario, mode, regCenterType);
}
- return String.format("/env/common/%s/proxy/conf/%s/global.yaml", modeType, regCenterType);
+ return String.format("/env/common/%s/proxy/conf/%s/global.yaml", mode, regCenterType);
}
- private static String getRegistryCenterType(final String modeType) {
+ private static String getRegistryCenterType(final String mode) {
String regCenterType = E2ETestEnvironment.getInstance().getArtifactEnvironment().getRegCenterType();
if (Strings.isNullOrEmpty(regCenterType)) {
- return "cluster".equals(modeType) ? "zookeeper" : "memory";
+ return "cluster".equals(mode) ? "zookeeper" : "memory";
}
return regCenterType.toLowerCase();
}
- private static boolean isDialectScenarioGlobalYamlExists(final String scenario, final String modeType, final String governanceCenterType, final DatabaseType databaseType) {
+ private static boolean isDialectScenarioGlobalYamlExists(final String scenario, final String mode, final String regCenterType, final DatabaseType databaseType) {
URL url = Thread.currentThread().getContextClassLoader().getResource(
- String.format("env/scenario/%s/proxy/mode/%s/%s/%s/global.yaml", scenario, modeType, databaseType.getType().toLowerCase(), governanceCenterType));
+ String.format("env/scenario/%s/proxy/mode/%s/%s/%s/global.yaml", scenario, mode, databaseType.getType().toLowerCase(), regCenterType));
return null != url;
}
- 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));
+ private static boolean isRegistryCenterGlobalYamlExists(final String scenario, final String mode, final String regCenterType) {
+ URL url = Thread.currentThread().getContextClassLoader().getResource(String.format("env/scenario/%s/proxy/mode/%s/%s/global.yaml", scenario, mode, regCenterType));
return null != url;
}
}