Class RealTimeGetComponent
- java.lang.Object
-
- org.apache.solr.handler.component.SearchComponent
-
- org.apache.solr.handler.component.RealTimeGetComponent
-
- All Implemented Interfaces:
AutoCloseable
,SolrInfoBean
,SolrMetricProducer
,NamedListInitializedPlugin
public class RealTimeGetComponent extends SearchComponent
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RealTimeGetComponent.Resolution
Lookup strategy for some methods on this class.-
Nested classes/interfaces inherited from interface org.apache.solr.core.SolrInfoBean
SolrInfoBean.Category, SolrInfoBean.Group
-
-
Field Summary
Fields Modifier and Type Field Description static String
COMPONENT_NAME
static SolrInputDocument
DELETED
-
Fields inherited from class org.apache.solr.handler.component.SearchComponent
solrMetricsContext, standard_components
-
-
Constructor Summary
Constructors Constructor Description RealTimeGetComponent()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
createSubRequests(ResponseBuilder rb)
int
distributedProcess(ResponseBuilder rb)
Process for a distributed search.void
finishStage(ResponseBuilder rb)
Called after all responses have been received for this stage.SolrInfoBean.Category
getCategory()
Category of this componentString
getDescription()
Simple one or two line descriptionstatic SolrInputDocument
getInputDocument(SolrCore core, org.apache.lucene.util.BytesRef idBytes, org.apache.lucene.util.BytesRef rootIdBytes, AtomicLong versionReturned, Set<String> onlyTheseFields, RealTimeGetComponent.Resolution resolveStrategy)
Obtains the latest document for a given id from the tlog or through the realtime searcher (if not found in the tlog).static SolrInputDocument
getInputDocument(SolrCore core, org.apache.lucene.util.BytesRef idBytes, RealTimeGetComponent.Resolution lookupStrategy)
Deprecated.static SolrInputDocument
getInputDocumentFromTlog(SolrCore core, org.apache.lucene.util.BytesRef idBytes, AtomicLong versionReturned, Set<String> onlyTheseNonStoredDVs, boolean resolveFullDocument)
Deprecated.static SolrInputDocument
getInputDocumentFromTlog(SolrCore core, org.apache.lucene.util.BytesRef idBytes, AtomicLong versionReturned, Set<String> onlyTheseFields, RealTimeGetComponent.Resolution resolution)
returns the SolrInputDocument from the current tlog, or DELETED if it has been deleted, or null if there is no record of it in the current update log.void
prepare(ResponseBuilder rb)
Prepare the response.void
process(ResponseBuilder rb)
Process the request for this componentvoid
processGetFingeprint(ResponseBuilder rb)
void
processGetUpdates(ResponseBuilder rb)
void
processGetVersions(ResponseBuilder rb)
void
processSync(ResponseBuilder rb, int nVersions, String sync)
void
processSyncWithLeader(ResponseBuilder rb, int nVersions, String syncWithLeader, List<Long> versions)
static SolrDocument
toSolrDoc(SolrInputDocument sdoc, IndexSchema schema)
Converts a SolrInputDocument to SolrDocument, using an IndexSchema instance.static SolrDocument
toSolrDoc(SolrInputDocument sdoc, IndexSchema schema, boolean forInPlaceUpdate)
Converts a SolrInputDocument to SolrDocument, using an IndexSchema instance.-
Methods inherited from class org.apache.solr.handler.component.SearchComponent
getName, getSolrMetricsContext, handleResponses, initializeMetrics, modifyRequest, setName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.solr.util.plugin.NamedListInitializedPlugin
init
-
Methods inherited from interface org.apache.solr.metrics.SolrMetricProducer
close
-
-
-
-
Field Detail
-
COMPONENT_NAME
public static final String COMPONENT_NAME
- See Also:
- Constant Field Values
-
DELETED
public static SolrInputDocument DELETED
-
-
Method Detail
-
prepare
public void prepare(ResponseBuilder rb) throws IOException
Description copied from class:SearchComponent
Prepare the response. Guaranteed to be called before any SearchComponentSearchComponent.process(org.apache.solr.handler.component.ResponseBuilder)
method. Called for every incoming request.The place to do initialization that is request dependent.
- Specified by:
prepare
in classSearchComponent
- Parameters:
rb
- TheResponseBuilder
- Throws:
IOException
- If there is a low-level I/O error.
-
process
public void process(ResponseBuilder rb) throws IOException
Description copied from class:SearchComponent
Process the request for this component- Specified by:
process
in classSearchComponent
- Parameters:
rb
- TheResponseBuilder
- Throws:
IOException
- If there is a low-level I/O error.
-
getInputDocumentFromTlog
@Deprecated public static SolrInputDocument getInputDocumentFromTlog(SolrCore core, org.apache.lucene.util.BytesRef idBytes, AtomicLong versionReturned, Set<String> onlyTheseNonStoredDVs, boolean resolveFullDocument)
Deprecated.
-
getInputDocumentFromTlog
public static SolrInputDocument getInputDocumentFromTlog(SolrCore core, org.apache.lucene.util.BytesRef idBytes, AtomicLong versionReturned, Set<String> onlyTheseFields, RealTimeGetComponent.Resolution resolution)
returns the SolrInputDocument from the current tlog, or DELETED if it has been deleted, or null if there is no record of it in the current update log. If null is returned, it could still be in the latest index. Copy-field target fields are excluded.- Parameters:
idBytes
- doc ID to find; never a child doc.versionReturned
- If a non-null AtomicLong is passed in, it is set to the version of the update returned from the TLog.
-
getInputDocument
@Deprecated public static SolrInputDocument getInputDocument(SolrCore core, org.apache.lucene.util.BytesRef idBytes, RealTimeGetComponent.Resolution lookupStrategy) throws IOException
Deprecated.- Throws:
IOException
-
getInputDocument
public static SolrInputDocument getInputDocument(SolrCore core, org.apache.lucene.util.BytesRef idBytes, org.apache.lucene.util.BytesRef rootIdBytes, AtomicLong versionReturned, Set<String> onlyTheseFields, RealTimeGetComponent.Resolution resolveStrategy) throws IOException
Obtains the latest document for a given id from the tlog or through the realtime searcher (if not found in the tlog). Fields that are targets of copy-fields are excluded.- Parameters:
idBytes
- ID of the document to be fetched.rootIdBytes
- the root ID of the document being looked up. If there are no child docs, this is always the same as idBytes.versionReturned
- If a non-null AtomicLong is passed in, it is set to the version of the update returned from the TLog.onlyTheseFields
- If not-null, this limits the fields that are returned. However it is only an optimization hint since other fields may be returned. Copy field targets are never returned.resolveStrategy
-RealTimeGetComponent.Resolution.DOC
orRealTimeGetComponent.Resolution.ROOT_WITH_CHILDREN
.- Throws:
IOException
- See Also:
RealTimeGetComponent.Resolution
-
toSolrDoc
public static SolrDocument toSolrDoc(SolrInputDocument sdoc, IndexSchema schema)
Converts a SolrInputDocument to SolrDocument, using an IndexSchema instance.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
toSolrDoc
public static SolrDocument toSolrDoc(SolrInputDocument sdoc, IndexSchema schema, boolean forInPlaceUpdate)
Converts a SolrInputDocument to SolrDocument, using an IndexSchema instance.- Parameters:
sdoc
- The input document.schema
- The index schema.forInPlaceUpdate
- Whether the document is being used for an in place update, seeDocumentBuilder.toDocument(SolrInputDocument, IndexSchema, boolean, boolean)
-
distributedProcess
public int distributedProcess(ResponseBuilder rb) throws IOException
Description copied from class:SearchComponent
Process for a distributed search.- Overrides:
distributedProcess
in classSearchComponent
- Returns:
- the next stage for this component
- Throws:
IOException
-
createSubRequests
public int createSubRequests(ResponseBuilder rb) throws IOException
- Throws:
IOException
-
finishStage
public void finishStage(ResponseBuilder rb)
Description copied from class:SearchComponent
Called after all responses have been received for this stage. Useful when different requests are sent to each shard.- Overrides:
finishStage
in classSearchComponent
-
getDescription
public String getDescription()
Description copied from interface:SolrInfoBean
Simple one or two line description- Specified by:
getDescription
in interfaceSolrInfoBean
- Specified by:
getDescription
in classSearchComponent
-
getCategory
public SolrInfoBean.Category getCategory()
Description copied from interface:SolrInfoBean
Category of this component- Specified by:
getCategory
in interfaceSolrInfoBean
- Overrides:
getCategory
in classSearchComponent
-
processGetFingeprint
public void processGetFingeprint(ResponseBuilder rb) throws IOException
- Throws:
IOException
-
processGetVersions
public void processGetVersions(ResponseBuilder rb) throws IOException
- Throws:
IOException
-
processSyncWithLeader
public void processSyncWithLeader(ResponseBuilder rb, int nVersions, String syncWithLeader, List<Long> versions)
-
processSync
public void processSync(ResponseBuilder rb, int nVersions, String sync)
-
processGetUpdates
public void processGetUpdates(ResponseBuilder rb) throws IOException
- Throws:
IOException
-
-