Class ReadOnlyEngine

java.lang.Object
org.elasticsearch.index.engine.Engine
org.elasticsearch.index.engine.ReadOnlyEngine
All Implemented Interfaces:
java.io.Closeable, java.lang.AutoCloseable
Direct Known Subclasses:
NoOpEngine

public class ReadOnlyEngine
extends Engine
A basic read-only engine that allows switching a shard to be true read-only temporarily or permanently. Note: this engine can be opened side-by-side with a read-write engine but will not reflect any changes made to the read-write engine.
See Also:
ReadOnlyEngine(EngineConfig, SeqNoStats, TranslogStats, boolean, Function, boolean)
  • Field Details

  • Constructor Details

    • ReadOnlyEngine

      public ReadOnlyEngine​(EngineConfig config, SeqNoStats seqNoStats, TranslogStats translogStats, boolean obtainLock, java.util.function.Function<org.apache.lucene.index.DirectoryReader,​org.apache.lucene.index.DirectoryReader> readerWrapperFunction, boolean requireCompleteHistory)
      Creates a new ReadOnlyEngine. This ctor can also be used to open a read-only engine on top of an already opened read-write engine. It allows to optionally obtain the writer locks for the shard which would time-out if another engine is still open.
      Parameters:
      config - the engine configuration
      seqNoStats - sequence number statistics for this engine or null if not provided
      translogStats - translog stats for this engine or null if not provided
      obtainLock - if true this engine will try to obtain the IndexWriter.WRITE_LOCK_NAME lock. Otherwise the lock won't be obtained
      readerWrapperFunction - allows to wrap the index-reader for this engine.
      requireCompleteHistory - indicates whether this engine permits an incomplete history (i.e. LCP < MSN)
  • Method Details