You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "RaigorJiang (via GitHub)" <gi...@apache.org> on 2023/04/22 16:24:00 UTC

[GitHub] [shardingsphere] RaigorJiang commented on a diff in pull request #25279: SHOW SHADOW RULES add algorithm information return

RaigorJiang commented on code in PR #25279:
URL: https://github.com/apache/shardingsphere/pull/25279#discussion_r1174434953


##########
features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowShadowRuleExecutor.java:
##########
@@ -84,28 +92,32 @@ private boolean isSpecified(final ShowShadowRulesStatement sqlStatement) {
         return null != sqlStatement.getRuleName() && !sqlStatement.getRuleName().isEmpty();
     }
     
-    private Map<String, String> buildDataItem(final ShadowDataSourceConfiguration dataSourceConfiguration, final Map<String, Map<String, ShadowTableConfiguration>> dataSourceTableMap) {
-        Map<String, String> result = convertToDataSourceMap(dataSourceConfiguration);
-        Map<String, ShadowTableConfiguration> dataSourceTable = dataSourceTableMap.getOrDefault(result.get(RULE_NAME), Collections.emptyMap());
-        result.put(SHADOW_TABLE, convertToString(dataSourceTable.keySet()));
+    private Collection<Map<String, String>> buildDataItems(final ShadowDataSourceConfiguration dataSourceConfig, final Map<String, Map<String, ShadowTableConfiguration>> dataSourceTableMap,
+                                                           final Map<String, AlgorithmConfiguration> algorithmConfigs) {
+        Map<String, ShadowTableConfiguration> dataSourceTable = dataSourceTableMap.getOrDefault(dataSourceConfig.getName(), Collections.emptyMap());
+        Collection<Map<String, String>> result = new LinkedList<>();
+        dataSourceTable.forEach((each, value) -> {

Review Comment:
   We should use `(key, value)` when iterating over a map.
   Please search `forEach((key, value)` for reference.



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