Class V2HttpCall

    • Constructor Detail

      • V2HttpCall

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

      • resolveDocCollection

        protected org.apache.solr.common.cloud.DocCollection resolveDocCollection​(String collectionStr)
        Lookup the collection from the collection string (maybe comma delimited). Also sets HttpSolrCall.collectionsList by side-effect. if secondTry is false then we'll potentially recursively try this all one more time while ensuring the alias and collection info is sync'ed from ZK.
      • getPathSegments

        public List<String> getPathSegments()
      • 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 class HttpSolrCall
        Throws:
        IOException
        See Also:
        V2HttpCall
      • 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:
        NotFoundExceptionMapper
      • getSpec

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