Class V2HttpCall

Direct Known Subclasses:
CoordinatorV2HttpSolrCall

@ThreadSafe public class V2HttpCall extends HttpSolrCall
  • Constructor Details

    • V2HttpCall

      public V2HttpCall(SolrDispatchFilter solrDispatchFilter, CoreContainer cc, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, boolean retry)
  • Method Details

    • init

      protected void init() throws Exception
      Overrides:
      init in class HttpSolrCall
      Throws:
      Exception
    • parseRequest

      protected void parseRequest() throws Exception
      Throws:
      Exception
    • getApiInfo

      public static Api getApiInfo(PluginBag<SolrRequestHandler> requestHandlers, String path, String method, String fullPath, Map<String,String> parts)
    • getPathSegments

      public List<String> getPathSegments()
    • handleAdminOrRemoteRequest

      protected void handleAdminOrRemoteRequest() throws IOException
      Differentiate between "admin" and "remoteproxy"-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 "REMOTEPROXY" requests which do require a local SolrCore to process.

      Overrides:
      handleAdminOrRemoteRequest in class HttpSolrCall
      Throws:
      IOException
      See Also:
    • handleAdmin

      protected void handleAdmin(SolrQueryResponse solrResp)
      Overrides:
      handleAdmin in class HttpSolrCall
    • executeCoreRequest

      protected void executeCoreRequest(SolrQueryResponse rsp)
      Executes the API or Jersey resource corresponding to a core-level request.

      Api-based endpoints do this by invoking Api.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 class HttpSolrCall
      See Also:
    • populateTracingSpan

      protected void populateTracingSpan(io.opentelemetry.api.trace.Span span)
      Overrides:
      populateTracingSpan in class HttpSolrCall
    • writeResponse

      protected void writeResponse(SolrQueryResponse solrRsp, QueryResponseWriter responseWriter, Method reqMethod) throws IOException
      Overrides:
      writeResponse in class HttpSolrCall
      Throws:
      IOException
    • _getHandler

      protected Object _getHandler()
      Overrides:
      _getHandler in class HttpSolrCall
    • getUrlParts

      public Map<String,String> getUrlParts()
    • getSpec

      protected org.apache.solr.common.util.ValidatingJsonMap getSpec()
      Overrides:
      getSpec in class HttpSolrCall
    • getValidators

      protected Map<String,org.apache.solr.common.util.JsonSchemaValidator> getValidators()
      Overrides:
      getValidators in class HttpSolrCall