java.lang.Object
org.elasticsearch.index.engine.Engine
org.elasticsearch.index.engine.ReadOnlyEngine
org.elasticsearch.index.engine.frozen.FrozenEngine
- All Implemented Interfaces:
Closeable,AutoCloseable
This is a stand-alone read-only engine that maintains an index reader that is opened lazily on calls to
Engine.SearcherSupplier.acquireSearcher(String). The index reader opened is maintained until there are no reference to it anymore
and then releases itself from the engine.
This is necessary to for instance release all SegmentReaders after a search phase finishes and reopen them before the next search
phase starts.
This together with a throttled threadpool (search_throttled) guarantees that at most N frozen shards have a low level index reader
open at the same time.
The internal reopen of readers is treated like a refresh and refresh listeners are called up-on reopen. This allows to consume refresh
stats in order to obtain the number of reopens.-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.index.engine.Engine
Engine.Delete, Engine.DeleteResult, Engine.EventListener, Engine.FlushResult, Engine.Get, Engine.GetResult, Engine.Index, Engine.IndexCommitListener, Engine.IndexCommitRef, Engine.IndexResult, Engine.IndexThrottle, Engine.NoOp, Engine.NoOpLock, Engine.NoOpResult, Engine.Operation, Engine.RefreshResult, Engine.Result, Engine.Searcher, Engine.SearcherScope, Engine.SearcherSupplier, Engine.TranslogRecoveryRunner, Engine.Warmer -
Field Summary
Fields inherited from class org.elasticsearch.index.engine.ReadOnlyEngine
FIELD_RANGE_SEARCH_SOURCE, translogStatsFields inherited from class org.elasticsearch.index.engine.Engine
CAN_MATCH_SEARCH_SOURCE, DOC_STATS_SOURCE, enableRecoverySource, engineConfig, ES_VERSION, eventListener, failedEngine, failEngineLock, FORCE_MERGE_UUID_KEY, HISTORY_UUID_KEY, isClosed, lastWriteNanos, logger, MAX_UNSAFE_AUTO_ID_TIMESTAMP_COMMIT_ID, MIN_RETAINED_SEQNO, pauseIndexingOnThrottle, ROOT_DOC_FIELD_NAME, SEARCH_SOURCE, SEGMENTS_STATS_SOURCE, shardId, store, UNKNOWN_PRIMARY_TERM -
Constructor Summary
ConstructorsConstructorDescriptionFrozenEngine(EngineConfig config, boolean requireCompleteHistory, boolean lazilyLoadSoftDeletes) FrozenEngine(EngineConfig config, SeqNoStats seqNoStats, TranslogStats translogStats, boolean obtainLock, Function<org.apache.lucene.index.DirectoryReader, org.apache.lucene.index.DirectoryReader> readerWrapperFunction, boolean requireCompleteHistory, boolean lazilyLoadSoftDeletes) -
Method Summary
Modifier and TypeMethodDescriptionacquireSearcherSupplier(Function<Engine.Searcher, Engine.Searcher> wrapper, Engine.SearcherScope scope) protected voidcloseNoLock(String reason, CountDownLatch closedLatch) denseVectorStats(MappingLookup mappingLookup) docStats()protected org.apache.lucene.index.DirectoryReaderopen(org.apache.lucene.index.IndexCommit indexCommit) segmentsStats(boolean includeSegmentFileSizes, boolean includeUnloadedSegments) sparseVectorStats(MappingLookup mappingLookup) Methods inherited from class org.elasticsearch.index.engine.ReadOnlyEngine
acquireHistoryRetentionLock, acquireLastIndexCommit, acquireSafeIndexCommit, activateThrottling, advanceMaxSeqNoOfUpdatesOrDeletes, assertMaxSeqNoEqualsToGlobalCheckpoint, asyncEnsureGlobalCheckpointSynced, asyncEnsureTranslogSynced, completionStats, countChanges, deactivateThrottling, delete, ensureMaxSeqNoEqualsToGlobalCheckpoint, fillSeqNoGaps, flushHoldingLock, forceMerge, get, getCommitId, getHistoryUUID, getIndexBufferRAMBytesUsed, getIndexThrottleTimeInMillis, getLastCommittedSegmentInfos, getLastSyncedGlobalCheckpoint, getMaxSeqNo, getMaxSeqNoOfUpdatesOrDeletes, getMinRetainedSeqNo, getPersistedLocalCheckpoint, getProcessedLocalCheckpoint, getRawFieldRange, getReferenceManager, getSafeCommitInfo, getSeqNoStats, getTranslogLastWriteLocation, getTranslogStats, getWritingBytes, hasCompleteOperationHistory, index, isThrottled, isTranslogSyncNeeded, maybePruneDeletes, maybeRefresh, newChangesSnapshot, noOp, openDirectory, recoverFromTranslog, refresh, refreshNeeded, restoreLocalHistoryFromTranslog, resumeThrottling, rollTranslogGeneration, segments, segments, shouldPeriodicallyFlush, shouldRollTranslogGeneration, skipTranslogRecovery, suspendThrottling, syncTranslog, trimOperationsFromTranslog, trimUnreferencedTranslogFiles, updateMaxUnsafeAutoIdTimestamp, verifyEngineBeforeIndexClosing, wrapReader, writeIndexingBufferMethods inherited from class org.elasticsearch.index.engine.Engine
acquireEnsureOpenRef, acquireIndexCommitForSnapshot, acquireSearcher, acquireSearcher, acquireSearcher, acquireSearcherSupplier, addFlushListener, addPrimaryTermAndGenerationListener, addSegmentGenerationListener, allowSearchIdleOptimization, awaitPendingClose, buildSeqNoStats, close, commitStats, config, denseVectorStats, docsStats, ensureOpen, ensureOpen, externalRefresh, failEngine, fillSegmentStats, flush, flush, flush, flushAndClose, getEngineConfig, getFromSearcher, getFromTranslog, getLastUnsafeSegmentGenerationForGets, getLastWriteNanos, getMaxSeenAutoIdTimestamp, getMergeStats, getTotalFlushTimeExcludingWaitingOnLockInMillis, isClosing, isDocumentInLiveVersionMap, isDrainedForClose, maybeFailEngine, onSearcherCreation, onSettingsChanged, prepareForEngineReset, readIndexVersion, recoverFromTranslog, shardFieldInfos, shardFieldStats, shardFieldStats, sparseVectorStats, wrapForAssertions, writerSegmentStats
-
Constructor Details
-
FrozenEngine
public FrozenEngine(EngineConfig config, boolean requireCompleteHistory, boolean lazilyLoadSoftDeletes) -
FrozenEngine
public FrozenEngine(EngineConfig config, SeqNoStats seqNoStats, TranslogStats translogStats, boolean obtainLock, Function<org.apache.lucene.index.DirectoryReader, org.apache.lucene.index.DirectoryReader> readerWrapperFunction, boolean requireCompleteHistory, boolean lazilyLoadSoftDeletes)
-
-
Method Details
-
open
protected org.apache.lucene.index.DirectoryReader open(org.apache.lucene.index.IndexCommit indexCommit) throws IOException - Overrides:
openin classReadOnlyEngine- Throws:
IOException
-
acquireSearcherSupplier
public Engine.SearcherSupplier acquireSearcherSupplier(Function<Engine.Searcher, Engine.Searcher> wrapper, Engine.SearcherScope scope) throws EngineException- Overrides:
acquireSearcherSupplierin classReadOnlyEngine- Throws:
EngineException
-
segmentsStats
public SegmentsStats segmentsStats(boolean includeSegmentFileSizes, boolean includeUnloadedSegments) - Overrides:
segmentsStatsin classEngine
-
closeNoLock
- Overrides:
closeNoLockin classReadOnlyEngine
-
docStats
-
denseVectorStats
- Overrides:
denseVectorStatsin classEngine
-
sparseVectorStats
- Overrides:
sparseVectorStatsin classEngine
-