Class QueryTimeoutImpl

    • Constructor Detail

      • QueryTimeoutImpl

        public QueryTimeoutImpl​(long timeAllowed)
        Sets the time at which to time out by adding the given timeAllowed to the current time.
        Parameters:
        timeAllowed - Number of milliseconds after which to time out. Use Long.MAX_VALUE to effectively never time out.
    • Method Detail

      • getTimeoutAt

        public Long getTimeoutAt()
        Returns time at which to time out, in nanoseconds relative to the (JVM-specific) epoch for System.nanoTime(), to compare with the value returned by nanoTime().
      • shouldExit

        public boolean shouldExit()
        Return true if reset() has not been called and the elapsed time has exceeded the time allowed.
        Specified by:
        shouldExit in interface QueryTimeout
      • reset

        public void reset()
        Reset the timeout value.