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 2021/08/10 17:46:55 UTC
[GitHub] [shardingsphere] sizzlecar opened a new pull request #11753: fix-10965
sizzlecar opened a new pull request #11753:
URL: https://github.com/apache/shardingsphere/pull/11753
Fixes #10965.
Changes proposed in this pull request:
- add unit test
--
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] menghaoranss merged pull request #11753: fix-10965
Posted by GitBox <gi...@apache.org>.
menghaoranss merged pull request #11753:
URL: https://github.com/apache/shardingsphere/pull/11753
--
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] menghaoranss commented on a change in pull request #11753: fix-10965
Posted by GitBox <gi...@apache.org>.
menghaoranss commented on a change in pull request #11753:
URL: https://github.com/apache/shardingsphere/pull/11753#discussion_r686712642
##########
File path: shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-distsql/shardingsphere-readwrite-splitting-distsql-handler/src/test/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/converter/ReadwriteSplittingRuleStatementConverterTest.java
##########
@@ -0,0 +1,120 @@
+/*
+ * 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.readwritesplitting.distsql.handler.converter;
+
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
+import org.apache.shardingsphere.readwritesplitting.api.ReadwriteSplittingRuleConfiguration;
+import org.apache.shardingsphere.readwritesplitting.api.rule.ReadwriteSplittingDataSourceRuleConfiguration;
+import org.apache.shardingsphere.readwritesplitting.distsql.parser.segment.ReadwriteSplittingRuleSegment;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.stream.Stream;
+
+import static org.junit.Assert.assertThat;
+
+public final class ReadwriteSplittingRuleStatementConverterTest {
+
+ @Test
+ public void convertTest() {
Review comment:
I suggest splitting this method to 3 methods for reading more friendly, such as `assertEmptyRuleSegmentConvertResult ` ,`assertSingleRuleSegmentConvertResult ` and `assertMultipleReadwriteSplittingRuleSegments `
--
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] sizzlecar commented on pull request #11753: fix-10965
Posted by GitBox <gi...@apache.org>.
sizzlecar commented on pull request #11753:
URL: https://github.com/apache/shardingsphere/pull/11753#issuecomment-896534839
> Hi @sizzlecar welcome, this is the first-time to see you here.
The second time actually
--
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] codecov-commenter edited a comment on pull request #11753: fix-10965
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #11753:
URL: https://github.com/apache/shardingsphere/pull/11753#issuecomment-896332344
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11753?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#11753](https://codecov.io/gh/apache/shardingsphere/pull/11753?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4c5fb44) into [master](https://codecov.io/gh/apache/shardingsphere/commit/ba5fe48a2f2c05adfa64768c4e98b7b53756bf03?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ba5fe48) will **increase** coverage by `0.04%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/11753/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/shardingsphere/pull/11753?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #11753 +/- ##
============================================
+ Coverage 63.63% 63.68% +0.04%
- Complexity 1126 1196 +70
============================================
Files 2280 2306 +26
Lines 34743 34894 +151
Branches 6041 6051 +10
============================================
+ Hits 22109 22222 +113
- Misses 10862 10897 +35
- Partials 1772 1775 +3
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/11753?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...sphere/scaling/core/job/schedule/JobScheduler.java](https://codecov.io/gh/apache/shardingsphere/pull/11753/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc2NhbGluZy9zaGFyZGluZ3NwaGVyZS1zY2FsaW5nLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NjYWxpbmcvY29yZS9qb2Ivc2NoZWR1bGUvSm9iU2NoZWR1bGVyLmphdmE=) | `22.22% <0.00%> (-29.63%)` | :arrow_down: |
| [...re/scaling/core/executor/engine/ExecuteEngine.java](https://codecov.io/gh/apache/shardingsphere/pull/11753/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc2NhbGluZy9zaGFyZGluZ3NwaGVyZS1zY2FsaW5nLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NjYWxpbmcvY29yZS9leGVjdXRvci9lbmdpbmUvRXhlY3V0ZUVuZ2luZS5qYXZh) | `88.88% <0.00%> (-11.12%)` | :arrow_down: |
| [...sphere/sharding/route/engine/condition/Column.java](https://codecov.io/gh/apache/shardingsphere/pull/11753/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvcm91dGUvZW5naW5lL2NvbmRpdGlvbi9Db2x1bW4uamF2YQ==) | `90.00% <0.00%> (-10.00%)` | :arrow_down: |
| [...e/shardingsphere/shadow/route/ShadowSQLRouter.java](https://codecov.io/gh/apache/shardingsphere/pull/11753/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcm91dGUvU2hhZG93U1FMUm91dGVyLmphdmE=) | `88.88% <0.00%> (-8.62%)` | :arrow_down: |
| [...scaling/core/job/task/inventory/InventoryTask.java](https://codecov.io/gh/apache/shardingsphere/pull/11753/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc2NhbGluZy9zaGFyZGluZ3NwaGVyZS1zY2FsaW5nLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NjYWxpbmcvY29yZS9qb2IvdGFzay9pbnZlbnRvcnkvSW52ZW50b3J5VGFzay5qYXZh) | `68.88% <0.00%> (-6.67%)` | :arrow_down: |
| [...shardingsphere/sharding/rule/BindingTableRule.java](https://codecov.io/gh/apache/shardingsphere/pull/11753/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvcnVsZS9CaW5kaW5nVGFibGVSdWxlLmphdmE=) | `66.66% <0.00%> (-6.42%)` | :arrow_down: |
| [...ra/rewrite/sql/token/pojo/generic/InsertValue.java](https://codecov.io/gh/apache/shardingsphere/pull/11753/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtcmV3cml0ZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvaW5mcmEvcmV3cml0ZS9zcWwvdG9rZW4vcG9qby9nZW5lcmljL0luc2VydFZhbHVlLmphdmE=) | `76.92% <0.00%> (-3.08%)` | :arrow_down: |
| [...ing/core/job/task/incremental/IncrementalTask.java](https://codecov.io/gh/apache/shardingsphere/pull/11753/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc2NhbGluZy9zaGFyZGluZ3NwaGVyZS1zY2FsaW5nLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NjYWxpbmcvY29yZS9qb2IvdGFzay9pbmNyZW1lbnRhbC9JbmNyZW1lbnRhbFRhc2suamF2YQ==) | `72.91% <0.00%> (-2.09%)` | :arrow_down: |
| [...ava/org/apache/shardingsphere/proxy/Bootstrap.java](https://codecov.io/gh/apache/shardingsphere/pull/11753/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYm9vdHN0cmFwL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9wcm94eS9Cb290c3RyYXAuamF2YQ==) | `0.00% <0.00%> (ø)` | |
| [...roxy/config/yaml/YamlProxyServerConfiguration.java](https://codecov.io/gh/apache/shardingsphere/pull/11753/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9wcm94eS9jb25maWcveWFtbC9ZYW1sUHJveHlTZXJ2ZXJDb25maWd1cmF0aW9uLmphdmE=) | `100.00% <0.00%> (ø)` | |
| ... and [92 more](https://codecov.io/gh/apache/shardingsphere/pull/11753/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11753?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11753?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [ba5fe48...4c5fb44](https://codecov.io/gh/apache/shardingsphere/pull/11753?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
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] sizzlecar commented on a change in pull request #11753: fix-10965
Posted by GitBox <gi...@apache.org>.
sizzlecar commented on a change in pull request #11753:
URL: https://github.com/apache/shardingsphere/pull/11753#discussion_r686531881
##########
File path: shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-distsql/shardingsphere-readwrite-splitting-distsql-handler/src/test/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/converter/ReadwriteSplittingRuleStatementConverterTest.java
##########
@@ -0,0 +1,121 @@
+/*
+ * 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.readwritesplitting.distsql.handler.converter;
+
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
+import org.apache.shardingsphere.readwritesplitting.api.ReadwriteSplittingRuleConfiguration;
+import org.apache.shardingsphere.readwritesplitting.api.rule.ReadwriteSplittingDataSourceRuleConfiguration;
+import org.apache.shardingsphere.readwritesplitting.distsql.parser.segment.ReadwriteSplittingRuleSegment;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.stream.Stream;
+
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertEquals;
+
+public final class ReadwriteSplittingRuleStatementConverterTest {
+
+ @Test
+ public void convertTest() {
+ ReadwriteSplittingRuleConfiguration emptyRuleSegmentConvertResult = ReadwriteSplittingRuleStatementConverter
+ .convert(Collections.emptyList());
+ assertEmptyRuleSegmentConvertResult(emptyRuleSegmentConvertResult);
+ Properties properties1 = new Properties();
+ properties1.setProperty("ping", "pong");
+ ReadwriteSplittingRuleSegment singleReadwriteSplittingRuleSegment = createReadwriteSplittingRuleSegment("name1", "write_ds_01", Arrays.asList("read_ds_01", "read_ds_02"), "lb01", properties1);
+ ReadwriteSplittingRuleConfiguration singleRuleSegmentConvertResult = ReadwriteSplittingRuleStatementConverter
+ .convert(Collections.singleton(singleReadwriteSplittingRuleSegment));
+ assertSingleRuleSegmentConvertResult(singleReadwriteSplittingRuleSegment, singleRuleSegmentConvertResult);
+ Properties properties2 = new Properties();
+ properties2.setProperty("ping1", "pong1");
+ Properties properties3 = new Properties();
+ properties3.setProperty("ping2", "pong2");
+ Properties properties4 = new Properties();
+ properties4.setProperty("ping3", "pong3");
+ properties4.setProperty("ping4", "pong4");
+ List<ReadwriteSplittingRuleSegment> multipleReadwriteSplittingRuleSegments = Arrays.asList(
+ createReadwriteSplittingRuleSegment("name2", "write_ds_02", Arrays.asList("read_ds_02", "read_ds_03"), "lb02", properties2),
+ createReadwriteSplittingRuleSegment("name3", "write_ds_03", Arrays.asList("read_ds_04", "read_ds_05"), "lb03", properties3),
+ createReadwriteSplittingRuleSegment("name4", "write_ds_04", Arrays.asList("read_ds_06", "read_ds_07"), "lb04", properties4));
+ ReadwriteSplittingRuleConfiguration multipleRuleSegmentConvertResult = ReadwriteSplittingRuleStatementConverter.convert(multipleReadwriteSplittingRuleSegments);
+ assertMultipleReadwriteSplittingRuleSegments(multipleReadwriteSplittingRuleSegments, multipleRuleSegmentConvertResult);
+ }
+
+ private ReadwriteSplittingRuleSegment createReadwriteSplittingRuleSegment(final String name,
+ final String writeDataSource,
+ final List<String> readDataSourceList,
+ final String loadBalancerTypeName,
+ final Properties properties) {
+ return new ReadwriteSplittingRuleSegment(name, writeDataSource, readDataSourceList, loadBalancerTypeName, properties);
+ }
+
+ private void assertEmptyRuleSegmentConvertResult(final ReadwriteSplittingRuleConfiguration emptyRuleSegmentConvertResult) {
+ assertTrue(emptyRuleSegmentConvertResult.getDataSources().isEmpty());
+ assertTrue(emptyRuleSegmentConvertResult.getLoadBalancers().isEmpty());
+ }
+
+ private void assertSingleRuleSegmentConvertResult(final ReadwriteSplittingRuleSegment readwriteSplittingRuleSegment,
+ final ReadwriteSplittingRuleConfiguration singleRuleSegmentConvertResult) {
+ Collection<ReadwriteSplittingDataSourceRuleConfiguration> singleRuleSegmentConvertResultDataSources = singleRuleSegmentConvertResult.getDataSources();
+ Map<String, ShardingSphereAlgorithmConfiguration> singleRuleSegmentConvertResultLoadBalancers = singleRuleSegmentConvertResult.getLoadBalancers();
+ assertEquals(1, singleRuleSegmentConvertResultDataSources.size());
Review comment:
ok, already edited
--
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] codecov-commenter edited a comment on pull request #11753: fix-10965
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #11753:
URL: https://github.com/apache/shardingsphere/pull/11753#issuecomment-896332344
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11753?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#11753](https://codecov.io/gh/apache/shardingsphere/pull/11753?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (d80f1a5) into [master](https://codecov.io/gh/apache/shardingsphere/commit/ba5fe48a2f2c05adfa64768c4e98b7b53756bf03?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ba5fe48) will **increase** coverage by `0.02%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/11753/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/shardingsphere/pull/11753?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #11753 +/- ##
============================================
+ Coverage 63.63% 63.66% +0.02%
- Complexity 1126 1127 +1
============================================
Files 2280 2283 +3
Lines 34743 34761 +18
Branches 6041 6042 +1
============================================
+ Hits 22109 22129 +20
+ Misses 10862 10859 -3
- Partials 1772 1773 +1
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/11753?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...l/parser/core/database/visitor/SQLVisitorRule.java](https://codecov.io/gh/apache/shardingsphere/pull/11753/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLWVuZ2luZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9jb3JlL2RhdGFiYXNlL3Zpc2l0b3IvU1FMVmlzaXRvclJ1bGUuamF2YQ==) | `100.00% <0.00%> (ø)` | |
| [...statement/ddl/FlashbackTableStatementTestCase.java](https://codecov.io/gh/apache/shardingsphere/pull/11753/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvamF4Yi9jYXNlcy9kb21haW4vc3RhdGVtZW50L2RkbC9GbGFzaGJhY2tUYWJsZVN0YXRlbWVudFRlc3RDYXNlLmphdmE=) | `100.00% <0.00%> (ø)` | |
| [...tement/ddl/impl/FlashbackTableStatementAssert.java](https://codecov.io/gh/apache/shardingsphere/pull/11753/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvYXNzZXJ0cy9zdGF0ZW1lbnQvZGRsL2ltcGwvRmxhc2hiYWNrVGFibGVTdGF0ZW1lbnRBc3NlcnQuamF2YQ==) | `0.00% <0.00%> (ø)` | |
| [...ment/oracle/ddl/OracleFlashbackTableStatement.java](https://codecov.io/gh/apache/shardingsphere/pull/11753/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLXN0YXRlbWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9zcWwvZGlhbGVjdC9zdGF0ZW1lbnQvb3JhY2xlL2RkbC9PcmFjbGVGbGFzaGJhY2tUYWJsZVN0YXRlbWVudC5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...eterized/jaxb/cases/domain/SQLParserTestCases.java](https://codecov.io/gh/apache/shardingsphere/pull/11753/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvamF4Yi9jYXNlcy9kb21haW4vU1FMUGFyc2VyVGVzdENhc2VzLmphdmE=) | `99.56% <0.00%> (+<0.01%)` | :arrow_up: |
| [...r/statement/impl/OracleDDLStatementSQLVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/11753/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLWRpYWxlY3Qvc2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci1vcmFjbGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NxbC9wYXJzZXIvb3JhY2xlL3Zpc2l0b3Ivc3RhdGVtZW50L2ltcGwvT3JhY2xlRERMU3RhdGVtZW50U1FMVmlzaXRvci5qYXZh) | `85.00% <0.00%> (+0.38%)` | :arrow_up: |
| [...rter/ReadwriteSplittingRuleStatementConverter.java](https://codecov.io/gh/apache/shardingsphere/pull/11753/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtcmVhZHdyaXRlLXNwbGl0dGluZy9zaGFyZGluZ3NwaGVyZS1yZWFkd3JpdGUtc3BsaXR0aW5nLWRpc3RzcWwvc2hhcmRpbmdzcGhlcmUtcmVhZHdyaXRlLXNwbGl0dGluZy1kaXN0c3FsLWhhbmRsZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3JlYWR3cml0ZXNwbGl0dGluZy9kaXN0c3FsL2hhbmRsZXIvY29udmVydGVyL1JlYWR3cml0ZVNwbGl0dGluZ1J1bGVTdGF0ZW1lbnRDb252ZXJ0ZXIuamF2YQ==) | `84.61% <0.00%> (+84.61%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11753?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11753?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [ba5fe48...d80f1a5](https://codecov.io/gh/apache/shardingsphere/pull/11753?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
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] sizzlecar commented on a change in pull request #11753: fix-10965
Posted by GitBox <gi...@apache.org>.
sizzlecar commented on a change in pull request #11753:
URL: https://github.com/apache/shardingsphere/pull/11753#discussion_r687634880
##########
File path: shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-distsql/shardingsphere-readwrite-splitting-distsql-handler/src/test/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/converter/ReadwriteSplittingRuleStatementConverterTest.java
##########
@@ -0,0 +1,120 @@
+/*
+ * 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.readwritesplitting.distsql.handler.converter;
+
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
+import org.apache.shardingsphere.readwritesplitting.api.ReadwriteSplittingRuleConfiguration;
+import org.apache.shardingsphere.readwritesplitting.api.rule.ReadwriteSplittingDataSourceRuleConfiguration;
+import org.apache.shardingsphere.readwritesplitting.distsql.parser.segment.ReadwriteSplittingRuleSegment;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.stream.Stream;
+
+import static org.junit.Assert.assertThat;
+
+public final class ReadwriteSplittingRuleStatementConverterTest {
+
+ @Test
+ public void convertTest() {
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] tristaZero commented on pull request #11753: fix-10965
Posted by GitBox <gi...@apache.org>.
tristaZero commented on pull request #11753:
URL: https://github.com/apache/shardingsphere/pull/11753#issuecomment-896493872
Hi @sizzlecar welcome, this is the first-time to see you here.
--
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] codecov-commenter commented on pull request #11753: fix-10965
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #11753:
URL: https://github.com/apache/shardingsphere/pull/11753#issuecomment-896332344
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11753?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#11753](https://codecov.io/gh/apache/shardingsphere/pull/11753?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (913d256) into [master](https://codecov.io/gh/apache/shardingsphere/commit/ba5fe48a2f2c05adfa64768c4e98b7b53756bf03?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ba5fe48) will **increase** coverage by `0.03%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/11753/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/shardingsphere/pull/11753?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #11753 +/- ##
============================================
+ Coverage 63.63% 63.66% +0.03%
Complexity 1126 1126
============================================
Files 2280 2280
Lines 34743 34743
Branches 6041 6041
============================================
+ Hits 22109 22120 +11
+ Misses 10862 10850 -12
- Partials 1772 1773 +1
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/11753?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...rter/ReadwriteSplittingRuleStatementConverter.java](https://codecov.io/gh/apache/shardingsphere/pull/11753/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtcmVhZHdyaXRlLXNwbGl0dGluZy9zaGFyZGluZ3NwaGVyZS1yZWFkd3JpdGUtc3BsaXR0aW5nLWRpc3RzcWwvc2hhcmRpbmdzcGhlcmUtcmVhZHdyaXRlLXNwbGl0dGluZy1kaXN0c3FsLWhhbmRsZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3JlYWR3cml0ZXNwbGl0dGluZy9kaXN0c3FsL2hhbmRsZXIvY29udmVydGVyL1JlYWR3cml0ZVNwbGl0dGluZ1J1bGVTdGF0ZW1lbnRDb252ZXJ0ZXIuamF2YQ==) | `84.61% <0.00%> (+84.61%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11753?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11753?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [ba5fe48...913d256](https://codecov.io/gh/apache/shardingsphere/pull/11753?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
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] menghaoranss commented on a change in pull request #11753: fix-10965
Posted by GitBox <gi...@apache.org>.
menghaoranss commented on a change in pull request #11753:
URL: https://github.com/apache/shardingsphere/pull/11753#discussion_r686470504
##########
File path: shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-distsql/shardingsphere-readwrite-splitting-distsql-handler/src/test/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/converter/ReadwriteSplittingRuleStatementConverterTest.java
##########
@@ -0,0 +1,121 @@
+/*
+ * 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.readwritesplitting.distsql.handler.converter;
+
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
+import org.apache.shardingsphere.readwritesplitting.api.ReadwriteSplittingRuleConfiguration;
+import org.apache.shardingsphere.readwritesplitting.api.rule.ReadwriteSplittingDataSourceRuleConfiguration;
+import org.apache.shardingsphere.readwritesplitting.distsql.parser.segment.ReadwriteSplittingRuleSegment;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.stream.Stream;
+
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertEquals;
+
+public final class ReadwriteSplittingRuleStatementConverterTest {
+
+ @Test
+ public void convertTest() {
+ ReadwriteSplittingRuleConfiguration emptyRuleSegmentConvertResult = ReadwriteSplittingRuleStatementConverter
+ .convert(Collections.emptyList());
+ assertEmptyRuleSegmentConvertResult(emptyRuleSegmentConvertResult);
+ Properties properties1 = new Properties();
+ properties1.setProperty("ping", "pong");
+ ReadwriteSplittingRuleSegment singleReadwriteSplittingRuleSegment = createReadwriteSplittingRuleSegment("name1", "write_ds_01", Arrays.asList("read_ds_01", "read_ds_02"), "lb01", properties1);
+ ReadwriteSplittingRuleConfiguration singleRuleSegmentConvertResult = ReadwriteSplittingRuleStatementConverter
+ .convert(Collections.singleton(singleReadwriteSplittingRuleSegment));
+ assertSingleRuleSegmentConvertResult(singleReadwriteSplittingRuleSegment, singleRuleSegmentConvertResult);
+ Properties properties2 = new Properties();
+ properties2.setProperty("ping1", "pong1");
+ Properties properties3 = new Properties();
+ properties3.setProperty("ping2", "pong2");
+ Properties properties4 = new Properties();
+ properties4.setProperty("ping3", "pong3");
+ properties4.setProperty("ping4", "pong4");
+ List<ReadwriteSplittingRuleSegment> multipleReadwriteSplittingRuleSegments = Arrays.asList(
+ createReadwriteSplittingRuleSegment("name2", "write_ds_02", Arrays.asList("read_ds_02", "read_ds_03"), "lb02", properties2),
+ createReadwriteSplittingRuleSegment("name3", "write_ds_03", Arrays.asList("read_ds_04", "read_ds_05"), "lb03", properties3),
+ createReadwriteSplittingRuleSegment("name4", "write_ds_04", Arrays.asList("read_ds_06", "read_ds_07"), "lb04", properties4));
+ ReadwriteSplittingRuleConfiguration multipleRuleSegmentConvertResult = ReadwriteSplittingRuleStatementConverter.convert(multipleReadwriteSplittingRuleSegments);
+ assertMultipleReadwriteSplittingRuleSegments(multipleReadwriteSplittingRuleSegments, multipleRuleSegmentConvertResult);
+ }
+
+ private ReadwriteSplittingRuleSegment createReadwriteSplittingRuleSegment(final String name,
+ final String writeDataSource,
+ final List<String> readDataSourceList,
+ final String loadBalancerTypeName,
+ final Properties properties) {
+ return new ReadwriteSplittingRuleSegment(name, writeDataSource, readDataSourceList, loadBalancerTypeName, properties);
+ }
+
+ private void assertEmptyRuleSegmentConvertResult(final ReadwriteSplittingRuleConfiguration emptyRuleSegmentConvertResult) {
+ assertTrue(emptyRuleSegmentConvertResult.getDataSources().isEmpty());
+ assertTrue(emptyRuleSegmentConvertResult.getLoadBalancers().isEmpty());
+ }
+
+ private void assertSingleRuleSegmentConvertResult(final ReadwriteSplittingRuleSegment readwriteSplittingRuleSegment,
+ final ReadwriteSplittingRuleConfiguration singleRuleSegmentConvertResult) {
+ Collection<ReadwriteSplittingDataSourceRuleConfiguration> singleRuleSegmentConvertResultDataSources = singleRuleSegmentConvertResult.getDataSources();
+ Map<String, ShardingSphereAlgorithmConfiguration> singleRuleSegmentConvertResultLoadBalancers = singleRuleSegmentConvertResult.getLoadBalancers();
+ assertEquals(1, singleRuleSegmentConvertResultDataSources.size());
Review comment:
Please use `assertThat` to instead of `assertEquals`
--
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