Interface BackOffPolicy


  • public interface BackOffPolicy
    Interface used to control how fast the mirror and register classes will retry in case of errors. The reset method is used to indicate that all is ok. When things start failing, the get method will be invoked for each new attempt in order to get the appropriate delay between retries (typically increasing for each invocation). The shouldWarn method is used to ask if a certain delay returned from get should result in a warning being logged. When things get back to normal operation, the reset method is invoked to indicate that we are no longer in a failure state.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      double get()
      Obtain the number of seconds to wait before the next attempt.
      void reset()
      Reset backoff logic.
      boolean shouldWarn​(double t)
      Check if a certain delay should result in a warning being logged.
    • Method Detail

      • reset

        void reset()
        Reset backoff logic.
      • get

        double get()
        Obtain the number of seconds to wait before the next attempt.
        Returns:
        delay in seconds
      • shouldWarn

        boolean shouldWarn​(double t)
        Check if a certain delay should result in a warning being logged.
        Parameters:
        t - current delay value
        Returns:
        true if we should log