shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterContextManagerCoordinator.java
/**
     * Renew rule configurations.
     *
     * @param event rule configurations changed event
     * @throws SQLException SQL exception
     */
Renew rule configurations.
@param event rule configurations changed event
@throws SQLException SQL exception
Renew rule configurations . @param event rule configurations changed event @throws SQLException SQL exception
@Subscribe
    public synchronized void renew(final RuleConfigurationsChangedEvent event) throws SQLException {
        String schemaName = event.getSchemaName();
        MetaDataContexts changedMetaDataContexts = buildChangedMetaDataContext(contextManager.getMetaDataContexts().getMetaDataMap().get(schemaName), event.getRuleConfigurations());
        contextManager.getMetaDataContexts().getOptimizerContext().getMetaData().getSchemas().putAll(changedMetaDataContexts.getOptimizerContext().getMetaData().getSchemas());
        Map<String, ShardingSphereMetaData> metaDataMap = new HashMap<>(contextManager.getMetaDataContexts().getMetaDataMap());
        metaDataMap.putAll(changedMetaDataContexts.getMetaDataMap());
        contextManager.renewMetaDataContexts(rebuildMetaDataContexts(metaDataMap));
    }
@ Subscribe public synchronized void renew ( final RuleConfigurationsChangedEvent event ) throws SQLException { String schemaName = event . getSchemaName ( ) ; MetaDataContexts changedMetaDataContexts = buildChangedMetaDataContext ( contextManager . getMetaDataContexts ( ) . getMetaDataMap ( ) . get ( schemaName ) , event . getRuleConfigurations ( ) ) ; contextManager . getMetaDataContexts ( ) . getOptimizerContext ( ) . getMetaData ( ) . getSchemas ( ) . putAll ( changedMetaDataContexts . getOptimizerContext ( ) . getMetaData ( ) . getSchemas ( ) ) ; Map < String , ShardingSphereMetaData > metaDataMap = new HashMap < > ( contextManager . getMetaDataContexts ( ) . getMetaDataMap ( ) ) ; metaDataMap . putAll ( changedMetaDataContexts . getMetaDataMap ( ) ) ; contextManager . renewMetaDataContexts ( rebuildMetaDataContexts ( metaDataMap ) ) ; }
Renew rule configurations.
Renew rule configurations .