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()
      • 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​(SolrQueryRequest req)
        Sets or clears the time allowed based on how much time remains from the start of the request plus the configured CommonParams.TIME_ALLOWED.
      • 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.