Package org.apache.solr.servlet
Class CoordinatorHttpSolrCall
- java.lang.Object
-
- org.apache.solr.servlet.HttpSolrCall
-
- org.apache.solr.servlet.CoordinatorHttpSolrCall
-
public class CoordinatorHttpSolrCall extends HttpSolrCall
A coordinator node can serve requests as if it hosts all collections in the cluster. it does so by hosting a synthetic replica for each configset used in the cluster.This class is responsible for forwarding the requests to the right core when the node is acting as a Coordinator The responsibilities also involve creating a synthetic collection or replica if they do not exist. It also sets the right threadlocal variables which reflects the current collection being served.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCoordinatorHttpSolrCall.Factory
-
Field Summary
Fields Modifier and Type Field Description static StringSYNTHETIC_COLL_PREFIX-
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 CoordinatorHttpSolrCall(CoordinatorHttpSolrCall.Factory factory, SolrDispatchFilter solrDispatchFilter, CoreContainer cores, 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 static SolrCoregetCore(CoordinatorHttpSolrCall.Factory factory, HttpSolrCall solrCall, String collectionName, boolean isPreferLeader)protected SolrCoregetCoreByCollection(String collectionName, boolean isPreferLeader)Retrieves a SolrCore instance associated with the specified collection name, with an option to prefer leader replicas.protected StringgetCoreOrColName()static StringgetSyntheticCollectionNameFromConfig(String configName)static StringgetSyntheticCoreNameFromConfig(String configName)protected voidinit()static SolrQueryRequestwrappedReq(SolrQueryRequest delegate, String collectionName, HttpSolrCall httpSolrCall)-
Methods inherited from class org.apache.solr.servlet.HttpSolrCall
_getHandler, addCollectionParamIfNeeded, autoCreateSystemColl, call, executeCoreRequest, extractHandlerFromURLPath, extractRemotePath, getCollectionsList, getCommands, getCore, getPath, getQueryParams, getRemoteCoreUrl, getReq, getResponseWriter, getSpan, getSpec, getValidators, handleAdmin, handleAdminOrRemoteRequest, logAndFlushAdminRequest, populateTracingSpan, resolveCollectionListOrAlias, resolveDocCollection, sendError, sendError, sendRemoteQuery, shouldAudit, shouldAudit, shouldAudit, shouldAudit, writeResponse
-
-
-
-
Field Detail
-
SYNTHETIC_COLL_PREFIX
public static final String SYNTHETIC_COLL_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CoordinatorHttpSolrCall
public CoordinatorHttpSolrCall(CoordinatorHttpSolrCall.Factory factory, SolrDispatchFilter solrDispatchFilter, CoreContainer cores, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean retry)
-
-
Method Detail
-
getCoreByCollection
protected SolrCore getCoreByCollection(String collectionName, boolean isPreferLeader)
Description copied from class:HttpSolrCallRetrieves a SolrCore instance associated with the specified collection name, with an option to prefer leader replicas. Makes a call toHttpSolrCall.resolveDocCollection(java.lang.String)which make an attempt to force update collection if it is not found in local cluster state- Overrides:
getCoreByCollectionin classHttpSolrCall
-
getCore
public static SolrCore getCore(CoordinatorHttpSolrCall.Factory factory, HttpSolrCall solrCall, String collectionName, boolean isPreferLeader)
-
getSyntheticCollectionNameFromConfig
public static String getSyntheticCollectionNameFromConfig(String configName)
-
getSyntheticCoreNameFromConfig
public static String getSyntheticCoreNameFromConfig(String configName)
-
init
protected void init() throws Exception- Overrides:
initin classHttpSolrCall- Throws:
Exception
-
getCoreOrColName
protected String getCoreOrColName()
- Overrides:
getCoreOrColNamein classHttpSolrCall
-
wrappedReq
public static SolrQueryRequest wrappedReq(SolrQueryRequest delegate, String collectionName, HttpSolrCall httpSolrCall)
-
-