Class StickyRandomDataSourceSelector
java.lang.Object
com.alibaba.druid.pool.ha.selector.RandomDataSourceSelector
com.alibaba.druid.pool.ha.selector.StickyRandomDataSourceSelector
- All Implemented Interfaces:
DataSourceSelector
An extend selector based on RandomDataSourceSelector which can stick a DataSource to a Thread in a while.
- Author:
- DigitalSonic
- See Also:
-
Field Summary
Fields inherited from class com.alibaba.druid.pool.ha.selector.RandomDataSourceSelector
PROP_BLACKLIST_THRESHOLD, PROP_CHECKING_INTERVAL, PROP_RECOVERY_INTERVAL, PROP_VALIDATION_SLEEP
-
Constructor Summary
ConstructorDescriptionStickyRandomDataSourceSelector
(HighAvailableDataSource highAvailableDataSource) -
Method Summary
Modifier and TypeMethodDescriptionget()
Return a DataSource according to the implemention.int
getName()
Return the name of this DataSourceSelector.void
setExpireSeconds
(int expireSeconds) Methods inherited from class com.alibaba.druid.pool.ha.selector.RandomDataSourceSelector
addBlacklist, containInBlacklist, destroy, getBlacklist, getBlacklistThreshold, getCheckingIntervalSeconds, getDataSourceMap, getFullDataSourceMap, getHighAvailableDataSource, getRecoverThread, getRecoveryIntervalSeconds, getValidateThread, getValidationSleepSeconds, init, removeBlacklist, setBlacklistThreshold, setCheckingIntervalSeconds, setRecoverThread, setRecoveryIntervalSeconds, setTarget, setValidateThread, setValidationSleepSeconds
-
Constructor Details
-
StickyRandomDataSourceSelector
-
-
Method Details
-
getName
Description copied from interface:DataSourceSelector
Return the name of this DataSourceSelector. e.g. byName- Specified by:
getName
in interfaceDataSourceSelector
- Overrides:
getName
in classRandomDataSourceSelector
-
get
Description copied from interface:DataSourceSelector
Return a DataSource according to the implemention.- Specified by:
get
in interfaceDataSourceSelector
- Overrides:
get
in classRandomDataSourceSelector
-
getExpireSeconds
public int getExpireSeconds() -
setExpireSeconds
public void setExpireSeconds(int expireSeconds)
-