Class SolrQueryRequestBase

java.lang.Object
org.apache.solr.request.SolrQueryRequestBase
All Implemented Interfaces:
Closeable, AutoCloseable, SolrQueryRequest
Direct Known Subclasses:
LocalSolrQueryRequest

public abstract class SolrQueryRequestBase extends Object implements SolrQueryRequest, Closeable
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 Details

    • core

      protected final SolrCore core
    • origParams

      protected final org.apache.solr.common.params.SolrParams origParams
    • schema

      protected volatile IndexSchema schema
    • params

      protected org.apache.solr.common.params.SolrParams params
    • context

      protected Map<Object,Object> context
    • streams

      protected Iterable<org.apache.solr.common.util.ContentStream> streams
    • json

      protected Map<String,Object> json
    • startTime

      protected final long startTime
    • searcherHolder

      protected RefCounted<SolrIndexSearcher> searcherHolder
  • Constructor Details

    • SolrQueryRequestBase

      public SolrQueryRequestBase(SolrCore core, org.apache.solr.common.params.SolrParams params, RTimerTree requestTimer)
    • SolrQueryRequestBase

      public SolrQueryRequestBase(SolrCore core, org.apache.solr.common.params.SolrParams params)
  • Method Details

    • 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 interface SolrQueryRequest
    • getParams

      public org.apache.solr.common.params.SolrParams getParams()
      Description copied from interface: SolrQueryRequest
      The parameters for this request; never null. Use SolrQueryRequest.setParams(SolrParams) to change.
      Specified by:
      getParams in interface SolrQueryRequest
    • getOriginalParams

      public org.apache.solr.common.params.SolrParams getOriginalParams()
      Description copied from interface: SolrQueryRequest
      The original request parameters; never null. As this does not normally include configured defaults, it's more suitable for logging.
      Specified by:
      getOriginalParams in interface SolrQueryRequest
    • 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 interface SolrQueryRequest
    • 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 interface SolrQueryRequest
    • 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 interface SolrQueryRequest
    • getSearcher

      public SolrIndexSearcher getSearcher()
      Description copied from interface: SolrQueryRequest
      The index searcher associated with this request
      Specified by:
      getSearcher in interface SolrQueryRequest
    • getCore

      public SolrCore getCore()
      Description copied from interface: SolrQueryRequest
      The solr core (coordinator, etc) associated with this request
      Specified by:
      getCore in interface SolrQueryRequest
    • getSchema

      public IndexSchema getSchema()
      Description copied from interface: SolrQueryRequest
      The schema snapshot from core.getLatestSchema() at request creation.
      Specified by:
      getSchema in interface SolrQueryRequest
    • updateSchemaToLatest

      public void updateSchemaToLatest()
      Description copied from interface: SolrQueryRequest
      Replaces the current schema snapshot with the latest from the core.
      Specified by:
      updateSchemaToLatest in interface SolrQueryRequest
    • 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:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface SolrQueryRequest
    • getContentStreams

      public Iterable<org.apache.solr.common.util.ContentStream> getContentStreams()
      A Collection of ContentStreams passed to the request
      Specified by:
      getContentStreams in interface SolrQueryRequest
    • setContentStreams

      public void setContentStreams(Iterable<org.apache.solr.common.util.ContentStream> s)
    • getParamString

      public String getParamString()
      Description copied from interface: SolrQueryRequest
      Returns a string representing all the important parameters. Suitable for logging.
      Specified by:
      getParamString in interface SolrQueryRequest
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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 interface SolrQueryRequest
    • setJSON

      public void setJSON(Map<String,Object> json)
      Specified by:
      setJSON in interface SolrQueryRequest
    • getUserPrincipal

      public Principal getUserPrincipal()
      Specified by:
      getUserPrincipal in interface SolrQueryRequest
    • 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 interface SolrQueryRequest
      Parameters:
      validateInput - , If true it is validated against the json schema spec
    • getSpec

      protected org.apache.solr.common.util.ValidatingJsonMap getSpec()
    • getValidators

      protected Map<String,org.apache.solr.common.util.JsonSchemaValidator> getValidators()