You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "Qianyi951015 (via GitHub)" <gi...@apache.org> on 2023/02/14 16:23:07 UTC
[GitHub] [shardingsphere] Qianyi951015 opened a new pull request, #24165: Make `ShowReadwriteSplittingRule`support query specified rule
Qianyi951015 opened a new pull request, #24165:
URL: https://github.com/apache/shardingsphere/pull/24165
For #24158.
Changes proposed in this pull request:
- Make `ShowReadwriteSplittingRule`support query specified rule with rule name
---
Before committing this PR, I'm sure that I have checked the following options:
- [x] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
- [x] I have self-reviewed the commit code.
- [ ] I have (or in comment I request) added corresponding labels for the pull request.
- [x] 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.
- [x] 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] RaigorJiang commented on a diff in pull request #24165: Make `ShowReadwriteSplittingRule`support query specified rule
Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on code in PR #24165:
URL: https://github.com/apache/shardingsphere/pull/24165#discussion_r1106570260
##########
features/readwrite-splitting/distsql/handler/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/query/ShowReadwriteSplittingRuleExecutor.java:
##########
@@ -64,11 +64,15 @@ private void buildExportableMap(final ReadwriteSplittingRule rule) {
exportableDataSourceMap = (Map<String, Map<String, String>>) exportedData.get(ExportableConstants.EXPORT_STATIC_READWRITE_SPLITTING_RULE);
}
- private Collection<LocalDataQueryResultRow> buildData(final ReadwriteSplittingRule rule) {
+ private Collection<LocalDataQueryResultRow> buildData(final ReadwriteSplittingRule rule, final ShowReadwriteSplittingRulesStatement sqlStatement) {
Collection<LocalDataQueryResultRow> result = new LinkedList<>();
((ReadwriteSplittingRuleConfiguration) rule.getConfiguration()).getDataSources().forEach(each -> {
LocalDataQueryResultRow dataItem = buildDataItem(each, getLoadBalancers((ReadwriteSplittingRuleConfiguration) rule.getConfiguration()));
- result.add(dataItem);
+ if (null == sqlStatement.getRuleName()) {
+ result.add(dataItem);
+ } else if (sqlStatement.getRuleName().equalsIgnoreCase(each.getName())) {
Review Comment:
I think it should be possible to combine these two if branches.
--
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 #24165: Make `ShowReadwriteSplittingRule`support query specified rule
Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang merged PR #24165:
URL: https://github.com/apache/shardingsphere/pull/24165
--
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