shardingsphere-infra/shardingsphere-infra-optimize/src/main/java/org/apache/shardingsphere/infra/optimize/context/planner/OptimizerPlannerContextFactory.java
/**
     * Create optimizer planner context map.
     *
     * @param metaData federation meta data
     * @return created optimizer planner context map
     */
Create optimizer planner context map.
@param metaData federation meta data
@return created optimizer planner context map
Create optimizer planner context map . @param metaData federation meta data @return created optimizer planner context map
public static Map<String, OptimizerPlannerContext> create(final FederationMetaData metaData) {
        Map<String, OptimizerPlannerContext> result = new HashMap<>(metaData.getSchemas().size(), 1);
        for (Entry<String, FederationSchemaMetaData> entry : metaData.getSchemas().entrySet()) {
            String schemaName = entry.getKey();
            FederationSchema federationSchema = new FederationSchema(entry.getValue());
            CalciteConnectionConfig connectionConfig = new CalciteConnectionConfigImpl(createConnectionProperties());
            RelDataTypeFactory relDataTypeFactory = new JavaTypeFactoryImpl();
            CalciteCatalogReader catalogReader = createCatalogReader(schemaName, federationSchema, relDataTypeFactory, connectionConfig);
            SqlValidator validator = createValidator(catalogReader, relDataTypeFactory, connectionConfig);
            result.put(schemaName, new OptimizerPlannerContext(validator, createConverter(catalogReader, validator, relDataTypeFactory)));
        }
        return result;
    }
public static Map < String , OptimizerPlannerContext > create ( final FederationMetaData metaData ) { Map < String , OptimizerPlannerContext > result = new HashMap < > ( metaData . getSchemas ( ) . size ( ) , 1 ) ; for ( Entry < String , FederationSchemaMetaData > entry : metaData . getSchemas ( ) . entrySet ( ) ) { String schemaName = entry . getKey ( ) ; FederationSchema federationSchema = new FederationSchema ( entry . getValue ( ) ) ; CalciteConnectionConfig connectionConfig = new CalciteConnectionConfigImpl ( createConnectionProperties ( ) ) ; RelDataTypeFactory relDataTypeFactory = new JavaTypeFactoryImpl ( ) ; CalciteCatalogReader catalogReader = createCatalogReader ( schemaName , federationSchema , relDataTypeFactory , connectionConfig ) ; SqlValidator validator = createValidator ( catalogReader , relDataTypeFactory , connectionConfig ) ; result . put ( schemaName , new OptimizerPlannerContext ( validator , createConverter ( catalogReader , validator , relDataTypeFactory ) ) ) ; } return result ; }
Create optimizer planner context map.
Create optimizer planner context map .