Class V2HttpCall
- java.lang.Object
-
- org.apache.solr.servlet.HttpSolrCall
-
- org.apache.solr.api.V2HttpCall
-
- Direct Known Subclasses:
CoordinatorV2HttpSolrCall
@ThreadSafe public class V2HttpCall extends HttpSolrCall
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classV2HttpCall.CompositeApi
-
Field Summary
-
Fields inherited from class org.apache.solr.servlet.HttpSolrCall
action, collectionsList, config, core, cores, coreUrl, handler, INTERNAL_REQUEST_COUNT, invalidStates, origCorename, ORIGINAL_USER_PRINCIPAL_HEADER, path, queryParams, req, requestType, response, retry, solrDispatchFilter, solrReq
-
-
Constructor Summary
Constructors Constructor Description V2HttpCall(SolrDispatchFilter solrDispatchFilter, CoreContainer cc, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean retry)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Object_getHandler()protected voidexecuteCoreRequest(SolrQueryResponse rsp)Executes the API or Jersey resource corresponding to a core-level request.static ApigetApiInfo(PluginBag<SolrRequestHandler> requestHandlers, String path, String method, String fullPath, Map<String,String> parts)List<String>getPathSegments()protected org.apache.solr.common.util.ValidatingJsonMapgetSpec()Map<String,String>getUrlParts()protected Map<String,org.apache.solr.common.util.JsonSchemaValidator>getValidators()protected voidhandleAdmin(SolrQueryResponse solrResp)protected voidhandleAdminOrRemoteRequest()Differentiate between "admin" and "remotequery"-type requests; executing each as appropriate.protected voidinit()protected voidparseRequest()protected voidpopulateTracingSpan(io.opentracing.Span span)protected voidwriteResponse(SolrQueryResponse solrRsp, QueryResponseWriter responseWriter, Method reqMethod)-
Methods inherited from class org.apache.solr.servlet.HttpSolrCall
addCollectionParamIfNeeded, autoCreateSystemColl, call, extractHandlerFromURLPath, extractRemotePath, getCollectionsList, getCommands, getCore, getCoreByCollection, getCoreOrColName, getPath, getQueryParams, getRemoteCoreUrl, getReq, getResponseWriter, getSpan, getUserAgentSolrVersion, logAndFlushAdminRequest, resolveCollectionListOrAlias, resolveDocCollection, sendError, sendError, sendRemoteQuery, shouldAudit, shouldAudit, shouldAudit, shouldAudit
-
-
-
-
Constructor Detail
-
V2HttpCall
public V2HttpCall(SolrDispatchFilter solrDispatchFilter, CoreContainer cc, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean retry)
-
-
Method Detail
-
init
protected void init() throws Exception- Overrides:
initin classHttpSolrCall- Throws:
Exception
-
getApiInfo
public static Api getApiInfo(PluginBag<SolrRequestHandler> requestHandlers, String path, String method, String fullPath, Map<String,String> parts)
-
handleAdminOrRemoteRequest
protected void handleAdminOrRemoteRequest() throws IOExceptionDifferentiate between "admin" and "remotequery"-type requests; executing each as appropriate.The JAX-RS framework used by
V2HttpCalldoesn't provide any easy way to check in advance whether a Jersey application can handle an incoming request. This, in turn, makes it difficult to classify requests as being "admin" or "core, "local" or "remote". The only option is to submit the request to the JAX-RS application and see whether a quick "404" flag comes back, or not.This method uses this strategy to differentiate between admin requests that don't require a
SolrCore, but whose path happen to contain a core/collection name (e.g. ADDREPLICAPROP's path of /collections/collName/shards/shardName/replicas/replicaName/properties), and "REMOTEQUERY" requests which do require a local SolrCore to process.- Overrides:
handleAdminOrRemoteRequestin classHttpSolrCall- Throws:
IOException- See Also:
V2HttpCall
-
handleAdmin
protected void handleAdmin(SolrQueryResponse solrResp)
- Overrides:
handleAdminin classHttpSolrCall
-
executeCoreRequest
protected void executeCoreRequest(SolrQueryResponse rsp)
Executes the API or Jersey resource corresponding to a core-level request.Api-based endpoints do this by invokingApi.call(SolrQueryRequest, SolrQueryResponse).JAX-RS-based endpoints must check both the core-level and container-level JAX-RS applications as the resource for a given "core-level request" might be registered in either place, depending on various legacy factors like the request handler it is associated with. In support of this, the JAX-RS codepath sets a flag to suppress the normal 404 error response when checking the first of the two JAX-RS applications.
- Overrides:
executeCoreRequestin classHttpSolrCall- See Also:
NotFoundExceptionMapper
-
populateTracingSpan
protected void populateTracingSpan(io.opentracing.Span span)
- Overrides:
populateTracingSpanin classHttpSolrCall
-
writeResponse
protected void writeResponse(SolrQueryResponse solrRsp, QueryResponseWriter responseWriter, Method reqMethod) throws IOException
- Overrides:
writeResponsein classHttpSolrCall- Throws:
IOException
-
_getHandler
protected Object _getHandler()
- Overrides:
_getHandlerin classHttpSolrCall
-
getSpec
protected org.apache.solr.common.util.ValidatingJsonMap getSpec()
- Overrides:
getSpecin classHttpSolrCall
-
getValidators
protected Map<String,org.apache.solr.common.util.JsonSchemaValidator> getValidators()
- Overrides:
getValidatorsin classHttpSolrCall
-
-