Package org.elasticsearch.index.engine
Class NoOpEngine
- java.lang.Object
-
- org.elasticsearch.index.engine.Engine
-
- org.elasticsearch.index.engine.ReadOnlyEngine
-
- org.elasticsearch.index.engine.NoOpEngine
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public final class NoOpEngine extends ReadOnlyEngine
NoOpEngine is an engine implementation that does nothing but the bare minimum required in order to have an engine. All attempts to do something (search, index, get), throwUnsupportedOperationException
. However, NoOpEngine allows to trim any existing translog files through the usage of the {trimUnreferencedTranslogFiles()
} method.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.elasticsearch.index.engine.Engine
Engine.CommitId, Engine.Delete, Engine.DeleteResult, Engine.EventListener, Engine.Get, Engine.GetResult, Engine.Index, Engine.IndexCommitRef, Engine.IndexResult, Engine.IndexThrottle, Engine.NoOp, Engine.NoOpLock, Engine.NoOpResult, Engine.Operation, Engine.Result, Engine.Searcher, Engine.SearcherScope, Engine.SyncedFlushResult, Engine.TranslogRecoveryRunner, Engine.Warmer
-
-
Field Summary
-
Fields inherited from class org.elasticsearch.index.engine.ReadOnlyEngine
OFF_HEAP_READER_ATTRIBUTES, translogStats
-
Fields inherited from class org.elasticsearch.index.engine.Engine
allocationId, engineConfig, eventListener, failedEngine, failEngineLock, HISTORY_UUID_KEY, isClosed, lastWriteNanos, logger, MAX_UNSAFE_AUTO_ID_TIMESTAMP_COMMIT_ID, MIN_RETAINED_SEQNO, readLock, rwl, shardId, store, SYNC_COMMIT_ID, writeLock
-
-
Constructor Summary
Constructors Constructor Description NoOpEngine(EngineConfig config)
-
Method Summary
Modifier and Type Method Description protected org.apache.lucene.index.DirectoryReader
open(org.apache.lucene.index.IndexCommit commit)
SegmentsStats
segmentsStats(boolean includeSegmentFileSizes, boolean includeUnloadedSegments)
Global stats on segments.void
trimUnreferencedTranslogFiles()
This implementation will trim existing translog files using aTranslogDeletionPolicy
that retains nothing but the last translog generation from safe commit.-
Methods inherited from class org.elasticsearch.index.engine.ReadOnlyEngine
acquireLastIndexCommit, acquireRetentionLock, acquireSafeIndexCommit, activateThrottling, advanceMaxSeqNoOfUpdatesOrDeletes, assertMaxSeqNoEqualsToGlobalCheckpoint, closeNoLock, deactivateThrottling, delete, docStats, ensureMaxSeqNoEqualsToGlobalCheckpoint, ensureTranslogSynced, estimateNumberOfHistoryOperations, fillSeqNoGaps, flush, forceMerge, get, getHistoryUUID, getIndexBufferRAMBytesUsed, getIndexThrottleTimeInMillis, getLastCommittedSegmentInfos, getLastSyncedGlobalCheckpoint, getMaxSeqNoOfUpdatesOrDeletes, getMinRetainedSeqNo, getPersistedLocalCheckpoint, getReferenceManager, getSeqNoStats, getTranslogLastWriteLocation, getTranslogStats, getWritingBytes, hasCompleteOperationHistory, index, isThrottled, isTranslogSyncNeeded, maybePruneDeletes, maybeRefresh, newChangesSnapshot, noOp, processReader, readHistoryOperations, recoverFromTranslog, refresh, refreshNeeded, restoreLocalHistoryFromTranslog, rollTranslogGeneration, segments, shouldPeriodicallyFlush, shouldRollTranslogGeneration, skipTranslogRecovery, syncFlush, syncTranslog, trimOperationsFromTranslog, updateMaxUnsafeAutoIdTimestamp, verifyEngineBeforeIndexClosing, wrapReader, writeIndexingBuffer
-
Methods inherited from class org.elasticsearch.index.engine.Engine
acquireSearcher, acquireSearcher, close, commitStats, completionStats, config, docsStats, ensureOpen, ensureOpen, failEngine, fillSegmentStats, flush, flushAndClose, forceMerge, getFromSearcher, getLastWriteNanos, getMaxSeenAutoIdTimestamp, getMergeStats, guardedRamBytesUsed, isMergedSegment, isRecovering, maybeFailEngine, onSettingsChanged, writerSegmentStats
-
-
-
-
Constructor Detail
-
NoOpEngine
public NoOpEngine(EngineConfig config)
-
-
Method Detail
-
open
protected org.apache.lucene.index.DirectoryReader open(org.apache.lucene.index.IndexCommit commit) throws java.io.IOException
- Overrides:
open
in classReadOnlyEngine
- Throws:
java.io.IOException
-
segmentsStats
public SegmentsStats segmentsStats(boolean includeSegmentFileSizes, boolean includeUnloadedSegments)
Description copied from class:Engine
Global stats on segments.- Overrides:
segmentsStats
in classEngine
-
trimUnreferencedTranslogFiles
public void trimUnreferencedTranslogFiles()
This implementation will trim existing translog files using aTranslogDeletionPolicy
that retains nothing but the last translog generation from safe commit.- Overrides:
trimUnreferencedTranslogFiles
in classReadOnlyEngine
-
-