code: public static DataSource createDataSource(final Map<String, DataSource> dataSourceMap, final MasterSlaveRuleConfiguration masterSlaveRuleConfig, 
                                                final Properties props, final OrchestrationConfiguration orchestrationConfig) throws SQLException {
          if (null == masterSlaveRuleConfig || null == masterSlaveRuleConfig.getMasterDataSourceName()) {
              return createDataSource(orchestrationConfig);
          }
          MasterSlaveDataSource masterSlaveDataSource = new MasterSlaveDataSource(dataSourceMap, masterSlaveRuleConfig, props);
          return new OrchestrationMasterSlaveDataSource(masterSlaveDataSource, orchestrationConfig);
      }
docs: Create master-slave data source.
  
  @param dataSourceMap data source map
  @param masterSlaveRuleConfig master-slave rule configuration
  @param props properties
  @param orchestrationConfig orchestration configuration
  @return master-slave data source
  @throws SQLException SQL exception