Class RealTimeGetComponent
java.lang.Object
org.apache.solr.handler.component.SearchComponent
org.apache.solr.handler.component.RealTimeGetComponent
- All Implemented Interfaces:
AutoCloseable,SolrInfoBean,SolrMetricProducer,NamedListInitializedPlugin
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumLookup strategy for some methods on this class.Nested classes/interfaces inherited from interface org.apache.solr.core.SolrInfoBean
SolrInfoBean.Category, SolrInfoBean.Group -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic org.apache.solr.common.SolrInputDocumentFields inherited from class org.apache.solr.handler.component.SearchComponent
solrMetricsContext, standard_componentsFields inherited from interface org.apache.solr.metrics.SolrMetricProducer
CATEGORY_ATTR, HANDLER_ATTR, NAME_ATTR, OPERATION_ATTR, PLUGIN_NAME_ATTR, RESULT_ATTR, TYPE_ATTR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintProcess for a distributed search.voidCalled after all responses have been received for this stage.Category of this componentSimple one or two line descriptionstatic org.apache.solr.common.SolrInputDocumentgetInputDocument(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 org.apache.solr.common.SolrInputDocumentgetInputDocumentFromTlog(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.voidPrepare the response.voidProcess the request for this componentvoidvoidvoidvoidprocessSync(ResponseBuilder rb, int nVersions, String sync) voidprocessSyncWithLeader(ResponseBuilder rb, int nVersions, String syncWithLeader, List<Long> versions) static org.apache.solr.common.SolrDocumenttoSolrDoc(org.apache.solr.common.SolrInputDocument sdoc, IndexSchema schema) Converts a SolrInputDocument to SolrDocument, using an IndexSchema instance.static org.apache.solr.common.SolrDocumenttoSolrDoc(org.apache.solr.common.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, setNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.solr.util.plugin.NamedListInitializedPlugin
initMethods inherited from interface org.apache.solr.metrics.SolrMetricProducer
close
-
Field Details
-
COMPONENT_NAME
- See Also:
-
DELETED
public static org.apache.solr.common.SolrInputDocument DELETED
-
-
Constructor Details
-
RealTimeGetComponent
public RealTimeGetComponent()
-
-
Method Details
-
prepare
Description copied from class:SearchComponentPrepare 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:
preparein classSearchComponent- Parameters:
rb- TheResponseBuilder- Throws:
IOException- If there is a low-level I/O error.
-
process
Description copied from class:SearchComponentProcess the request for this component- Specified by:
processin classSearchComponent- Parameters:
rb- TheResponseBuilder- Throws:
IOException- If there is a low-level I/O error.
-
getInputDocumentFromTlog
public static org.apache.solr.common.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
public static org.apache.solr.common.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.DOCorRealTimeGetComponent.Resolution.ROOT_WITH_CHILDREN.- Throws:
IOException- See Also:
-
toSolrDoc
public static org.apache.solr.common.SolrDocument toSolrDoc(org.apache.solr.common.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 org.apache.solr.common.SolrDocument toSolrDoc(org.apache.solr.common.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
Description copied from class:SearchComponentProcess for a distributed search.- Overrides:
distributedProcessin classSearchComponent- Returns:
- the next stage for this component
- Throws:
IOException
-
createSubRequests
- Throws:
IOException
-
finishStage
Description copied from class:SearchComponentCalled after all responses have been received for this stage. Useful when different requests are sent to each shard.- Overrides:
finishStagein classSearchComponent
-
getDescription
Description copied from interface:SolrInfoBeanSimple one or two line description- Specified by:
getDescriptionin interfaceSolrInfoBean- Specified by:
getDescriptionin classSearchComponent
-
getCategory
Description copied from interface:SolrInfoBeanCategory of this component- Specified by:
getCategoryin interfaceSolrInfoBean- Overrides:
getCategoryin classSearchComponent
-
processGetFingeprint
- Throws:
IOException
-
processGetVersions
- Throws:
IOException
-
processSyncWithLeader
public void processSyncWithLeader(ResponseBuilder rb, int nVersions, String syncWithLeader, List<Long> versions) -
processSync
-
processGetUpdates
- Throws:
IOException
-