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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]