Interface Deadline

All Known Implementing Classes:
StaticDeadline

@Incubating public interface Deadline
Common interface providing a deadline through the method checkRemainingTimeMillis().
  • Method Details

    • checkRemainingTimeMillis

      long checkRemainingTimeMillis()
      Returns:
      The remaining time to the deadline in milliseconds.
      Throws:
      SearchTimeoutException - If the deadline was reached and it's a hard deadline requiring immediate failure.
    • forceTimeout

      void forceTimeout(Exception cause)
      Parameters:
      cause - The cause of the timeout, or null.
      Throws:
      SearchTimeoutException - If the deadline is a hard deadline requiring immediate failure.
    • forceTimeoutAndCreateException

      SearchTimeoutException forceTimeoutAndCreateException(Exception cause)
      Parameters:
      cause - The cause of the timeout, or null.
      Returns:
      An exception to be thrown on timeout.