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, toSeqNo
Fields 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 TypeMethodDescriptionvoid
close()
protected Translog.Operation
Abstract method for retrieving the next operation.int
The number of operations have been skipped (overridden or trimmed) in the snapshot so far.int
The 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classSearchBasedChangesSnapshot
- Throws:
IOException
-
totalOperations
public int totalOperations()Description copied from interface:Translog.Snapshot
The total estimated number of operations in the snapshot.- Specified by:
totalOperations
in interfaceTranslog.Snapshot
- Overrides:
totalOperations
in classSearchBasedChangesSnapshot
-
skippedOperations
public int skippedOperations()Description copied from interface:Translog.Snapshot
The 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:SearchBasedChangesSnapshot
Abstract method for retrieving the next operation. Should be implemented by subclasses.- Specified by:
nextOperation
in classSearchBasedChangesSnapshot
- Returns:
- The next Translog.Operation in the snapshot.
- Throws:
IOException
- If an I/O error occurs.
-