Package org.apache.solr.servlet
Class HttpSolrCall
- java.lang.Object
-
- org.apache.solr.servlet.HttpSolrCall
-
- Direct Known Subclasses:
V2HttpCall
public class HttpSolrCall extends Object
This class represents a call made to Solr
-
-
Field Summary
Fields Modifier and Type Field Description protected SolrDispatchFilter.Action
action
protected List<String>
collectionsList
protected SolrConfig
config
protected SolrCore
core
protected CoreContainer
cores
protected String
coreUrl
protected SolrRequestHandler
handler
protected Map<String,Integer>
invalidStates
protected String
origCorename
protected String
path
protected SolrParams
queryParams
static Random
random
protected javax.servlet.http.HttpServletRequest
req
protected AuthorizationContext.RequestType
requestType
protected javax.servlet.http.HttpServletResponse
response
protected boolean
retry
protected SolrDispatchFilter
solrDispatchFilter
protected SolrQueryRequest
solrReq
-
Constructor Summary
Constructors Constructor Description HttpSolrCall(SolrDispatchFilter solrDispatchFilter, CoreContainer cores, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean retry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Object
_getHandler()
protected void
addCollectionParamIfNeeded(List<String> collections)
Sets the "collection" parameter on the request to the list of alias-resolved collections for this request.protected void
autoCreateSystemColl(String corename)
SolrDispatchFilter.Action
call()
This method processes the request.protected void
execute(SolrQueryResponse rsp)
protected void
extractHandlerFromURLPath(SolrRequestParsers parser)
Extract handler from the URL path if not set.protected void
extractRemotePath(String collectionName, String origCorename)
protected Aliases
getAliases()
List<String>
getCollectionsList()
The collection(s) referenced in this request.List<CommandOperation>
getCommands(boolean validateInput)
SolrCore
getCore()
protected SolrCore
getCoreByCollection(String collectionName, boolean isPreferLeader)
String
getPath()
SolrParams
getQueryParams()
protected String
getRemoteCoreUrl(String collectionName, String origCorename)
javax.servlet.http.HttpServletRequest
getReq()
AuthorizationContext.RequestType
getRequestType()
protected QueryResponseWriter
getResponseWriter()
ReturnsQueryResponseWriter
to be used.protected ValidatingJsonMap
getSpec()
protected Map<String,JsonSchemaValidator>
getValidators()
protected void
handleAdmin(SolrQueryResponse solrResp)
protected void
init()
protected List<String>
resolveCollectionListOrAlias(String collectionStr)
Resolves the parameter as a potential comma delimited list of collections, and resolves aliases too.protected void
sendError(int code, String message)
protected void
sendError(Throwable ex)
-
-
-
Field Detail
-
random
public static final Random random
-
solrDispatchFilter
protected final SolrDispatchFilter solrDispatchFilter
-
cores
protected final CoreContainer cores
-
req
protected final javax.servlet.http.HttpServletRequest req
-
response
protected final javax.servlet.http.HttpServletResponse response
-
retry
protected final boolean retry
-
core
protected SolrCore core
-
solrReq
protected SolrQueryRequest solrReq
-
handler
protected SolrRequestHandler handler
-
queryParams
protected final SolrParams queryParams
-
path
protected String path
-
action
protected SolrDispatchFilter.Action action
-
coreUrl
protected String coreUrl
-
config
protected SolrConfig config
-
origCorename
protected String origCorename
-
requestType
protected AuthorizationContext.RequestType requestType
-
-
Constructor Detail
-
HttpSolrCall
public HttpSolrCall(SolrDispatchFilter solrDispatchFilter, CoreContainer cores, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean retry)
-
-
Method Detail
-
getRequestType
public AuthorizationContext.RequestType getRequestType()
-
getPath
public String getPath()
-
getReq
public javax.servlet.http.HttpServletRequest getReq()
-
getCore
public SolrCore getCore()
-
getQueryParams
public SolrParams getQueryParams()
-
getAliases
protected Aliases getAliases()
-
getCollectionsList
public List<String> getCollectionsList()
The collection(s) referenced in this request. Populated ininit()
. Not null.
-
autoCreateSystemColl
protected void autoCreateSystemColl(String corename) throws Exception
- Throws:
Exception
-
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 UnsupportedEncodingException, org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
UnsupportedEncodingException
org.apache.zookeeper.KeeperException
InterruptedException
-
call
public SolrDispatchFilter.Action call() throws IOException
This method processes the request.- Throws:
IOException
-
sendError
protected void sendError(Throwable ex) throws IOException
- Throws:
IOException
-
sendError
protected void sendError(int code, String message) throws IOException
- Throws:
IOException
-
execute
protected void execute(SolrQueryResponse rsp)
-
getResponseWriter
protected QueryResponseWriter getResponseWriter()
ReturnsQueryResponseWriter
to be used. WhenCommonParams.WT
not specified in the request or specified value doesn't have correspondingQueryResponseWriter
then, returns the default query response writer Note: This method must not return null
-
handleAdmin
protected void handleAdmin(SolrQueryResponse solrResp)
-
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)
-
_getHandler
protected Object _getHandler()
-
getCommands
public List<CommandOperation> getCommands(boolean validateInput)
-
getSpec
protected ValidatingJsonMap getSpec()
-
getValidators
protected Map<String,JsonSchemaValidator> getValidators()
-
-