public class RandomDataSourceSelector extends Object implements DataSourceSelector
| Modifier and Type | Field and Description |
|---|---|
static String |
PROP_BLACKLIST_THRESHOLD |
static String |
PROP_CHECKING_INTERVAL |
static String |
PROP_RECOVERY_INTERVAL |
static String |
PROP_VALIDATION_SLEEP |
| Constructor and Description |
|---|
RandomDataSourceSelector(HighAvailableDataSource highAvailableDataSource) |
public static final String PROP_CHECKING_INTERVAL
public static final String PROP_RECOVERY_INTERVAL
public static final String PROP_VALIDATION_SLEEP
public static final String PROP_BLACKLIST_THRESHOLD
public RandomDataSourceSelector(HighAvailableDataSource highAvailableDataSource)
public void init()
init in interface DataSourceSelectorpublic String getName()
getName in interface DataSourceSelectorpublic DataSource get()
get in interface DataSourceSelectorpublic void setTarget(String name)
setTarget in interface DataSourceSelectorpublic Map<String,DataSource> getDataSourceMap()
public List<DataSource> getBlacklist()
public boolean containInBlacklist(DataSource dataSource)
public void addBlacklist(DataSource dataSource)
public void removeBlacklist(DataSource dataSource)
public HighAvailableDataSource getHighAvailableDataSource()
public RandomDataSourceValidateThread getValidateThread()
public void setValidateThread(RandomDataSourceValidateThread validateThread)
public RandomDataSourceRecoverThread getRecoverThread()
public void setRecoverThread(RandomDataSourceRecoverThread recoverThread)
public int getCheckingIntervalSeconds()
public void setCheckingIntervalSeconds(int checkingIntervalSeconds)
public int getRecoveryIntervalSeconds()
public void setRecoveryIntervalSeconds(int recoveryIntervalSeconds)
public int getValidationSleepSeconds()
public void setValidationSleepSeconds(int validationSleepSeconds)
public int getBlacklistThreshold()
public void setBlacklistThreshold(int blacklistThreshold)
Copyright © 2013–2019 Alibaba Group. All rights reserved.