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
ConstructorsConstructorDescriptionStickyRandomDataSourceSelector(HighAvailableDataSource highAvailableDataSource) -
Method Summary
Modifier and TypeMethodDescriptionget()Return a DataSource according to the implemention.intgetName()Return the name of this DataSourceSelector.voidsetExpireSeconds(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:DataSourceSelectorReturn the name of this DataSourceSelector. e.g. byName- Specified by:
getNamein interfaceDataSourceSelector- Overrides:
getNamein classRandomDataSourceSelector
-
get
Description copied from interface:DataSourceSelectorReturn a DataSource according to the implemention.- Specified by:
getin interfaceDataSourceSelector- Overrides:
getin classRandomDataSourceSelector
-
getExpireSeconds
public int getExpireSeconds() -
setExpireSeconds
public void setExpireSeconds(int expireSeconds)
-