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

zhonghongsheng 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 18d6fdbbd47 Simplify the configuration of pipeline MySQL E2E (#27877)
18d6fdbbd47 is described below

commit 18d6fdbbd47a36dc345d5418c80dc3f6af053741
Author: Xinze Guo <[email protected]>
AuthorDate: Thu Aug 3 19:19:21 2023 +0800

    Simplify the configuration of pipeline MySQL E2E (#27877)
---
 .../container/compose/DockerContainerComposer.java |  2 +-
 ...eProxyClusterContainerConfigurationFactory.java | 18 +++-----
 .../src/test/resources/env/mysql/server-8.yaml     | 50 ----------------------
 .../env/mysql/{server-5.yaml => server.yaml}       |  0
 .../src/test/resources/env/opengauss/server.yaml   |  5 +--
 .../src/test/resources/env/postgresql/server.yaml  |  8 +---
 6 files changed, 8 insertions(+), 75 deletions(-)

diff --git 
a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/framework/container/compose/DockerContainerComposer.java
 
b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/framework/container/compose/DockerContainerComposer.java
index 5c88e31f28b..9a18c3c099e 100644
--- 
a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/framework/container/compose/DockerContainerComposer.java
+++ 
b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/framework/container/compose/DockerContainerComposer.java
@@ -74,7 +74,7 @@ public final class DockerContainerComposer extends 
BaseContainerComposer {
             
storageContainer.setNetworkAliases(Collections.singletonList(String.join(".", 
databaseType.getType().toLowerCase() + "_" + i, "host")));
             storageContainers.add(storageContainer);
         }
-        AdaptorContainerConfiguration containerConfig = 
PipelineProxyClusterContainerConfigurationFactory.newInstance(databaseType, 
storageContainerImage);
+        AdaptorContainerConfiguration containerConfig = 
PipelineProxyClusterContainerConfigurationFactory.newInstance(databaseType);
         ShardingSphereProxyClusterContainer proxyClusterContainer = 
(ShardingSphereProxyClusterContainer) AdapterContainerFactory.newInstance(
                 AdapterMode.CLUSTER, AdapterType.PROXY, databaseType, null, 
"", containerConfig);
         for (DockerStorageContainer each : storageContainers) {
diff --git 
a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/framework/container/config/proxy/PipelineProxyClusterContainerConfigurationFactory.java
 
b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/framework/container/config/proxy/PipelineProxyClusterContainerConfigurationFactory.java
index d7fd9c57dcd..9463ae506b2 100644
--- 
a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/framework/container/config/proxy/PipelineProxyClusterContainerConfigurationFactory.java
+++ 
b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/framework/container/config/proxy/PipelineProxyClusterContainerConfigurationFactory.java
@@ -20,14 +20,12 @@ package 
org.apache.shardingsphere.test.e2e.data.pipeline.framework.container.con
 import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
 import org.apache.shardingsphere.infra.database.core.type.DatabaseType;
-import org.apache.shardingsphere.infra.database.mysql.type.MySQLDatabaseType;
 import 
org.apache.shardingsphere.infra.database.opengauss.type.OpenGaussDatabaseType;
 import 
org.apache.shardingsphere.infra.database.postgresql.type.PostgreSQLDatabaseType;
 import 
org.apache.shardingsphere.test.e2e.env.container.atomic.adapter.config.AdaptorContainerConfiguration;
 import 
org.apache.shardingsphere.test.e2e.env.container.atomic.adapter.config.ProxyClusterContainerConfigurationFactory;
 import 
org.apache.shardingsphere.test.e2e.env.container.atomic.constants.ProxyContainerConstants;
 import 
org.apache.shardingsphere.test.e2e.env.container.atomic.util.AdapterContainerUtils;
-import 
org.apache.shardingsphere.test.e2e.env.container.atomic.util.DatabaseVersionParser;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -40,28 +38,22 @@ public final class 
PipelineProxyClusterContainerConfigurationFactory {
     
     /**
      * Create instance of adaptor container configuration.
-     * 
+     *
      * @param databaseType database type
-     * @param storageContainerImage storage container image
      * @return created instance
      */
-    public static AdaptorContainerConfiguration newInstance(final DatabaseType 
databaseType, final String storageContainerImage) {
-        return new 
AdaptorContainerConfiguration(getProxyDatasourceName(databaseType), 
getMountedResource(databaseType, storageContainerImage), 
AdapterContainerUtils.getAdapterContainerImage());
+    public static AdaptorContainerConfiguration newInstance(final DatabaseType 
databaseType) {
+        return new 
AdaptorContainerConfiguration(getProxyDatasourceName(databaseType), 
getMountedResource(databaseType), 
AdapterContainerUtils.getAdapterContainerImage());
     }
     
     private static String getProxyDatasourceName(final DatabaseType 
databaseType) {
         return (databaseType instanceof PostgreSQLDatabaseType || databaseType 
instanceof OpenGaussDatabaseType) ? "postgres" : "";
     }
     
-    private static Map<String, String> getMountedResource(final DatabaseType 
databaseType, final String storageContainerImage) {
+    private static Map<String, String> getMountedResource(final DatabaseType 
databaseType) {
         Map<String, String> result = new HashMap<>(2, 1F);
         
result.putAll(ProxyClusterContainerConfigurationFactory.newInstance().getMountedResources());
-        if (databaseType instanceof MySQLDatabaseType) {
-            String majorVersion = 
DatabaseVersionParser.parseMajorVersion(storageContainerImage);
-            result.put(String.format("/env/%s/server-%s.yaml", 
databaseType.getType().toLowerCase(), majorVersion), 
ProxyContainerConstants.CONFIG_PATH_IN_CONTAINER + "server.yaml");
-        } else {
-            result.put(String.format("/env/%s/server.yaml", 
databaseType.getType().toLowerCase()), 
ProxyContainerConstants.CONFIG_PATH_IN_CONTAINER + "server.yaml");
-        }
+        result.put(String.format("/env/%s/server.yaml", 
databaseType.getType().toLowerCase()), 
ProxyContainerConstants.CONFIG_PATH_IN_CONTAINER + "server.yaml");
         result.put("/env/logback.xml", 
ProxyContainerConstants.CONFIG_PATH_IN_CONTAINER + "logback.xml");
         return result;
     }
diff --git 
a/test/e2e/operation/pipeline/src/test/resources/env/mysql/server-8.yaml 
b/test/e2e/operation/pipeline/src/test/resources/env/mysql/server-8.yaml
deleted file mode 100644
index f37cc14ee69..00000000000
--- a/test/e2e/operation/pipeline/src/test/resources/env/mysql/server-8.yaml
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-mode:
-  type: Cluster
-  repository:
-    type: ZooKeeper
-    props:
-      namespace: it_db_mysql
-      server-lists: zk.host:2181
-      timeToLiveSeconds: 60
-      operationTimeoutMilliseconds: 500
-      retryIntervalMilliseconds: 500
-      maxRetries: 3
-
-authority:
-  users:
-    - user: proxy
-      password: Proxy@123
-  privilege:
-    type: ALL_PERMITTED
-
-sqlFederation:
-  sqlFederationEnabled: true
-  executionPlanCache:
-    initialCapacity: 2000
-    maximumSize: 65535
-
-props:
-  system-schema-metadata-enabled: false
-  max-connections-size-per-query: 1
-  kernel-executor-size: 16  # Infinite by default.
-  proxy-frontend-flush-threshold: 128  # The default value is 128.
-  sql-show: false
-  cdc-server-port: 33071 # CDC server port
-  proxy-frontend-ssl-enabled: true
diff --git 
a/test/e2e/operation/pipeline/src/test/resources/env/mysql/server-5.yaml 
b/test/e2e/operation/pipeline/src/test/resources/env/mysql/server.yaml
similarity index 100%
rename from 
test/e2e/operation/pipeline/src/test/resources/env/mysql/server-5.yaml
rename to test/e2e/operation/pipeline/src/test/resources/env/mysql/server.yaml
diff --git 
a/test/e2e/operation/pipeline/src/test/resources/env/opengauss/server.yaml 
b/test/e2e/operation/pipeline/src/test/resources/env/opengauss/server.yaml
index f34d2ed6efc..f929d043cfe 100644
--- a/test/e2e/operation/pipeline/src/test/resources/env/opengauss/server.yaml
+++ b/test/e2e/operation/pipeline/src/test/resources/env/opengauss/server.yaml
@@ -40,9 +40,6 @@ props:
   kernel-executor-size: 16  # Infinite by default.
   proxy-frontend-flush-threshold: 128  # The default value is 128.
   sql-show: false
-  check-table-metadata-enabled: false
-  proxy-backend-query-fetch-size: -1
-  proxy-frontend-max-connections: 0 # Less than or equal to 0 means no 
limitation.
-  proxy-frontend-database-protocol-type: openGauss
   cdc-server-port: 33071 # CDC server port
   proxy-frontend-ssl-enabled: true
+  proxy-frontend-database-protocol-type: openGauss
diff --git 
a/test/e2e/operation/pipeline/src/test/resources/env/postgresql/server.yaml 
b/test/e2e/operation/pipeline/src/test/resources/env/postgresql/server.yaml
index 9f857166cb7..bc53930ae8a 100644
--- a/test/e2e/operation/pipeline/src/test/resources/env/postgresql/server.yaml
+++ b/test/e2e/operation/pipeline/src/test/resources/env/postgresql/server.yaml
@@ -40,12 +40,6 @@ props:
   kernel-executor-size: 16  # Infinite by default.
   proxy-frontend-flush-threshold: 128  # The default value is 128.
   sql-show: false
-  check-table-metadata-enabled: false
-  # Proxy backend query fetch size. A larger value may increase the memory 
usage of ShardingSphere Proxy.
-  # The default value is -1, which means set the minimum value for different 
JDBC drivers.
-  proxy-backend-query-fetch-size: -1
-  proxy-frontend-executor-size: 0 # Proxy frontend executor size. The default 
value is 0, which means let Netty decide.
-  proxy-frontend-max-connections: 0 # Less than or equal to 0 means no 
limitation.
-  proxy-frontend-database-protocol-type: PostgreSQL
   cdc-server-port: 33071 # CDC server port
   proxy-frontend-ssl-enabled: true
+  proxy-frontend-database-protocol-type: PostgreSQL

Reply via email to