Package org.elasticsearch.test.engine
Class MockEngineSupport
- java.lang.Object
-
- org.elasticsearch.test.engine.MockEngineSupport
-
public final class MockEngineSupport extends java.lang.ObjectSupport class to build MockEngines likeMockInternalEnginesince they need to subclass the actual engine
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMockEngineSupport.DirectoryReaderWrapperstatic classMockEngineSupport.MockContext
-
Field Summary
Fields Modifier and Type Field Description static Setting<java.lang.Boolean>DISABLE_FLUSH_ON_CLOSEAllows tests to prevent an engine from being flushed on close ie.static Setting<java.lang.Double>WRAP_READER_RATIOAllows tests to wrap an index reader randomly with a given ratio.
-
Constructor Summary
Constructors Constructor Description MockEngineSupport(EngineConfig config, java.lang.Class<? extends FilterDirectoryReader> wrapper)
-
Method Summary
Modifier and Type Method Description org.elasticsearch.test.engine.MockEngineSupport.CloseActionflushOrClose(org.elasticsearch.test.engine.MockEngineSupport.CloseAction originalAction)Returns the CloseAction to execute on the actual engine.booleanisFlushOnCloseDisabled()AssertingIndexSearchernewSearcher(Engine.Searcher searcher)Engine.SearcherwrapSearcher(Engine.Searcher engineSearcher)
-
-
-
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.0dsince reader wrapping is insanely slow ifAssertingDirectoryReaderis 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...
-
-
Constructor Detail
-
MockEngineSupport
public MockEngineSupport(EngineConfig config, java.lang.Class<? extends FilterDirectoryReader> wrapper)
-
-
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.IOExceptionReturns 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
-
newSearcher
public AssertingIndexSearcher newSearcher(Engine.Searcher searcher) throws EngineException
- Throws:
EngineException
-
wrapSearcher
public Engine.Searcher wrapSearcher(Engine.Searcher engineSearcher)
-
-