You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/08/14 16:01:09 UTC

[GitHub] [shardingsphere] taojintianxia commented on a diff in pull request #20169: Refacor : refacor the storage configration as the proxy config style

taojintianxia commented on code in PR #20169:
URL: https://github.com/apache/shardingsphere/pull/20169#discussion_r945310145


##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/StorageContainerConfigurationFactory.java:
##########
@@ -15,43 +15,36 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.test.integration.container.config;
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl;
 
 import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
 import org.apache.shardingsphere.infra.database.type.DatabaseType;
 import org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
-import org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.mysql.DefaultMySQLContainerConfiguration;
-import org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.opengauss.DefaultOpenGaussContainerConfiguration;
-import org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.postgresql.DefaultPostgreSQLContainerConfiguration;
+import org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.mysql.MySQLContainerConfigurationFactory;
+import org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.opengauss.OpenGaussContainerConfigurationFactory;
+import org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.postgresql.PostgreSQLContainerConfigurationFactory;
 
 /**
- * Suite storage container configuration factory.
+ * Storage container configuration factory.
  */
 @NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class SuiteStorageContainerConfigurationFactory {
+public final class StorageContainerConfigurationFactory {
     
     /**
      * Create new instance of storage container configuration.
-     *
+     * 
      * @param databaseType database type
-     * @param scenario scenario
      * @return created instance
      */
-    public static StorageContainerConfiguration newInstance(final DatabaseType databaseType, final String scenario) {
+    public static StorageContainerConfiguration newInstance(final DatabaseType databaseType) {
         switch (databaseType.getType()) {
             case "MySQL":
-                if ("default".equalsIgnoreCase(scenario)) {
-                    return new DefaultMySQLContainerConfiguration();
-                }
-                return new DefaultMySQLContainerConfiguration();
+                return MySQLContainerConfigurationFactory.newInstance();
             case "PostgreSQL":
-                if ("default".equalsIgnoreCase(scenario)) {
-                    return new DefaultPostgreSQLContainerConfiguration();
-                }
-                return new DefaultPostgreSQLContainerConfiguration();
+                return PostgreSQLContainerConfigurationFactory.newInstance();
             case "openGauss":
-                return new DefaultOpenGaussContainerConfiguration();
+                return OpenGaussContainerConfigurationFactory.newInstance();
             case "H2":
                 return null;

Review Comment:
   that's because H2 container doesn't need any configuration. do you have any better idea ? I don't think `return null;` is a good idea, but there is no other better logic to make this clear.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org