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/30 12:08:03 UTC
[GitHub] [shardingsphere] soulasuna opened a new pull request #12112: Add insert statement shadow route engine
soulasuna opened a new pull request #12112:
URL: https://github.com/apache/shardingsphere/pull/12112
## Add insert statement shadow route engine.
For #11661.
Changes proposed in this pull request:
- Add insert statement shadow route engine.
- Add insert statement shadow route engine test.
- Optimize rule checker method.
--
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 merged pull request #12112: Add insert statement shadow route engine
Posted by GitBox <gi...@apache.org>.
tristaZero merged pull request #12112:
URL: https://github.com/apache/shardingsphere/pull/12112
--
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 a change in pull request #12112: Add insert statement shadow route engine
Posted by GitBox <gi...@apache.org>.
tristaZero commented on a change in pull request #12112:
URL: https://github.com/apache/shardingsphere/pull/12112#discussion_r698926407
##########
File path: shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/route/future/engine/determiner/ShadowAlgorithmDeterminer.java
##########
@@ -0,0 +1,38 @@
+/*
+ * 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.route.future.engine.determiner;
+
+import org.apache.shardingsphere.infra.binder.statement.dml.InsertStatementContext;
+
+import java.util.Collection;
+
+/**
+ * Shadow algorithm determiner.
+ */
+public interface ShadowAlgorithmDeterminer {
+
+ /**
+ * Is shadow in shadow algorithm.
+ *
+ * @param insertStatementContext insert statement context
+ * @param relatedShadowTables related shadow tables
+ * @param tableName table name
+ * @return is pass or not
+ */
+ boolean isShadow(InsertStatementContext insertStatementContext, Collection<String> relatedShadowTables, String tableName);
Review comment:
Intertstatement?
##########
File path: shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/route/future/engine/determiner/ShadowDeterminerFactory.java
##########
@@ -0,0 +1,70 @@
+/*
+ * 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.route.future.engine.determiner;
+
+import org.apache.shardingsphere.shadow.algorithm.shadow.ShadowAlgorithmException;
+import org.apache.shardingsphere.shadow.api.shadow.column.ColumnShadowAlgorithm;
+import org.apache.shardingsphere.shadow.api.shadow.note.NoteShadowAlgorithm;
+import org.apache.shardingsphere.shadow.route.future.engine.determiner.algorithm.ColumnShadowAlgorithmDeterminer;
+import org.apache.shardingsphere.shadow.route.future.engine.determiner.algorithm.NoteShadowAlgorithmDeterminer;
+import org.apache.shardingsphere.shadow.route.future.engine.determiner.table.AnyAlgorithmApplicableShadowTableDeterminer;
+import org.apache.shardingsphere.shadow.rule.ShadowRule;
+import org.apache.shardingsphere.shadow.spi.ShadowAlgorithm;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+/**
+ * Shadow determiner factory.
+ */
+public final class ShadowDeterminerFactory {
Review comment:
Judge is better?
--
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 merged pull request #12112: Add insert statement shadow route engine
Posted by GitBox <gi...@apache.org>.
tristaZero merged pull request #12112:
URL: https://github.com/apache/shardingsphere/pull/12112
--
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 a change in pull request #12112: Add insert statement shadow route engine
Posted by GitBox <gi...@apache.org>.
tristaZero commented on a change in pull request #12112:
URL: https://github.com/apache/shardingsphere/pull/12112#discussion_r698926407
##########
File path: shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/route/future/engine/determiner/ShadowAlgorithmDeterminer.java
##########
@@ -0,0 +1,38 @@
+/*
+ * 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.route.future.engine.determiner;
+
+import org.apache.shardingsphere.infra.binder.statement.dml.InsertStatementContext;
+
+import java.util.Collection;
+
+/**
+ * Shadow algorithm determiner.
+ */
+public interface ShadowAlgorithmDeterminer {
+
+ /**
+ * Is shadow in shadow algorithm.
+ *
+ * @param insertStatementContext insert statement context
+ * @param relatedShadowTables related shadow tables
+ * @param tableName table name
+ * @return is pass or not
+ */
+ boolean isShadow(InsertStatementContext insertStatementContext, Collection<String> relatedShadowTables, String tableName);
Review comment:
Intertstatement?
##########
File path: shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/route/future/engine/determiner/ShadowDeterminerFactory.java
##########
@@ -0,0 +1,70 @@
+/*
+ * 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.route.future.engine.determiner;
+
+import org.apache.shardingsphere.shadow.algorithm.shadow.ShadowAlgorithmException;
+import org.apache.shardingsphere.shadow.api.shadow.column.ColumnShadowAlgorithm;
+import org.apache.shardingsphere.shadow.api.shadow.note.NoteShadowAlgorithm;
+import org.apache.shardingsphere.shadow.route.future.engine.determiner.algorithm.ColumnShadowAlgorithmDeterminer;
+import org.apache.shardingsphere.shadow.route.future.engine.determiner.algorithm.NoteShadowAlgorithmDeterminer;
+import org.apache.shardingsphere.shadow.route.future.engine.determiner.table.AnyAlgorithmApplicableShadowTableDeterminer;
+import org.apache.shardingsphere.shadow.rule.ShadowRule;
+import org.apache.shardingsphere.shadow.spi.ShadowAlgorithm;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+/**
+ * Shadow determiner factory.
+ */
+public final class ShadowDeterminerFactory {
Review comment:
Judge is better?
--
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] soulasuna commented on a change in pull request #12112: Add insert statement shadow route engine
Posted by GitBox <gi...@apache.org>.
soulasuna commented on a change in pull request #12112:
URL: https://github.com/apache/shardingsphere/pull/12112#discussion_r698932899
##########
File path: shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/route/future/engine/determiner/ShadowAlgorithmDeterminer.java
##########
@@ -0,0 +1,38 @@
+/*
+ * 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.route.future.engine.determiner;
+
+import org.apache.shardingsphere.infra.binder.statement.dml.InsertStatementContext;
+
+import java.util.Collection;
+
+/**
+ * Shadow algorithm determiner.
+ */
+public interface ShadowAlgorithmDeterminer {
+
+ /**
+ * Is shadow in shadow algorithm.
+ *
+ * @param insertStatementContext insert statement context
+ * @param relatedShadowTables related shadow tables
+ * @param tableName table name
+ * @return is pass or not
+ */
+ boolean isShadow(InsertStatementContext insertStatementContext, Collection<String> relatedShadowTables, String tableName);
Review comment:
The ShadowAlgorithmDeterminer isShadow method will be reconstructed after the development of the dml Statement.
After refactoring, ShadowAlgorithmDeterminer will not rely on StatementContext.
There will be an anti-corrosion layer in the middle for isolation to reduce coupling.
##########
File path: shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/route/future/engine/determiner/ShadowDeterminerFactory.java
##########
@@ -0,0 +1,70 @@
+/*
+ * 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.route.future.engine.determiner;
+
+import org.apache.shardingsphere.shadow.algorithm.shadow.ShadowAlgorithmException;
+import org.apache.shardingsphere.shadow.api.shadow.column.ColumnShadowAlgorithm;
+import org.apache.shardingsphere.shadow.api.shadow.note.NoteShadowAlgorithm;
+import org.apache.shardingsphere.shadow.route.future.engine.determiner.algorithm.ColumnShadowAlgorithmDeterminer;
+import org.apache.shardingsphere.shadow.route.future.engine.determiner.algorithm.NoteShadowAlgorithmDeterminer;
+import org.apache.shardingsphere.shadow.route.future.engine.determiner.table.AnyAlgorithmApplicableShadowTableDeterminer;
+import org.apache.shardingsphere.shadow.rule.ShadowRule;
+import org.apache.shardingsphere.shadow.spi.ShadowAlgorithm;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+/**
+ * Shadow determiner factory.
+ */
+public final class ShadowDeterminerFactory {
Review comment:
This class `ShadowAlgorithmDeterminer`, `ShadowTableDeterminer` factory class.
I am currently not sure whether the two interfaces can be unified into one.
If it can be achieved by introducing an anti-corrosion layer, there should be a unified interface `ShadowDeterminer` in the future.
--
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 #12112: Add insert statement shadow route engine
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #12112:
URL: https://github.com/apache/shardingsphere/pull/12112#issuecomment-908393583
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/12112?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 [#12112](https://codecov.io/gh/apache/shardingsphere/pull/12112?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4d3cf6c) into [master](https://codecov.io/gh/apache/shardingsphere/commit/36fc3299f932b56c03cb53479cbb7520fc94a15f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (36fc329) will **increase** coverage by `0.06%`.
> The diff coverage is `82.82%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/12112/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/12112?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 #12112 +/- ##
============================================
+ Coverage 63.48% 63.55% +0.06%
- Complexity 1233 1235 +2
============================================
Files 2312 2317 +5
Lines 35170 35238 +68
Branches 6117 6131 +14
============================================
+ Hits 22327 22394 +67
+ Misses 11042 11039 -3
- Partials 1801 1805 +4
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/12112?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [.../route/future/engine/ShadowRouteEngineFactory.java](https://codecov.io/gh/apache/shardingsphere/pull/12112/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcm91dGUvZnV0dXJlL2VuZ2luZS9TaGFkb3dSb3V0ZUVuZ2luZUZhY3RvcnkuamF2YQ==) | `20.00% <ø> (+20.00%)` | :arrow_up: |
| [...engine/dml/ShadowDeleteStatementRoutingEngine.java](https://codecov.io/gh/apache/shardingsphere/pull/12112/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcm91dGUvZnV0dXJlL2VuZ2luZS9kbWwvU2hhZG93RGVsZXRlU3RhdGVtZW50Um91dGluZ0VuZ2luZS5qYXZh) | `0.00% <ø> (ø)` | |
| [...engine/dml/ShadowSelectStatementRoutingEngine.java](https://codecov.io/gh/apache/shardingsphere/pull/12112/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcm91dGUvZnV0dXJlL2VuZ2luZS9kbWwvU2hhZG93U2VsZWN0U3RhdGVtZW50Um91dGluZ0VuZ2luZS5qYXZh) | `0.00% <ø> (ø)` | |
| [...engine/dml/ShadowUpdateStatementRoutingEngine.java](https://codecov.io/gh/apache/shardingsphere/pull/12112/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcm91dGUvZnV0dXJlL2VuZ2luZS9kbWwvU2hhZG93VXBkYXRlU3RhdGVtZW50Um91dGluZ0VuZ2luZS5qYXZh) | `0.00% <ø> (ø)` | |
| [.../apache/shardingsphere/shadow/rule/ShadowRule.java](https://codecov.io/gh/apache/shardingsphere/pull/12112/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcnVsZS9TaGFkb3dSdWxlLmphdmE=) | `80.76% <33.33%> (-2.87%)` | :arrow_down: |
| [...ure/engine/determiner/ShadowDeterminerFactory.java](https://codecov.io/gh/apache/shardingsphere/pull/12112/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcm91dGUvZnV0dXJlL2VuZ2luZS9kZXRlcm1pbmVyL1NoYWRvd0RldGVybWluZXJGYWN0b3J5LmphdmE=) | `62.50% <62.50%> (ø)` | |
| [...re/shadow/rule/checker/ShadowTableRuleChecker.java](https://codecov.io/gh/apache/shardingsphere/pull/12112/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcnVsZS9jaGVja2VyL1NoYWRvd1RhYmxlUnVsZUNoZWNrZXIuamF2YQ==) | `64.70% <68.42%> (-1.09%)` | :arrow_down: |
| [...ner/algorithm/ColumnShadowAlgorithmDeterminer.java](https://codecov.io/gh/apache/shardingsphere/pull/12112/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcm91dGUvZnV0dXJlL2VuZ2luZS9kZXRlcm1pbmVyL2FsZ29yaXRobS9Db2x1bW5TaGFkb3dBbGdvcml0aG1EZXRlcm1pbmVyLmphdmE=) | `86.95% <86.95%> (ø)` | |
| [...engine/dml/ShadowInsertStatementRoutingEngine.java](https://codecov.io/gh/apache/shardingsphere/pull/12112/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcm91dGUvZnV0dXJlL2VuZ2luZS9kbWwvU2hhZG93SW5zZXJ0U3RhdGVtZW50Um91dGluZ0VuZ2luZS5qYXZh) | `88.88% <88.88%> (ø)` | |
| [...route/future/engine/AbstractShadowRouteEngine.java](https://codecov.io/gh/apache/shardingsphere/pull/12112/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcm91dGUvZnV0dXJlL2VuZ2luZS9BYnN0cmFjdFNoYWRvd1JvdXRlRW5naW5lLmphdmE=) | `91.66% <91.66%> (ø)` | |
| ... and [11 more](https://codecov.io/gh/apache/shardingsphere/pull/12112/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/12112?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/12112?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 [36fc329...4d3cf6c](https://codecov.io/gh/apache/shardingsphere/pull/12112?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 commented on pull request #12112: Add insert statement shadow route engine
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #12112:
URL: https://github.com/apache/shardingsphere/pull/12112#issuecomment-908393583
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/12112?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 [#12112](https://codecov.io/gh/apache/shardingsphere/pull/12112?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4d3cf6c) into [master](https://codecov.io/gh/apache/shardingsphere/commit/36fc3299f932b56c03cb53479cbb7520fc94a15f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (36fc329) will **increase** coverage by `0.06%`.
> The diff coverage is `82.82%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/12112/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/12112?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 #12112 +/- ##
============================================
+ Coverage 63.48% 63.55% +0.06%
- Complexity 1233 1235 +2
============================================
Files 2312 2317 +5
Lines 35170 35238 +68
Branches 6117 6131 +14
============================================
+ Hits 22327 22394 +67
+ Misses 11042 11039 -3
- Partials 1801 1805 +4
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/12112?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [.../route/future/engine/ShadowRouteEngineFactory.java](https://codecov.io/gh/apache/shardingsphere/pull/12112/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcm91dGUvZnV0dXJlL2VuZ2luZS9TaGFkb3dSb3V0ZUVuZ2luZUZhY3RvcnkuamF2YQ==) | `20.00% <ø> (+20.00%)` | :arrow_up: |
| [...engine/dml/ShadowDeleteStatementRoutingEngine.java](https://codecov.io/gh/apache/shardingsphere/pull/12112/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcm91dGUvZnV0dXJlL2VuZ2luZS9kbWwvU2hhZG93RGVsZXRlU3RhdGVtZW50Um91dGluZ0VuZ2luZS5qYXZh) | `0.00% <ø> (ø)` | |
| [...engine/dml/ShadowSelectStatementRoutingEngine.java](https://codecov.io/gh/apache/shardingsphere/pull/12112/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcm91dGUvZnV0dXJlL2VuZ2luZS9kbWwvU2hhZG93U2VsZWN0U3RhdGVtZW50Um91dGluZ0VuZ2luZS5qYXZh) | `0.00% <ø> (ø)` | |
| [...engine/dml/ShadowUpdateStatementRoutingEngine.java](https://codecov.io/gh/apache/shardingsphere/pull/12112/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcm91dGUvZnV0dXJlL2VuZ2luZS9kbWwvU2hhZG93VXBkYXRlU3RhdGVtZW50Um91dGluZ0VuZ2luZS5qYXZh) | `0.00% <ø> (ø)` | |
| [.../apache/shardingsphere/shadow/rule/ShadowRule.java](https://codecov.io/gh/apache/shardingsphere/pull/12112/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcnVsZS9TaGFkb3dSdWxlLmphdmE=) | `80.76% <33.33%> (-2.87%)` | :arrow_down: |
| [...ure/engine/determiner/ShadowDeterminerFactory.java](https://codecov.io/gh/apache/shardingsphere/pull/12112/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcm91dGUvZnV0dXJlL2VuZ2luZS9kZXRlcm1pbmVyL1NoYWRvd0RldGVybWluZXJGYWN0b3J5LmphdmE=) | `62.50% <62.50%> (ø)` | |
| [...re/shadow/rule/checker/ShadowTableRuleChecker.java](https://codecov.io/gh/apache/shardingsphere/pull/12112/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcnVsZS9jaGVja2VyL1NoYWRvd1RhYmxlUnVsZUNoZWNrZXIuamF2YQ==) | `64.70% <68.42%> (-1.09%)` | :arrow_down: |
| [...ner/algorithm/ColumnShadowAlgorithmDeterminer.java](https://codecov.io/gh/apache/shardingsphere/pull/12112/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcm91dGUvZnV0dXJlL2VuZ2luZS9kZXRlcm1pbmVyL2FsZ29yaXRobS9Db2x1bW5TaGFkb3dBbGdvcml0aG1EZXRlcm1pbmVyLmphdmE=) | `86.95% <86.95%> (ø)` | |
| [...engine/dml/ShadowInsertStatementRoutingEngine.java](https://codecov.io/gh/apache/shardingsphere/pull/12112/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcm91dGUvZnV0dXJlL2VuZ2luZS9kbWwvU2hhZG93SW5zZXJ0U3RhdGVtZW50Um91dGluZ0VuZ2luZS5qYXZh) | `88.88% <88.88%> (ø)` | |
| [...route/future/engine/AbstractShadowRouteEngine.java](https://codecov.io/gh/apache/shardingsphere/pull/12112/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcm91dGUvZnV0dXJlL2VuZ2luZS9BYnN0cmFjdFNoYWRvd1JvdXRlRW5naW5lLmphdmE=) | `91.66% <91.66%> (ø)` | |
| ... and [11 more](https://codecov.io/gh/apache/shardingsphere/pull/12112/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/12112?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/12112?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 [36fc329...4d3cf6c](https://codecov.io/gh/apache/shardingsphere/pull/12112?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] soulasuna commented on a change in pull request #12112: Add insert statement shadow route engine
Posted by GitBox <gi...@apache.org>.
soulasuna commented on a change in pull request #12112:
URL: https://github.com/apache/shardingsphere/pull/12112#discussion_r698935688
##########
File path: shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/route/future/engine/determiner/ShadowDeterminerFactory.java
##########
@@ -0,0 +1,70 @@
+/*
+ * 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.route.future.engine.determiner;
+
+import org.apache.shardingsphere.shadow.algorithm.shadow.ShadowAlgorithmException;
+import org.apache.shardingsphere.shadow.api.shadow.column.ColumnShadowAlgorithm;
+import org.apache.shardingsphere.shadow.api.shadow.note.NoteShadowAlgorithm;
+import org.apache.shardingsphere.shadow.route.future.engine.determiner.algorithm.ColumnShadowAlgorithmDeterminer;
+import org.apache.shardingsphere.shadow.route.future.engine.determiner.algorithm.NoteShadowAlgorithmDeterminer;
+import org.apache.shardingsphere.shadow.route.future.engine.determiner.table.AnyAlgorithmApplicableShadowTableDeterminer;
+import org.apache.shardingsphere.shadow.rule.ShadowRule;
+import org.apache.shardingsphere.shadow.spi.ShadowAlgorithm;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+/**
+ * Shadow determiner factory.
+ */
+public final class ShadowDeterminerFactory {
Review comment:
This class `ShadowAlgorithmDeterminer`, `ShadowTableDeterminer` factory class.
I am currently not sure whether the two interfaces can be unified into one.
If it can be achieved by introducing an anti-corrosion layer, there should be a unified interface `ShadowDeterminer` in the future.
--
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] soulasuna commented on a change in pull request #12112: Add insert statement shadow route engine
Posted by GitBox <gi...@apache.org>.
soulasuna commented on a change in pull request #12112:
URL: https://github.com/apache/shardingsphere/pull/12112#discussion_r698932899
##########
File path: shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/route/future/engine/determiner/ShadowAlgorithmDeterminer.java
##########
@@ -0,0 +1,38 @@
+/*
+ * 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.route.future.engine.determiner;
+
+import org.apache.shardingsphere.infra.binder.statement.dml.InsertStatementContext;
+
+import java.util.Collection;
+
+/**
+ * Shadow algorithm determiner.
+ */
+public interface ShadowAlgorithmDeterminer {
+
+ /**
+ * Is shadow in shadow algorithm.
+ *
+ * @param insertStatementContext insert statement context
+ * @param relatedShadowTables related shadow tables
+ * @param tableName table name
+ * @return is pass or not
+ */
+ boolean isShadow(InsertStatementContext insertStatementContext, Collection<String> relatedShadowTables, String tableName);
Review comment:
The ShadowAlgorithmDeterminer isShadow method will be reconstructed after the development of the dml Statement.
After refactoring, ShadowAlgorithmDeterminer will not rely on StatementContext.
There will be an anti-corrosion layer in the middle for isolation to reduce coupling.
--
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