shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/cache/subscriber/ScalingRegistrySubscriber.java
/**
     * Scaling task finished.
     *
     * @param event scaling task finished event
     */
Scaling task finished.
@param event scaling task finished event
Scaling task finished . @param event scaling task finished event
@Subscribe
    public void scalingTaskFinished(final ScalingTaskFinishedEvent event) {
        YamlRootConfiguration yamlRootConfiguration = YamlEngine.unmarshal(event.getTargetParameter(), YamlRootConfiguration.class);
        Map<String, DataSourceConfiguration> dataSourceConfigs = yamlRootConfiguration.getDataSources().entrySet().stream().collect(Collectors.toMap(
                Entry::getKey, entry -> new YamlDataSourceConfigurationSwapper().swapToDataSourceConfiguration(entry.getValue()), (oldValue, currentValue) -> oldValue, LinkedHashMap::new));
        Collection<RuleConfiguration> ruleConfigs = new YamlRuleConfigurationSwapperEngine().swapToRuleConfigurations(yamlRootConfiguration.getRules());
        ClusterSwitchConfigurationEvent switchEvent = new ClusterSwitchConfigurationEvent(event.getTargetSchemaName(), dataSourceConfigs, ruleConfigs);
        ShardingSphereEventBus.getInstance().post(switchEvent);
    }
@ Subscribe public void scalingTaskFinished ( final ScalingTaskFinishedEvent event ) { YamlRootConfiguration yamlRootConfiguration = YamlEngine . unmarshal ( event . getTargetParameter ( ) , YamlRootConfiguration . class ) ; Map < String , DataSourceConfiguration > dataSourceConfigs = yamlRootConfiguration . getDataSources ( ) . entrySet ( ) . stream ( ) . collect ( Collectors . toMap ( Entry :: getKey , entry -> new YamlDataSourceConfigurationSwapper ( ) . swapToDataSourceConfiguration ( entry . getValue ( ) ) , ( oldValue , currentValue ) -> oldValue , LinkedHashMap :: new ) ) ; Collection < RuleConfiguration > ruleConfigs = new YamlRuleConfigurationSwapperEngine ( ) . swapToRuleConfigurations ( yamlRootConfiguration . getRules ( ) ) ; ClusterSwitchConfigurationEvent switchEvent = new ClusterSwitchConfigurationEvent ( event . getTargetSchemaName ( ) , dataSourceConfigs , ruleConfigs ) ; ShardingSphereEventBus . getInstance ( ) . post ( switchEvent ) ; }
Scaling task finished.
Scaling task finished .