Class TimeoutManager

  • public class TimeoutManager
    extends Object
    Emmanuel Bernard
    • Method Detail

      • start

        public void start()
        we start counting from this method call (if needed)
      • stop

        public void stop()
      • deadlineOrNull

        public Deadline deadlineOrNull()
        The deadline for the timeout defined by this timeout manager, null if no timeout is set.
      • hardDeadlineOrNull

        public Deadline hardDeadlineOrNull()
        The hard deadline defined by this timeout manager, i.e. the deadline beyond which an exception should be thrown. null if no hard timeout is set.
      • timeoutBaseline

        public long timeoutBaseline()
      • isTimedOut

        public boolean isTimedOut()
        true if the timeout was reached in a previous call to checkTimedOut(), false otherwise.
      • checkTimedOut

        public boolean checkTimedOut()
        true if the timeout was reached, false otherwise.
        SearchTimeoutException - If the timeout was reached and a hard timeout was requested.
      • hasHardTimeout

        public boolean hasHardTimeout()
      • tookTime

        public Duration tookTime()
        Returns the time passed from the start with high precision. This method may be performance expensive.
        high precision duration of took time.
      • elapsedTimeEstimateMillis

        protected long elapsedTimeEstimateMillis()