Package org.apache.solr.servlet
Class HttpSolrCall
- java.lang.Object
- 
- org.apache.solr.servlet.HttpSolrCall
 
- 
- Direct Known Subclasses:
- V2HttpCall
 
 @SolrThreadSafe 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 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 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 voidexecute(SolrQueryResponse rsp)protected voidextractHandlerFromURLPath(SolrRequestParsers parser)Extract handler from the URL path if not set.protected voidextractRemotePath(String collectionName, String origCorename)protected AliasesgetAliases()List<String>getCollectionsList()The collection(s) referenced in this request.List<CommandOperation>getCommands(boolean validateInput)SolrCoregetCore()protected SolrCoregetCoreByCollection(String collectionName, boolean isPreferLeader)StringgetPath()SolrParamsgetQueryParams()protected StringgetRemoteCoreUrl(String collectionName, String origCorename)javax.servlet.http.HttpServletRequestgetReq()AuthorizationContext.RequestTypegetRequestType()protected QueryResponseWritergetResponseWriter()ReturnsQueryResponseWriterto be used.protected io.opentracing.SpangetSpan()Get the span for this request.protected ValidatingJsonMapgetSpec()protected Map<String,JsonSchemaValidator>getValidators()protected voidhandleAdmin(SolrQueryResponse solrResp)protected voidinit()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)
 
- 
- 
- 
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 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- 
getRequestTypepublic AuthorizationContext.RequestType getRequestType() 
 - 
getPathpublic String getPath() 
 - 
getReqpublic javax.servlet.http.HttpServletRequest getReq() 
 - 
getCorepublic SolrCore getCore() 
 - 
getQueryParamspublic SolrParams getQueryParams() 
 - 
getAliasesprotected 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, SolrException - Throws:
- UnsupportedEncodingException
- org.apache.zookeeper.KeeperException
- InterruptedException
- SolrException
 
 - 
callpublic SolrDispatchFilter.Action call() throws IOException This method processes the request.- Throws:
- IOException
 
 - 
getSpanprotected io.opentracing.Span getSpan() Get the span for this request. Not null.
 - 
populateTracingSpanprotected void populateTracingSpan(io.opentracing.Span span) 
 - 
sendErrorprotected void sendError(Throwable ex) throws IOException - Throws:
- IOException
 
 - 
sendErrorprotected void sendError(int code, String message) throws IOException- Throws:
- IOException
 
 - 
executeprotected void execute(SolrQueryResponse rsp) 
 - 
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()
 
 - 
getCoreByCollectionprotected SolrCore getCoreByCollection(String collectionName, boolean isPreferLeader) 
 - 
getRemoteCoreUrlprotected String getRemoteCoreUrl(String collectionName, String origCorename) throws SolrException - Throws:
- SolrException
 
 - 
_getHandlerprotected Object _getHandler() 
 - 
getCommandspublic List<CommandOperation> getCommands(boolean validateInput) 
 - 
getSpecprotected ValidatingJsonMap getSpec() 
 - 
getValidatorsprotected Map<String,JsonSchemaValidator> getValidators() 
 
- 
 
-