mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
ha
This commit is contained in:
@@ -50,7 +50,7 @@ public class HADataSource extends MultiDataSource implements HADataSourceMBean,
|
||||
}
|
||||
|
||||
public void setMaster(DataSourceHolder master) {
|
||||
this.getDataSources().put("master", master);
|
||||
this.addDataSource("master", master);
|
||||
this.master = master;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class HADataSource extends MultiDataSource implements HADataSourceMBean,
|
||||
}
|
||||
|
||||
public void setSlave(DataSourceHolder slave) {
|
||||
this.getDataSources().put("slave", slave);
|
||||
this.addDataSource("slave", slave);
|
||||
this.slave = slave;
|
||||
}
|
||||
|
||||
|
||||
@@ -258,7 +258,7 @@ public abstract class MultiDataSource extends DataSourceAdapter implements Multi
|
||||
public void addDataSource(String name, DataSourceHolder dataSourceHolder) {
|
||||
dataSources.put(name, dataSourceHolder);
|
||||
|
||||
this.totalWeight += dataSourceHolder.getWeight();
|
||||
this.computeTotalWeight();
|
||||
}
|
||||
|
||||
public Properties getProperties() {
|
||||
|
||||
Reference in New Issue
Block a user