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/05/20 13:14:11 UTC

[GitHub] [shardingsphere] lanchengx opened a new pull request, #17838: Refactor ExportableConstant

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

   Changes proposed in this pull request:
   - Rename ExportableConstant
   - Add ExportableItemConstant
   - Remove EXPORTABLE_KEY_AUTO_AWARE_DATA_SOURCE 、EXPORTABLE_KEY_DATA_SOURCE
   
   


-- 
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 diff in pull request #17838: Refactor ExportableConstant

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


##########
shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-distsql/shardingsphere-db-discovery-distsql-handler/src/test/java/org/apache/shardingsphere/dbdiscovery/distsql/handler/fixture/ReadwriteSplittingRuleExportableFixture.java:
##########
@@ -0,0 +1,59 @@
+/*
+ * 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.dbdiscovery.distsql.handler.fixture;
+
+import org.apache.shardingsphere.infra.distsql.constant.ExportableConstants;
+import org.apache.shardingsphere.infra.distsql.constant.ExportableItemConstants;
+import org.apache.shardingsphere.infra.rule.identifier.type.ExportableRule;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.function.Supplier;
+
+public final class ReadwriteSplittingRuleExportableFixture implements ExportableRule {
+    
+    @Override
+    public String getType() {
+        return null;
+    }
+    
+    @Override
+    public Map<String, Supplier<Object>> getExportedMethods() {
+        Map<String, Supplier<Object>> result = new HashMap<>(4, 1);
+        result.put(ExportableConstants.EXPORT_DYNAMIC_READ_WRITE_SPLITTING_RULE, this::exportDynamicDataSources);

Review Comment:
   read and write does not need to be separated, refer to `ReadwriteSplittingRule`



-- 
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 #17838: Refactor ExportableConstant

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

   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/17838?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 [#17838](https://codecov.io/gh/apache/shardingsphere/pull/17838?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (31c9a4e) into [master](https://codecov.io/gh/apache/shardingsphere/commit/d30f64bc2ec12ac2398481deb1fd932997dc2ca0?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (d30f64b) will **increase** coverage by `0.15%`.
   > The diff coverage is `56.25%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #17838      +/-   ##
   ============================================
   + Coverage     59.11%   59.27%   +0.15%     
     Complexity     2134     2134              
   ============================================
     Files          3600     3601       +1     
     Lines         53457    53389      -68     
     Branches       9119     9101      -18     
   ============================================
   + Hits          31603    31647      +44     
   + Misses        19174    19065     -109     
   + Partials       2680     2677       -3     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/17838?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...litting/rule/ReadwriteSplittingDataSourceRule.java](https://codecov.io/gh/apache/shardingsphere/pull/17838/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtcmVhZHdyaXRlLXNwbGl0dGluZy9zaGFyZGluZ3NwaGVyZS1yZWFkd3JpdGUtc3BsaXR0aW5nLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3JlYWR3cml0ZXNwbGl0dGluZy9ydWxlL1JlYWR3cml0ZVNwbGl0dGluZ0RhdGFTb3VyY2VSdWxlLmphdmE=) | `94.44% <ø> (+29.05%)` | :arrow_up: |
   | [...eadwritesplitting/rule/ReadwriteSplittingRule.java](https://codecov.io/gh/apache/shardingsphere/pull/17838/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtcmVhZHdyaXRlLXNwbGl0dGluZy9zaGFyZGluZ3NwaGVyZS1yZWFkd3JpdGUtc3BsaXR0aW5nLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3JlYWR3cml0ZXNwbGl0dGluZy9ydWxlL1JlYWR3cml0ZVNwbGl0dGluZ1J1bGUuamF2YQ==) | `55.00% <0.00%> (+8.52%)` | :arrow_up: |
   | [...ardingsphere/singletable/rule/SingleTableRule.java](https://codecov.io/gh/apache/shardingsphere/pull/17838/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-c2hhcmRpbmdzcGhlcmUta2VybmVsL3NoYXJkaW5nc3BoZXJlLXNpbmdsZS10YWJsZS9zaGFyZGluZ3NwaGVyZS1zaW5nbGUtdGFibGUtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2luZ2xldGFibGUvcnVsZS9TaW5nbGVUYWJsZVJ1bGUuamF2YQ==) | `66.30% <0.00%> (ø)` | |
   | [...le/ShowReadwriteSplittingReadResourcesHandler.java](https://codecov.io/gh/apache/shardingsphere/pull/17838/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-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC90ZXh0L2Rpc3RzcWwvcmFsL2NvbW1vbi9xdWVyeWFibGUvU2hvd1JlYWR3cml0ZVNwbGl0dGluZ1JlYWRSZXNvdXJjZXNIYW5kbGVyLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [.../updatable/SetReadwriteSplittingStatusHandler.java](https://codecov.io/gh/apache/shardingsphere/pull/17838/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-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC90ZXh0L2Rpc3RzcWwvcmFsL2NvbW1vbi91cGRhdGFibGUvU2V0UmVhZHdyaXRlU3BsaXR0aW5nU3RhdHVzSGFuZGxlci5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...sphere/dbdiscovery/rule/DatabaseDiscoveryRule.java](https://codecov.io/gh/apache/shardingsphere/pull/17838/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZGItZGlzY292ZXJ5L3NoYXJkaW5nc3BoZXJlLWRiLWRpc2NvdmVyeS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9kYmRpc2NvdmVyeS9ydWxlL0RhdGFiYXNlRGlzY292ZXJ5UnVsZS5qYXZh) | `60.52% <100.00%> (ø)` | |
   | [...ler/query/DatabaseDiscoveryRuleQueryResultSet.java](https://codecov.io/gh/apache/shardingsphere/pull/17838/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZGItZGlzY292ZXJ5L3NoYXJkaW5nc3BoZXJlLWRiLWRpc2NvdmVyeS1kaXN0c3FsL3NoYXJkaW5nc3BoZXJlLWRiLWRpc2NvdmVyeS1kaXN0c3FsLWhhbmRsZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2RiZGlzY292ZXJ5L2Rpc3RzcWwvaGFuZGxlci9xdWVyeS9EYXRhYmFzZURpc2NvdmVyeVJ1bGVRdWVyeVJlc3VsdFNldC5qYXZh) | `85.18% <100.00%> (ø)` | |
   | [...ate/DropDatabaseDiscoveryRuleStatementUpdater.java](https://codecov.io/gh/apache/shardingsphere/pull/17838/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZGItZGlzY292ZXJ5L3NoYXJkaW5nc3BoZXJlLWRiLWRpc2NvdmVyeS1kaXN0c3FsL3NoYXJkaW5nc3BoZXJlLWRiLWRpc2NvdmVyeS1kaXN0c3FsLWhhbmRsZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2RiZGlzY292ZXJ5L2Rpc3RzcWwvaGFuZGxlci91cGRhdGUvRHJvcERhdGFiYXNlRGlzY292ZXJ5UnVsZVN0YXRlbWVudFVwZGF0ZXIuamF2YQ==) | `86.48% <100.00%> (+10.72%)` | :arrow_up: |
   | [...er/query/ReadwriteSplittingRuleQueryResultSet.java](https://codecov.io/gh/apache/shardingsphere/pull/17838/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtcmVhZHdyaXRlLXNwbGl0dGluZy9zaGFyZGluZ3NwaGVyZS1yZWFkd3JpdGUtc3BsaXR0aW5nLWRpc3RzcWwvc2hhcmRpbmdzcGhlcmUtcmVhZHdyaXRlLXNwbGl0dGluZy1kaXN0c3FsLWhhbmRsZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3JlYWR3cml0ZXNwbGl0dGluZy9kaXN0c3FsL2hhbmRsZXIvcXVlcnkvUmVhZHdyaXRlU3BsaXR0aW5nUnVsZVF1ZXJ5UmVzdWx0U2V0LmphdmE=) | `93.47% <100.00%> (+0.14%)` | :arrow_up: |
   | [...e/AlterReadwriteSplittingRuleStatementUpdater.java](https://codecov.io/gh/apache/shardingsphere/pull/17838/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtcmVhZHdyaXRlLXNwbGl0dGluZy9zaGFyZGluZ3NwaGVyZS1yZWFkd3JpdGUtc3BsaXR0aW5nLWRpc3RzcWwvc2hhcmRpbmdzcGhlcmUtcmVhZHdyaXRlLXNwbGl0dGluZy1kaXN0c3FsLWhhbmRsZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3JlYWR3cml0ZXNwbGl0dGluZy9kaXN0c3FsL2hhbmRsZXIvdXBkYXRlL0FsdGVyUmVhZHdyaXRlU3BsaXR0aW5nUnVsZVN0YXRlbWVudFVwZGF0ZXIuamF2YQ==) | `63.93% <100.00%> (+9.83%)` | :arrow_up: |
   | ... and [19 more](https://codecov.io/gh/apache/shardingsphere/pull/17838/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/17838?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/17838?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 [d30f64b...31c9a4e](https://codecov.io/gh/apache/shardingsphere/pull/17838?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 diff in pull request #17838: Refactor ExportableConstant

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


##########
shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/distsql/constant/ExportableConstants.java:
##########
@@ -26,19 +26,11 @@
 @NoArgsConstructor(access = AccessLevel.PRIVATE)
 public final class ExportableConstants {
     
-    public static final String EXPORTABLE_KEY_PRIMARY_DATA_SOURCE = "primary_data_source";
+    public static final String EXPORT_DB_DISCOVERY_PRIMARY_DATA_SOURCES = "primary_data_source";
     
-    public static final String EXPORTABLE_KEY_AUTO_AWARE_DATA_SOURCE = "auto_aware_data_source";
+    public static final String EXPORT_DYNAMIC_READ_WRITE_SPLITTING_RULE = "dynamic_read_write_rules";

Review Comment:
   `read_write_rules` is inaccurate, `splitting` cannot be omitted



-- 
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 #17838: Refactor ExportableConstant

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


-- 
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