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/13 05:13:16 UTC
[GitHub] [shardingsphere] taojintianxia opened a new pull request, #20139: Refactor : replace the container config with pojo way
taojintianxia opened a new pull request, #20139:
URL: https://github.com/apache/shardingsphere/pull/20139
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 #20139: Refactor : replace the container config with pojo way
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #20139:
URL: https://github.com/apache/shardingsphere/pull/20139#discussion_r945121179
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/container/config/SuiteProxyClusterContainerConfigurationFactory.java:
##########
@@ -15,27 +15,30 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config.impl;
+package org.apache.shardingsphere.test.integration.container.config;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config.AdaptorContainerConfiguration;
-import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
/**
- * Proxy cluster container configuration.
+ * Suite proxy cluster container configuration creator.
*/
-public final class DefaultProxyClusterContainerConfiguration implements AdaptorContainerConfiguration {
+public final class SuiteProxyClusterContainerConfigurationFactory {
- @Override
- public Map<String, String> getWaitStrategyInfo() {
- return Collections.singletonMap("dataSourceName", "");
+ /**
+ * Creator adaptor 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 #20139: Refactor : replace the container config with pojo way
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #20139:
URL: https://github.com/apache/shardingsphere/pull/20139#discussion_r945117544
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/ProxyClusterContainerConfigurationFactory.java:
##########
@@ -0,0 +1,42 @@
+/*
+ * 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.adapter.config;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Proxy cluster container configuration creator.
+ */
+public final class ProxyClusterContainerConfigurationFactory {
+
+ /**
+ * Create adaptor container configuration.
+ *
+ * @return adaptor container configuration
+ */
+ public static AdaptorContainerConfiguration newInstance() {
+ return new AdaptorContainerConfiguration("", getMountedResource());
+ }
+
+ private static Map<String, String> getMountedResource() {
+ Map<String, String> result = new HashMap<>(1, 1);
Review Comment:
ok
--
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 #20139: Refactor : replace the container config with pojo way
Posted by GitBox <gi...@apache.org>.
terrymanu commented on code in PR #20139:
URL: https://github.com/apache/shardingsphere/pull/20139#discussion_r945117250
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/ProxyClusterContainerConfigurationFactory.java:
##########
@@ -0,0 +1,42 @@
+/*
+ * 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.adapter.config;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Proxy cluster container configuration creator.
+ */
+public final class ProxyClusterContainerConfigurationFactory {
+
+ /**
+ * Create adaptor container configuration.
Review Comment:
Please ref the current factory to format your java doc
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/AdaptorContainerConfiguration.java:
##########
@@ -17,28 +17,19 @@
package org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config;
-import org.apache.shardingsphere.infra.database.type.DatabaseType;
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
import java.util.Map;
/**
* Adaptor container configuration.
*/
-public interface AdaptorContainerConfiguration {
+@RequiredArgsConstructor
+@Getter
+public final class AdaptorContainerConfiguration {
- /**
- * Get wait strategy info.
- *
- * @return wait strategy info
- */
- Map<String, String> getWaitStrategyInfo();
+ private final String proxyDataSourceName;
- /**
- * Get docker container mapping resources.
- *
- * @param scenario scenario
- * @param databaseType database type
- * @return docker container resource mapping
- */
- Map<String, String> getResourceMappings(String scenario, DatabaseType databaseType);
+ private final Map<String, String> mountedResource;
Review Comment:
should be mountedResources
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/ProxyClusterContainerConfigurationFactory.java:
##########
@@ -0,0 +1,42 @@
+/*
+ * 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.adapter.config;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Proxy cluster container configuration creator.
+ */
+public final class ProxyClusterContainerConfigurationFactory {
+
+ /**
+ * Create adaptor container configuration.
+ *
+ * @return adaptor container configuration
+ */
+ public static AdaptorContainerConfiguration newInstance() {
+ return new AdaptorContainerConfiguration("", getMountedResource());
+ }
+
+ private static Map<String, String> getMountedResource() {
+ Map<String, String> result = new HashMap<>(1, 1);
Review Comment:
Please use Collections.singletonMap to simplify your code
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/framework/container/config/proxy/ScalingProxyClusterContainerConfigurationFactory.java:
##########
@@ -20,31 +20,33 @@
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config.AdaptorContainerConfiguration;
+import org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config.ProxyClusterContainerConfigurationFactory;
import org.apache.shardingsphere.test.integration.env.container.atomic.util.DatabaseTypeUtil;
-import java.util.Collections;
-import java.util.HashMap;
import java.util.Map;
/**
- * Scaling proxy cluster container configuration.
+ * Scaling proxy cluster container configuration creator.
*/
@RequiredArgsConstructor
Review Comment:
What is the useful of @RequiredArgsConstructor?
--
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 #20139: Refactor : replace the container config with pojo way
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #20139:
URL: https://github.com/apache/shardingsphere/pull/20139#discussion_r945120970
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/ProxyClusterContainerConfigurationCreator.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.adapter.config;
+
+import lombok.RequiredArgsConstructor;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Proxy cluster container configuration creator.
+ */
+@RequiredArgsConstructor
+public final class ProxyClusterContainerConfigurationCreator {
+
+ /**
+ * Create adaptor container config.
+ * @return adaptor 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 #20139: Refactor : replace the container config with pojo way
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #20139:
URL: https://github.com/apache/shardingsphere/pull/20139#discussion_r945114156
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/ProxyClusterContainerConfigurationCreator.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.adapter.config;
+
+import lombok.RequiredArgsConstructor;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Proxy cluster container configuration creator.
+ */
+@RequiredArgsConstructor
+public final class ProxyClusterContainerConfigurationCreator {
+
+ /**
+ * Create adaptor container config.
+ * @return adaptor container config
+ */
+ public static AdaptorContainerConfiguration create() {
+ return new AdaptorContainerConfiguration(getProxyDatasourceName(), getMountedResource());
+ }
+
+ private static String getProxyDatasourceName() {
+ return "";
+ }
+
+ private static Map<String, String> getMountedResource() {
+ Map<String, String> result = new HashMap<>(2, 1);
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 #20139: Refactor : replace the container config with pojo way
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #20139:
URL: https://github.com/apache/shardingsphere/pull/20139#discussion_r945120129
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/container/config/SuiteProxyClusterContainerConfigurationFactory.java:
##########
@@ -15,27 +15,30 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config.impl;
+package org.apache.shardingsphere.test.integration.container.config;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config.AdaptorContainerConfiguration;
-import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
/**
- * Proxy cluster container configuration.
+ * Suite proxy cluster container configuration creator.
*/
-public final class DefaultProxyClusterContainerConfiguration implements AdaptorContainerConfiguration {
+public final class SuiteProxyClusterContainerConfigurationFactory {
- @Override
- public Map<String, String> getWaitStrategyInfo() {
- return Collections.singletonMap("dataSourceName", "");
+ /**
+ * Creator adaptor container config.
Review Comment:
fixed
--
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 #20139: Refactor : replace the container config with pojo way
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #20139:
URL: https://github.com/apache/shardingsphere/pull/20139#discussion_r945121151
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/ProxyClusterContainerConfigurationFactory.java:
##########
@@ -0,0 +1,42 @@
+/*
+ * 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.adapter.config;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Proxy cluster container configuration creator.
+ */
+public final class ProxyClusterContainerConfigurationFactory {
Review Comment:
all done
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/container/config/SuiteProxyClusterContainerConfigurationFactory.java:
##########
@@ -15,27 +15,30 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config.impl;
+package org.apache.shardingsphere.test.integration.container.config;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config.AdaptorContainerConfiguration;
-import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
/**
- * Proxy cluster container configuration.
+ * Suite proxy cluster container configuration creator.
*/
-public final class DefaultProxyClusterContainerConfiguration implements AdaptorContainerConfiguration {
+public final class SuiteProxyClusterContainerConfigurationFactory {
Review Comment:
all 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 #20139: Refactor : replace the container config with pojo way
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #20139:
URL: https://github.com/apache/shardingsphere/pull/20139#discussion_r945121140
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/ProxyClusterContainerConfigurationFactory.java:
##########
@@ -0,0 +1,42 @@
+/*
+ * 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.adapter.config;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Proxy cluster container configuration creator.
+ */
+public final class ProxyClusterContainerConfigurationFactory {
+
+ /**
+ * Create adaptor container configuration.
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 #20139: Refactor : replace the container config with pojo way
Posted by GitBox <gi...@apache.org>.
terrymanu merged PR #20139:
URL: https://github.com/apache/shardingsphere/pull/20139
--
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 #20139: Refactor : replace the container config with pojo way
Posted by GitBox <gi...@apache.org>.
terrymanu commented on code in PR #20139:
URL: https://github.com/apache/shardingsphere/pull/20139#discussion_r945117660
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/ProxyClusterContainerConfigurationFactory.java:
##########
@@ -0,0 +1,42 @@
+/*
+ * 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.adapter.config;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Proxy cluster container configuration creator.
+ */
+public final class ProxyClusterContainerConfigurationFactory {
Review Comment:
Please add private no argument constructor to avoid static class initialize.
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/container/config/SuiteProxyClusterContainerConfigurationFactory.java:
##########
@@ -15,27 +15,30 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config.impl;
+package org.apache.shardingsphere.test.integration.container.config;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config.AdaptorContainerConfiguration;
-import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
/**
- * Proxy cluster container configuration.
+ * Suite proxy cluster container configuration creator.
*/
-public final class DefaultProxyClusterContainerConfiguration implements AdaptorContainerConfiguration {
+public final class SuiteProxyClusterContainerConfigurationFactory {
- @Override
- public Map<String, String> getWaitStrategyInfo() {
- return Collections.singletonMap("dataSourceName", "");
+ /**
+ * Creator adaptor container config.
Review Comment:
please do not use abbreviation for javadoc
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/container/config/SuiteProxyClusterContainerConfigurationFactory.java:
##########
@@ -15,27 +15,30 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config.impl;
+package org.apache.shardingsphere.test.integration.container.config;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config.AdaptorContainerConfiguration;
-import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
/**
- * Proxy cluster container configuration.
+ * Suite proxy cluster container configuration creator.
*/
-public final class DefaultProxyClusterContainerConfiguration implements AdaptorContainerConfiguration {
+public final class SuiteProxyClusterContainerConfigurationFactory {
- @Override
- public Map<String, String> getWaitStrategyInfo() {
- return Collections.singletonMap("dataSourceName", "");
+ /**
+ * Creator adaptor container config.
Review Comment:
Please leave a blank line
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/container/config/SuiteProxyClusterContainerConfigurationFactory.java:
##########
@@ -15,27 +15,30 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config.impl;
+package org.apache.shardingsphere.test.integration.container.config;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config.AdaptorContainerConfiguration;
-import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
/**
- * Proxy cluster container configuration.
+ * Suite proxy cluster container configuration creator.
*/
-public final class DefaultProxyClusterContainerConfiguration implements AdaptorContainerConfiguration {
+public final class SuiteProxyClusterContainerConfigurationFactory {
- @Override
- public Map<String, String> getWaitStrategyInfo() {
- return Collections.singletonMap("dataSourceName", "");
+ /**
+ * Creator adaptor container config.
Review Comment:
Creator is non, please use verb
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/container/config/SuiteProxyClusterContainerConfigurationFactory.java:
##########
@@ -15,27 +15,30 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config.impl;
+package org.apache.shardingsphere.test.integration.container.config;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config.AdaptorContainerConfiguration;
-import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
/**
- * Proxy cluster container configuration.
+ * Suite proxy cluster container configuration creator.
*/
-public final class DefaultProxyClusterContainerConfiguration implements AdaptorContainerConfiguration {
+public final class SuiteProxyClusterContainerConfigurationFactory {
Review Comment:
Please add private no argument constructor to avoid static class initialize.
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/container/config/SuiteProxyClusterContainerConfigurationFactory.java:
##########
@@ -15,27 +15,30 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config.impl;
+package org.apache.shardingsphere.test.integration.container.config;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config.AdaptorContainerConfiguration;
-import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
/**
- * Proxy cluster container configuration.
+ * Suite proxy cluster container configuration creator.
Review Comment:
Please change the java doc, the class name is factory, but javadoc is creator
--
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 #20139: Refactor : replace the container config with pojo way
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #20139:
URL: https://github.com/apache/shardingsphere/pull/20139#discussion_r945114013
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/ProxyClusterContainerConfigurationCreator.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.adapter.config;
+
+import lombok.RequiredArgsConstructor;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Proxy cluster container configuration creator.
+ */
+@RequiredArgsConstructor
Review Comment:
fixed
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/AdaptorContainerConfiguration.java:
##########
@@ -17,28 +17,20 @@
package org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config;
-import org.apache.shardingsphere.infra.database.type.DatabaseType;
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
import java.util.Map;
/**
* Adaptor container configuration.
*/
-public interface AdaptorContainerConfiguration {
+@RequiredArgsConstructor
+public final class AdaptorContainerConfiguration {
- /**
- * Get wait strategy info.
- *
- * @return wait strategy info
- */
- Map<String, String> getWaitStrategyInfo();
+ @Getter
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 #20139: Refactor : replace the container config with pojo way
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #20139:
URL: https://github.com/apache/shardingsphere/pull/20139#discussion_r945114468
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/AdapterContainerFactory.java:
##########
@@ -40,15 +40,15 @@ public final class AdapterContainerFactory {
* @param databaseType database type
* @param storageContainer storage container
* @param scenario scenario
- * @param adaptorContainerConfig adaptor container configuration
+ * @param containerConfig adaptor container configuration
* @return adapter container
*/
public static AdapterContainer newInstance(final String mode, final String adapter, final DatabaseType databaseType,
- final StorageContainer storageContainer, final String scenario, final AdaptorContainerConfiguration adaptorContainerConfig) {
+ final StorageContainer storageContainer, final String scenario, final AdaptorContainerConfiguration containerConfig) {
switch (adapter) {
case "proxy":
if ("Cluster".equalsIgnoreCase(mode)) {
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 #20139: Refactor : replace the container config with pojo way
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #20139:
URL: https://github.com/apache/shardingsphere/pull/20139#discussion_r945114792
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/ProxyClusterContainerConfigurationCreator.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.adapter.config;
+
+import lombok.RequiredArgsConstructor;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Proxy cluster container configuration creator.
+ */
+@RequiredArgsConstructor
+public final class ProxyClusterContainerConfigurationCreator {
+
+ /**
+ * Create adaptor container config.
+ * @return adaptor container config
+ */
+ public static AdaptorContainerConfiguration create() {
Review Comment:
finished
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/ProxyClusterContainerConfigurationCreator.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.adapter.config;
+
+import lombok.RequiredArgsConstructor;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Proxy cluster container configuration creator.
+ */
+@RequiredArgsConstructor
+public final class ProxyClusterContainerConfigurationCreator {
Review Comment:
finished
--
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 #20139: Refactor : replace the container config with pojo way
Posted by GitBox <gi...@apache.org>.
terrymanu commented on code in PR #20139:
URL: https://github.com/apache/shardingsphere/pull/20139#discussion_r945112808
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/ProxyClusterContainerConfigurationCreator.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.adapter.config;
+
+import lombok.RequiredArgsConstructor;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Proxy cluster container configuration creator.
+ */
+@RequiredArgsConstructor
Review Comment:
Why use `@RequiredArgsConstructor` here?
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/ProxyClusterContainerConfigurationCreator.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.adapter.config;
+
+import lombok.RequiredArgsConstructor;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Proxy cluster container configuration creator.
+ */
+@RequiredArgsConstructor
+public final class ProxyClusterContainerConfigurationCreator {
+
+ /**
+ * Create adaptor container config.
+ * @return adaptor container config
+ */
+ public static AdaptorContainerConfiguration create() {
+ return new AdaptorContainerConfiguration(getProxyDatasourceName(), getMountedResource());
+ }
+
+ private static String getProxyDatasourceName() {
+ return "";
+ }
+
+ private static Map<String, String> getMountedResource() {
+ Map<String, String> result = new HashMap<>(2, 1);
Review Comment:
The element of map is one, why the initial size is `2`?
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/AdaptorContainerConfiguration.java:
##########
@@ -17,28 +17,20 @@
package org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config;
-import org.apache.shardingsphere.infra.database.type.DatabaseType;
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
import java.util.Map;
/**
* Adaptor container configuration.
*/
-public interface AdaptorContainerConfiguration {
+@RequiredArgsConstructor
+public final class AdaptorContainerConfiguration {
- /**
- * Get wait strategy info.
- *
- * @return wait strategy info
- */
- Map<String, String> getWaitStrategyInfo();
+ @Getter
Review Comment:
Can `@Getter` move to class level?
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/ProxyClusterContainerConfigurationCreator.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.adapter.config;
+
+import lombok.RequiredArgsConstructor;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Proxy cluster container configuration creator.
+ */
+@RequiredArgsConstructor
+public final class ProxyClusterContainerConfigurationCreator {
Review Comment:
How about rename Creator to Factory? It is better to keep consist with other codes with ShardingSphere
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/ProxyClusterContainerConfigurationCreator.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.adapter.config;
+
+import lombok.RequiredArgsConstructor;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Proxy cluster container configuration creator.
+ */
+@RequiredArgsConstructor
+public final class ProxyClusterContainerConfigurationCreator {
+
+ /**
+ * Create adaptor container config.
Review Comment:
Please do not use abbreviation in java doc
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/AdapterContainerFactory.java:
##########
@@ -40,15 +40,15 @@ public final class AdapterContainerFactory {
* @param databaseType database type
* @param storageContainer storage container
* @param scenario scenario
- * @param adaptorContainerConfig adaptor container configuration
+ * @param containerConfig adaptor container configuration
* @return adapter container
*/
public static AdapterContainer newInstance(final String mode, final String adapter, final DatabaseType databaseType,
- final StorageContainer storageContainer, final String scenario, final AdaptorContainerConfiguration adaptorContainerConfig) {
+ final StorageContainer storageContainer, final String scenario, final AdaptorContainerConfiguration containerConfig) {
switch (adapter) {
case "proxy":
if ("Cluster".equalsIgnoreCase(mode)) {
Review Comment:
Please use ternary expression
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/ProxyClusterContainerConfigurationCreator.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.adapter.config;
+
+import lombok.RequiredArgsConstructor;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Proxy cluster container configuration creator.
+ */
+@RequiredArgsConstructor
+public final class ProxyClusterContainerConfigurationCreator {
+
+ /**
+ * Create adaptor container config.
+ * @return adaptor container config
Review Comment:
Please leave blank line between javadoc content and return value.
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/AdapterContainerFactory.java:
##########
@@ -40,15 +40,15 @@ public final class AdapterContainerFactory {
* @param databaseType database type
* @param storageContainer storage container
Review Comment:
Why use storage container and database type together, is storage container include database type?
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/ProxyClusterContainerConfigurationCreator.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.adapter.config;
+
+import lombok.RequiredArgsConstructor;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Proxy cluster container configuration creator.
+ */
+@RequiredArgsConstructor
+public final class ProxyClusterContainerConfigurationCreator {
+
+ /**
+ * Create adaptor container config.
+ * @return adaptor container config
+ */
+ public static AdaptorContainerConfiguration create() {
+ return new AdaptorContainerConfiguration(getProxyDatasourceName(), getMountedResource());
+ }
+
+ private static String getProxyDatasourceName() {
Review Comment:
Is it necessary to create an independent method?
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/ProxyClusterContainerConfigurationCreator.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.adapter.config;
+
+import lombok.RequiredArgsConstructor;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Proxy cluster container configuration creator.
+ */
+@RequiredArgsConstructor
+public final class ProxyClusterContainerConfigurationCreator {
+
+ /**
+ * Create adaptor container config.
+ * @return adaptor container config
+ */
+ public static AdaptorContainerConfiguration create() {
Review Comment:
How about change method name to newInstance? It is better to keep consist with other codes with ShardingSphere
--
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 #20139: Refactor : replace the container config with pojo way
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #20139:
URL: https://github.com/apache/shardingsphere/pull/20139#discussion_r945114311
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/AdapterContainerFactory.java:
##########
@@ -40,15 +40,15 @@ public final class AdapterContainerFactory {
* @param databaseType database type
* @param storageContainer storage container
Review Comment:
for the most parameters in AdapterContainerFactory will be refactored in next PR.
--
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 #20139: Refactor : replace the container config with pojo way
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #20139:
URL: https://github.com/apache/shardingsphere/pull/20139#discussion_r945114528
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/ProxyClusterContainerConfigurationCreator.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.adapter.config;
+
+import lombok.RequiredArgsConstructor;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Proxy cluster container configuration creator.
+ */
+@RequiredArgsConstructor
+public final class ProxyClusterContainerConfigurationCreator {
+
+ /**
+ * Create adaptor 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 #20139: Refactor : replace the container config with pojo way
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #20139:
URL: https://github.com/apache/shardingsphere/pull/20139#discussion_r945117624
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/framework/container/config/proxy/ScalingProxyClusterContainerConfigurationFactory.java:
##########
@@ -20,31 +20,33 @@
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config.AdaptorContainerConfiguration;
+import org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config.ProxyClusterContainerConfigurationFactory;
import org.apache.shardingsphere.test.integration.env.container.atomic.util.DatabaseTypeUtil;
-import java.util.Collections;
-import java.util.HashMap;
import java.util.Map;
/**
- * Scaling proxy cluster container configuration.
+ * Scaling proxy cluster container configuration creator.
*/
@RequiredArgsConstructor
Review Comment:
fixed
--
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 #20139: Refactor : replace the container config with pojo way
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #20139:
URL: https://github.com/apache/shardingsphere/pull/20139#discussion_r945121125
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/AdaptorContainerConfiguration.java:
##########
@@ -17,28 +17,19 @@
package org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config;
-import org.apache.shardingsphere.infra.database.type.DatabaseType;
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
import java.util.Map;
/**
* Adaptor container configuration.
*/
-public interface AdaptorContainerConfiguration {
+@RequiredArgsConstructor
+@Getter
+public final class AdaptorContainerConfiguration {
- /**
- * Get wait strategy info.
- *
- * @return wait strategy info
- */
- Map<String, String> getWaitStrategyInfo();
+ private final String proxyDataSourceName;
- /**
- * Get docker container mapping resources.
- *
- * @param scenario scenario
- * @param databaseType database type
- * @return docker container resource mapping
- */
- Map<String, String> getResourceMappings(String scenario, DatabaseType databaseType);
+ private final Map<String, String> mountedResource;
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 #20139: Refactor : replace the container config with pojo way
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #20139:
URL: https://github.com/apache/shardingsphere/pull/20139#discussion_r945121209
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/container/config/SuiteProxyClusterContainerConfigurationFactory.java:
##########
@@ -15,27 +15,30 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config.impl;
+package org.apache.shardingsphere.test.integration.container.config;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config.AdaptorContainerConfiguration;
-import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
/**
- * Proxy cluster container configuration.
+ * Suite proxy cluster container configuration creator.
*/
-public final class DefaultProxyClusterContainerConfiguration implements AdaptorContainerConfiguration {
+public final class SuiteProxyClusterContainerConfigurationFactory {
- @Override
- public Map<String, String> getWaitStrategyInfo() {
- return Collections.singletonMap("dataSourceName", "");
+ /**
+ * Creator adaptor 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