Class MockEngineSupport


  • public final class MockEngineSupport
    extends java.lang.Object
    Support class to build MockEngines like MockInternalEngine since they need to subclass the actual engine
    • Field Detail

      • WRAP_READER_RATIO

        public static final Setting<java.lang.Double> WRAP_READER_RATIO
        Allows tests to wrap an index reader randomly with a given ratio. This is disabled by default ie. 0.0d since reader wrapping is insanely slow if AssertingDirectoryReader is used.
      • DISABLE_FLUSH_ON_CLOSE

        public static final Setting<java.lang.Boolean> DISABLE_FLUSH_ON_CLOSE
        Allows tests to prevent an engine from being flushed on close ie. to test translog recovery...
    • Method Detail

      • isFlushOnCloseDisabled

        public boolean isFlushOnCloseDisabled()
      • flushOrClose

        public org.elasticsearch.test.engine.MockEngineSupport.CloseAction flushOrClose​(org.elasticsearch.test.engine.MockEngineSupport.CloseAction originalAction)
                                                                                 throws java.io.IOException
        Returns the CloseAction to execute on the actual engine. Note this method changes the state on the first call and treats subsequent calls as if the engine passed is already closed.
        Throws:
        java.io.IOException