RaigorJiang commented on code in PR #23066:
URL: https://github.com/apache/shardingsphere/pull/23066#discussion_r1056774599
##########
proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rdl/resource/RegisterStorageUnitBackendHandler.java:
##########
@@ -66,6 +68,18 @@ public RegisterStorageUnitBackendHandler(final
RegisterStorageUnitStatement sqlS
public ResponseHeader execute(final String databaseName, final
RegisterStorageUnitStatement sqlStatement) {
checkSQLStatement(databaseName, sqlStatement);
Map<String, DataSourceProperties> dataSourcePropsMap =
ResourceSegmentsConverter.convert(databaseType, sqlStatement.getStorageUnits());
+ if (sqlStatement.isIfNotExists()) {
+ Set<String> currentStorageUnits =
ProxyContext.getInstance().getContextManager().getDataSourceMap(databaseName).keySet();
+ Iterator<String> storageUnitName =
dataSourcePropsMap.keySet().iterator();
Review Comment:
The variable name storageUnitName can be replaced with `iterator`
--
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]