use of io.shardingjdbc.orchestration.yaml.YamlOrchestrationShardingRuleConfiguration in project sharding-jdbc by shardingjdbc.
the class OrchestrationShardingDataSourceFactory method createDataSource.
/**
* Create sharding data source.
*
* @param dataSourceMap data source map
* @param yamlFile yaml file for rule configuration of databases and tables sharding without data sources
* @return sharding data source
* @throws SQLException SQL exception
* @throws IOException IO exception
*/
public static DataSource createDataSource(final Map<String, DataSource> dataSourceMap, final File yamlFile) throws SQLException, IOException {
YamlOrchestrationShardingRuleConfiguration config = unmarshal(yamlFile);
YamlShardingRuleConfiguration shardingRuleConfig = config.getShardingRule();
return createDataSource(dataSourceMap, shardingRuleConfig, config.getOrchestration().getOrchestrationConfiguration());
}
use of io.shardingjdbc.orchestration.yaml.YamlOrchestrationShardingRuleConfiguration in project sharding-jdbc by shardingjdbc.
the class OrchestrationShardingDataSourceFactory method createDataSource.
/**
* Create sharding data source.
*
* @param yamlByteArray yaml byte array for rule configuration of databases and tables sharding with data sources
* @return sharding data source
* @throws SQLException SQL exception
*/
public static DataSource createDataSource(final byte[] yamlByteArray) throws SQLException {
YamlOrchestrationShardingRuleConfiguration config = unmarshal(yamlByteArray);
YamlShardingRuleConfiguration shardingRuleConfig = config.getShardingRule();
return createDataSource(config.getDataSources(), shardingRuleConfig, config.getOrchestration().getOrchestrationConfiguration());
}
use of io.shardingjdbc.orchestration.yaml.YamlOrchestrationShardingRuleConfiguration in project sharding-jdbc by shardingjdbc.
the class OrchestrationShardingDataSourceFactory method createDataSource.
/**
* Create sharding data source.
*
* @param dataSourceMap data source map
* @param yamlByteArray yaml byte array for rule configuration of databases and tables sharding without data sources
* @return sharding data source
* @throws SQLException SQL exception
*/
public static DataSource createDataSource(final Map<String, DataSource> dataSourceMap, final byte[] yamlByteArray) throws SQLException {
YamlOrchestrationShardingRuleConfiguration config = unmarshal(yamlByteArray);
YamlShardingRuleConfiguration shardingRuleConfig = config.getShardingRule();
return createDataSource(dataSourceMap, shardingRuleConfig, config.getOrchestration().getOrchestrationConfiguration());
}
use of io.shardingjdbc.orchestration.yaml.YamlOrchestrationShardingRuleConfiguration in project sharding-jdbc by shardingjdbc.
the class OrchestrationShardingDataSourceFactory method createDataSource.
/**
* Create sharding data source.
*
* @param yamlFile yaml file for rule configuration of databases and tables sharding with data sources
* @return sharding data source
* @throws SQLException SQL exception
* @throws IOException IO exception
*/
public static DataSource createDataSource(final File yamlFile) throws SQLException, IOException {
YamlOrchestrationShardingRuleConfiguration config = unmarshal(yamlFile);
YamlShardingRuleConfiguration shardingRuleConfig = config.getShardingRule();
return createDataSource(config.getDataSources(), shardingRuleConfig, config.getOrchestration().getOrchestrationConfiguration());
}
Aggregations