You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/07/12 04:20:43 UTC
[GitHub] [shardingsphere] yx9o commented on a diff in pull request #19037: Refactor ImportDatabaseConfigurationHandler.
yx9o commented on code in PR #19037:
URL: https://github.com/apache/shardingsphere/pull/19037#discussion_r918533690
##########
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/updatable/ImportDatabaseConfigurationHandler.java:
##########
@@ -94,73 +91,84 @@ protected void update(final ContextManager contextManager) throws DistSQLExcepti
String databaseName = yamlConfig.getDatabaseName();
checkDatabaseName(databaseName, file);
checkDataSource(yamlConfig.getDataSources(), file);
- updateResources(databaseName, yamlConfig.getDataSources());
- updateRules(databaseName, yamlConfig.getRules());
+ addDatabase(databaseName);
+ addResources(databaseName, yamlConfig.getDataSources());
+ try {
+ addRules(databaseName, yamlConfig.getRules());
+ } catch (DistSQLException ex) {
+ dropDatabase(databaseName);
+ throw new RuntimeException(ex.getMessage());
Review Comment:
I made adjustments, please review, thank you.
--
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