Class SolrRequestInfo

java.lang.Object
org.apache.solr.request.SolrRequestInfo

public class SolrRequestInfo extends Object
Information about the Solr request/response held in a ThreadLocal.
  • Constructor Details

  • Method Details

    • getRequestInfo

      public static SolrRequestInfo getRequestInfo()
    • getReqInfo

      public static Optional<SolrRequestInfo> getReqInfo()
    • getRequest

      public static Optional<SolrQueryRequest> getRequest()
    • setRequestInfo

      public static void setRequestInfo(SolrRequestInfo info)
      Adds the SolrRequestInfo onto a stack held in a ThreadLocal. Remember to call clearRequestInfo()!
    • clearRequestInfo

      public static void clearRequestInfo()
      Removes the most recent SolrRequestInfo from the stack. Close hooks are called.
    • reset

      public static void reset()
      This reset method is more of a protection mechanism as we expect it to be empty by now because all "set" calls need to be balanced with a "clear".
    • getUserPrincipal

      public Principal getUserPrincipal()
    • getNOW

      public Date getNOW()
    • getClientTimeZone

      public TimeZone getClientTimeZone()
      The TimeZone specified by the request, or UTC if none was specified.
    • getReq

      public SolrQueryRequest getReq()
    • getRsp

      public SolrQueryResponse getRsp()
    • getResponseBuilder

      public ResponseBuilder getResponseBuilder()
      May return null if the request handler is not based on SearchHandler
    • setResponseBuilder

      public void setResponseBuilder(ResponseBuilder rb)
    • addCloseHook

      public void addCloseHook(AutoCloseable hook)
    • getLimits

      public QueryLimits getLimits()
      Get the query limits for the current request. This will trigger the creation of the (possibly empty) QueryLimits object if it has not been created, and will then return the same object on every subsequent invocation.
      Returns:
      The QueryLimits object for the current request.
    • getQueryLimits

      public static QueryLimits getQueryLimits(SolrQueryRequest request, SolrQueryResponse response)
    • getAction

      public SolrDispatchFilter.Action getAction()
    • setAction

      public void setAction(SolrDispatchFilter.Action action)
    • useServerToken

      public boolean useServerToken()
      Used when making remote requests to other Solr nodes from the thread associated with this request, true means the server token header should be used instead of the Principal associated with the request.
    • setUseServerToken

      public void setUseServerToken(boolean use)
    • getInheritableThreadLocalProvider

      public static org.apache.solr.common.util.ExecutorUtil.InheritableThreadLocalProvider getInheritableThreadLocalProvider()