Class EngineTestCase


  • public abstract class EngineTestCase
    extends ESTestCase
    • Field Detail

      • shardId

        protected final ShardId shardId
      • INDEX_SETTINGS

        protected static final IndexSettings INDEX_SETTINGS
      • store

        protected Store store
      • storeReplica

        protected Store storeReplica
      • codecName

        protected java.lang.String codecName
      • primaryTranslogDir

        protected java.nio.file.Path primaryTranslogDir
      • replicaTranslogDir

        protected java.nio.file.Path replicaTranslogDir
      • primaryTerm

        protected java.util.concurrent.atomic.AtomicLong primaryTerm
      • SOURCE

        protected static final BytesArray SOURCE
    • Constructor Detail

      • EngineTestCase

        public EngineTestCase()
    • Method Detail

      • assertVisibleCount

        protected static void assertVisibleCount​(Engine engine,
                                                 int numDocs)
                                          throws java.io.IOException
        Throws:
        java.io.IOException
      • assertVisibleCount

        protected static void assertVisibleCount​(Engine engine,
                                                 int numDocs,
                                                 boolean refresh)
                                          throws java.io.IOException
        Throws:
        java.io.IOException
      • setUp

        public void setUp()
                   throws java.lang.Exception
        Overrides:
        setUp in class org.apache.lucene.util.LuceneTestCase
        Throws:
        java.lang.Exception
      • tearDown

        public void tearDown()
                      throws java.lang.Exception
        Overrides:
        tearDown in class org.apache.lucene.util.LuceneTestCase
        Throws:
        java.lang.Exception
      • testDocumentWithTextField

        protected static ParseContext.Document testDocumentWithTextField​(java.lang.String value)
      • createParsedDoc

        public static ParsedDocument createParsedDoc​(java.lang.String id,
                                                     java.lang.String routing)
      • createStore

        protected Store createStore()
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • createStore

        protected Store createStore​(org.apache.lucene.store.Directory directory)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • createStore

        protected Store createStore​(IndexSettings indexSettings,
                                    org.apache.lucene.store.Directory directory)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • createTranslog

        protected Translog createTranslog​(java.util.function.LongSupplier primaryTermSupplier)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • createTranslog

        protected Translog createTranslog​(java.nio.file.Path translogPath,
                                          java.util.function.LongSupplier primaryTermSupplier)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • createEngine

        protected InternalEngine createEngine​(Store store,
                                              java.nio.file.Path translogPath)
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • createEngine

        protected InternalEngine createEngine​(Store store,
                                              java.nio.file.Path translogPath,
                                              java.util.function.LongSupplier globalCheckpointSupplier)
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • createEngine

        protected InternalEngine createEngine​(Store store,
                                              java.nio.file.Path translogPath,
                                              java.util.function.BiFunction<java.lang.Long,java.lang.Long,LocalCheckpointTracker> localCheckpointTrackerSupplier)
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • createEngine

        protected InternalEngine createEngine​(Store store,
                                              java.nio.file.Path translogPath,
                                              java.util.function.BiFunction<java.lang.Long,java.lang.Long,LocalCheckpointTracker> localCheckpointTrackerSupplier,
                                              java.util.function.ToLongBiFunction<Engine,Engine.Operation> seqNoForOperation)
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • createEngine

        protected InternalEngine createEngine​(IndexSettings indexSettings,
                                              Store store,
                                              java.nio.file.Path translogPath,
                                              MergePolicy mergePolicy)
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • createEngine

        protected InternalEngine createEngine​(EngineConfig config)
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • generateNewSeqNo

        public static long generateNewSeqNo​(Engine engine)
        Generate a new sequence number and return it. Only works on InternalEngines
      • bytesArray

        protected static BytesArray bytesArray​(java.lang.String string)
      • newUid

        protected Term newUid​(java.lang.String id)
      • replicaIndexForDoc

        protected Engine.Index replicaIndexForDoc​(ParsedDocument doc,
                                                  long version,
                                                  long seqNo,
                                                  boolean isRetry)
      • replicaDeleteForDoc

        protected Engine.Delete replicaDeleteForDoc​(java.lang.String id,
                                                    long version,
                                                    long seqNo,
                                                    long startTime)
      • getTranslog

        public static Translog getTranslog​(Engine engine)
        Exposes a translog associated with the given engine for testing purpose.