Class SolrQueryTimeoutImpl

  • All Implemented Interfaces:

    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.
    • Field Detail

      • timeoutAt

        public static ThreadLocal<Long> timeoutAt
        The ThreadLocal variable to store the time beyond which, the processing should exit.
    • Method Detail

      • get

        public static Long get()
        Get the current value of timeoutAt.
      • 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)
        Method to set the time at which the timeOut should happen.
        timeAllowed - set the time at which this thread should timeout.
      • reset

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