Skip to content

Commit

Permalink
modify SpringMasterSlaveDataSource constructor.
Browse files Browse the repository at this point in the history
  • Loading branch information
tristaZero committed Jul 19, 2018
1 parent 8301899 commit ec6eb6b
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import javax.sql.DataSource;
import java.sql.SQLException;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Properties;

Expand All @@ -38,13 +39,15 @@ public class SpringMasterSlaveDataSource extends MasterSlaveDataSource {

public SpringMasterSlaveDataSource(final Map<String, DataSource> dataSourceMap, final String name,
final String masterDataSourceName, final Collection<String> slaveDataSourceNames, final MasterSlaveLoadBalanceAlgorithm strategy, final Map<String, Object> configMap, final Properties props) throws SQLException {
super(dataSourceMap, getMasterSlaveRuleConfiguration(name, masterDataSourceName, slaveDataSourceNames, strategy), configMap, props);
super(dataSourceMap, getMasterSlaveRuleConfiguration(name, masterDataSourceName, slaveDataSourceNames, strategy),
null == configMap ? new LinkedHashMap<String, Object>() : configMap, null == props ? new Properties() : props);
}

public SpringMasterSlaveDataSource(final Map<String, DataSource> dataSourceMap, final String name,
final String masterDataSourceName, final Collection<String> slaveDataSourceNames, final MasterSlaveLoadBalanceAlgorithmType strategyType, final Map<String, Object> configMap, final Properties props) throws SQLException {
super(dataSourceMap,
getMasterSlaveRuleConfiguration(name, masterDataSourceName, slaveDataSourceNames, null == strategyType ? null : strategyType.getAlgorithm()), configMap, props);
getMasterSlaveRuleConfiguration(name, masterDataSourceName, slaveDataSourceNames, null == strategyType ? null : strategyType.getAlgorithm()),
null == configMap ? new LinkedHashMap<String, Object>() : configMap, null == props ? new Properties() : props);
}

private static MasterSlaveRuleConfiguration getMasterSlaveRuleConfiguration(
Expand Down

0 comments on commit ec6eb6b

Please sign in to comment.