public class RealTimeGetComponent extends SearchComponent
Modifier and Type | Class and Description |
---|---|
static class |
RealTimeGetComponent.Resolution
Lookup strategy for
getInputDocument(SolrCore, BytesRef, AtomicLong, Set, Resolution) . |
SolrInfoBean.Category, SolrInfoBean.Group
Modifier and Type | Field and Description |
---|---|
static String |
COMPONENT_NAME |
static SolrInputDocument |
DELETED |
metricNames, registry, standard_components
Constructor and Description |
---|
RealTimeGetComponent() |
Modifier and Type | Method and Description |
---|---|
int |
createSubRequests(ResponseBuilder rb) |
int |
distributedProcess(ResponseBuilder rb)
Process for a distributed search.
|
void |
finishStage(ResponseBuilder rb)
private void handleRegularResponses(ResponseBuilder rb, ShardRequest sreq) {
}
|
SolrInfoBean.Category |
getCategory()
Category of this component
|
String |
getDescription()
Simple one or two line description
|
static SolrInputDocument |
getInputDocument(SolrCore core,
BytesRef idBytes,
AtomicLong versionReturned,
Set<String> onlyTheseNonStoredDVs,
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,
BytesRef idBytes,
RealTimeGetComponent.Resolution lookupStrategy)
Obtains the latest document for a given id from the tlog or index (if not found in the tlog).
|
static SolrInputDocument |
getInputDocumentFromTlog(SolrCore core,
BytesRef idBytes,
AtomicLong versionReturned,
Set<String> onlyTheseNonStoredDVs,
boolean resolveFullDocument)
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 component
|
void |
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.
|
getMetricNames, getMetricRegistry, getName, handleResponses, init, modifyRequest, setName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMetricsSnapshot, registerMetricName
public static final String COMPONENT_NAME
public static SolrInputDocument DELETED
public void prepare(ResponseBuilder rb) throws IOException
SearchComponent
SearchComponent.process(org.apache.solr.handler.component.ResponseBuilder)
method.
Called for every incoming request.
The place to do initialization that is request dependent.prepare
in class SearchComponent
rb
- The ResponseBuilder
IOException
- If there is a low-level I/O error.public void process(ResponseBuilder rb) throws IOException
SearchComponent
process
in class SearchComponent
rb
- The ResponseBuilder
IOException
- If there is a low-level I/O error.public static SolrInputDocument getInputDocumentFromTlog(SolrCore core, BytesRef idBytes, AtomicLong versionReturned, Set<String> onlyTheseNonStoredDVs, boolean resolveFullDocument)
versionReturned
- If a non-null AtomicLong is passed in, it is set to the version of the update returned from the TLog.resolveFullDocument
- In case the document is fetched from the tlog, it could only be a partial document if the last update
was an in-place update. In that case, should this partial document be resolved to a full document (by following
back prevPointer/prevVersion)?public static SolrInputDocument getInputDocument(SolrCore core, BytesRef idBytes, RealTimeGetComponent.Resolution lookupStrategy) throws IOException
getInputDocument(SolrCore, BytesRef, AtomicLong, Set, Resolution)
,
so as to retrieve all stored and non-stored DV fields from all documents.IOException
public static SolrInputDocument getInputDocument(SolrCore core, BytesRef idBytes, AtomicLong versionReturned, Set<String> onlyTheseNonStoredDVs, RealTimeGetComponent.Resolution resolveStrategy) throws IOException
versionReturned
- If a non-null AtomicLong is passed in, it is set to the version of the update returned from the TLog.onlyTheseNonStoredDVs
- If not-null, populate only these DV fields in the document fetched through the realtime searcher.
If this is null, decorate all non-stored DVs (that are not targets of copy fields) from the searcher.
When non-null, stored fields are not fetched.resolveStrategy
- The strategy to resolve the the document.IOException
RealTimeGetComponent.Resolution
public static SolrDocument toSolrDoc(SolrInputDocument sdoc, IndexSchema schema)
public static SolrDocument toSolrDoc(SolrInputDocument sdoc, IndexSchema schema, boolean forInPlaceUpdate)
sdoc
- The input document.schema
- The index schema.forInPlaceUpdate
- Whether the document is being used for an in place update,
see DocumentBuilder.toDocument(SolrInputDocument, IndexSchema, boolean, boolean)
public int distributedProcess(ResponseBuilder rb) throws IOException
SearchComponent
distributedProcess
in class SearchComponent
IOException
public int createSubRequests(ResponseBuilder rb) throws IOException
IOException
public void finishStage(ResponseBuilder rb)
finishStage
in class SearchComponent
public String getDescription()
SolrInfoBean
getDescription
in interface SolrInfoBean
getDescription
in class SearchComponent
public SolrInfoBean.Category getCategory()
SolrInfoBean
getCategory
in interface SolrInfoBean
getCategory
in class SearchComponent
public void processGetFingeprint(ResponseBuilder rb) throws IOException
IOException
public void processGetVersions(ResponseBuilder rb) throws IOException
IOException
public void processSyncWithLeader(ResponseBuilder rb, int nVersions, String syncWithLeader, List<Long> versions)
public void processSync(ResponseBuilder rb, int nVersions, String sync)
public void processGetUpdates(ResponseBuilder rb) throws IOException
IOException
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.