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/11/23 10:50:46 UTC

[GitHub] [shardingsphere] Pace2Car opened a new pull request, #22364: Improve DistSQL DROP DB_DISCOVERY RULE

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

   For #22358.
   
   Changes proposed in this pull request:
     - Remove unused discovery type and discovery heartbeat while dropping DB discovery rule
     - Add related test cases
     - Update doucument
   
   ---
   
   Before committing this PR, I'm sure that I have checked the following options:
   - [ ] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
   - [ ] I have self-reviewed the commit code.
   - [ ] I have (or in comment I request) added corresponding labels for the pull request.
   - [ ] I have passed maven check locally : `./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`.
   - [ ] I have made corresponding changes to the documentation.
   - [ ] I have added corresponding unit tests for my changes.
   


-- 
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] Pace2Car commented on a diff in pull request #22364: Improve DistSQL DROP DB_DISCOVERY RULE

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


##########
features/db-discovery/distsql/handler/src/test/java/org/apache/shardingsphere/dbdiscovery/distsql/handler/update/DropDatabaseDiscoveryRuleStatementUpdaterTest.java:
##########
@@ -106,7 +107,8 @@ public void assertUpdateCurrentRuleConfiguration() {
         DatabaseDiscoveryRuleConfiguration databaseDiscoveryRuleConfig = createCurrentRuleConfiguration();
         updater.updateCurrentRuleConfiguration(createSQLStatement(), databaseDiscoveryRuleConfig);
         assertTrue(databaseDiscoveryRuleConfig.getDataSources().isEmpty());
-        assertThat(databaseDiscoveryRuleConfig.getDiscoveryTypes().size(), is(1));
+        assertThat(databaseDiscoveryRuleConfig.getDiscoveryTypes().size(), is(0));

Review Comment:
   Thanks for your guidance



-- 
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 #22364: Improve DistSQL DROP DB_DISCOVERY RULE

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


##########
features/db-discovery/distsql/handler/src/test/java/org/apache/shardingsphere/dbdiscovery/distsql/handler/update/DropDatabaseDiscoveryRuleStatementUpdaterTest.java:
##########
@@ -106,7 +107,8 @@ public void assertUpdateCurrentRuleConfiguration() {
         DatabaseDiscoveryRuleConfiguration databaseDiscoveryRuleConfig = createCurrentRuleConfiguration();
         updater.updateCurrentRuleConfiguration(createSQLStatement(), databaseDiscoveryRuleConfig);
         assertTrue(databaseDiscoveryRuleConfig.getDataSources().isEmpty());
-        assertThat(databaseDiscoveryRuleConfig.getDiscoveryTypes().size(), is(1));
+        assertThat(databaseDiscoveryRuleConfig.getDiscoveryTypes().size(), is(0));

Review Comment:
   `assertTrue(xxxCollection.isEmpty());`  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] codecov-commenter commented on pull request #22364: Improve DistSQL DROP DB_DISCOVERY RULE

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

   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/22364?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 [#22364](https://codecov.io/gh/apache/shardingsphere/pull/22364?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (6de566a) into [master](https://codecov.io/gh/apache/shardingsphere/commit/74ec5dfa35c98d7436a353456a6d5be99320a570?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (74ec5df) will **increase** coverage by `0.00%`.
   > The diff coverage is `92.85%`.
   
   ```diff
   @@            Coverage Diff            @@
   ##             master   #22364   +/-   ##
   =========================================
     Coverage     51.03%   51.04%           
     Complexity     2507     2507           
   =========================================
     Files          4166     4166           
     Lines         57846    57872   +26     
     Branches       9818     9821    +3     
   =========================================
   + Hits          29520    29539   +19     
   - Misses        25793    25796    +3     
   - Partials       2533     2537    +4     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/22364?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ate/DropDatabaseDiscoveryRuleStatementUpdater.java](https://codecov.io/gh/apache/shardingsphere/pull/22364/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-ZmVhdHVyZXMvZGItZGlzY292ZXJ5L2Rpc3RzcWwvaGFuZGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvZGJkaXNjb3ZlcnkvZGlzdHNxbC9oYW5kbGVyL3VwZGF0ZS9Ecm9wRGF0YWJhc2VEaXNjb3ZlcnlSdWxlU3RhdGVtZW50VXBkYXRlci5qYXZh) | `87.50% <92.85%> (+1.01%)` | :arrow_up: |
   | [.../update/DropShardingTableRuleStatementUpdater.java](https://codecov.io/gh/apache/shardingsphere/pull/22364/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-ZmVhdHVyZXMvc2hhcmRpbmcvZGlzdHNxbC9oYW5kbGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFyZGluZy9kaXN0c3FsL2hhbmRsZXIvdXBkYXRlL0Ryb3BTaGFyZGluZ1RhYmxlUnVsZVN0YXRlbWVudFVwZGF0ZXIuamF2YQ==) | `77.33% <0.00%> (-4.34%)` | :arrow_down: |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?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 merged pull request #22364: Improve DistSQL DROP DB_DISCOVERY RULE

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


-- 
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 #22364: Improve DistSQL DROP DB_DISCOVERY RULE

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


##########
features/db-discovery/distsql/handler/src/test/java/org/apache/shardingsphere/dbdiscovery/distsql/handler/update/DropDatabaseDiscoveryRuleStatementUpdaterTest.java:
##########
@@ -136,8 +138,10 @@ private DropDatabaseDiscoveryRuleStatement createSQLStatementWithIfExists() {
     
     private DatabaseDiscoveryRuleConfiguration createCurrentRuleConfiguration() {
         DatabaseDiscoveryDataSourceRuleConfiguration dataSourceRuleConfig = new DatabaseDiscoveryDataSourceRuleConfiguration("ha_group", Collections.emptyList(), "ha_heartbeat", "readwrite_ds_MGR");
-        Map<String, AlgorithmConfiguration> discoveryTypes = Collections.singletonMap(
-                "readwrite_ds_MGR", new AlgorithmConfiguration("readwrite_ds_MGR", new Properties()));
+        Map<String, AlgorithmConfiguration> discoveryTypes = new LinkedHashMap<>(1, 1);
+        discoveryTypes.put("readwrite_ds_MGR", new AlgorithmConfiguration("readwrite_ds_MGR", new Properties()));
+        Map<String, DatabaseDiscoveryHeartBeatConfiguration> discoveryHeartbeats = new LinkedHashMap<>(1, 1);
+        discoveryTypes.put("unused_heartbeat", new AlgorithmConfiguration("heartbeat", new Properties()));

Review Comment:
   May be  put into `discoveryHeartbeats`?



-- 
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] Pace2Car commented on a diff in pull request #22364: Improve DistSQL DROP DB_DISCOVERY RULE

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


##########
features/db-discovery/distsql/handler/src/test/java/org/apache/shardingsphere/dbdiscovery/distsql/handler/update/DropDatabaseDiscoveryRuleStatementUpdaterTest.java:
##########
@@ -136,8 +138,10 @@ private DropDatabaseDiscoveryRuleStatement createSQLStatementWithIfExists() {
     
     private DatabaseDiscoveryRuleConfiguration createCurrentRuleConfiguration() {
         DatabaseDiscoveryDataSourceRuleConfiguration dataSourceRuleConfig = new DatabaseDiscoveryDataSourceRuleConfiguration("ha_group", Collections.emptyList(), "ha_heartbeat", "readwrite_ds_MGR");
-        Map<String, AlgorithmConfiguration> discoveryTypes = Collections.singletonMap(
-                "readwrite_ds_MGR", new AlgorithmConfiguration("readwrite_ds_MGR", new Properties()));
+        Map<String, AlgorithmConfiguration> discoveryTypes = new LinkedHashMap<>(1, 1);
+        discoveryTypes.put("readwrite_ds_MGR", new AlgorithmConfiguration("readwrite_ds_MGR", new Properties()));
+        Map<String, DatabaseDiscoveryHeartBeatConfiguration> discoveryHeartbeats = new LinkedHashMap<>(1, 1);
+        discoveryTypes.put("unused_heartbeat", new AlgorithmConfiguration("heartbeat", new Properties()));

Review Comment:
   Thank you for your correction



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