strongduanmu commented on issue #11392:
URL:
https://github.com/apache/shardingsphere/issues/11392#issuecomment-885494680
@hsw409328 The latest master branch adds a duplicate check to the single
table. This can ensure that you find duplicate single tables in time and avoid
routing errors.
```java
public static Map<String, SingleTableDataNode> load(final DatabaseType
databaseType, final Map<String, DataSource> dataSourceMap, final
Collection<String> excludedTables) {
Map<String, SingleTableDataNode> result = new HashMap<>();
for (Entry<String, DataSource> entry : dataSourceMap.entrySet()) {
Map<String, SingleTableDataNode> singleTableDataNodes =
load(databaseType, entry.getKey(), entry.getValue(), excludedTables);
singleTableDataNodes.keySet().forEach(each ->
Preconditions.checkState(!result.containsKey(each), "Single table conflict,
there are multiple tables `%s` existed.", each));
result.putAll(singleTableDataNodes);
}
return result;
}
```
--
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]