Class SolrQueryTimeoutImpl

  • All Implemented Interfaces:
    org.apache.lucene.index.QueryTimeout

    public class SolrQueryTimeoutImpl
    extends Object
    implements org.apache.lucene.index.QueryTimeout
    Implementation of QueryTimeout that is used by Solr. It uses a ThreadLocal variable to track the timeoutAt value for each request thread.
    • Method Detail

      • getTimeoutAtNs

        public static Long getTimeoutAtNs()
        The time (nanoseconds) at which the request should be considered timed out.
      • isTimeoutEnabled

        public boolean isTimeoutEnabled()
        Specified by:
        isTimeoutEnabled in interface org.apache.lucene.index.QueryTimeout
      • shouldExit

        public boolean shouldExit()
        Return true if a timeoutAt value is set and the current time has exceeded the set timeOut.
        Specified by:
        shouldExit in interface org.apache.lucene.index.QueryTimeout
      • set

        public static void set​(long timeAllowed)
        Sets the time allowed (milliseconds), assuming we start a timer immediately. You should probably invoke set(SolrQueryRequest) instead.
      • reset

        public static void reset()
        Cleanup the ThreadLocal timeout value.