提交 0252c546 编写于 作者: T tristaZero

use new OrchestrationMasterSlaveDataSource(masterSlaveDataSource, orchestrationConfig)

上级 f785ef48
......@@ -19,9 +19,8 @@ package io.shardingsphere.jdbc.orchestration.api.yaml;
import io.shardingsphere.core.jdbc.core.datasource.MasterSlaveDataSource;
import io.shardingsphere.core.yaml.masterslave.YamlMasterSlaveRuleConfiguration;
import io.shardingsphere.jdbc.orchestration.config.OrchestrationConfiguration;
import io.shardingsphere.jdbc.orchestration.internal.OrchestrationFacade;
import io.shardingsphere.jdbc.orchestration.api.datasource.OrchestrationMasterSlaveDataSource;
import io.shardingsphere.jdbc.orchestration.config.OrchestrationConfiguration;
import io.shardingsphere.jdbc.orchestration.internal.yaml.YamlOrchestrationMasterSlaveRuleConfiguration;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
......@@ -102,10 +101,10 @@ public final class YamlOrchestrationMasterSlaveDataSourceFactory {
private static DataSource createDataSource(final Map<String, DataSource> dataSourceMap,
final YamlMasterSlaveRuleConfiguration yamlConfig, final OrchestrationConfiguration orchestrationConfig) throws SQLException {
if (null == yamlConfig) {
return new OrchestrationMasterSlaveDataSource(new OrchestrationFacade(orchestrationConfig));
return new OrchestrationMasterSlaveDataSource(orchestrationConfig);
} else {
MasterSlaveDataSource masterSlaveDataSource = new MasterSlaveDataSource(dataSourceMap, yamlConfig.getMasterSlaveRuleConfiguration(), yamlConfig.getConfigMap(), yamlConfig.getProps());
return new OrchestrationMasterSlaveDataSource(masterSlaveDataSource, new OrchestrationFacade(orchestrationConfig));
return new OrchestrationMasterSlaveDataSource(masterSlaveDataSource, orchestrationConfig);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册