Class NoOpEngine

java.lang.Object
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), throw UnsupportedOperationException. However, NoOpEngine allows to trim any existing translog files through the usage of the {trimUnreferencedTranslogFiles()} method.
  • Constructor Details

  • Method Details

    • open

      protected org.apache.lucene.index.DirectoryReader open​(org.apache.lucene.index.IndexCommit commit) throws java.io.IOException
      Overrides:
      open in class ReadOnlyEngine
      Throws:
      java.io.IOException
    • segmentsStats

      public SegmentsStats segmentsStats​(boolean includeSegmentFileSizes, boolean includeUnloadedSegments)
      Description copied from class: Engine
      Global stats on segments.
      Overrides:
      segmentsStats in class Engine
    • docStats

      public DocsStats docStats()
      Description copied from class: Engine
      Returns the DocsStats for this engine
      Overrides:
      docStats in class Engine
    • trimUnreferencedTranslogFiles

      public void trimUnreferencedTranslogFiles()
      This implementation will trim existing translog files using a TranslogDeletionPolicy that retains nothing but the last translog generation from safe commit.
      Overrides:
      trimUnreferencedTranslogFiles in class ReadOnlyEngine