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 meta data of the schema.
     *
     * @param event meta data changed event
     */
Renew meta data of the schema.
@param event meta data changed event
Renew meta data of the schema . @param event meta data changed event
@Subscribe
    public synchronized void renew(final SchemaChangedEvent event) {
        String schemaName = event.getSchemaName();
        Collection<TableMetaData> tableMetaDataList = event.getSchema().getTables().values();
        ShardingSphereMetaData kernelMetaData = new ShardingSphereMetaData(schemaName, contextManager.getMetaDataContexts().getMetaData(schemaName).getResource(), 
                contextManager.getMetaDataContexts().getMetaData(schemaName).getRuleMetaData(), SchemaBuilder.buildKernelSchema(tableMetaDataList, 
                contextManager.getMetaDataContexts().getMetaData(schemaName).getRuleMetaData().getRules()));
        Map<String, ShardingSphereMetaData> kernelMetaDataMap = new HashMap<>(contextManager.getMetaDataContexts().getMetaDataMap());
        kernelMetaDataMap.put(schemaName, kernelMetaData);
        contextManager.getMetaDataContexts().getOptimizerContext().getMetaData().getSchemas().put(schemaName,
                new FederationSchemaMetaData(schemaName, SchemaBuilder.buildFederationSchema(tableMetaDataList, 
                        contextManager.getMetaDataContexts().getMetaData(schemaName).getRuleMetaData().getRules()).getTables()));
        contextManager.renewMetaDataContexts(rebuildMetaDataContexts(kernelMetaDataMap));
    }
@ Subscribe public synchronized void renew ( final SchemaChangedEvent event ) { String schemaName = event . getSchemaName ( ) ; Collection < TableMetaData > tableMetaDataList = event . getSchema ( ) . getTables ( ) . values ( ) ; ShardingSphereMetaData kernelMetaData = new ShardingSphereMetaData ( schemaName , contextManager . getMetaDataContexts ( ) . getMetaData ( schemaName ) . getResource ( ) , contextManager . getMetaDataContexts ( ) . getMetaData ( schemaName ) . getRuleMetaData ( ) , SchemaBuilder . buildKernelSchema ( tableMetaDataList , contextManager . getMetaDataContexts ( ) . getMetaData ( schemaName ) . getRuleMetaData ( ) . getRules ( ) ) ) ; Map < String , ShardingSphereMetaData > kernelMetaDataMap = new HashMap < > ( contextManager . getMetaDataContexts ( ) . getMetaDataMap ( ) ) ; kernelMetaDataMap . put ( schemaName , kernelMetaData ) ; contextManager . getMetaDataContexts ( ) . getOptimizerContext ( ) . getMetaData ( ) . getSchemas ( ) . put ( schemaName , new FederationSchemaMetaData ( schemaName , SchemaBuilder . buildFederationSchema ( tableMetaDataList , contextManager . getMetaDataContexts ( ) . getMetaData ( schemaName ) . getRuleMetaData ( ) . getRules ( ) ) . getTables ( ) ) ) ; contextManager . renewMetaDataContexts ( rebuildMetaDataContexts ( kernelMetaDataMap ) ) ; }
Renew meta data of the schema.
Renew meta data of the schema .