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 class
V2HttpCall.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, random, 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 void
executeCoreRequest(SolrQueryResponse rsp)
Executes the API or Jersey resource corresponding to a core-level request.static Api
getApiInfo(PluginBag<SolrRequestHandler> requestHandlers, String path, String method, String fullPath, Map<String,String> parts)
List<String>
getPathSegments()
protected org.apache.solr.common.util.ValidatingJsonMap
getSpec()
Map<String,String>
getUrlParts()
protected Map<String,org.apache.solr.common.util.JsonSchemaValidator>
getValidators()
protected void
handleAdmin(SolrQueryResponse solrResp)
protected void
handleAdminOrRemoteRequest()
Differentiate between "admin" and "remotequery"-type requests; executing each as appropriate.protected void
init()
protected void
parseRequest()
protected void
populateTracingSpan(io.opentracing.Span span)
protected void
writeResponse(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, 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:
init
in 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 IOException
Differentiate between "admin" and "remotequery"-type requests; executing each as appropriate.The JAX-RS framework used by
V2HttpCall
doesn'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:
handleAdminOrRemoteRequest
in classHttpSolrCall
- Throws:
IOException
- See Also:
V2HttpCall
-
handleAdmin
protected void handleAdmin(SolrQueryResponse solrResp)
- Overrides:
handleAdmin
in 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:
executeCoreRequest
in classHttpSolrCall
- See Also:
NotFoundExceptionMapper
-
populateTracingSpan
protected void populateTracingSpan(io.opentracing.Span span)
- Overrides:
populateTracingSpan
in classHttpSolrCall
-
writeResponse
protected void writeResponse(SolrQueryResponse solrRsp, QueryResponseWriter responseWriter, Method reqMethod) throws IOException
- Overrides:
writeResponse
in classHttpSolrCall
- Throws:
IOException
-
_getHandler
protected Object _getHandler()
- Overrides:
_getHandler
in classHttpSolrCall
-
getSpec
protected org.apache.solr.common.util.ValidatingJsonMap getSpec()
- Overrides:
getSpec
in classHttpSolrCall
-
getValidators
protected Map<String,org.apache.solr.common.util.JsonSchemaValidator> getValidators()
- Overrides:
getValidators
in classHttpSolrCall
-
-