Skip to content

Commit

Permalink
Refactor DatabaseRuleConfigurationManager (apache#32921)
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu authored Sep 18, 2024
1 parent b829842 commit 1320226
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

package org.apache.shardingsphere.mode.metadata.manager;

import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.infra.config.rule.RuleConfiguration;
import org.apache.shardingsphere.infra.config.rule.scope.DatabaseRuleConfiguration;
import org.apache.shardingsphere.infra.instance.ComputeNodeInstanceContext;
Expand All @@ -42,7 +41,6 @@
/**
* Database rule configuration manager.
*/
@Slf4j
public final class DatabaseRuleConfigurationManager {

private final AtomicReference<MetaDataContexts> metaDataContexts;
Expand Down Expand Up @@ -75,8 +73,8 @@ public synchronized void alterRuleConfiguration(final String databaseName, final
return;
}
rules.removeIf(each -> each.getConfiguration().getClass().isAssignableFrom(ruleConfig.getClass()));
rules.addAll(DatabaseRulesBuilder.build(databaseName, database.getProtocolType(), database.getRuleMetaData().getRules(),
ruleConfig, computeNodeInstanceContext, database.getResourceMetaData()));
rules.addAll(DatabaseRulesBuilder.build(
databaseName, database.getProtocolType(), database.getRuleMetaData().getRules(), ruleConfig, computeNodeInstanceContext, database.getResourceMetaData()));
refreshMetadata(databaseName, database, rules);
}

Expand Down

0 comments on commit 1320226

Please sign in to comment.