You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/07/01 07:46:06 UTC

[GitHub] [shardingsphere] natehuangting opened a new pull request, #18765: add audit algorithm

natehuangting opened a new pull request, #18765:
URL: https://github.com/apache/shardingsphere/pull/18765

   Fixes #18706 .
   
   Changes proposed in this pull request:
   - add audit algorithm EmptyShardingKeyDMLRejectionShardingAudioAlgorithm
   


-- 
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] strongduanmu merged pull request #18765: add audit algorithm

Posted by GitBox <gi...@apache.org>.
strongduanmu merged PR #18765:
URL: https://github.com/apache/shardingsphere/pull/18765


-- 
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] strongduanmu commented on a diff in pull request #18765: add audit algorithm

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on code in PR #18765:
URL: https://github.com/apache/shardingsphere/pull/18765#discussion_r911795552


##########
shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/algorithm/audit/EmptyShardingKeyDMLRejectionShardingAudioAlgorithm.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.sharding.algorithm.audit;
+
+import lombok.Getter;
+import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
+import org.apache.shardingsphere.infra.binder.statement.dml.InsertStatementContext;
+import org.apache.shardingsphere.infra.binder.type.CursorAvailable;
+import org.apache.shardingsphere.infra.check.SQLCheckResult;
+import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
+import org.apache.shardingsphere.infra.metadata.user.Grantee;
+import org.apache.shardingsphere.sharding.route.engine.condition.engine.ShardingConditionEngine;
+import org.apache.shardingsphere.sharding.route.engine.condition.engine.impl.InsertClauseShardingConditionEngine;
+import org.apache.shardingsphere.sharding.route.engine.condition.engine.impl.WhereClauseShardingConditionEngine;
+import org.apache.shardingsphere.sharding.rule.ShardingRule;
+import org.apache.shardingsphere.sharding.spi.ShardingAuditAlgorithm;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.DMLStatement;
+
+import java.util.List;
+import java.util.Properties;
+
+public final class EmptyShardingKeyDMLRejectionShardingAudioAlgorithm implements ShardingAuditAlgorithm {

Review Comment:
   @natehuangting Please add javadoc for EmptyShardingKeyDMLRejectionShardingAudioAlgorithm.



##########
shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/algorithm/audit/EmptyShardingKeyDMLRejectionShardingAudioAlgorithm.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.sharding.algorithm.audit;
+
+import lombok.Getter;
+import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
+import org.apache.shardingsphere.infra.binder.statement.dml.InsertStatementContext;
+import org.apache.shardingsphere.infra.binder.type.CursorAvailable;
+import org.apache.shardingsphere.infra.check.SQLCheckResult;
+import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
+import org.apache.shardingsphere.infra.metadata.user.Grantee;
+import org.apache.shardingsphere.sharding.route.engine.condition.engine.ShardingConditionEngine;
+import org.apache.shardingsphere.sharding.route.engine.condition.engine.impl.InsertClauseShardingConditionEngine;
+import org.apache.shardingsphere.sharding.route.engine.condition.engine.impl.WhereClauseShardingConditionEngine;
+import org.apache.shardingsphere.sharding.rule.ShardingRule;
+import org.apache.shardingsphere.sharding.spi.ShardingAuditAlgorithm;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.DMLStatement;
+
+import java.util.List;
+import java.util.Properties;
+
+public final class EmptyShardingKeyDMLRejectionShardingAudioAlgorithm implements ShardingAuditAlgorithm {

Review Comment:
   Besides, do you think ShardingConditionsAuditAlgorithm 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] natehuangting commented on pull request #18765: add audit algorithm

Posted by GitBox <gi...@apache.org>.
natehuangting commented on PR #18765:
URL: https://github.com/apache/shardingsphere/pull/18765#issuecomment-1172238835

   For #18430 


-- 
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 #18765: add audit algorithm

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #18765:
URL: https://github.com/apache/shardingsphere/pull/18765#issuecomment-1172088629

   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/18765?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 [#18765](https://codecov.io/gh/apache/shardingsphere/pull/18765?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (bb0d50c) into [master](https://codecov.io/gh/apache/shardingsphere/commit/d9727920df30dcad50cce32cedcde35f09dae4eb?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (d972792) will **decrease** coverage by `0.01%`.
   > The diff coverage is `0.00%`.
   
   > :exclamation: Current head bb0d50c differs from pull request most recent head 699df4f. Consider uploading reports for the commit 699df4f to get more accurate results
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #18765      +/-   ##
   ============================================
   - Coverage     59.12%   59.10%   -0.02%     
     Complexity     2261     2261              
   ============================================
     Files          3735     3736       +1     
     Lines         54241    54254      +13     
     Branches       9152     9157       +5     
   ============================================
     Hits          32068    32068              
   - Misses        19475    19488      +13     
     Partials       2698     2698              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/18765?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ShardingKeyDMLRejectionShardingAudioAlgorithm.java](https://codecov.io/gh/apache/shardingsphere/pull/18765/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvYWxnb3JpdGhtL2F1ZGl0L0VtcHR5U2hhcmRpbmdLZXlETUxSZWplY3Rpb25TaGFyZGluZ0F1ZGlvQWxnb3JpdGhtLmphdmE=) | `0.00% <0.00%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/18765?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/18765?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 [d972792...699df4f](https://codecov.io/gh/apache/shardingsphere/pull/18765?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