Package org.apache.solr.request
Class DelegatingSolrQueryRequest
- java.lang.Object
-
- org.apache.solr.request.DelegatingSolrQueryRequest
-
- All Implemented Interfaces:
AutoCloseable,SolrQueryRequest
public class DelegatingSolrQueryRequest extends Object implements SolrQueryRequest
ASolrQueryRequestimplementation that defers to a delegate in all cases.Used primarily in cases where developers want to customize one or more SolrQueryRequest methods while deferring the remainder to an existing instances.
-
-
Constructor Summary
Constructors Constructor Description DelegatingSolrQueryRequest(SolrQueryRequest delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()This method should be called when all uses of this request are finished, so that resources can be freed.CloudDescriptorgetCloudDescriptor()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>getContentStreams()A Collection of ContentStreams passed to the requestMap<Object,Object>getContext()Generic information associated with this request that may be both read and updated.SolrCoregetCore()The solr core (coordinator, etc) associated with this requestCoreContainergetCoreContainer()StringgetHttpMethod()HttpSolrCallgetHttpSolrCall()Map<String,Object>getJSON()Returns any associated JSON (or null if none) in deserialized generic form.org.apache.solr.common.params.SolrParamsgetOriginalParams()Returns the original request parameters.org.apache.solr.common.params.SolrParamsgetParams()returns the current request parametersStringgetParamString()Returns a string representing all the important parameters.StringgetPath()Map<String,String>getPathTemplateValues()Only for V2 API.RTimerTreegetRequestTimer()The timer for this request, created when the request started being processedIndexSchemagetSchema()The schema snapshot from core.getLatestSchema() at request creation.SolrIndexSearchergetSearcher()The index searcher associated with this requestio.opentracing.SpangetSpan()The distributed tracing Span for the request itself; never null.longgetStartTime()The start time of this request in milliseconds.io.opentracing.TracergetTracer()Distributed tracing Tracer.PrincipalgetUserPrincipal()voidsetJSON(Map<String,Object> json)voidsetParams(org.apache.solr.common.params.SolrParams params)Change the parameters for this request.voidupdateSchemaToLatest()Replaces the current schema snapshot with the latest from the core.
-
-
-
Constructor Detail
-
DelegatingSolrQueryRequest
public DelegatingSolrQueryRequest(SolrQueryRequest delegate)
-
-
Method Detail
-
getParams
public org.apache.solr.common.params.SolrParams getParams()
Description copied from interface:SolrQueryRequestreturns the current request parameters- Specified by:
getParamsin 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
-
getContentStreams
public Iterable<org.apache.solr.common.util.ContentStream> getContentStreams()
Description copied from interface:SolrQueryRequestA Collection of ContentStreams passed to the request- Specified by:
getContentStreamsin interfaceSolrQueryRequest
-
getOriginalParams
public org.apache.solr.common.params.SolrParams getOriginalParams()
Description copied from interface:SolrQueryRequestReturns the original request parameters. As this does not normally include configured defaults it's more suitable for logging.- Specified by:
getOriginalParamsin interfaceSolrQueryRequest
-
getContext
public Map<Object,Object> getContext()
Description copied from interface:SolrQueryRequestGeneric information associated with this request that may be both read and updated.- Specified by:
getContextin interfaceSolrQueryRequest
-
close
public void close()
Description copied from interface:SolrQueryRequestThis method should be called when all uses of this request are finished, so that resources can be freed.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein 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
public RTimerTree getRequestTimer()
Description copied from interface:SolrQueryRequestThe timer for this request, created when the request started being processed- Specified by:
getRequestTimerin interfaceSolrQueryRequest
-
getSearcher
public SolrIndexSearcher getSearcher()
Description copied from interface:SolrQueryRequestThe index searcher associated with this request- Specified by:
getSearcherin interfaceSolrQueryRequest
-
getCore
public SolrCore getCore()
Description copied from interface:SolrQueryRequestThe solr core (coordinator, etc) associated with this request- Specified by:
getCorein interfaceSolrQueryRequest
-
getSchema
public IndexSchema 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
-
getParamString
public String getParamString()
Description copied from interface:SolrQueryRequestReturns a string representing all the important parameters. Suitable for logging.- Specified by:
getParamStringin interfaceSolrQueryRequest
-
getJSON
public Map<String,Object> 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
public void setJSON(Map<String,Object> json)
- Specified by:
setJSONin interfaceSolrQueryRequest
-
getUserPrincipal
public Principal getUserPrincipal()
- Specified by:
getUserPrincipalin interfaceSolrQueryRequest
-
getPath
public String getPath()
- Specified by:
getPathin interfaceSolrQueryRequest
-
getPathTemplateValues
public Map<String,String> getPathTemplateValues()
Description copied from interface:SolrQueryRequestOnly for V2 API. Returns a map of path segments and their values. For example, if the path is configured as /path/{segment1}/{segment2} and a reguest is made as /path/x/y the returned map would contain {segment1:x ,segment2:y}- Specified by:
getPathTemplateValuesin interfaceSolrQueryRequest
-
getCommands
public List<org.apache.solr.common.util.CommandOperation> getCommands(boolean validateInput)
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
-
getHttpMethod
public String getHttpMethod()
- Specified by:
getHttpMethodin interfaceSolrQueryRequest
-
getHttpSolrCall
public HttpSolrCall getHttpSolrCall()
- Specified by:
getHttpSolrCallin interfaceSolrQueryRequest
-
getTracer
public io.opentracing.Tracer getTracer()
Description copied from interface:SolrQueryRequestDistributed tracing Tracer. Never null but might implementNoopTracer.- Specified by:
getTracerin interfaceSolrQueryRequest
-
getSpan
public io.opentracing.Span getSpan()
Description copied from interface:SolrQueryRequestThe distributed tracing Span for the request itself; never null. This is useful for adding tags or updating the operation name of the request span. If you need the current span, which might not necessarily be the request span, do this instead:tracer.activeSpan().- Specified by:
getSpanin interfaceSolrQueryRequest
-
getCoreContainer
public CoreContainer getCoreContainer()
- Specified by:
getCoreContainerin interfaceSolrQueryRequest
-
getCloudDescriptor
public CloudDescriptor getCloudDescriptor()
- Specified by:
getCloudDescriptorin interfaceSolrQueryRequest
-
-