Class RandomDataSourceValidateThread

  • All Implemented Interfaces:
    Runnable

    public class RandomDataSourceValidateThread
    extends Object
    implements Runnable
    A Thread trying to test all DataSource provided by HADataSource. If a DataSource failed this test for 3 times (default value), it will be put into a blacklist.
    Author:
    DigitalSonic
    • Field Detail

      • DEFAULT_CHECKING_INTERVAL_SECONDS

        public static final int DEFAULT_CHECKING_INTERVAL_SECONDS
        See Also:
        Constant Field Values
      • DEFAULT_BLACKLIST_THRESHOLD

        public static final int DEFAULT_BLACKLIST_THRESHOLD
        See Also:
        Constant Field Values
    • Method Detail

      • logSuccessTime

        public static void logSuccessTime​(DataSourceProxy dataSource)
        Provide a static method to record the last success time of a DataSource
      • run

        public void run()
        Specified by:
        run in interface Runnable
      • getCheckingIntervalSeconds

        public int getCheckingIntervalSeconds()
      • setCheckingIntervalSeconds

        public void setCheckingIntervalSeconds​(int checkingIntervalSeconds)
      • getValidationSleepSeconds

        public int getValidationSleepSeconds()
      • setValidationSleepSeconds

        public void setValidationSleepSeconds​(int validationSleepSeconds)
      • getBlacklistThreshold

        public int getBlacklistThreshold()
      • setBlacklistThreshold

        public void setBlacklistThreshold​(int blacklistThreshold)