Package org.elasticsearch.test.engine
Class MockEngineSupport
java.lang.Object
org.elasticsearch.test.engine.MockEngineSupport
Support class to build MockEngines like
MockInternalEngine
since they need to subclass the actual engine-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionAllows tests to prevent an engine from being flushed on close ie.Allows tests to wrap an index reader randomly with a given ratio. -
Constructor Summary
ConstructorsConstructorDescriptionMockEngineSupport(EngineConfig config, Class<? extends org.apache.lucene.index.FilterDirectoryReader> wrapper) -
Method Summary
Modifier and TypeMethodDescriptionorg.elasticsearch.test.engine.MockEngineSupport.CloseActionflushOrClose(org.elasticsearch.test.engine.MockEngineSupport.CloseAction originalAction) Returns the CloseAction to execute on the actual engine.booleanorg.apache.lucene.index.IndexReadernewReader(org.apache.lucene.index.IndexReader reader) wrapSearcher(Engine.Searcher searcher)
-
Field Details
-
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
Allows tests to prevent an engine from being flushed on close ie. to test translog recovery...
-
-
Constructor Details
-
MockEngineSupport
public MockEngineSupport(EngineConfig config, Class<? extends org.apache.lucene.index.FilterDirectoryReader> wrapper)
-
-
Method Details
-
isFlushOnCloseDisabled
public boolean isFlushOnCloseDisabled() -
flushOrClose
public org.elasticsearch.test.engine.MockEngineSupport.CloseAction flushOrClose(org.elasticsearch.test.engine.MockEngineSupport.CloseAction originalAction) throws 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:
IOException
-
newReader
public org.apache.lucene.index.IndexReader newReader(org.apache.lucene.index.IndexReader reader) throws EngineException - Throws:
EngineException
-
wrapSearcher
-