类 RandomDataSourceSelector

java.lang.Object
com.alibaba.druid.pool.ha.selector.RandomDataSourceSelector
所有已实现的接口:
DataSourceSelector
直接已知子类:
StickyRandomDataSourceSelector

public class RandomDataSourceSelector extends Object implements DataSourceSelector
A selector which uses java.util.Random to choose DataSource.
作者:
DigitalSonic
  • 字段详细资料

    • PROP_CHECKING_INTERVAL

      public static final String PROP_CHECKING_INTERVAL
      另请参阅:
    • PROP_RECOVERY_INTERVAL

      public static final String PROP_RECOVERY_INTERVAL
      另请参阅:
    • PROP_VALIDATION_SLEEP

      public static final String PROP_VALIDATION_SLEEP
      另请参阅:
    • PROP_BLACKLIST_THRESHOLD

      public static final String PROP_BLACKLIST_THRESHOLD
      另请参阅:
  • 构造器详细资料

  • 方法详细资料

    • init

      public void init()
      从接口复制的说明: DataSourceSelector
      Init the DataSourceSelector before use it.
      指定者:
      init 在接口中 DataSourceSelector
    • destroy

      public void destroy()
      Interrupt Threads if needed.
      指定者:
      destroy 在接口中 DataSourceSelector
    • getName

      public String getName()
      从接口复制的说明: DataSourceSelector
      Return the name of this DataSourceSelector. e.g. byName
      指定者:
      getName 在接口中 DataSourceSelector
    • get

      public DataSource get()
      从接口复制的说明: DataSourceSelector
      Return a DataSource according to the implemention.
      指定者:
      get 在接口中 DataSourceSelector
    • setTarget

      public void setTarget(String name)
      从接口复制的说明: DataSourceSelector
      Set the target DataSource name to return. Wether to use this or not, it's decided by the implemention.
      指定者:
      setTarget 在接口中 DataSourceSelector
    • getFullDataSourceMap

      public Map<String,DataSource> getFullDataSourceMap()
    • getDataSourceMap

      public Map<String,DataSource> getDataSourceMap()
    • getBlacklist

      public List<DataSource> getBlacklist()
    • containInBlacklist

      public boolean containInBlacklist(DataSource dataSource)
    • addBlacklist

      public void addBlacklist(DataSource dataSource)
    • removeBlacklist

      public void removeBlacklist(DataSource dataSource)
    • getHighAvailableDataSource

      public HighAvailableDataSource getHighAvailableDataSource()
    • getValidateThread

      public RandomDataSourceValidateThread getValidateThread()
    • setValidateThread

      public void setValidateThread(RandomDataSourceValidateThread validateThread)
    • getRecoverThread

      public RandomDataSourceRecoverThread getRecoverThread()
    • setRecoverThread

      public void setRecoverThread(RandomDataSourceRecoverThread recoverThread)
    • getCheckingIntervalSeconds

      public int getCheckingIntervalSeconds()
    • setCheckingIntervalSeconds

      public void setCheckingIntervalSeconds(int checkingIntervalSeconds)
    • getRecoveryIntervalSeconds

      public int getRecoveryIntervalSeconds()
    • setRecoveryIntervalSeconds

      public void setRecoveryIntervalSeconds(int recoveryIntervalSeconds)
    • getValidationSleepSeconds

      public int getValidationSleepSeconds()
    • setValidationSleepSeconds

      public void setValidationSleepSeconds(int validationSleepSeconds)
    • getBlacklistThreshold

      public int getBlacklistThreshold()
    • setBlacklistThreshold

      public void setBlacklistThreshold(int blacklistThreshold)