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/09/22 10:32:55 UTC
[GitHub] [shardingsphere] lanchengx opened a new pull request #12623: Refactor Shadow DistSQL and adapt the new data structure of tableConfiguration
lanchengx opened a new pull request #12623:
URL: https://github.com/apache/shardingsphere/pull/12623
Changes proposed in this pull request:
- Added checker and supporter
- Adapt to Shadow's new data structure
--
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] RaigorJiang commented on a change in pull request #12623: Refactor Shadow DistSQL and adapt the new data structure of tableConfiguration
Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on a change in pull request #12623:
URL: https://github.com/apache/shardingsphere/pull/12623#discussion_r715273491
##########
File path: shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-distsql/shardingsphere-shadow-distsql-parser/src/main/java/org/apache/shardingsphere/shadow/distsql/parser/core/ShadowDistSQLStatementVisitor.java
##########
@@ -127,15 +128,18 @@ public ASTNode visitShowShadowTableRules(final ShowShadowTableRulesContext ctx)
}
private static String getText(final ParserRuleContext ctx) {
+ if (null == ctx || ctx.isEmpty()) {
+ return null;
+ }
return new IdentifierValue(ctx.getText()).getValue();
}
private Collection<ShadowAlgorithmSegment> visitShadowAlgorithms(final List<ShadowAlgorithmDefinitionContext> ctxs) {
return ctxs.stream().map(this::visit).map(each -> (ShadowAlgorithmSegment) each).collect(Collectors.toList());
}
- private String createAlgorithmName(final String tableName, final AlgorithmSegment algorithmSegment) {
- return (tableName + "_" + algorithmSegment.getName()).toLowerCase();
+ private String createAlgorithmName(final String ruleName, final String tableName, final AlgorithmSegment algorithmSegment) {
+ return (ruleName + "_" + tableName + "_" + algorithmSegment.getName()).toLowerCase();
Review comment:
Is it better to use String.format instead of `+`?
--
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 #12623: Refactor Shadow DistSQL and adapt the new data structure of tableConfiguration
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #12623:
URL: https://github.com/apache/shardingsphere/pull/12623#issuecomment-925272396
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/12623?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 [#12623](https://codecov.io/gh/apache/shardingsphere/pull/12623?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (92dcfd9) into [master](https://codecov.io/gh/apache/shardingsphere/commit/77b1006ebd28b8ef73d42d6819099ab8658eee79?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (77b1006) will **decrease** coverage by `0.08%`.
> The diff coverage is `67.49%`.
[](https://codecov.io/gh/apache/shardingsphere/pull/12623?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 #12623 +/- ##
============================================
- Coverage 63.37% 63.29% -0.09%
- Complexity 1327 1328 +1
============================================
Files 2440 2441 +1
Lines 37009 37037 +28
Branches 6405 6390 -15
============================================
- Hits 23456 23441 -15
- Misses 11648 11707 +59
+ Partials 1905 1889 -16
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/12623?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...er/update/DropShadowAlgorithmStatementUpdater.java](https://codecov.io/gh/apache/shardingsphere/pull/12623/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1kaXN0c3FsL3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1kaXN0c3FsLWhhbmRsZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NoYWRvdy9kaXN0c3FsL2hhbmRsZXIvdXBkYXRlL0Ryb3BTaGFkb3dBbGdvcml0aG1TdGF0ZW1lbnRVcGRhdGVyLmphdmE=) | `0.00% <0.00%> (ø)` | |
| [...sql/parser/core/ShadowDistSQLStatementVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/12623/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1kaXN0c3FsL3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1kaXN0c3FsLXBhcnNlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhZG93L2Rpc3RzcWwvcGFyc2VyL2NvcmUvU2hhZG93RGlzdFNRTFN0YXRlbWVudFZpc2l0b3IuamF2YQ==) | `0.00% <0.00%> (ø)` | |
| [...ere/infra/metadata/schema/loader/SchemaLoader.java](https://codecov.io/gh/apache/shardingsphere/pull/12623/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9zY2hlbWEvbG9hZGVyL1NjaGVtYUxvYWRlci5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...derate/execute/raw/FederateExecuteDataContext.java](https://codecov.io/gh/apache/shardingsphere/pull/12623/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtZXhlY3V0b3Ivc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL2V4ZWN1dG9yL3NxbC9mZWRlcmF0ZS9leGVjdXRlL3Jhdy9GZWRlcmF0ZUV4ZWN1dGVEYXRhQ29udGV4dC5qYXZh) | `0.00% <ø> (ø)` | |
| [...sphere/infra/optimize/ShardingSphereOptimizer.java](https://codecov.io/gh/apache/shardingsphere/pull/12623/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtb3B0aW1pemUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL29wdGltaXplL1NoYXJkaW5nU3BoZXJlT3B0aW1pemVyLmphdmE=) | `0.00% <0.00%> (ø)` | |
| [.../customized/CustomizedOptimizerContextFactory.java](https://codecov.io/gh/apache/shardingsphere/pull/12623/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtb3B0aW1pemUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL29wdGltaXplL2NvbnRleHQvY3VzdG9taXplZC9DdXN0b21pemVkT3B0aW1pemVyQ29udGV4dEZhY3RvcnkuamF2YQ==) | `0.00% <0.00%> (ø)` | |
| [...text/original/OriginalOptimizerContextFactory.java](https://codecov.io/gh/apache/shardingsphere/pull/12623/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtb3B0aW1pemUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL29wdGltaXplL2NvbnRleHQvb3JpZ2luYWwvT3JpZ2luYWxPcHRpbWl6ZXJDb250ZXh0RmFjdG9yeS5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...ginal/props/OptimizerPropertiesBuilderFactory.java](https://codecov.io/gh/apache/shardingsphere/pull/12623/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtb3B0aW1pemUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL29wdGltaXplL2NvbnRleHQvb3JpZ2luYWwvcHJvcHMvT3B0aW1pemVyUHJvcGVydGllc0J1aWxkZXJGYWN0b3J5LmphdmE=) | `0.00% <ø> (ø)` | |
| [...ginal/props/impl/H2OptimizerPropertiesBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/12623/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtb3B0aW1pemUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL29wdGltaXplL2NvbnRleHQvb3JpZ2luYWwvcHJvcHMvaW1wbC9IMk9wdGltaXplclByb3BlcnRpZXNCdWlsZGVyLmphdmE=) | `0.00% <ø> (ø)` | |
| [.../props/impl/MariaDBOptimizerPropertiesBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/12623/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtb3B0aW1pemUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL29wdGltaXplL2NvbnRleHQvb3JpZ2luYWwvcHJvcHMvaW1wbC9NYXJpYURCT3B0aW1pemVyUHJvcGVydGllc0J1aWxkZXIuamF2YQ==) | `0.00% <ø> (ø)` | |
| ... and [52 more](https://codecov.io/gh/apache/shardingsphere/pull/12623/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/12623?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/12623?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 [54aed2a...92dcfd9](https://codecov.io/gh/apache/shardingsphere/pull/12623?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] codecov-commenter edited a comment on pull request #12623: Refactor Shadow DistSQL and adapt the new data structure of tableConfiguration
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #12623:
URL: https://github.com/apache/shardingsphere/pull/12623#issuecomment-925272396
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/12623?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 [#12623](https://codecov.io/gh/apache/shardingsphere/pull/12623?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3ab1be1) into [master](https://codecov.io/gh/apache/shardingsphere/commit/77b1006ebd28b8ef73d42d6819099ab8658eee79?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (77b1006) will **decrease** coverage by `0.12%`.
> The diff coverage is `66.35%`.
[](https://codecov.io/gh/apache/shardingsphere/pull/12623?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 #12623 +/- ##
============================================
- Coverage 63.37% 63.25% -0.13%
- Complexity 1327 1328 +1
============================================
Files 2440 2442 +2
Lines 37009 37058 +49
Branches 6405 6394 -11
============================================
- Hits 23456 23441 -15
- Misses 11648 11732 +84
+ Partials 1905 1885 -20
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/12623?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...er/update/DropShadowAlgorithmStatementUpdater.java](https://codecov.io/gh/apache/shardingsphere/pull/12623/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1kaXN0c3FsL3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1kaXN0c3FsLWhhbmRsZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NoYWRvdy9kaXN0c3FsL2hhbmRsZXIvdXBkYXRlL0Ryb3BTaGFkb3dBbGdvcml0aG1TdGF0ZW1lbnRVcGRhdGVyLmphdmE=) | `0.00% <0.00%> (ø)` | |
| [...sql/parser/core/ShadowDistSQLStatementVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/12623/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1kaXN0c3FsL3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1kaXN0c3FsLXBhcnNlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhZG93L2Rpc3RzcWwvcGFyc2VyL2NvcmUvU2hhZG93RGlzdFNRTFN0YXRlbWVudFZpc2l0b3IuamF2YQ==) | `0.00% <0.00%> (ø)` | |
| [...ere/infra/metadata/schema/loader/SchemaLoader.java](https://codecov.io/gh/apache/shardingsphere/pull/12623/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9zY2hlbWEvbG9hZGVyL1NjaGVtYUxvYWRlci5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...sphere/infra/optimize/ShardingSphereOptimizer.java](https://codecov.io/gh/apache/shardingsphere/pull/12623/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtb3B0aW1pemUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL29wdGltaXplL1NoYXJkaW5nU3BoZXJlT3B0aW1pemVyLmphdmE=) | `0.00% <0.00%> (ø)` | |
| [.../customized/CustomizedOptimizerContextFactory.java](https://codecov.io/gh/apache/shardingsphere/pull/12623/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtb3B0aW1pemUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL29wdGltaXplL2NvbnRleHQvY3VzdG9taXplZC9DdXN0b21pemVkT3B0aW1pemVyQ29udGV4dEZhY3RvcnkuamF2YQ==) | `0.00% <0.00%> (ø)` | |
| [...text/original/OriginalOptimizerContextFactory.java](https://codecov.io/gh/apache/shardingsphere/pull/12623/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtb3B0aW1pemUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL29wdGltaXplL2NvbnRleHQvb3JpZ2luYWwvT3JpZ2luYWxPcHRpbWl6ZXJDb250ZXh0RmFjdG9yeS5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...ginal/props/OptimizerPropertiesBuilderFactory.java](https://codecov.io/gh/apache/shardingsphere/pull/12623/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtb3B0aW1pemUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL29wdGltaXplL2NvbnRleHQvb3JpZ2luYWwvcHJvcHMvT3B0aW1pemVyUHJvcGVydGllc0J1aWxkZXJGYWN0b3J5LmphdmE=) | `0.00% <ø> (ø)` | |
| [...ginal/props/impl/H2OptimizerPropertiesBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/12623/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtb3B0aW1pemUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL29wdGltaXplL2NvbnRleHQvb3JpZ2luYWwvcHJvcHMvaW1wbC9IMk9wdGltaXplclByb3BlcnRpZXNCdWlsZGVyLmphdmE=) | `0.00% <ø> (ø)` | |
| [.../props/impl/MariaDBOptimizerPropertiesBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/12623/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtb3B0aW1pemUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL29wdGltaXplL2NvbnRleHQvb3JpZ2luYWwvcHJvcHMvaW1wbC9NYXJpYURCT3B0aW1pemVyUHJvcGVydGllc0J1aWxkZXIuamF2YQ==) | `0.00% <ø> (ø)` | |
| [...al/props/impl/MySQLOptimizerPropertiesBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/12623/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtb3B0aW1pemUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL29wdGltaXplL2NvbnRleHQvb3JpZ2luYWwvcHJvcHMvaW1wbC9NeVNRTE9wdGltaXplclByb3BlcnRpZXNCdWlsZGVyLmphdmE=) | `0.00% <ø> (ø)` | |
| ... and [64 more](https://codecov.io/gh/apache/shardingsphere/pull/12623/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/12623?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/12623?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 [54aed2a...3ab1be1](https://codecov.io/gh/apache/shardingsphere/pull/12623?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] RaigorJiang commented on a change in pull request #12623: Refactor Shadow DistSQL and adapt the new data structure of tableConfiguration
Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on a change in pull request #12623:
URL: https://github.com/apache/shardingsphere/pull/12623#discussion_r714511119
##########
File path: shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-distsql/shardingsphere-shadow-distsql-handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/supporter/ShadowRuleStatementSupporter.java
##########
@@ -0,0 +1,151 @@
+/*
+ * 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.shadow.distsql.handler.supporter;
+
+import org.apache.shardingsphere.shadow.api.config.ShadowRuleConfiguration;
+import org.apache.shardingsphere.shadow.api.config.table.ShadowTableConfiguration;
+import org.apache.shardingsphere.shadow.distsql.parser.segment.ShadowAlgorithmSegment;
+import org.apache.shardingsphere.shadow.distsql.parser.segment.ShadowRuleSegment;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+/**
+ * Show rule statement supporter.
+ */
+public final class ShadowRuleStatementSupporter {
+
+ /**
+ * Get the rule name from the configuration.
+ *
+ * @param configuration configuration
+ * @return the value corresponding to the rule name
+ */
+ public static List<String> getRuleName(final ShadowRuleConfiguration configuration) {
Review comment:
Because the result is a list, 'getRuleNames' is better for the method name.
--
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] RaigorJiang commented on a change in pull request #12623: Refactor Shadow DistSQL and adapt the new data structure of tableConfiguration
Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on a change in pull request #12623:
URL: https://github.com/apache/shardingsphere/pull/12623#discussion_r714510158
##########
File path: shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-distsql/shardingsphere-shadow-distsql-handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/supporter/ShadowRuleStatementSupporter.java
##########
@@ -0,0 +1,151 @@
+/*
+ * 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.shadow.distsql.handler.supporter;
+
+import org.apache.shardingsphere.shadow.api.config.ShadowRuleConfiguration;
+import org.apache.shardingsphere.shadow.api.config.table.ShadowTableConfiguration;
+import org.apache.shardingsphere.shadow.distsql.parser.segment.ShadowAlgorithmSegment;
+import org.apache.shardingsphere.shadow.distsql.parser.segment.ShadowRuleSegment;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+/**
+ * Show rule statement supporter.
Review comment:
'Show' may be 'Shadow'?
--
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] RaigorJiang commented on a change in pull request #12623: Refactor Shadow DistSQL and adapt the new data structure of tableConfiguration
Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on a change in pull request #12623:
URL: https://github.com/apache/shardingsphere/pull/12623#discussion_r713830247
##########
File path: shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-api/src/main/java/org/apache/shardingsphere/shadow/api/config/table/ShadowTableConfiguration.java
##########
@@ -46,4 +46,16 @@ public ShadowTableConfiguration(final Collection<String> shadowAlgorithmNames) {
this.dataSourceNames = new LinkedList<>();
this.shadowAlgorithmNames = shadowAlgorithmNames;
}
+
+ /**
+ * Aggregate the data of two shadow table configuration.
+ *
+ * @param config new shadow table configuration
+ * @return shadow table configuration
+ */
+ public ShadowTableConfiguration aggregateData(final ShadowTableConfiguration config) {
Review comment:
Data is not a good name.
--
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] lanchengx commented on a change in pull request #12623: Refactor Shadow DistSQL and adapt the new data structure of tableConfiguration
Posted by GitBox <gi...@apache.org>.
lanchengx commented on a change in pull request #12623:
URL: https://github.com/apache/shardingsphere/pull/12623#discussion_r715276014
##########
File path: shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-distsql/shardingsphere-shadow-distsql-parser/src/main/java/org/apache/shardingsphere/shadow/distsql/parser/core/ShadowDistSQLStatementVisitor.java
##########
@@ -127,15 +128,18 @@ public ASTNode visitShowShadowTableRules(final ShowShadowTableRulesContext ctx)
}
private static String getText(final ParserRuleContext ctx) {
+ if (null == ctx || ctx.isEmpty()) {
+ return null;
+ }
return new IdentifierValue(ctx.getText()).getValue();
}
private Collection<ShadowAlgorithmSegment> visitShadowAlgorithms(final List<ShadowAlgorithmDefinitionContext> ctxs) {
return ctxs.stream().map(this::visit).map(each -> (ShadowAlgorithmSegment) each).collect(Collectors.toList());
}
- private String createAlgorithmName(final String tableName, final AlgorithmSegment algorithmSegment) {
- return (tableName + "_" + algorithmSegment.getName()).toLowerCase();
+ private String createAlgorithmName(final String ruleName, final String tableName, final AlgorithmSegment algorithmSegment) {
+ return (ruleName + "_" + tableName + "_" + algorithmSegment.getName()).toLowerCase();
Review comment:
Already 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] RaigorJiang commented on a change in pull request #12623: Refactor Shadow DistSQL and adapt the new data structure of tableConfiguration
Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on a change in pull request #12623:
URL: https://github.com/apache/shardingsphere/pull/12623#discussion_r714511399
##########
File path: shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-distsql/shardingsphere-shadow-distsql-handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/supporter/ShadowRuleStatementSupporter.java
##########
@@ -0,0 +1,151 @@
+/*
+ * 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.shadow.distsql.handler.supporter;
+
+import org.apache.shardingsphere.shadow.api.config.ShadowRuleConfiguration;
+import org.apache.shardingsphere.shadow.api.config.table.ShadowTableConfiguration;
+import org.apache.shardingsphere.shadow.distsql.parser.segment.ShadowAlgorithmSegment;
+import org.apache.shardingsphere.shadow.distsql.parser.segment.ShadowRuleSegment;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+/**
+ * Show rule statement supporter.
+ */
+public final class ShadowRuleStatementSupporter {
+
+ /**
+ * Get the rule name from the configuration.
+ *
+ * @param configuration configuration
+ * @return the value corresponding to the rule name
+ */
+ public static List<String> getRuleName(final ShadowRuleConfiguration configuration) {
+ if (null == configuration) {
+ return Collections.emptyList();
+ }
+ return new ArrayList<>(configuration.getDataSources().keySet());
+ }
+
+ /**
+ * Get the rule name from the rules.
+ *
+ * @param rules rules
+ * @return the value corresponding to the rule name
+ */
+ public static List<String> getRuleName(final Collection<ShadowRuleSegment> rules) {
+ if (rules.isEmpty()) {
+ return Collections.emptyList();
+ }
+ return rules.stream().map(ShadowRuleSegment::getRuleName).collect(Collectors.toList());
+ }
+
+ /**
+ * Get the table from the configuration.
+ *
+ * @param configuration configuration
+ * @return the value corresponding to the table
+ */
+ public static List<String> getTable(final ShadowRuleConfiguration configuration) {
Review comment:
Same problem.
--
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] RaigorJiang commented on a change in pull request #12623: Refactor Shadow DistSQL and adapt the new data structure of tableConfiguration
Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on a change in pull request #12623:
URL: https://github.com/apache/shardingsphere/pull/12623#discussion_r714439168
##########
File path: shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-distsql/shardingsphere-shadow-distsql-handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/checker/ShadowRuleStatementChecker.java
##########
@@ -0,0 +1,126 @@
+/*
+ * 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.shadow.distsql.handler.checker;
+
+import org.apache.shardingsphere.infra.config.scope.SchemaRuleConfiguration;
+import org.apache.shardingsphere.infra.distsql.exception.DistSQLException;
+import org.apache.shardingsphere.infra.distsql.exception.resource.RequiredResourceMissedException;
+import org.apache.shardingsphere.infra.distsql.exception.rule.InvalidAlgorithmConfigurationException;
+import org.apache.shardingsphere.infra.distsql.exception.rule.RequiredRuleMissedException;
+import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData;
+import org.apache.shardingsphere.shadow.distsql.parser.segment.ShadowAlgorithmSegment;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+/**
+ * Shadow rule statement checker.
+ */
+public class ShadowRuleStatementChecker {
+
+ public static final String SHADOW = "shadow";
+
+ /**
+ * Check if the configuration exists.
+ *
+ * @param schemaName schema name
+ * @param configuration configuration
+ * @throws DistSQLException DistSQL exception
+ */
+ public static void checkConfigurationExist(final String schemaName, final SchemaRuleConfiguration configuration) throws DistSQLException {
+ DistSQLException.predictionThrow(null != configuration, new RequiredRuleMissedException(SHADOW, schemaName));
+ }
+
+ /**
+ * Check if resources exists in meta data.
+ *
+ * @param resources resource being checked
Review comment:
'to be' may be better than 'being'.
--
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] RaigorJiang commented on a change in pull request #12623: Refactor Shadow DistSQL and adapt the new data structure of tableConfiguration
Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on a change in pull request #12623:
URL: https://github.com/apache/shardingsphere/pull/12623#discussion_r714438657
##########
File path: shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-distsql/shardingsphere-shadow-distsql-handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/checker/ShadowRuleStatementChecker.java
##########
@@ -0,0 +1,126 @@
+/*
+ * 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.shadow.distsql.handler.checker;
+
+import org.apache.shardingsphere.infra.config.scope.SchemaRuleConfiguration;
+import org.apache.shardingsphere.infra.distsql.exception.DistSQLException;
+import org.apache.shardingsphere.infra.distsql.exception.resource.RequiredResourceMissedException;
+import org.apache.shardingsphere.infra.distsql.exception.rule.InvalidAlgorithmConfigurationException;
+import org.apache.shardingsphere.infra.distsql.exception.rule.RequiredRuleMissedException;
+import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData;
+import org.apache.shardingsphere.shadow.distsql.parser.segment.ShadowAlgorithmSegment;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+/**
+ * Shadow rule statement checker.
+ */
+public class ShadowRuleStatementChecker {
+
+ public static final String SHADOW = "shadow";
+
+ /**
+ * Check if the configuration exists.
+ *
+ * @param schemaName schema name
+ * @param configuration configuration
+ * @throws DistSQLException DistSQL exception
+ */
+ public static void checkConfigurationExist(final String schemaName, final SchemaRuleConfiguration configuration) throws DistSQLException {
+ DistSQLException.predictionThrow(null != configuration, new RequiredRuleMissedException(SHADOW, schemaName));
+ }
+
+ /**
+ * Check if resources exists in meta data.
Review comment:
`resources` is plural, verbs should not be singular
--
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] lanchengx commented on a change in pull request #12623: Refactor Shadow DistSQL and adapt the new data structure of tableConfiguration
Posted by GitBox <gi...@apache.org>.
lanchengx commented on a change in pull request #12623:
URL: https://github.com/apache/shardingsphere/pull/12623#discussion_r714031538
##########
File path: shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-api/src/main/java/org/apache/shardingsphere/shadow/api/config/table/ShadowTableConfiguration.java
##########
@@ -46,4 +46,16 @@ public ShadowTableConfiguration(final Collection<String> shadowAlgorithmNames) {
this.dataSourceNames = new LinkedList<>();
this.shadowAlgorithmNames = shadowAlgorithmNames;
}
+
+ /**
+ * Aggregate the data of two shadow table configuration.
+ *
+ * @param config new shadow table configuration
+ * @return shadow table configuration
+ */
+ public ShadowTableConfiguration aggregateData(final ShadowTableConfiguration config) {
Review comment:
I also agree, it has been modified to `mergeConfiguration()` and moved to `ShadowRuleStatementSupporter`, What do you think of this?
--
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] RaigorJiang merged pull request #12623: Refactor Shadow DistSQL and adapt the new data structure of tableConfiguration
Posted by GitBox <gi...@apache.org>.
RaigorJiang merged pull request #12623:
URL: https://github.com/apache/shardingsphere/pull/12623
--
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