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
ASolrQueryRequest
implementation 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 void
close()
This method should be called when all uses of this request are finished, so that resources can be freed.CloudDescriptor
getCloudDescriptor()
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.SolrCore
getCore()
The solr core (coordinator, etc) associated with this requestCoreContainer
getCoreContainer()
String
getHttpMethod()
HttpSolrCall
getHttpSolrCall()
Map<String,Object>
getJSON()
Returns any associated JSON (or null if none) in deserialized generic form.org.apache.solr.common.params.SolrParams
getOriginalParams()
Returns the original request parameters.org.apache.solr.common.params.SolrParams
getParams()
returns the current request parametersString
getParamString()
Returns a string representing all the important parameters.String
getPath()
Map<String,String>
getPathTemplateValues()
Only for V2 API.RTimerTree
getRequestTimer()
The timer for this request, created when the request started being processedIndexSchema
getSchema()
The schema snapshot from core.getLatestSchema() at request creation.SolrIndexSearcher
getSearcher()
The index searcher associated with this requestio.opentracing.Span
getSpan()
The distributed tracing Span for the request itself; never null.long
getStartTime()
The start time of this request in milliseconds.io.opentracing.Tracer
getTracer()
Distributed tracing Tracer.Principal
getUserPrincipal()
void
setJSON(Map<String,Object> json)
void
setParams(org.apache.solr.common.params.SolrParams params)
Change the parameters for this request.void
updateSchemaToLatest()
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:SolrQueryRequest
returns the current request parameters- Specified by:
getParams
in interfaceSolrQueryRequest
-
setParams
public void setParams(org.apache.solr.common.params.SolrParams params)
Description copied from interface:SolrQueryRequest
Change the parameters for this request. This does not affect the original parameters returned by getOriginalParams()- Specified by:
setParams
in interfaceSolrQueryRequest
-
getContentStreams
public Iterable<org.apache.solr.common.util.ContentStream> getContentStreams()
Description copied from interface:SolrQueryRequest
A Collection of ContentStreams passed to the request- Specified by:
getContentStreams
in interfaceSolrQueryRequest
-
getOriginalParams
public org.apache.solr.common.params.SolrParams getOriginalParams()
Description copied from interface:SolrQueryRequest
Returns the original request parameters. As this does not normally include configured defaults it's more suitable for logging.- Specified by:
getOriginalParams
in interfaceSolrQueryRequest
-
getContext
public Map<Object,Object> getContext()
Description copied from interface:SolrQueryRequest
Generic information associated with this request that may be both read and updated.- Specified by:
getContext
in interfaceSolrQueryRequest
-
close
public void close()
Description copied from interface:SolrQueryRequest
This method should be called when all uses of this request are finished, so that resources can be freed.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSolrQueryRequest
-
getStartTime
public long getStartTime()
Description copied from interface:SolrQueryRequest
The 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:
getStartTime
in interfaceSolrQueryRequest
-
getRequestTimer
public RTimerTree getRequestTimer()
Description copied from interface:SolrQueryRequest
The timer for this request, created when the request started being processed- Specified by:
getRequestTimer
in interfaceSolrQueryRequest
-
getSearcher
public SolrIndexSearcher getSearcher()
Description copied from interface:SolrQueryRequest
The index searcher associated with this request- Specified by:
getSearcher
in interfaceSolrQueryRequest
-
getCore
public SolrCore getCore()
Description copied from interface:SolrQueryRequest
The solr core (coordinator, etc) associated with this request- Specified by:
getCore
in interfaceSolrQueryRequest
-
getSchema
public IndexSchema getSchema()
Description copied from interface:SolrQueryRequest
The schema snapshot from core.getLatestSchema() at request creation.- Specified by:
getSchema
in interfaceSolrQueryRequest
-
updateSchemaToLatest
public void updateSchemaToLatest()
Description copied from interface:SolrQueryRequest
Replaces the current schema snapshot with the latest from the core.- Specified by:
updateSchemaToLatest
in interfaceSolrQueryRequest
-
getParamString
public String getParamString()
Description copied from interface:SolrQueryRequest
Returns a string representing all the important parameters. Suitable for logging.- Specified by:
getParamString
in interfaceSolrQueryRequest
-
getJSON
public Map<String,Object> getJSON()
Description copied from interface:SolrQueryRequest
Returns 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:
getJSON
in interfaceSolrQueryRequest
-
setJSON
public void setJSON(Map<String,Object> json)
- Specified by:
setJSON
in interfaceSolrQueryRequest
-
getUserPrincipal
public Principal getUserPrincipal()
- Specified by:
getUserPrincipal
in interfaceSolrQueryRequest
-
getPath
public String getPath()
- Specified by:
getPath
in interfaceSolrQueryRequest
-
getPathTemplateValues
public Map<String,String> getPathTemplateValues()
Description copied from interface:SolrQueryRequest
Only 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:
getPathTemplateValues
in interfaceSolrQueryRequest
-
getCommands
public List<org.apache.solr.common.util.CommandOperation> getCommands(boolean validateInput)
Description copied from interface:SolrQueryRequest
Only for v2 API if the request contains a command payload, it's parsed and returned as a list of CommandOperation objects- Specified by:
getCommands
in interfaceSolrQueryRequest
- Parameters:
validateInput
- , If true it is validated against the json schema spec
-
getHttpMethod
public String getHttpMethod()
- Specified by:
getHttpMethod
in interfaceSolrQueryRequest
-
getHttpSolrCall
public HttpSolrCall getHttpSolrCall()
- Specified by:
getHttpSolrCall
in interfaceSolrQueryRequest
-
getTracer
public io.opentracing.Tracer getTracer()
Description copied from interface:SolrQueryRequest
Distributed tracing Tracer. Never null but might implementNoopTracer
.- Specified by:
getTracer
in interfaceSolrQueryRequest
-
getSpan
public io.opentracing.Span getSpan()
Description copied from interface:SolrQueryRequest
The 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:
getSpan
in interfaceSolrQueryRequest
-
getCoreContainer
public CoreContainer getCoreContainer()
- Specified by:
getCoreContainer
in interfaceSolrQueryRequest
-
getCloudDescriptor
public CloudDescriptor getCloudDescriptor()
- Specified by:
getCloudDescriptor
in interfaceSolrQueryRequest
-
-