Package org.apache.solr.request
Class SolrRequestInfo
java.lang.Object
org.apache.solr.request.SolrRequestInfo
Information about the Solr request/response held in a
ThreadLocal.-
Constructor Summary
ConstructorsConstructorDescriptionSolrRequestInfo(jakarta.servlet.http.HttpServletRequest httpReq, SolrQueryResponse rsp) SolrRequestInfo(jakarta.servlet.http.HttpServletRequest httpReq, SolrQueryResponse rsp, SolrDispatchFilter.Action action) SolrRequestInfo(SolrQueryRequest req, SolrQueryResponse rsp) SolrRequestInfo(SolrQueryRequest req, SolrQueryResponse rsp, SolrDispatchFilter.Action action) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCloseHook(AutoCloseable hook) static voidRemoves the most recent SolrRequestInfo from the stack.The TimeZone specified by the request, or UTC if none was specified.static org.apache.solr.common.util.ExecutorUtil.InheritableThreadLocalProviderGet the query limits for the current request.getNOW()static QueryLimitsgetQueryLimits(SolrQueryRequest request, SolrQueryResponse response) getReq()static Optional<SolrRequestInfo> static Optional<SolrQueryRequest> static SolrRequestInfoMay return null if the request handler is not based on SearchHandlergetRsp()static voidreset()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".voidsetAction(SolrDispatchFilter.Action action) static voidAdds the SolrRequestInfo onto a stack held in aThreadLocal.voidvoidsetUseServerToken(boolean use) booleanUsed 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.
-
Constructor Details
-
SolrRequestInfo
-
SolrRequestInfo
public SolrRequestInfo(SolrQueryRequest req, SolrQueryResponse rsp, SolrDispatchFilter.Action action) -
SolrRequestInfo
-
SolrRequestInfo
public SolrRequestInfo(jakarta.servlet.http.HttpServletRequest httpReq, SolrQueryResponse rsp, SolrDispatchFilter.Action action)
-
-
Method Details
-
getRequestInfo
-
getReqInfo
-
getRequest
-
setRequestInfo
Adds the SolrRequestInfo onto a stack held in aThreadLocal. Remember to callclearRequestInfo()! -
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
-
getNOW
-
getClientTimeZone
The TimeZone specified by the request, or UTC if none was specified. -
getReq
-
getRsp
-
getResponseBuilder
May return null if the request handler is not based on SearchHandler -
setResponseBuilder
-
addCloseHook
-
getLimits
Get the query limits for the current request. This will trigger the creation of the (possibly empty)QueryLimitsobject if it has not been created, and will then return the same object on every subsequent invocation.- Returns:
- The
QueryLimitsobject for the current request.
-
getQueryLimits
-
getAction
-
setAction
-
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()
-