java.lang.Object
org.elasticsearch.index.engine.SearchBasedChangesSnapshot
org.elasticsearch.index.engine.LuceneChangesSnapshot
- All Implemented Interfaces:
Closeable,AutoCloseable,Translog.Snapshot
A
Translog.Snapshot from changes in a Lucene index-
Field Summary
Fields inherited from class org.elasticsearch.index.engine.SearchBasedChangesSnapshot
DEFAULT_BATCH_SIZE, fromSeqNo, requiredFullRange, searchBatchSize, toSeqNoFields inherited from interface org.elasticsearch.index.translog.Translog.Snapshot
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionLuceneChangesSnapshot(MapperService mapperService, Engine.Searcher engineSearcher, int searchBatchSize, long fromSeqNo, long toSeqNo, boolean requiredFullRange, boolean singleConsumer, boolean accessStats, IndexVersion indexVersionCreated) Creates a new "translog" snapshot from Lucene for reading operations whose seq# in the specified range. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected Translog.OperationAbstract method for retrieving the next operation.intThe number of operations have been skipped (overridden or trimmed) in the snapshot so far.intThe total estimated number of operations in the snapshot.Methods inherited from class org.elasticsearch.index.engine.SearchBasedChangesSnapshot
addSourceMetadata, assertDocSoftDeleted, leaves, next, nextTopDocs, setNextSourceMetadataReader
-
Constructor Details
-
LuceneChangesSnapshot
public LuceneChangesSnapshot(MapperService mapperService, Engine.Searcher engineSearcher, int searchBatchSize, long fromSeqNo, long toSeqNo, boolean requiredFullRange, boolean singleConsumer, boolean accessStats, IndexVersion indexVersionCreated) throws IOException Creates a new "translog" snapshot from Lucene for reading operations whose seq# in the specified range.- Parameters:
mapperService- the mapper service for this indexengineSearcher- the internal engine searcher which will be taken over if the snapshot is opened successfullysearchBatchSize- the number of documents should be returned by each searchfromSeqNo- the min requesting seq# - inclusivetoSeqNo- the maximum requesting seq# - inclusiverequiredFullRange- if true, the snapshot will strictly check for the existence of operations between fromSeqNo and toSeqNosingleConsumer- true if the snapshot is accessed by a single thread that creates the snapshotaccessStats- true if the stats of the snapshot can be accessed viatotalOperations()indexVersionCreated- the version on which this index was created- Throws:
IOException
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classSearchBasedChangesSnapshot- Throws:
IOException
-
totalOperations
public int totalOperations()Description copied from interface:Translog.SnapshotThe total estimated number of operations in the snapshot.- Specified by:
totalOperationsin interfaceTranslog.Snapshot- Overrides:
totalOperationsin classSearchBasedChangesSnapshot
-
skippedOperations
public int skippedOperations()Description copied from interface:Translog.SnapshotThe number of operations have been skipped (overridden or trimmed) in the snapshot so far. UnlikeTranslog.Snapshot.totalOperations(), this value is updated each time afterTranslog.Snapshot.next()) is called. -
nextOperation
Description copied from class:SearchBasedChangesSnapshotAbstract method for retrieving the next operation. Should be implemented by subclasses.- Specified by:
nextOperationin classSearchBasedChangesSnapshot- Returns:
- The next Translog.Operation in the snapshot.
- Throws:
IOException- If an I/O error occurs.
-