Package org.apache.solr.servlet
Class HttpSolrCall
- java.lang.Object
- 
- org.apache.solr.servlet.HttpSolrCall
 
- 
- Direct Known Subclasses:
- CoordinatorHttpSolrCall,- V2HttpCall
 
 @ThreadSafe public class HttpSolrCall extends Object This class represents a call made to Solr
- 
- 
Field SummaryFields Modifier and Type Field Description protected SolrDispatchFilter.Actionactionprotected List<String>collectionsListprotected SolrConfigconfigprotected SolrCorecoreprotected CoreContainercoresprotected StringcoreUrlprotected SolrRequestHandlerhandlerstatic StringINTERNAL_REQUEST_COUNTprotected Map<String,Integer>invalidStatesprotected StringorigCorenamestatic StringORIGINAL_USER_PRINCIPAL_HEADERprotected Stringpathprotected org.apache.solr.common.params.SolrParamsqueryParamsstatic Randomrandomprotected javax.servlet.http.HttpServletRequestreqprotected AuthorizationContext.RequestTyperequestTypeprotected javax.servlet.http.HttpServletResponseresponseprotected booleanretryprotected SolrDispatchFiltersolrDispatchFilterprotected SolrQueryRequestsolrReq
 - 
Constructor SummaryConstructors Constructor Description HttpSolrCall(SolrDispatchFilter solrDispatchFilter, CoreContainer cores, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean retry)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Object_getHandler()protected voidaddCollectionParamIfNeeded(List<String> collections)Sets the "collection" parameter on the request to the list of alias-resolved collections for this request.protected voidautoCreateSystemColl(String corename)SolrDispatchFilter.Actioncall()This method processes the request.protected voidexecuteCoreRequest(SolrQueryResponse rsp)protected voidextractHandlerFromURLPath(SolrRequestParsers parser)Extract handler from the URL path if not set.protected voidextractRemotePath(String collectionName, String origCorename)protected org.apache.solr.common.cloud.AliasesgetAliases()List<String>getCollectionsList()The collection(s) referenced in this request.List<org.apache.solr.common.util.CommandOperation>getCommands(boolean validateInput)SolrCoregetCore()protected SolrCoregetCoreByCollection(String collectionName, boolean isPreferLeader)StringgetPath()org.apache.solr.common.params.SolrParamsgetQueryParams()protected StringgetRemoteCoreUrl(String collectionName, String origCorename)javax.servlet.http.HttpServletRequestgetReq()protected QueryResponseWritergetResponseWriter()ReturnsQueryResponseWriterto be used.protected io.opentracing.SpangetSpan()Get the span for this request.protected org.apache.solr.common.util.ValidatingJsonMapgetSpec()protected Map<String,org.apache.solr.common.util.JsonSchemaValidator>getValidators()protected voidhandleAdmin(SolrQueryResponse solrResp)protected voidhandleAdminOrRemoteRequest()Handle a request whose "type" could not be discerned in advance and may be either "admin" or "remotequery".protected voidinit()protected voidlogAndFlushAdminRequest(SolrQueryResponse solrResp)protected voidpopulateTracingSpan(io.opentracing.Span span)protected List<String>resolveCollectionListOrAlias(String collectionStr)Resolves the parameter as a potential comma delimited list of collections, and resolves aliases too.protected voidsendError(int code, String message)protected voidsendError(Throwable ex)protected voidsendRemoteQuery()booleanshouldAudit()static booleanshouldAudit(CoreContainer cores)static booleanshouldAudit(CoreContainer cores, AuditEvent.EventType eventType)booleanshouldAudit(AuditEvent.EventType eventType)protected voidwriteResponse(SolrQueryResponse solrRsp, QueryResponseWriter responseWriter, Method reqMethod)
 
- 
- 
- 
Field Detail- 
ORIGINAL_USER_PRINCIPAL_HEADERpublic static final String ORIGINAL_USER_PRINCIPAL_HEADER - See Also:
- Constant Field Values
 
 - 
INTERNAL_REQUEST_COUNTpublic static final String INTERNAL_REQUEST_COUNT - See Also:
- Constant Field Values
 
 - 
randompublic static final Random random 
 - 
solrDispatchFilterprotected final SolrDispatchFilter solrDispatchFilter 
 - 
coresprotected final CoreContainer cores 
 - 
reqprotected final javax.servlet.http.HttpServletRequest req 
 - 
responseprotected final javax.servlet.http.HttpServletResponse response 
 - 
retryprotected final boolean retry 
 - 
coreprotected SolrCore core 
 - 
solrReqprotected SolrQueryRequest solrReq 
 - 
handlerprotected SolrRequestHandler handler 
 - 
queryParamsprotected org.apache.solr.common.params.SolrParams queryParams 
 - 
pathprotected String path 
 - 
actionprotected SolrDispatchFilter.Action action 
 - 
coreUrlprotected String coreUrl 
 - 
configprotected SolrConfig config 
 - 
origCorenameprotected String origCorename 
 - 
requestTypeprotected AuthorizationContext.RequestType requestType 
 
- 
 - 
Constructor Detail- 
HttpSolrCallpublic HttpSolrCall(SolrDispatchFilter solrDispatchFilter, CoreContainer cores, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean retry) 
 
- 
 - 
Method Detail- 
getPathpublic String getPath() 
 - 
getReqpublic javax.servlet.http.HttpServletRequest getReq() 
 - 
getCorepublic SolrCore getCore() 
 - 
getQueryParamspublic org.apache.solr.common.params.SolrParams getQueryParams() 
 - 
getAliasesprotected org.apache.solr.common.cloud.Aliases getAliases() 
 - 
getCollectionsListpublic List<String> getCollectionsList() The collection(s) referenced in this request. Populated ininit(). Not null.
 - 
autoCreateSystemCollprotected void autoCreateSystemColl(String corename) throws Exception - Throws:
- Exception
 
 - 
resolveCollectionListOrAliasprotected List<String> resolveCollectionListOrAlias(String collectionStr) Resolves the parameter as a potential comma delimited list of collections, and resolves aliases too. One level of aliases pointing to another alias is supported. De-duplicates and retains the order.getCollectionsList()
 - 
extractHandlerFromURLPathprotected void extractHandlerFromURLPath(SolrRequestParsers parser) throws Exception Extract handler from the URL path if not set.- Throws:
- Exception
 
 - 
extractRemotePathprotected void extractRemotePath(String collectionName, String origCorename) throws UnsupportedEncodingException, org.apache.zookeeper.KeeperException, InterruptedException, org.apache.solr.common.SolrException - Throws:
- UnsupportedEncodingException
- org.apache.zookeeper.KeeperException
- InterruptedException
- org.apache.solr.common.SolrException
 
 - 
sendRemoteQueryprotected void sendRemoteQuery() throws IOException- Throws:
- IOException
 
 - 
callpublic SolrDispatchFilter.Action call() throws IOException This method processes the request.- Throws:
- IOException
 
 - 
handleAdminOrRemoteRequestprotected void handleAdminOrRemoteRequest() throws IOExceptionHandle a request whose "type" could not be discerned in advance and may be either "admin" or "remotequery".Some implementations (such as V2HttpCall) may find it difficult to differentiate all request types in advance. This method serves as a hook; allowing those implementations to handle these cases gracefully.- Throws:
- IOException
- See Also:
- V2HttpCall
 
 - 
getSpanprotected io.opentracing.Span getSpan() Get the span for this request. Not null.
 - 
populateTracingSpanprotected void populateTracingSpan(io.opentracing.Span span) 
 - 
shouldAuditpublic boolean shouldAudit() 
 - 
shouldAuditpublic boolean shouldAudit(AuditEvent.EventType eventType) 
 - 
shouldAuditpublic static boolean shouldAudit(CoreContainer cores) 
 - 
shouldAuditpublic static boolean shouldAudit(CoreContainer cores, AuditEvent.EventType eventType) 
 - 
sendErrorprotected void sendError(Throwable ex) throws IOException - Throws:
- IOException
 
 - 
sendErrorprotected void sendError(int code, String message) throws IOException- Throws:
- IOException
 
 - 
executeCoreRequestprotected void executeCoreRequest(SolrQueryResponse rsp) 
 - 
logAndFlushAdminRequestprotected void logAndFlushAdminRequest(SolrQueryResponse solrResp) throws IOException - Throws:
- IOException
 
 - 
getResponseWriterprotected QueryResponseWriter getResponseWriter() ReturnsQueryResponseWriterto be used. WhenCommonParams.WTnot specified in the request or specified value doesn't have correspondingQueryResponseWriterthen, returns the default query response writer Note: This method must not return null
 - 
handleAdminprotected void handleAdmin(SolrQueryResponse solrResp) 
 - 
addCollectionParamIfNeededprotected void addCollectionParamIfNeeded(List<String> collections) Sets the "collection" parameter on the request to the list of alias-resolved collections for this request. It can be avoided sometimes. Note:HttpShardHandlerprocesses this param.- See Also:
- getCollectionsList()
 
 - 
writeResponseprotected void writeResponse(SolrQueryResponse solrRsp, QueryResponseWriter responseWriter, Method reqMethod) throws IOException - Throws:
- IOException
 
 - 
getCoreByCollectionprotected SolrCore getCoreByCollection(String collectionName, boolean isPreferLeader) 
 - 
getRemoteCoreUrlprotected String getRemoteCoreUrl(String collectionName, String origCorename) throws org.apache.solr.common.SolrException - Throws:
- org.apache.solr.common.SolrException
 
 - 
_getHandlerprotected Object _getHandler() 
 - 
getCommandspublic List<org.apache.solr.common.util.CommandOperation> getCommands(boolean validateInput) 
 - 
getSpecprotected org.apache.solr.common.util.ValidatingJsonMap getSpec() 
 
- 
 
-