Package org.apache.solr.request
Class SolrQueryRequestBase
java.lang.Object
org.apache.solr.request.SolrQueryRequestBase
- All Implemented Interfaces:
Closeable,AutoCloseable,SolrQueryRequest
- Direct Known Subclasses:
LocalSolrQueryRequest
Base implementation of
SolrQueryRequest that provides some convenience methods for
accessing parameters, and manages an IndexSearcher reference.
The close() method must be called on any instance of this class once it is no
longer in use.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final SolrCoreprotected final org.apache.solr.common.params.SolrParamsprotected org.apache.solr.common.params.SolrParamsprotected IndexSchemaprotected RefCounted<SolrIndexSearcher> protected final longprotected Iterable<org.apache.solr.common.util.ContentStream> Fields inherited from interface org.apache.solr.request.SolrQueryRequest
ALLOW_PARTIAL_RESULTS_DEFAULT, SOLR_ALLOW_PARTIAL_RESULTS_DEFAULT -
Constructor Summary
ConstructorsConstructorDescriptionSolrQueryRequestBase(SolrCore core, org.apache.solr.common.params.SolrParams params) SolrQueryRequestBase(SolrCore core, org.apache.solr.common.params.SolrParams params, RTimerTree requestTimer) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Frees resources associated with this request, this method must be called when the object is no longer in use.List<org.apache.solr.common.util.CommandOperation> getCommands(boolean validateInput) Only for v2 API if the request contains a command payload, it's parsed and returned as a list of CommandOperation objectsIterable<org.apache.solr.common.util.ContentStream> A Collection of ContentStreams passed to the requestGeneric information associated with this request that may be both read and updated.getCore()The solr core (coordinator, etc) associated with this requestgetJSON()Returns any associated JSON (or null if none) in deserialized generic form.org.apache.solr.common.params.SolrParamsThe original request parameters; never null.org.apache.solr.common.params.SolrParamsThe parameters for this request; never null.Returns a string representing all the important parameters.The timer for this request, created when the request started being processedThe schema snapshot from core.getLatestSchema() at request creation.The index searcher associated with this requestprotected org.apache.solr.common.util.ValidatingJsonMapgetSpec()longThe start time of this request in milliseconds.voidsetContentStreams(Iterable<org.apache.solr.common.util.ContentStream> s) voidvoidsetParams(org.apache.solr.common.params.SolrParams params) Change the parameters for this request.toString()voidReplaces the current schema snapshot with the latest from the core.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.solr.request.SolrQueryRequest
getCloudDescriptor, getCoreContainer, getHttpMethod, getHttpSolrCall, getPath, getPathTemplateValues, getResponseWriter, getSpan, subRequest
-
Field Details
-
core
-
origParams
protected final org.apache.solr.common.params.SolrParams origParams -
schema
-
params
protected org.apache.solr.common.params.SolrParams params -
context
-
streams
-
json
-
startTime
protected final long startTime -
searcherHolder
-
-
Constructor Details
-
SolrQueryRequestBase
public SolrQueryRequestBase(SolrCore core, org.apache.solr.common.params.SolrParams params, RTimerTree requestTimer) -
SolrQueryRequestBase
-
-
Method Details
-
getContext
Description copied from interface:SolrQueryRequestGeneric information associated with this request that may be both read and updated.- Specified by:
getContextin interfaceSolrQueryRequest
-
getParams
public org.apache.solr.common.params.SolrParams getParams()Description copied from interface:SolrQueryRequestThe parameters for this request; never null. UseSolrQueryRequest.setParams(SolrParams)to change.- Specified by:
getParamsin interfaceSolrQueryRequest
-
getOriginalParams
public org.apache.solr.common.params.SolrParams getOriginalParams()Description copied from interface:SolrQueryRequestThe original request parameters; never null. As this does not normally include configured defaults, it's more suitable for logging.- Specified by:
getOriginalParamsin interfaceSolrQueryRequest
-
setParams
public void setParams(org.apache.solr.common.params.SolrParams params) Description copied from interface:SolrQueryRequestChange the parameters for this request. This does not affect the original parameters returned by getOriginalParams()- Specified by:
setParamsin interfaceSolrQueryRequest
-
getStartTime
public long getStartTime()Description copied from interface:SolrQueryRequestThe start time of this request in milliseconds. Use this only if you need the absolute system time at the start of the request, getRequestTimer() provides a more accurate mechanism for timing purposes.- Specified by:
getStartTimein interfaceSolrQueryRequest
-
getRequestTimer
Description copied from interface:SolrQueryRequestThe timer for this request, created when the request started being processed- Specified by:
getRequestTimerin interfaceSolrQueryRequest
-
getSearcher
Description copied from interface:SolrQueryRequestThe index searcher associated with this request- Specified by:
getSearcherin interfaceSolrQueryRequest
-
getCore
Description copied from interface:SolrQueryRequestThe solr core (coordinator, etc) associated with this request- Specified by:
getCorein interfaceSolrQueryRequest
-
getSchema
Description copied from interface:SolrQueryRequestThe schema snapshot from core.getLatestSchema() at request creation.- Specified by:
getSchemain interfaceSolrQueryRequest
-
updateSchemaToLatest
public void updateSchemaToLatest()Description copied from interface:SolrQueryRequestReplaces the current schema snapshot with the latest from the core.- Specified by:
updateSchemaToLatestin interfaceSolrQueryRequest
-
close
public void close()Frees resources associated with this request, this method must be called when the object is no longer in use.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceSolrQueryRequest
-
getContentStreams
A Collection of ContentStreams passed to the request- Specified by:
getContentStreamsin interfaceSolrQueryRequest
-
setContentStreams
-
getParamString
Description copied from interface:SolrQueryRequestReturns a string representing all the important parameters. Suitable for logging.- Specified by:
getParamStringin interfaceSolrQueryRequest
-
toString
-
getJSON
Description copied from interface:SolrQueryRequestReturns any associated JSON (or null if none) in deserialized generic form. Java classes used to represent the JSON are as follows: Map, List, String, Long, Double, Boolean- Specified by:
getJSONin interfaceSolrQueryRequest
-
setJSON
- Specified by:
setJSONin interfaceSolrQueryRequest
-
getUserPrincipal
- Specified by:
getUserPrincipalin interfaceSolrQueryRequest
-
getCommands
Description copied from interface:SolrQueryRequestOnly for v2 API if the request contains a command payload, it's parsed and returned as a list of CommandOperation objects- Specified by:
getCommandsin interfaceSolrQueryRequest- Parameters:
validateInput- , If true it is validated against the json schema spec
-
getSpec
protected org.apache.solr.common.util.ValidatingJsonMap getSpec() -
getValidators
-