com.alibaba.druid.pool.ha
Class HADataSource
java.lang.Object
com.alibaba.druid.pool.WrapperAdapter
com.alibaba.druid.pool.DataSourceAdapter
com.alibaba.druid.pool.ha.MultiDataSource
com.alibaba.druid.pool.ha.HADataSource
- All Implemented Interfaces:
- HADataSourceMBean, MultiDataSourceMBean, ManagedDataSource, DataSourceProxy, Wrapper, CommonDataSource, DataSource
public class HADataSource
- extends MultiDataSource
- implements HADataSourceMBean, ManagedDataSource, DataSource
| Methods inherited from class com.alibaba.druid.pool.ha.MultiDataSource |
addDataSource, afterDataSourceChanged, createConnectionId, createResultSetId, createStatementId, createTransactionId, failureDetect, getActiveCount, getBusySkipCount, getConfigLoadCount, getConfigLoader, getConfigLoadPeriodMillis, getConnection, getConnectProperties, getDataSourceHolder, getDataSourceNames, getDataSources, getDataSourceStat, getDbType, getEnabledDataSourceCount, getFailureDetectCount, getFailureDetector, getFailureDetectPeriodMillis, getLock, getMaxPoolSize, getMaxWait, getMaxWaitMillis, getName, getNameInternal, getNotFail, getObjectName, getProperties, getProxyFilters, getRawDriver, getRawJdbcUrl, getRealConnection, getRetryGetConnectionCount, getUrl, handleNotAwailableDatasource, incrementBusySkipCount, incrementRetryGetConnectionCount, init, isEnable, isIntited, notFailSignal, restartDataSource, setConfigLoader, setConfigLoadPeriodMillis, setEnable, setFailureDetector, setFailureDetectPeriodMillis, setMaxPoolSize, setMaxWait, setMaxWaitMillis, setName, setObjectName, startConfigLoadScheduleTask, startFailureDetectScheduleTask, stopConfigLoadScheduleTask, stopFailureDetectScheduleTask |
| Methods inherited from interface com.alibaba.druid.pool.ha.MultiDataSourceMBean |
failureDetect, getActiveCount, getBusySkipCount, getConfigLoadCount, getConfigLoadPeriodMillis, getDataSourceNames, getFailureDetectCount, getFailureDetectPeriodMillis, getMaxPoolSize, getRetryGetConnectionCount, restartDataSource, startConfigLoadScheduleTask, startFailureDetectScheduleTask, stopConfigLoadScheduleTask, stopFailureDetectScheduleTask |
HADataSource
public HADataSource()
resetStat
public void resetStat()
- Specified by:
resetStat in interface HADataSourceMBean- Overrides:
resetStat in class MultiDataSource
isMasterWritable
public boolean isMasterWritable()
isSlaveWritable
public boolean isSlaveWritable()
getMasterConnectCount
public long getMasterConnectCount()
- Specified by:
getMasterConnectCount in interface HADataSourceMBean
getSlaveConnectCount
public long getSlaveConnectCount()
- Specified by:
getSlaveConnectCount in interface HADataSourceMBean
getMaster
public DataSourceHolder getMaster()
restartMaster
public void restartMaster()
- Specified by:
restartMaster in interface HADataSourceMBean
restartSlave
public void restartSlave()
- Specified by:
restartSlave in interface HADataSourceMBean
setMaster
public DataSourceHolder setMaster(DruidDataSource master)
setMaster
public void setMaster(DataSourceHolder master)
getSlave
public DataSourceHolder getSlave()
setSlave
public DataSourceHolder setSlave(DruidDataSource slave)
setSlave
public void setSlave(DataSourceHolder slave)
isMasterEnable
public boolean isMasterEnable()
- Specified by:
isMasterEnable in interface HADataSourceMBean
isMasterFail
public boolean isMasterFail()
- Specified by:
isMasterFail in interface HADataSourceMBean
isSlaveFail
public boolean isSlaveFail()
- Specified by:
isSlaveFail in interface HADataSourceMBean
setMasterEnable
public void setMasterEnable(boolean value)
- Specified by:
setMasterEnable in interface HADataSourceMBean
getMasterUrl
public String getMasterUrl()
- Specified by:
getMasterUrl in interface HADataSourceMBean
getSlaveUrl
public String getSlaveUrl()
- Specified by:
getSlaveUrl in interface HADataSourceMBean
getMasterWeight
public int getMasterWeight()
- Specified by:
getMasterWeight in interface HADataSourceMBean
getSlaveWeight
public int getSlaveWeight()
- Specified by:
getSlaveWeight in interface HADataSourceMBean
getMasterWeightRegionBegin
public int getMasterWeightRegionBegin()
- Specified by:
getMasterWeightRegionBegin in interface HADataSourceMBean
getMasterWeightRegionEnd
public int getMasterWeightRegionEnd()
- Specified by:
getMasterWeightRegionEnd in interface HADataSourceMBean
getSlaveWeightRegionBegin
public int getSlaveWeightRegionBegin()
- Specified by:
getSlaveWeightRegionBegin in interface HADataSourceMBean
getSlaveWeightRegionEnd
public int getSlaveWeightRegionEnd()
- Specified by:
getSlaveWeightRegionEnd in interface HADataSourceMBean
isSlaveEnable
public boolean isSlaveEnable()
- Specified by:
isSlaveEnable in interface HADataSourceMBean
setSlaveEnable
public void setSlaveEnable(boolean value)
- Specified by:
setSlaveEnable in interface HADataSourceMBean
switchMasterSlave
public void switchMasterSlave()
- Specified by:
switchMasterSlave in interface HADataSourceMBean
close
public void close()
- Overrides:
close in class MultiDataSource
Copyright © 2012 Alibaba Group. All Rights Reserved.