Class HttpSolrCall

    • Constructor Detail

      • HttpSolrCall

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

      • getPath

        public String getPath()
      • getReq

        public javax.servlet.http.HttpServletRequest getReq()
      • getQueryParams

        public org.apache.solr.common.params.SolrParams getQueryParams()
      • getCollectionsList

        public List<String> getCollectionsList()
        The collection(s) referenced in this request. Populated in init(). Not null.
      • resolveDocCollection

        protected org.apache.solr.common.cloud.DocCollection resolveDocCollection​(String collectionName)
        Resolves the specified collection name to a DocCollection object. If Solr is not in cloud mode, a SolrException is thrown. Returns null if the collection name is null or empty. Retrieves the DocCollection using the ZkStateReader from CoreContainer. If the collection is null, updates the state by refreshing aliases and forcing a collection update.
      • resolveCollectionListOrAlias

        protected 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()
      • extractHandlerFromURLPath

        protected void extractHandlerFromURLPath​(SolrRequestParsers parser)
                                          throws Exception
        Extract handler from the URL path if not set.
        Throws:
        Exception
      • extractRemotePath

        protected void extractRemotePath​(String collectionName,
                                         String origCorename)
                                  throws org.apache.zookeeper.KeeperException,
                                         InterruptedException,
                                         org.apache.solr.common.SolrException
        Throws:
        org.apache.zookeeper.KeeperException
        InterruptedException
        org.apache.solr.common.SolrException
      • handleAdminOrRemoteRequest

        protected void handleAdminOrRemoteRequest()
                                           throws IOException
        Handle a request whose "type" could not be discerned in advance and may be either "admin" or "remotequery".

        Some implementations (such as V2HttpCall) may find it difficult to differentiate all request types in advance. This method serves as a hook; allowing those implementations to handle these cases gracefully.

        Throws:
        IOException
        See Also:
        V2HttpCall
      • getSpan

        protected io.opentracing.Span getSpan()
        Get the span for this request. Not null.
      • populateTracingSpan

        protected void populateTracingSpan​(io.opentracing.Span span)
      • getCoreOrColName

        protected String getCoreOrColName()
      • shouldAudit

        public boolean shouldAudit()
      • shouldAudit

        public static boolean shouldAudit​(CoreContainer cores)
      • getResponseWriter

        protected QueryResponseWriter getResponseWriter()
        Returns QueryResponseWriter to be used. When CommonParams.WT not specified in the request or specified value doesn't have corresponding QueryResponseWriter then, returns the default query response writer Note: This method must not return null
      • addCollectionParamIfNeeded

        protected 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: HttpShardHandler processes this param.
        See Also:
        getCollectionsList()
      • getCoreByCollection

        protected SolrCore getCoreByCollection​(String collectionName,
                                               boolean isPreferLeader)
        Retrieves a SolrCore instance associated with the specified collection name, with an option to prefer leader replicas. Makes a call to resolveDocCollection(java.lang.String) which make an attempt to force update collection if it is not found in local cluster state
      • getRemoteCoreUrl

        protected String getRemoteCoreUrl​(String collectionName,
                                          String origCorename)
                                   throws org.apache.solr.common.SolrException
        Throws:
        org.apache.solr.common.SolrException
      • _getHandler

        protected Object _getHandler()
      • getCommands

        public List<org.apache.solr.common.util.CommandOperation> getCommands​(boolean validateInput)
      • getSpec

        protected org.apache.solr.common.util.ValidatingJsonMap getSpec()
      • getValidators

        protected Map<String,​org.apache.solr.common.util.JsonSchemaValidator> getValidators()