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/09 08:43:00 UTC
[GitHub] [shardingsphere] taojintianxia opened a new pull request, #20021: Refactor : transfer all container related config files to env module
taojintianxia opened a new pull request, #20021:
URL: https://github.com/apache/shardingsphere/pull/20021
Fixes #19958.
--
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
[GitHub] [shardingsphere] taojintianxia commented on a diff in pull request #20021: Refactor : transfer all container related config files to env module
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #20021:
URL: https://github.com/apache/shardingsphere/pull/20021#discussion_r941949871
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/DockerStorageContainer.java:
##########
@@ -50,14 +50,17 @@ public abstract class DockerStorageContainer extends DockerITContainer implement
@Getter(AccessLevel.NONE)
private final String scenario;
+ private final String module;
+
private final Map<String, DataSource> actualDataSourceMap;
private final Map<String, DataSource> expectedDataSourceMap;
- public DockerStorageContainer(final DatabaseType databaseType, final String dockerImageName, final String scenario) {
+ public DockerStorageContainer(final DatabaseType databaseType, final String dockerImageName, final String scenario, final String module) {
Review Comment:
> The module is not make sense, the basic module should not know other module name. How about merge module and scenario?
after all container management and config reclaimed in env, this may refactored as a`StorageContainerContext` .
--
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
[GitHub] [shardingsphere] taojintianxia commented on a diff in pull request #20021: Refactor : transfer all container related config files to env module
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #20021:
URL: https://github.com/apache/shardingsphere/pull/20021#discussion_r941945017
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/DockerStorageContainer.java:
##########
@@ -50,14 +50,17 @@ public abstract class DockerStorageContainer extends DockerITContainer implement
@Getter(AccessLevel.NONE)
private final String scenario;
+ private final String module;
+
private final Map<String, DataSource> actualDataSourceMap;
private final Map<String, DataSource> expectedDataSourceMap;
- public DockerStorageContainer(final DatabaseType databaseType, final String dockerImageName, final String scenario) {
+ public DockerStorageContainer(final DatabaseType databaseType, final String dockerImageName, final String scenario, final String module) {
Review Comment:
and for the combination for modue and scenario. I prefer to design a InitStrategy. like MySQLScalingStrategy, the content of the strategy in this module will implement by scaling developer, they will decide how to init storage type cotnainer , if there is no special init strategy, we provide a MySQLDefaultStrategy which just init a common my.cnf and related init sql.
--
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
[GitHub] [shardingsphere] taojintianxia commented on a diff in pull request #20021: Refactor : transfer all container related config files to env module
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #20021:
URL: https://github.com/apache/shardingsphere/pull/20021#discussion_r941945017
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/DockerStorageContainer.java:
##########
@@ -50,14 +50,17 @@ public abstract class DockerStorageContainer extends DockerITContainer implement
@Getter(AccessLevel.NONE)
private final String scenario;
+ private final String module;
+
private final Map<String, DataSource> actualDataSourceMap;
private final Map<String, DataSource> expectedDataSourceMap;
- public DockerStorageContainer(final DatabaseType databaseType, final String dockerImageName, final String scenario) {
+ public DockerStorageContainer(final DatabaseType databaseType, final String dockerImageName, final String scenario, final String module) {
Review Comment:
and for the combination for modue and scenario. I prefer to design a InitStrategy. like MySQLScalingStrategy, the content of the strategy in this module will implement by scaling developer, they will decide how to init storage type cotnainer , if this is no special init strategy, we will provide a MySQLDefaultStrategy which just init a common my.cnf and related init sql.
--
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
[GitHub] [shardingsphere] taojintianxia commented on a diff in pull request #20021: Refactor : transfer all container related config files to env module
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #20021:
URL: https://github.com/apache/shardingsphere/pull/20021#discussion_r941945017
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/DockerStorageContainer.java:
##########
@@ -50,14 +50,17 @@ public abstract class DockerStorageContainer extends DockerITContainer implement
@Getter(AccessLevel.NONE)
private final String scenario;
+ private final String module;
+
private final Map<String, DataSource> actualDataSourceMap;
private final Map<String, DataSource> expectedDataSourceMap;
- public DockerStorageContainer(final DatabaseType databaseType, final String dockerImageName, final String scenario) {
+ public DockerStorageContainer(final DatabaseType databaseType, final String dockerImageName, final String scenario, final String module) {
Review Comment:
and for the combination for modue and scenario. I prefer to design a InitStrategy. likeMySQL ScalingStrategy, the content of the strategy in this module will implement by scaling developer, they will decide how to init storage type cotnainer , if this is no special init strategy, we will provide a MySQLDefaultStrategy which just init a common my.cnf and related init sql.
--
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
[GitHub] [shardingsphere] taojintianxia commented on a diff in pull request #20021: Refactor : transfer all container related config files to env module
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #20021:
URL: https://github.com/apache/shardingsphere/pull/20021#discussion_r943203277
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/DockerStorageContainer.java:
##########
@@ -78,6 +78,26 @@ protected void configure() {
: DataSourceEnvironment.getURL(databaseType, "localhost", getFirstMappedPort()), getUsername(), getUnifiedPassword())));
}
+ protected void setCommands(final String[] commands) {
+ if (commands.length > 0) {
+ for (String each : commands) {
+ setCommand(each);
+ }
+ }
+ }
+
+ protected void addEnvs(final Map<String, String> envs) {
+ if (!envs.isEmpty()) {
+ envs.forEach(this::addEnv);
+ }
+ }
+
+ protected void mapResources(final Map<String, String> resources) {
Review Comment:
done
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/StorageContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config;
+
+import java.util.Map;
+
+/**
+ * Docker Storage Container Config.
Review Comment:
done
--
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
[GitHub] [shardingsphere] taojintianxia commented on a diff in pull request #20021: Refactor : transfer all container related config files to env module
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #20021:
URL: https://github.com/apache/shardingsphere/pull/20021#discussion_r943085058
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/DockerStorageContainer.java:
##########
@@ -50,14 +50,17 @@ public abstract class DockerStorageContainer extends DockerITContainer implement
@Getter(AccessLevel.NONE)
private final String scenario;
+ private final String module;
+
private final Map<String, DataSource> actualDataSourceMap;
private final Map<String, DataSource> expectedDataSourceMap;
- public DockerStorageContainer(final DatabaseType databaseType, final String dockerImageName, final String scenario) {
+ public DockerStorageContainer(final DatabaseType databaseType, final String dockerImageName, final String scenario, final String module) {
Review Comment:
done
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/DockerStorageContainer.java:
##########
@@ -78,6 +78,26 @@ protected void configure() {
: DataSourceEnvironment.getURL(databaseType, "localhost", getFirstMappedPort()), getUsername(), getUnifiedPassword())));
}
+ protected void setCommands(final String[] commands) {
+ if (commands.length > 0) {
Review Comment:
done
--
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
[GitHub] [shardingsphere] taojintianxia commented on pull request #20021: Refactor : transfer all container related config files to env module
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on PR #20021:
URL: https://github.com/apache/shardingsphere/pull/20021#issuecomment-1211540834
> What is DefaultPostgreSQLContainerConfiguration or ScalingMySQLContainerConfiguration? Could the design be easier for configuration pass by only?
make composition instead of inheritance.
--
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
[GitHub] [shardingsphere] taojintianxia commented on a diff in pull request #20021: Refactor : transfer all container related config files to env module
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #20021:
URL: https://github.com/apache/shardingsphere/pull/20021#discussion_r943085275
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/StorageContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config;
+
+import java.util.Map;
+
+/**
+ * Docker Storage Container Config.
Review Comment:
done
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/postgresql/DefaultPostgreSQLContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.postgresql;
+
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultPostgreSQLContainerConfiguration implements StorageContainerConfiguration {
+
+ private final String scenario;
+
+ @Override
+ public String[] getCommands() {
+ String[] commands = new String[1];
+ commands[0] = "-c config_file=/etc/postgresql/postgresql.conf";
+ return commands;
+ }
+
+ @Override
+ public Map<String, String> getEnvs() {
+ return ImmutableMap.<String, String>builder().put("POSTGRES_PASSWORD", "Test@123").build();
Review Comment:
done
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/postgresql/ScalingPostgreSQLContainerConfiguration.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.postgresql;
+
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+public class ScalingPostgreSQLContainerConfiguration extends DefaultPostgreSQLContainerConfiguration {
Review Comment:
done
--
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
[GitHub] [shardingsphere] taojintianxia commented on pull request #20021: Refactor : transfer all container related config files to env module
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on PR #20021:
URL: https://github.com/apache/shardingsphere/pull/20021#issuecomment-1209093750
do not merge this until @terrymanu 's review and all it passed.
--
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
[GitHub] [shardingsphere] taojintianxia commented on pull request #20021: Refactor : transfer all container related config files to env module
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on PR #20021:
URL: https://github.com/apache/shardingsphere/pull/20021#issuecomment-1209094250
hi, @TeslaCN , would you like to take a look ?
--
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
[GitHub] [shardingsphere] terrymanu commented on a diff in pull request #20021: Refactor : transfer all container related config files to env module
Posted by GitBox <gi...@apache.org>.
terrymanu commented on code in PR #20021:
URL: https://github.com/apache/shardingsphere/pull/20021#discussion_r941928701
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/DockerStorageContainer.java:
##########
@@ -50,14 +50,17 @@ public abstract class DockerStorageContainer extends DockerITContainer implement
@Getter(AccessLevel.NONE)
private final String scenario;
+ private final String module;
+
private final Map<String, DataSource> actualDataSourceMap;
private final Map<String, DataSource> expectedDataSourceMap;
- public DockerStorageContainer(final DatabaseType databaseType, final String dockerImageName, final String scenario) {
+ public DockerStorageContainer(final DatabaseType databaseType, final String dockerImageName, final String scenario, final String module) {
Review Comment:
The module is not make sense, the basic module should not know other module name.
How about merge module and scenario?
--
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
[GitHub] [shardingsphere] taojintianxia commented on a diff in pull request #20021: Refactor : transfer all container related config files to env module
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #20021:
URL: https://github.com/apache/shardingsphere/pull/20021#discussion_r941943686
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/DockerStorageContainer.java:
##########
@@ -50,14 +50,17 @@ public abstract class DockerStorageContainer extends DockerITContainer implement
@Getter(AccessLevel.NONE)
private final String scenario;
+ private final String module;
+
private final Map<String, DataSource> actualDataSourceMap;
private final Map<String, DataSource> expectedDataSourceMap;
- public DockerStorageContainer(final DatabaseType databaseType, final String dockerImageName, final String scenario) {
+ public DockerStorageContainer(final DatabaseType databaseType, final String dockerImageName, final String scenario, final String module) {
Review Comment:
this is not a replacement, it's polymorphism. what I thought is refactor scaling and then refactor transaction, finally refactor suite. if we merge module and scenario now, this will affect too much.
--
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
[GitHub] [shardingsphere] taojintianxia commented on a diff in pull request #20021: Refactor : transfer all container related config files to env module
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #20021:
URL: https://github.com/apache/shardingsphere/pull/20021#discussion_r943085375
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/postgresql/DefaultPostgreSQLContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.postgresql;
+
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultPostgreSQLContainerConfiguration implements StorageContainerConfiguration {
+
+ private final String scenario;
+
+ @Override
+ public String[] getCommands() {
+ String[] commands = new String[1];
+ commands[0] = "-c config_file=/etc/postgresql/postgresql.conf";
+ return commands;
+ }
+
+ @Override
+ public Map<String, String> getEnvs() {
+ return ImmutableMap.<String, String>builder().put("POSTGRES_PASSWORD", "Test@123").build();
+ }
+
+ @Override
+ public Map<String, String> getResourceMappings() {
+ return ImmutableMap.<String, String>builder().put("/env/postgresql/postgresql.conf", "/etc/postgresql/postgresql.conf").build();
Review Comment:
done
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/postgresql/ScalingPostgreSQLContainerConfiguration.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.postgresql;
+
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+public class ScalingPostgreSQLContainerConfiguration extends DefaultPostgreSQLContainerConfiguration {
+
+ public ScalingPostgreSQLContainerConfiguration(final String scenario) {
+ super(scenario);
+ }
+
+ @Override
+ public Map<String, String> getResourceMappings() {
+ return ImmutableMap.<String, String>builder().put("/env/postgresql/postgresql.conf", "/etc/postgresql/postgresql.conf").build();
Review Comment:
done
--
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
[GitHub] [shardingsphere] taojintianxia commented on a diff in pull request #20021: Refactor : transfer all container related config files to env module
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #20021:
URL: https://github.com/apache/shardingsphere/pull/20021#discussion_r943085161
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/DockerStorageContainer.java:
##########
@@ -78,6 +78,26 @@ protected void configure() {
: DataSourceEnvironment.getURL(databaseType, "localhost", getFirstMappedPort()), getUsername(), getUnifiedPassword())));
}
+ protected void setCommands(final String[] commands) {
+ if (commands.length > 0) {
+ for (String each : commands) {
+ setCommand(each);
+ }
+ }
+ }
+
+ protected void addEnvs(final Map<String, String> envs) {
+ if (!envs.isEmpty()) {
Review Comment:
done
--
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
[GitHub] [shardingsphere] taojintianxia commented on a diff in pull request #20021: Refactor : transfer all container related config files to env module
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #20021:
URL: https://github.com/apache/shardingsphere/pull/20021#discussion_r943203520
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/postgresql/ScalingPostgreSQLContainerConfiguration.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.postgresql;
+
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+public class ScalingPostgreSQLContainerConfiguration extends DefaultPostgreSQLContainerConfiguration {
Review Comment:
done
--
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
[GitHub] [shardingsphere] terrymanu merged pull request #20021: Refactor : transfer all container related config files to env module
Posted by GitBox <gi...@apache.org>.
terrymanu merged PR #20021:
URL: https://github.com/apache/shardingsphere/pull/20021
--
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
[GitHub] [shardingsphere] terrymanu commented on a diff in pull request #20021: Refactor : transfer all container related config files to env module
Posted by GitBox <gi...@apache.org>.
terrymanu commented on code in PR #20021:
URL: https://github.com/apache/shardingsphere/pull/20021#discussion_r942489069
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/DockerStorageContainer.java:
##########
@@ -78,6 +78,26 @@ protected void configure() {
: DataSourceEnvironment.getURL(databaseType, "localhost", getFirstMappedPort()), getUsername(), getUnifiedPassword())));
}
+ protected void setCommands(final String[] commands) {
+ if (commands.length > 0) {
+ for (String each : commands) {
+ setCommand(each);
+ }
+ }
+ }
+
+ protected void addEnvs(final Map<String, String> envs) {
+ if (!envs.isEmpty()) {
Review Comment:
Unnecessary to judge !envs.isEmpty()
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/DockerStorageContainer.java:
##########
@@ -78,6 +78,26 @@ protected void configure() {
: DataSourceEnvironment.getURL(databaseType, "localhost", getFirstMappedPort()), getUsername(), getUnifiedPassword())));
}
+ protected void setCommands(final String[] commands) {
+ if (commands.length > 0) {
+ for (String each : commands) {
+ setCommand(each);
+ }
+ }
+ }
+
+ protected void addEnvs(final Map<String, String> envs) {
+ if (!envs.isEmpty()) {
+ envs.forEach(this::addEnv);
+ }
+ }
+
+ protected void mapResources(final Map<String, String> resources) {
Review Comment:
Please add final if method does not design for extension
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/StorageContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config;
+
+import java.util.Map;
+
+/**
+ * Docker Storage Container Config.
Review Comment:
Config should be configuration
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/StorageContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config;
+
+import java.util.Map;
+
+/**
+ * Docker Storage Container Config.
+ */
+public interface StorageContainerConfiguration {
+
+ /**
+ * get docker container commands.
+ *
+ * @return docker container commands
+ */
+ String[] getCommands();
+
+ /**
+ * get docker container environment variables.
+ *
+ * @return docker container environments
+ */
+ Map<String, String> getEnvs();
+
+ /**
+ * get docker container mapping resources.
Review Comment:
Please upper case for the first letter in the sentence
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/mysql/DefaultMySQLContainerConfiguration.java:
##########
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.mysql;
+
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultMySQLContainerConfiguration implements StorageContainerConfiguration {
Review Comment:
Please add final if class does not design for extension
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/mysql/DefaultMySQLContainerConfiguration.java:
##########
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.mysql;
+
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultMySQLContainerConfiguration implements StorageContainerConfiguration {
+
+ private final String scenario;
+
+ @Override
+ public String[] getCommands() {
+ // TODO need auto set server-id by generator, now always set server-id to 1
+ String[] commands = new String[1];
+ commands[0] = "--server-id=1";
+ return commands;
+ }
+
+ @Override
+ public Map<String, String> getEnvs() {
+ return ImmutableMap.<String, String>builder().put("LANG", "C.UTF-8").put("MYSQL_RANDOM_ROOT_PASSWORD", "yes").build();
+ }
+
+ @Override
+ public Map<String, String> getResourceMappings() {
+ return ImmutableMap.<String, String>builder().put("/env/mysql/my.cnf", "/etc/mysql/my.cnf").build();
Review Comment:
Please avoid to use guava API if possible
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/mysql/ScalingMySQLContainerConfiguration.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.mysql;
+
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+public class ScalingMySQLContainerConfiguration extends DefaultMySQLContainerConfiguration {
+
+ public ScalingMySQLContainerConfiguration(final String scenario) {
+ super(scenario);
+ }
+
+ @Override
+ public Map<String, String> getResourceMappings() {
+ return ImmutableMap.<String, String>builder().put("/env/mysql/my.cnf", "/etc/mysql/my.cnf").build();
Review Comment:
Please avoid to use guava API if possible
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/opengauss/DefaultOpenGaussContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.opengauss;
+
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultOpenGaussContainerConfiguration implements StorageContainerConfiguration {
+
+ private final String scenario;
+
+ @Override
+ public String[] getCommands() {
Review Comment:
How about use default method?
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/postgresql/DefaultPostgreSQLContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.postgresql;
+
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultPostgreSQLContainerConfiguration implements StorageContainerConfiguration {
Review Comment:
Missed javadoc
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/postgresql/ScalingPostgreSQLContainerConfiguration.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.postgresql;
+
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+public class ScalingPostgreSQLContainerConfiguration extends DefaultPostgreSQLContainerConfiguration {
Review Comment:
Missed javadoc
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/DockerStorageContainer.java:
##########
@@ -78,6 +78,26 @@ protected void configure() {
: DataSourceEnvironment.getURL(databaseType, "localhost", getFirstMappedPort()), getUsername(), getUnifiedPassword())));
}
+ protected void setCommands(final String[] commands) {
+ if (commands.length > 0) {
Review Comment:
Unnecessary to judge commands.length > 0
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/StorageContainerConfigurationFactory.java:
##########
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config;
+
+import org.apache.shardingsphere.infra.database.type.DatabaseType;
+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.mysql.ScalingMySQLContainerConfiguration;
+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.postgresql.ScalingPostgreSQLContainerConfiguration;
+
+public class StorageContainerConfigurationFactory {
Review Comment:
Please add final if class does not design for extension
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/StorageContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config;
+
+import java.util.Map;
+
+/**
+ * Docker Storage Container Config.
Review Comment:
Only first letter in the sentence could be upper case.
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/StorageContainerConfigurationFactory.java:
##########
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config;
+
+import org.apache.shardingsphere.infra.database.type.DatabaseType;
+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.mysql.ScalingMySQLContainerConfiguration;
+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.postgresql.ScalingPostgreSQLContainerConfiguration;
+
+public class StorageContainerConfigurationFactory {
Review Comment:
Missed javadoc
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/StorageContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config;
+
+import java.util.Map;
+
+/**
+ * Docker Storage Container Config.
+ */
+public interface StorageContainerConfiguration {
+
+ /**
+ * get docker container commands.
Review Comment:
Please upper case for the first letter in the sentence
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/StorageContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config;
+
+import java.util.Map;
+
+/**
+ * Docker Storage Container Config.
+ */
+public interface StorageContainerConfiguration {
+
+ /**
+ * get docker container commands.
+ *
+ * @return docker container commands
+ */
+ String[] getCommands();
+
+ /**
+ * get docker container environment variables.
Review Comment:
Please upper case for the first letter in the sentence
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/mysql/DefaultMySQLContainerConfiguration.java:
##########
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.mysql;
+
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultMySQLContainerConfiguration implements StorageContainerConfiguration {
Review Comment:
Missed javadoc
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/StorageContainerFactory.java:
##########
@@ -40,13 +41,26 @@ public final class StorageContainerFactory {
* @return created instance
*/
public static StorageContainer newInstance(final DatabaseType databaseType, final String dockerImageName, final String scenario) {
+ return newInstance(databaseType, dockerImageName, scenario, "");
+ }
+
+ /**
+ * Create new instance of storage container.
+ *
+ * @param databaseType database type
+ * @param dockerImageName docker image name
+ * @param scenario scenario
+ * @param module module
+ * @return created instance
+ */
+ public static StorageContainer newInstance(final DatabaseType databaseType, final String dockerImageName, final String scenario, final String module) {
Review Comment:
env is the basic module, please do not include `module` argument
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/StorageContainerConfigurationFactory.java:
##########
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config;
+
+import org.apache.shardingsphere.infra.database.type.DatabaseType;
+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.mysql.ScalingMySQLContainerConfiguration;
+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.postgresql.ScalingPostgreSQLContainerConfiguration;
+
+public class StorageContainerConfigurationFactory {
+
+ /**
+ * Create new instance of storage container.
+ *
+ * @param databaseType database type
+ * @param module module
+ * @param scenario scenario
+ * @return created instance
+ */
+ public static StorageContainerConfiguration newInstance(final DatabaseType databaseType, final String scenario, final String module) {
Review Comment:
env is the basic module, please do not include `module` argument
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/mysql/DefaultMySQLContainerConfiguration.java:
##########
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.mysql;
+
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultMySQLContainerConfiguration implements StorageContainerConfiguration {
Review Comment:
Please add final if class does not design for extension
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/mysql/ScalingMySQLContainerConfiguration.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.mysql;
+
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+public class ScalingMySQLContainerConfiguration extends DefaultMySQLContainerConfiguration {
Review Comment:
Missed javadoc
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/opengauss/DefaultOpenGaussContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.opengauss;
+
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultOpenGaussContainerConfiguration implements StorageContainerConfiguration {
Review Comment:
Missed javadoc
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/mysql/DefaultMySQLContainerConfiguration.java:
##########
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.mysql;
+
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultMySQLContainerConfiguration implements StorageContainerConfiguration {
+
+ private final String scenario;
+
+ @Override
+ public String[] getCommands() {
+ // TODO need auto set server-id by generator, now always set server-id to 1
+ String[] commands = new String[1];
+ commands[0] = "--server-id=1";
+ return commands;
+ }
+
+ @Override
+ public Map<String, String> getEnvs() {
+ return ImmutableMap.<String, String>builder().put("LANG", "C.UTF-8").put("MYSQL_RANDOM_ROOT_PASSWORD", "yes").build();
Review Comment:
Please avoid to use guava API if possible
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/mysql/ScalingMySQLContainerConfiguration.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.mysql;
+
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+public class ScalingMySQLContainerConfiguration extends DefaultMySQLContainerConfiguration {
Review Comment:
Please add final if class does not design for extension
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/opengauss/DefaultOpenGaussContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.opengauss;
+
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultOpenGaussContainerConfiguration implements StorageContainerConfiguration {
Review Comment:
Please add final if class does not design for extension
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/opengauss/DefaultOpenGaussContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.opengauss;
+
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultOpenGaussContainerConfiguration implements StorageContainerConfiguration {
+
+ private final String scenario;
+
+ @Override
+ public String[] getCommands() {
+ return new String[0];
+ }
+
+ @Override
+ public Map<String, String> getEnvs() {
+ return ImmutableMap.<String, String>builder().put("GS_PASSWORD", "Test@123").build();
Review Comment:
Please avoid to use guava API if possible
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/postgresql/DefaultPostgreSQLContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.postgresql;
+
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultPostgreSQLContainerConfiguration implements StorageContainerConfiguration {
Review Comment:
Please add final if class does not design for extension
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/postgresql/DefaultPostgreSQLContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.postgresql;
+
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultPostgreSQLContainerConfiguration implements StorageContainerConfiguration {
+
+ private final String scenario;
+
+ @Override
+ public String[] getCommands() {
+ String[] commands = new String[1];
+ commands[0] = "-c config_file=/etc/postgresql/postgresql.conf";
+ return commands;
Review Comment:
return value should name as `result`
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/opengauss/DefaultOpenGaussContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.opengauss;
+
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultOpenGaussContainerConfiguration implements StorageContainerConfiguration {
+
+ private final String scenario;
+
+ @Override
+ public String[] getCommands() {
+ return new String[0];
+ }
+
+ @Override
+ public Map<String, String> getEnvs() {
+ return ImmutableMap.<String, String>builder().put("GS_PASSWORD", "Test@123").build();
+ }
+
+ @Override
+ public Map<String, String> getResourceMappings() {
+ return ImmutableMap.<String, String>builder()
Review Comment:
Please avoid to use guava API if possible
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/postgresql/DefaultPostgreSQLContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.postgresql;
+
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultPostgreSQLContainerConfiguration implements StorageContainerConfiguration {
+
+ private final String scenario;
+
+ @Override
+ public String[] getCommands() {
+ String[] commands = new String[1];
+ commands[0] = "-c config_file=/etc/postgresql/postgresql.conf";
+ return commands;
+ }
+
+ @Override
+ public Map<String, String> getEnvs() {
+ return ImmutableMap.<String, String>builder().put("POSTGRES_PASSWORD", "Test@123").build();
+ }
+
+ @Override
+ public Map<String, String> getResourceMappings() {
+ return ImmutableMap.<String, String>builder().put("/env/postgresql/postgresql.conf", "/etc/postgresql/postgresql.conf").build();
Review Comment:
Please avoid to use guava API if possible
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/postgresql/DefaultPostgreSQLContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.postgresql;
+
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultPostgreSQLContainerConfiguration implements StorageContainerConfiguration {
+
+ private final String scenario;
+
+ @Override
+ public String[] getCommands() {
+ String[] commands = new String[1];
+ commands[0] = "-c config_file=/etc/postgresql/postgresql.conf";
+ return commands;
+ }
+
+ @Override
+ public Map<String, String> getEnvs() {
+ return ImmutableMap.<String, String>builder().put("POSTGRES_PASSWORD", "Test@123").build();
Review Comment:
Please avoid to use guava API if possible
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/postgresql/ScalingPostgreSQLContainerConfiguration.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.postgresql;
+
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+public class ScalingPostgreSQLContainerConfiguration extends DefaultPostgreSQLContainerConfiguration {
Review Comment:
Please add final if class does not design for extension
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/postgresql/ScalingPostgreSQLContainerConfiguration.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.postgresql;
+
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+public class ScalingPostgreSQLContainerConfiguration extends DefaultPostgreSQLContainerConfiguration {
+
+ public ScalingPostgreSQLContainerConfiguration(final String scenario) {
+ super(scenario);
+ }
+
+ @Override
+ public Map<String, String> getResourceMappings() {
+ return ImmutableMap.<String, String>builder().put("/env/postgresql/postgresql.conf", "/etc/postgresql/postgresql.conf").build();
Review Comment:
Please avoid to use guava API if possible
--
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
[GitHub] [shardingsphere] taojintianxia commented on pull request #20021: Refactor : transfer all container related config files to env module
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on PR #20021:
URL: https://github.com/apache/shardingsphere/pull/20021#issuecomment-1210246763
refactor as following design :
1. remove variable `module` from all container, container itself should be pure
2. add Configuration for container
--
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