Class EngineTestCase
java.lang.Object
org.junit.Assert
org.apache.lucene.tests.util.LuceneTestCase
org.opensearch.test.OpenSearchTestCase
org.opensearch.index.engine.EngineTestCase
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic final classNested classes/interfaces inherited from class org.opensearch.test.OpenSearchTestCase
OpenSearchTestCase.AnnotatedFeatureFlagRule, OpenSearchTestCase.GeohashGenerator, OpenSearchTestCase.LockFeatureFlag, OpenSearchTestCase.TestAnalysisNested classes/interfaces inherited from class org.apache.lucene.tests.util.LuceneTestCase
org.apache.lucene.tests.util.LuceneTestCase.AwaitsFix, org.apache.lucene.tests.util.LuceneTestCase.Concurrency, org.apache.lucene.tests.util.LuceneTestCase.Monster, org.apache.lucene.tests.util.LuceneTestCase.Nightly, org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs, org.apache.lucene.tests.util.LuceneTestCase.SuppressFileSystems, org.apache.lucene.tests.util.LuceneTestCase.SuppressFsync, org.apache.lucene.tests.util.LuceneTestCase.SuppressReproduceLine, org.apache.lucene.tests.util.LuceneTestCase.SuppressSysoutChecks, org.apache.lucene.tests.util.LuceneTestCase.SuppressTempFileChecks, org.apache.lucene.tests.util.LuceneTestCase.ThrowingConsumer<T>, org.apache.lucene.tests.util.LuceneTestCase.ThrowingRunnable, org.apache.lucene.tests.util.LuceneTestCase.Weekly -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.opensearch.cluster.routing.AllocationIdprotected static final org.opensearch.core.common.bytes.BytesReferenceprotected static final org.opensearch.core.common.bytes.BytesReferenceprotected static final org.opensearch.core.common.bytes.BytesReferenceprotected Stringprotected org.opensearch.index.IndexSettingsprotected org.opensearch.index.engine.InternalEngineprotected static final org.opensearch.index.IndexSettingsprotected final EngineTestCase.PrimaryTermSupplierprotected Pathprotected org.opensearch.index.engine.InternalEngineprotected Pathprotected final org.opensearch.core.index.shard.ShardIdprotected static final org.opensearch.core.common.bytes.BytesArrayprotected org.opensearch.index.store.Storeprotected org.opensearch.index.store.Storeprotected org.opensearch.threadpool.ThreadPoolprotected TranslogHandlerFields inherited from class org.opensearch.test.OpenSearchTestCase
checkIndexFailures, DEFAULT_NAMED_WRITABLE_REGISTRY, DEFAULT_TEST_WORKER_ID, failureAndSuccessEvents, flagLockRule, JAVA_TIMEZONE_IDS, JAVA_ZONE_IDS, JODA_TIMEZONE_IDS, logger, TEST_WORKER_SYS_PROPERTY, TEST_WORKER_VM_IDFields inherited from class org.apache.lucene.tests.util.LuceneTestCase
assertsAreEnabled, classRules, DEFAULT_LINE_DOCS_FILE, INFOSTREAM, JENKINS_LARGE_LINE_DOCS_FILE, LEAVE_TEMPORARY, MAYBE_CACHE_POLICY, RANDOM_MULTIPLIER, ruleChain, suiteFailureMarker, SYSPROP_AWAITSFIX, SYSPROP_FAILFAST, SYSPROP_MAXFAILURES, SYSPROP_MONSTER, SYSPROP_NIGHTLY, SYSPROP_WEEKLY, TEST_ASSERTS_ENABLED, TEST_AWAITSFIX, TEST_CODEC, TEST_DIRECTORY, TEST_DOCVALUESFORMAT, TEST_LINE_DOCS_FILE, TEST_MONSTER, TEST_NIGHTLY, TEST_POSTINGSFORMAT, TEST_THROTTLING, TEST_WEEKLY, VERBOSE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.opensearch.index.engine.Engine.ResultapplyOperation(org.opensearch.index.engine.Engine engine, org.opensearch.index.engine.Engine.Operation operation) static voidapplyOperations(org.opensearch.index.engine.Engine engine, List<org.opensearch.index.engine.Engine.Operation> operations) protected org.opensearch.index.translog.InternalTranslogManagerassertAndGetInternalTranslogManager(org.opensearch.index.translog.TranslogManager translogManager) static voidassertAtMostOneLuceneDocumentPerSequenceNumber(org.opensearch.index.engine.Engine engine) static voidassertAtMostOneLuceneDocumentPerSequenceNumber(org.opensearch.index.IndexSettings indexSettings, org.apache.lucene.index.DirectoryReader reader) static voidassertConsistentHistoryBetweenTranslogAndLuceneIndex(org.opensearch.index.engine.Engine engine) Asserts the provided engine has a consistent document history between translog and Lucene index.protected voidassertEngineCleanedUp(org.opensearch.index.engine.Engine engine, org.opensearch.index.translog.TranslogDeletionPolicy translogDeletionPolicy) static voidassertMaxSeqNoInCommitUserData(org.opensearch.index.engine.Engine engine) Asserts that the max_seq_no stored in the commit's user_data is never smaller than seq_no of any document in the commit.static voidassertNoInFlightDocuments(org.opensearch.index.engine.Engine engine) static voidassertOpsOnReplica(List<org.opensearch.index.engine.Engine.Operation> ops, org.opensearch.index.engine.InternalEngine replicaEngine, boolean shuffleOps, org.apache.logging.log4j.Logger logger) protected static voidassertVisibleCount(org.opensearch.index.engine.Engine engine, int numDocs, boolean refresh) protected static voidassertVisibleCount(org.opensearch.index.engine.InternalEngine engine, int numDocs) protected static voidassertVisibleCount(org.opensearch.index.engine.InternalEngine engine, int numDocs, boolean refresh) protected static org.opensearch.core.common.bytes.BytesArraybytesArray(String string) static voidconcurrentlyApplyOps(List<org.opensearch.index.engine.Engine.Operation> ops, org.opensearch.index.engine.InternalEngine engine) protected org.opensearch.index.engine.EngineConfigconfig(org.opensearch.index.engine.EngineConfig config, Supplier<org.opensearch.index.mapper.DocumentMapperForType> documentMapperForTypeSupplier, org.opensearch.cluster.service.ClusterApplierService clusterApplierService) Override config with ingestion engine configsprotected org.opensearch.index.engine.EngineConfigconfig(org.opensearch.index.engine.EngineConfig config, org.opensearch.index.store.Store store, Path translogPath, org.opensearch.index.engine.EngineConfig.TombstoneDocSupplier tombstoneDocSupplier) org.opensearch.index.engine.EngineConfigconfig(org.opensearch.index.IndexSettings indexSettings, org.opensearch.index.store.Store store, Path translogPath, org.apache.lucene.index.MergePolicy mergePolicy, org.apache.lucene.search.ReferenceManager.RefreshListener refreshListener) org.opensearch.index.engine.EngineConfigconfig(org.opensearch.index.IndexSettings indexSettings, org.opensearch.index.store.Store store, Path translogPath, org.apache.lucene.index.MergePolicy mergePolicy, org.apache.lucene.search.ReferenceManager.RefreshListener externalRefreshListener, org.apache.lucene.search.ReferenceManager.RefreshListener internalRefreshListener, org.apache.lucene.search.Sort indexSort, LongSupplier maybeGlobalCheckpointSupplier, Supplier<org.opensearch.index.seqno.RetentionLeases> maybeRetentionLeasesSupplier, org.opensearch.core.indices.breaker.CircuitBreakerService breakerService) org.opensearch.index.engine.EngineConfigconfig(org.opensearch.index.IndexSettings indexSettings, org.opensearch.index.store.Store store, Path translogPath, org.apache.lucene.index.MergePolicy mergePolicy, org.apache.lucene.search.ReferenceManager.RefreshListener externalRefreshListener, org.apache.lucene.search.ReferenceManager.RefreshListener internalRefreshListener, org.apache.lucene.search.Sort indexSort, LongSupplier maybeGlobalCheckpointSupplier, Supplier<org.opensearch.index.seqno.RetentionLeases> maybeRetentionLeasesSupplier, org.opensearch.core.indices.breaker.CircuitBreakerService breakerService, org.opensearch.index.engine.Engine.EventListener eventListener) org.opensearch.index.engine.EngineConfigconfig(org.opensearch.index.IndexSettings indexSettings, org.opensearch.index.store.Store store, Path translogPath, org.apache.lucene.index.MergePolicy mergePolicy, org.apache.lucene.search.ReferenceManager.RefreshListener externalRefreshListener, org.apache.lucene.search.ReferenceManager.RefreshListener internalRefreshListener, org.apache.lucene.search.Sort indexSort, LongSupplier maybeGlobalCheckpointSupplier, org.opensearch.core.indices.breaker.CircuitBreakerService breakerService) org.opensearch.index.engine.EngineConfigconfig(org.opensearch.index.IndexSettings indexSettings, org.opensearch.index.store.Store store, Path translogPath, org.apache.lucene.index.MergePolicy mergePolicy, org.apache.lucene.search.ReferenceManager.RefreshListener refreshListener, org.apache.lucene.search.Sort indexSort, LongSupplier globalCheckpointSupplier) org.opensearch.index.engine.EngineConfigconfig(org.opensearch.index.IndexSettings indexSettings, org.opensearch.index.store.Store store, Path translogPath, org.apache.lucene.index.MergePolicy mergePolicy, org.apache.lucene.search.ReferenceManager.RefreshListener refreshListener, org.apache.lucene.search.Sort indexSort, LongSupplier globalCheckpointSupplier, Supplier<org.opensearch.index.seqno.RetentionLeases> retentionLeasesSupplier) org.opensearch.index.engine.EngineConfigcopy(org.opensearch.index.engine.EngineConfig config, LongSupplier globalCheckpointSupplier) org.opensearch.index.engine.EngineConfigcopy(org.opensearch.index.engine.EngineConfig config, org.apache.lucene.analysis.Analyzer analyzer) org.opensearch.index.engine.EngineConfigcopy(org.opensearch.index.engine.EngineConfig config, org.apache.lucene.index.MergePolicy mergePolicy) protected org.opensearch.index.engine.InternalEnginecreateEngine(org.opensearch.index.engine.EngineConfig config) static org.opensearch.index.engine.InternalEnginecreateEngine(org.opensearch.index.engine.EngineConfig engineConfig, int maxDocs) protected org.opensearch.index.engine.InternalEnginecreateEngine(EngineTestCase.IndexWriterFactory indexWriterFactory, BiFunction<Long, Long, org.opensearch.index.seqno.LocalCheckpointTracker> localCheckpointTrackerSupplier, ToLongBiFunction<org.opensearch.index.engine.Engine, org.opensearch.index.engine.Engine.Operation> seqNoForOperation, org.opensearch.index.engine.EngineConfig config) protected org.opensearch.index.engine.InternalEnginecreateEngine(org.opensearch.index.IndexSettings indexSettings, org.opensearch.index.store.Store store, Path translogPath, org.apache.lucene.index.MergePolicy mergePolicy) protected org.opensearch.index.engine.InternalEnginecreateEngine(org.opensearch.index.IndexSettings indexSettings, org.opensearch.index.store.Store store, Path translogPath, org.apache.lucene.index.MergePolicy mergePolicy, EngineTestCase.IndexWriterFactory indexWriterFactory) protected org.opensearch.index.engine.InternalEnginecreateEngine(org.opensearch.index.IndexSettings indexSettings, org.opensearch.index.store.Store store, Path translogPath, org.apache.lucene.index.MergePolicy mergePolicy, EngineTestCase.IndexWriterFactory indexWriterFactory, BiFunction<Long, Long, org.opensearch.index.seqno.LocalCheckpointTracker> localCheckpointTrackerSupplier, LongSupplier globalCheckpointSupplier) protected org.opensearch.index.engine.InternalEnginecreateEngine(org.opensearch.index.IndexSettings indexSettings, org.opensearch.index.store.Store store, Path translogPath, org.apache.lucene.index.MergePolicy mergePolicy, EngineTestCase.IndexWriterFactory indexWriterFactory, BiFunction<Long, Long, org.opensearch.index.seqno.LocalCheckpointTracker> localCheckpointTrackerSupplier, LongSupplier globalCheckpointSupplier, ToLongBiFunction<org.opensearch.index.engine.Engine, org.opensearch.index.engine.Engine.Operation> seqNoForOperation) protected org.opensearch.index.engine.InternalEnginecreateEngine(org.opensearch.index.IndexSettings indexSettings, org.opensearch.index.store.Store store, Path translogPath, org.apache.lucene.index.MergePolicy mergePolicy, EngineTestCase.IndexWriterFactory indexWriterFactory, BiFunction<Long, Long, org.opensearch.index.seqno.LocalCheckpointTracker> localCheckpointTrackerSupplier, ToLongBiFunction<org.opensearch.index.engine.Engine, org.opensearch.index.engine.Engine.Operation> seqNoForOperation, org.apache.lucene.search.Sort indexSort, LongSupplier globalCheckpointSupplier) protected org.opensearch.index.engine.InternalEnginecreateEngine(org.opensearch.index.store.Store store, Path translogPath) protected org.opensearch.index.engine.InternalEnginecreateEngine(org.opensearch.index.store.Store store, Path translogPath, BiFunction<Long, Long, org.opensearch.index.seqno.LocalCheckpointTracker> localCheckpointTrackerSupplier) protected org.opensearch.index.engine.InternalEnginecreateEngine(org.opensearch.index.store.Store store, Path translogPath, BiFunction<Long, Long, org.opensearch.index.seqno.LocalCheckpointTracker> localCheckpointTrackerSupplier, ToLongBiFunction<org.opensearch.index.engine.Engine, org.opensearch.index.engine.Engine.Operation> seqNoForOperation) protected org.opensearch.index.engine.InternalEnginecreateEngine(org.opensearch.index.store.Store store, Path translogPath, LongSupplier globalCheckpointSupplier) static org.opensearch.index.engine.InternalEnginecreateInternalEngine(EngineTestCase.IndexWriterFactory indexWriterFactory, BiFunction<Long, Long, org.opensearch.index.seqno.LocalCheckpointTracker> localCheckpointTrackerSupplier, ToLongBiFunction<org.opensearch.index.engine.Engine, org.opensearch.index.engine.Engine.Operation> seqNoForOperation, org.opensearch.index.engine.EngineConfig config) static org.opensearch.index.mapper.MapperServicestatic org.opensearch.index.mapper.MapperServicecreateMapperService(String mapping) static org.opensearch.index.mapper.ParsedDocumentcreateParsedDoc(String id, String routing) static org.opensearch.index.mapper.ParsedDocumentcreateParsedDoc(String id, String routing, boolean recoverySource) protected org.opensearch.index.store.Storeprotected org.opensearch.index.store.StorecreateStore(org.apache.lucene.store.Directory directory) protected org.opensearch.index.store.StorecreateStore(org.opensearch.index.IndexSettings indexSettings, org.apache.lucene.store.Directory directory) protected org.opensearch.index.translog.TranslogcreateTranslog(Path translogPath, LongSupplier primaryTermSupplier) protected org.opensearch.index.translog.TranslogcreateTranslog(LongSupplier primaryTermSupplier) protected TranslogHandlercreateTranslogHandler(org.opensearch.index.IndexSettings indexSettings, org.opensearch.index.engine.Engine engine) List<org.opensearch.index.engine.Engine.Operation> generateHistoryOnReplica(int numOps, boolean allowGapInSeqNo, boolean allowDuplicate, boolean includeNestedDocs) List<org.opensearch.index.engine.Engine.Operation> generateHistoryOnReplica(int numOps, boolean allowGapInSeqNo, boolean allowDuplicate, boolean includeNestedDocs, org.opensearch.index.engine.Engine.Operation.TYPE opType) static longgenerateNewSeqNo(org.opensearch.index.engine.Engine engine) Generate a new sequence number and return it.static List<org.opensearch.index.engine.Engine.Operation> generateSingleDocHistory(boolean forReplica, org.opensearch.index.VersionType versionType, long primaryTerm, int minOpCount, int maxOpCount, String docId) static List<DocIdSeqNoAndSource> getDocIds(org.opensearch.index.engine.Engine engine, boolean refresh) Gets a collection of tuples of docId, sequence number, and primary term of all live documents in the provided engine.static longgetInFlightDocCount(org.opensearch.index.engine.Engine engine) static longgetNumVersionLookups(org.opensearch.index.engine.Engine engine) Returns the number of times a version was looked up either from version map or from the index.static org.opensearch.index.translog.TransloggetTranslog(org.opensearch.index.engine.Engine engine) Exposes a translog associated with the given engine for testing purpose.static booleanhasSnapshottedCommits(org.opensearch.index.engine.Engine engine) protected org.opensearch.index.engine.Engine.IndexindexForDoc(org.opensearch.index.mapper.ParsedDocument doc) protected org.opensearch.common.settings.Settingsstatic org.opensearch.common.CheckedBiFunction<String, Integer, org.opensearch.index.mapper.ParsedDocument, IOException> protected org.opensearch.index.engine.Engine.GetnewGet(boolean realtime, org.opensearch.index.mapper.ParsedDocument doc) static org.apache.lucene.index.Termstatic org.apache.lucene.index.TermnewUid(org.opensearch.index.mapper.ParsedDocument doc) protected org.opensearch.index.engine.EngineConfignoOpConfig(org.opensearch.index.IndexSettings indexSettings, org.opensearch.index.store.Store store, Path translogPath) protected org.opensearch.index.engine.EngineConfignoOpConfig(org.opensearch.index.IndexSettings indexSettings, org.opensearch.index.store.Store store, Path translogPath, LongSupplier globalCheckpointSupplier) static List<org.opensearch.index.translog.Translog.Operation> readAllOperationsBasedOnSource(org.opensearch.index.engine.Engine engine) Reads all engine operations that have been processed by the engine from Lucene index/Translog based on source.static List<org.opensearch.index.translog.Translog.Operation> readAllOperationsInLucene(org.opensearch.index.engine.Engine engine) Reads all engine operations that have been processed by the engine from Lucene index.protected org.opensearch.index.engine.Engine.DeletereplicaDeleteForDoc(String id, long version, long seqNo, long startTime) protected org.opensearch.index.engine.Engine.IndexreplicaIndexForDoc(org.opensearch.index.mapper.ParsedDocument doc, long version, long seqNo, boolean isRetry) voidsetUp()voidtearDown()protected static org.opensearch.index.mapper.ParseContext.Documentprotected static org.opensearch.index.mapper.ParseContext.Documentprotected static org.opensearch.index.mapper.ParseContext.DocumenttestDocumentWithTextField(String value) protected static org.opensearch.index.mapper.ParsedDocumenttestParsedDocument(String id, String routing, org.opensearch.index.mapper.ParseContext.Document document, org.opensearch.core.common.bytes.BytesReference source, org.opensearch.index.mapper.Mapping mappingUpdate) protected static org.opensearch.index.mapper.ParsedDocumenttestParsedDocument(String id, String routing, org.opensearch.index.mapper.ParseContext.Document document, org.opensearch.core.common.bytes.BytesReference source, org.opensearch.index.mapper.Mapping mappingUpdate, boolean recoverySource) static org.opensearch.index.engine.EngineConfig.TombstoneDocSupplierCreates a tombstone document that only includes uid, seq#, term and version fields.static voidwaitForOpsToComplete(org.opensearch.index.engine.InternalEngine engine, long seqNo) Waits for all operations up to the provided sequence number to complete in the given internal engine.Methods inherited from class org.opensearch.test.OpenSearchTestCase
after, afterIfFailed, afterIfSuccessful, allowedWarnings, assertArrayEquals, assertBusy, assertBusy, assertBusyWithFixedSleepTime, assertEquals, assertNoDeprecationWarnings, assertSettingDeprecationsAndWarnings, assertSettingDeprecationsAndWarnings, assertWarnings, assertWarnings, before, between, buildEnvSettings, buildNewFakeTransportAddress, checkStaticState, clearAdditionalRoles, copyInstance, copyNamedWriteable, copyNamedWriteable, copyWriteable, copyWriteable, createDefaultIndexAnalyzers, createParser, createParser, createParser, createParser, createParser, createParser, createTestAnalysis, createTestAnalysis, createTestAnalysis, enableJodaDeprecationWarningsCheck, enableWarningsCheck, ensureAllSearchContextsReleased, ensureCheckIndexPassed, ensureSupportedLocale, frequently, generateRandomStringArray, generateRandomStringArray, getBasePort, getBasePort, getDataPath, getPortRange, getShardLevelBlobPath, getSuiteFailureMarker, getTestTransportPlugin, getTestTransportType, inFipsJvm, iterations, maybeSet, mockScript, newNodeEnvironment, newNodeEnvironment, persistedStateRegistry, randomAlphaOfLength, randomAlphaOfLengthBetween, randomArray, randomArray, randomBigInteger, randomBoolean, randomByte, randomByteArrayOfLength, randomDateFormatterPattern, randomDateTimeZone, randomDouble, randomDoubleBetween, randomFloat, randomFrom, randomFrom, randomFrom, randomFrom, randomFrom, randomGeohash, randomInt, randomInt, randomIntBetween, randomIp, randomList, randomList, randomLong, randomLongBetween, randomNonNegativeInt, randomNonNegativeLong, randomPositiveTimeValue, randomRealisticUnicodeOfCodepointLength, randomRealisticUnicodeOfCodepointLengthBetween, randomRealisticUnicodeOfLength, randomRealisticUnicodeOfLengthBetween, randomShort, randomSubsetOf, randomSubsetOf, randomSubsetOf, randomTimeValue, randomTimeValue, randomTimeValue, randomTimeZone, randomUnicodeOfCodepointLength, randomUnicodeOfCodepointLengthBetween, randomUnicodeOfLength, randomUnicodeOfLengthBetween, randomUnique, randomUnsignedLong, randomValueOtherThan, randomValueOtherThanMany, randomZone, remoteIndexSettings, removeHeaderWarningAppender, replaceUnicodeControlCharacters, replaceUnicodeControlCharacters, resetCheckIndexStatus, resetPortCounter, restoreContentType, restoreFileSystem, scaledRandomIntBetween, setContentType, setFileSystem, setHeaderWarningAppender, settings, shuffleMap, shuffleXContent, shuffleXContent, spinForAtLeastNMilliseconds, spinForAtLeastOneMillisecond, terminate, terminate, tmpPaths, toShuffledXContent, toShuffledXContent, waitUntil, waitUntil, warmIndexSettings, writableRegistry, xContentRegistryMethods inherited from class org.apache.lucene.tests.util.LuceneTestCase
addVirusChecker, assertDeletedDocsEquals, assertDocsAndPositionsEnumEquals, assertDocsEnumEquals, assertDocsSkippingEquals, assertDocValuesEquals, assertDocValuesEquals, assertDoubleUlpEquals, assertFieldInfosEquals, assertFloatUlpEquals, assertNormsEquals, assertPointsEquals, assertPositionsSkippingEquals, assertReaderEquals, assertReaderStatisticsEquals, assertStoredFieldEquals, assertStoredFieldsEquals, assertTermsEnumEquals, assertTermsEquals, assertTermsEquals, assertTermsStatisticsEquals, assertTermStatsEquals, assertTermVectorsEquals, assertThat, assertThat, asSet, assumeFalse, assumeNoException, assumeTrue, atLeast, atLeast, callStackContains, callStackContains, callStackContainsAnyOf, closeAfterSuite, closeAfterTest, collate, createTempDir, createTempDir, createTempFile, createTempFile, dumpArray, dumpIterator, ensureSaneIWCOnNightly, expectThrows, expectThrows, expectThrows, expectThrowsAnyOf, expectThrowsAnyOf, getDataInputStream, getJvmForkArguments, getOnlyLeafReader, getTestClass, getTestName, isTestThread, localeForLanguageTag, maybeChangeLiveIndexWriterConfig, maybeWrapReader, newAlcoholicMergePolicy, newAlcoholicMergePolicy, newBytesRef, newBytesRef, newBytesRef, newBytesRef, newBytesRef, newBytesRef, newDirectory, newDirectory, newDirectory, newDirectory, newDirectory, newField, newField, newFSDirectory, newFSDirectory, newIndexWriterConfig, newIndexWriterConfig, newIndexWriterConfig, newIOContext, newIOContext, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newMaybeVirusCheckingDirectory, newMaybeVirusCheckingFSDirectory, newMergePolicy, newMergePolicy, newMergePolicy, newMockDirectory, newMockDirectory, newMockDirectory, newMockFSDirectory, newMockFSDirectory, newSearcher, newSearcher, newSearcher, newSearcher, newSearcher, newSnapshotIndexWriterConfig, newStringField, newStringField, newStringField, newStringField, newTextField, newTextField, newTieredMergePolicy, newTieredMergePolicy, overrideDefaultQueryCache, overrideTestDefaultQueryCache, random, randomLocale, randomTimeZone, randomVectorFormat, rarely, rarely, replaceMaxFailureRule, resetDefaultQueryCache, restoreCPUCoreCount, restoreIndexWriterMaxDocs, runWithRestrictedPermissions, setIndexWriterMaxDocs, setupCPUCoreCount, setUpExecutorService, shutdownExecutorService, slowFileExists, usually, usually, wrapReaderMethods inherited from class org.junit.Assert
assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThrows, assertThrows, assertTrue, assertTrue, fail, fail
-
Field Details
-
shardId
protected final org.opensearch.core.index.shard.ShardId shardId -
allocationId
protected final org.opensearch.cluster.routing.AllocationId allocationId -
INDEX_SETTINGS
protected static final org.opensearch.index.IndexSettings INDEX_SETTINGS -
threadPool
protected org.opensearch.threadpool.ThreadPool threadPool -
translogHandler
-
store
protected org.opensearch.index.store.Store store -
storeReplica
protected org.opensearch.index.store.Store storeReplica -
engine
protected org.opensearch.index.engine.InternalEngine engine -
replicaEngine
protected org.opensearch.index.engine.InternalEngine replicaEngine -
defaultSettings
protected org.opensearch.index.IndexSettings defaultSettings -
codecName
-
-
replicaTranslogDir
-
primaryTerm
-
B_1
protected static final org.opensearch.core.common.bytes.BytesReference B_1 -
B_2
protected static final org.opensearch.core.common.bytes.BytesReference B_2 -
B_3
protected static final org.opensearch.core.common.bytes.BytesReference B_3 -
SOURCE
protected static final org.opensearch.core.common.bytes.BytesArray SOURCE
-
-
Constructor Details
-
EngineTestCase
public EngineTestCase()
-
-
Method Details
-
assertVisibleCount
protected static void assertVisibleCount(org.opensearch.index.engine.Engine engine, int numDocs, boolean refresh) throws IOException - Throws:
IOException
-
indexSettings
protected org.opensearch.common.settings.Settings indexSettings() -
setUp
-
copy
public org.opensearch.index.engine.EngineConfig copy(org.opensearch.index.engine.EngineConfig config, LongSupplier globalCheckpointSupplier) -
copy
public org.opensearch.index.engine.EngineConfig copy(org.opensearch.index.engine.EngineConfig config, org.apache.lucene.analysis.Analyzer analyzer) -
copy
public org.opensearch.index.engine.EngineConfig copy(org.opensearch.index.engine.EngineConfig config, org.apache.lucene.index.MergePolicy mergePolicy) -
tearDown
- Overrides:
tearDownin classOpenSearchTestCase- Throws:
Exception
-
assertAndGetInternalTranslogManager
protected org.opensearch.index.translog.InternalTranslogManager assertAndGetInternalTranslogManager(org.opensearch.index.translog.TranslogManager translogManager) -
assertEngineCleanedUp
-
testDocumentWithTextField
protected static org.opensearch.index.mapper.ParseContext.Document testDocumentWithTextField() -
testDocumentWithTextField
protected static org.opensearch.index.mapper.ParseContext.Document testDocumentWithTextField(String value) -
testDocument
protected static org.opensearch.index.mapper.ParseContext.Document testDocument() -
createParsedDoc
-
createParsedDoc
-
testParsedDocument
-
testParsedDocument
-
nestedParsedDocFactory
public static org.opensearch.common.CheckedBiFunction<String, Integer, org.opensearch.index.mapper.ParsedDocument, IOException> nestedParsedDocFactory() throws Exception- Throws:
Exception
-
tombstoneDocSupplier
public static org.opensearch.index.engine.EngineConfig.TombstoneDocSupplier tombstoneDocSupplier()Creates a tombstone document that only includes uid, seq#, term and version fields. -
createStore
- Throws:
IOException
-
createStore
protected org.opensearch.index.store.Store createStore(org.apache.lucene.store.Directory directory) throws IOException - Throws:
IOException
-
createStore
protected org.opensearch.index.store.Store createStore(org.opensearch.index.IndexSettings indexSettings, org.apache.lucene.store.Directory directory) throws IOException - Throws:
IOException
-
createTranslog
protected org.opensearch.index.translog.Translog createTranslog(LongSupplier primaryTermSupplier) throws IOException - Throws:
IOException
-
createTranslog
protected org.opensearch.index.translog.Translog createTranslog(Path translogPath, LongSupplier primaryTermSupplier) throws IOException - Throws:
IOException
-
createTranslogHandler
protected TranslogHandler createTranslogHandler(org.opensearch.index.IndexSettings indexSettings, org.opensearch.index.engine.Engine engine) -
createEngine
protected org.opensearch.index.engine.InternalEngine createEngine(org.opensearch.index.store.Store store, Path translogPath) throws IOException - Throws:
IOException
-
createEngine
protected org.opensearch.index.engine.InternalEngine createEngine(org.opensearch.index.store.Store store, Path translogPath, LongSupplier globalCheckpointSupplier) throws IOException - Throws:
IOException
-
createEngine
protected org.opensearch.index.engine.InternalEngine createEngine(org.opensearch.index.store.Store store, Path translogPath, BiFunction<Long, Long, org.opensearch.index.seqno.LocalCheckpointTracker> localCheckpointTrackerSupplier) throws IOException - Throws:
IOException
-
createEngine
protected org.opensearch.index.engine.InternalEngine createEngine(org.opensearch.index.store.Store store, Path translogPath, BiFunction<Long, Long, org.opensearch.index.seqno.LocalCheckpointTracker> localCheckpointTrackerSupplier, ToLongBiFunction<org.opensearch.index.engine.Engine, org.opensearch.index.engine.Engine.Operation> seqNoForOperation) throws IOException - Throws:
IOException
-
createEngine
protected org.opensearch.index.engine.InternalEngine createEngine(org.opensearch.index.IndexSettings indexSettings, org.opensearch.index.store.Store store, Path translogPath, org.apache.lucene.index.MergePolicy mergePolicy) throws IOException - Throws:
IOException
-
createEngine
protected org.opensearch.index.engine.InternalEngine createEngine(org.opensearch.index.IndexSettings indexSettings, org.opensearch.index.store.Store store, Path translogPath, org.apache.lucene.index.MergePolicy mergePolicy, @Nullable EngineTestCase.IndexWriterFactory indexWriterFactory) throws IOException - Throws:
IOException
-
createEngine
protected org.opensearch.index.engine.InternalEngine createEngine(org.opensearch.index.IndexSettings indexSettings, org.opensearch.index.store.Store store, Path translogPath, org.apache.lucene.index.MergePolicy mergePolicy, @Nullable EngineTestCase.IndexWriterFactory indexWriterFactory, @Nullable BiFunction<Long, Long, org.opensearch.index.seqno.LocalCheckpointTracker> localCheckpointTrackerSupplier, @Nullable LongSupplier globalCheckpointSupplier) throws IOException - Throws:
IOException
-
createEngine
protected org.opensearch.index.engine.InternalEngine createEngine(org.opensearch.index.IndexSettings indexSettings, org.opensearch.index.store.Store store, Path translogPath, org.apache.lucene.index.MergePolicy mergePolicy, @Nullable EngineTestCase.IndexWriterFactory indexWriterFactory, @Nullable BiFunction<Long, Long, org.opensearch.index.seqno.LocalCheckpointTracker> localCheckpointTrackerSupplier, @Nullable LongSupplier globalCheckpointSupplier, @Nullable ToLongBiFunction<org.opensearch.index.engine.Engine, org.opensearch.index.engine.Engine.Operation> seqNoForOperation) throws IOException - Throws:
IOException
-
createEngine
protected org.opensearch.index.engine.InternalEngine createEngine(org.opensearch.index.IndexSettings indexSettings, org.opensearch.index.store.Store store, Path translogPath, org.apache.lucene.index.MergePolicy mergePolicy, @Nullable EngineTestCase.IndexWriterFactory indexWriterFactory, @Nullable BiFunction<Long, Long, org.opensearch.index.seqno.LocalCheckpointTracker> localCheckpointTrackerSupplier, @Nullable ToLongBiFunction<org.opensearch.index.engine.Engine, org.opensearch.index.engine.Engine.Operation> seqNoForOperation, @Nullable org.apache.lucene.search.Sort indexSort, @Nullable LongSupplier globalCheckpointSupplier) throws IOException - Throws:
IOException
-
createEngine
protected org.opensearch.index.engine.InternalEngine createEngine(org.opensearch.index.engine.EngineConfig config) throws IOException - Throws:
IOException
-
createEngine
protected org.opensearch.index.engine.InternalEngine createEngine(@Nullable EngineTestCase.IndexWriterFactory indexWriterFactory, @Nullable BiFunction<Long, Long, org.opensearch.index.seqno.LocalCheckpointTracker> localCheckpointTrackerSupplier, @Nullable ToLongBiFunction<org.opensearch.index.engine.Engine, org.opensearch.index.engine.Engine.Operation> seqNoForOperation, org.opensearch.index.engine.EngineConfig config) throws IOException - Throws:
IOException
-
createEngine
public static org.opensearch.index.engine.InternalEngine createEngine(org.opensearch.index.engine.EngineConfig engineConfig, int maxDocs) -
generateNewSeqNo
public static long generateNewSeqNo(org.opensearch.index.engine.Engine engine) Generate a new sequence number and return it. Only works on InternalEngines -
createInternalEngine
public static org.opensearch.index.engine.InternalEngine createInternalEngine(@Nullable EngineTestCase.IndexWriterFactory indexWriterFactory, @Nullable BiFunction<Long, Long, org.opensearch.index.seqno.LocalCheckpointTracker> localCheckpointTrackerSupplier, @Nullable ToLongBiFunction<org.opensearch.index.engine.Engine, org.opensearch.index.engine.Engine.Operation> seqNoForOperation, org.opensearch.index.engine.EngineConfig config) -
config
public org.opensearch.index.engine.EngineConfig config(org.opensearch.index.IndexSettings indexSettings, org.opensearch.index.store.Store store, Path translogPath, org.apache.lucene.index.MergePolicy mergePolicy, org.apache.lucene.search.ReferenceManager.RefreshListener refreshListener) -
config
public org.opensearch.index.engine.EngineConfig config(org.opensearch.index.IndexSettings indexSettings, org.opensearch.index.store.Store store, Path translogPath, org.apache.lucene.index.MergePolicy mergePolicy, org.apache.lucene.search.ReferenceManager.RefreshListener refreshListener, org.apache.lucene.search.Sort indexSort, LongSupplier globalCheckpointSupplier) -
config
public org.opensearch.index.engine.EngineConfig config(org.opensearch.index.IndexSettings indexSettings, org.opensearch.index.store.Store store, Path translogPath, org.apache.lucene.index.MergePolicy mergePolicy, org.apache.lucene.search.ReferenceManager.RefreshListener refreshListener, org.apache.lucene.search.Sort indexSort, LongSupplier globalCheckpointSupplier, Supplier<org.opensearch.index.seqno.RetentionLeases> retentionLeasesSupplier) -
config
public org.opensearch.index.engine.EngineConfig config(org.opensearch.index.IndexSettings indexSettings, org.opensearch.index.store.Store store, Path translogPath, org.apache.lucene.index.MergePolicy mergePolicy, org.apache.lucene.search.ReferenceManager.RefreshListener externalRefreshListener, org.apache.lucene.search.ReferenceManager.RefreshListener internalRefreshListener, org.apache.lucene.search.Sort indexSort, @Nullable LongSupplier maybeGlobalCheckpointSupplier, org.opensearch.core.indices.breaker.CircuitBreakerService breakerService) -
config
public org.opensearch.index.engine.EngineConfig config(org.opensearch.index.IndexSettings indexSettings, org.opensearch.index.store.Store store, Path translogPath, org.apache.lucene.index.MergePolicy mergePolicy, org.apache.lucene.search.ReferenceManager.RefreshListener externalRefreshListener, org.apache.lucene.search.ReferenceManager.RefreshListener internalRefreshListener, org.apache.lucene.search.Sort indexSort, @Nullable LongSupplier maybeGlobalCheckpointSupplier, @Nullable Supplier<org.opensearch.index.seqno.RetentionLeases> maybeRetentionLeasesSupplier, org.opensearch.core.indices.breaker.CircuitBreakerService breakerService) -
config
public org.opensearch.index.engine.EngineConfig config(org.opensearch.index.IndexSettings indexSettings, org.opensearch.index.store.Store store, Path translogPath, org.apache.lucene.index.MergePolicy mergePolicy, org.apache.lucene.search.ReferenceManager.RefreshListener externalRefreshListener, org.apache.lucene.search.ReferenceManager.RefreshListener internalRefreshListener, org.apache.lucene.search.Sort indexSort, @Nullable LongSupplier maybeGlobalCheckpointSupplier, @Nullable Supplier<org.opensearch.index.seqno.RetentionLeases> maybeRetentionLeasesSupplier, org.opensearch.core.indices.breaker.CircuitBreakerService breakerService, org.opensearch.index.engine.Engine.EventListener eventListener) -
config
protected org.opensearch.index.engine.EngineConfig config(org.opensearch.index.engine.EngineConfig config, org.opensearch.index.store.Store store, Path translogPath, org.opensearch.index.engine.EngineConfig.TombstoneDocSupplier tombstoneDocSupplier) -
config
protected org.opensearch.index.engine.EngineConfig config(org.opensearch.index.engine.EngineConfig config, Supplier<org.opensearch.index.mapper.DocumentMapperForType> documentMapperForTypeSupplier, org.opensearch.cluster.service.ClusterApplierService clusterApplierService) Override config with ingestion engine configs -
noOpConfig
protected org.opensearch.index.engine.EngineConfig noOpConfig(org.opensearch.index.IndexSettings indexSettings, org.opensearch.index.store.Store store, Path translogPath) -
noOpConfig
protected org.opensearch.index.engine.EngineConfig noOpConfig(org.opensearch.index.IndexSettings indexSettings, org.opensearch.index.store.Store store, Path translogPath, LongSupplier globalCheckpointSupplier) -
bytesArray
-
newUid
-
newUid
public static org.apache.lucene.index.Term newUid(org.opensearch.index.mapper.ParsedDocument doc) -
newGet
protected org.opensearch.index.engine.Engine.Get newGet(boolean realtime, org.opensearch.index.mapper.ParsedDocument doc) -
indexForDoc
protected org.opensearch.index.engine.Engine.Index indexForDoc(org.opensearch.index.mapper.ParsedDocument doc) -
replicaIndexForDoc
protected org.opensearch.index.engine.Engine.Index replicaIndexForDoc(org.opensearch.index.mapper.ParsedDocument doc, long version, long seqNo, boolean isRetry) -
replicaDeleteForDoc
protected org.opensearch.index.engine.Engine.Delete replicaDeleteForDoc(String id, long version, long seqNo, long startTime) -
assertVisibleCount
protected static void assertVisibleCount(org.opensearch.index.engine.InternalEngine engine, int numDocs) throws IOException - Throws:
IOException
-
assertVisibleCount
protected static void assertVisibleCount(org.opensearch.index.engine.InternalEngine engine, int numDocs, boolean refresh) throws IOException - Throws:
IOException
-
generateSingleDocHistory
-
generateHistoryOnReplica
-
generateHistoryOnReplica
-
assertOpsOnReplica
public static void assertOpsOnReplica(List<org.opensearch.index.engine.Engine.Operation> ops, org.opensearch.index.engine.InternalEngine replicaEngine, boolean shuffleOps, org.apache.logging.log4j.Logger logger) throws IOException - Throws:
IOException
-
concurrentlyApplyOps
public static void concurrentlyApplyOps(List<org.opensearch.index.engine.Engine.Operation> ops, org.opensearch.index.engine.InternalEngine engine) throws InterruptedException - Throws:
InterruptedException
-
applyOperations
public static void applyOperations(org.opensearch.index.engine.Engine engine, List<org.opensearch.index.engine.Engine.Operation> operations) throws IOException - Throws:
IOException
-
applyOperation
public static org.opensearch.index.engine.Engine.Result applyOperation(org.opensearch.index.engine.Engine engine, org.opensearch.index.engine.Engine.Operation operation) throws IOException - Throws:
IOException
-
getDocIds
public static List<DocIdSeqNoAndSource> getDocIds(org.opensearch.index.engine.Engine engine, boolean refresh) throws IOException Gets a collection of tuples of docId, sequence number, and primary term of all live documents in the provided engine.- Throws:
IOException
-
readAllOperationsInLucene
public static List<org.opensearch.index.translog.Translog.Operation> readAllOperationsInLucene(org.opensearch.index.engine.Engine engine) throws IOException Reads all engine operations that have been processed by the engine from Lucene index. The returned operations are sorted and de-duplicated, thus each sequence number will be have at most one operation.- Throws:
IOException
-
readAllOperationsBasedOnSource
public static List<org.opensearch.index.translog.Translog.Operation> readAllOperationsBasedOnSource(org.opensearch.index.engine.Engine engine) throws IOException Reads all engine operations that have been processed by the engine from Lucene index/Translog based on source.- Throws:
IOException
-
assertConsistentHistoryBetweenTranslogAndLuceneIndex
public static void assertConsistentHistoryBetweenTranslogAndLuceneIndex(org.opensearch.index.engine.Engine engine) throws IOException Asserts the provided engine has a consistent document history between translog and Lucene index.- Throws:
IOException
-
assertMaxSeqNoInCommitUserData
-
assertAtMostOneLuceneDocumentPerSequenceNumber
public static void assertAtMostOneLuceneDocumentPerSequenceNumber(org.opensearch.index.engine.Engine engine) throws IOException - Throws:
IOException
-
assertAtMostOneLuceneDocumentPerSequenceNumber
public static void assertAtMostOneLuceneDocumentPerSequenceNumber(org.opensearch.index.IndexSettings indexSettings, org.apache.lucene.index.DirectoryReader reader) throws IOException - Throws:
IOException
-
createMapperService
- Throws:
IOException
-
createMapperService
public static org.opensearch.index.mapper.MapperService createMapperService(String mapping) throws IOException - Throws:
IOException
-
getTranslog
public static org.opensearch.index.translog.Translog getTranslog(org.opensearch.index.engine.Engine engine) Exposes a translog associated with the given engine for testing purpose. -
waitForOpsToComplete
public static void waitForOpsToComplete(org.opensearch.index.engine.InternalEngine engine, long seqNo) throws InterruptedException Waits for all operations up to the provided sequence number to complete in the given internal engine.- Parameters:
seqNo- the sequence number that the checkpoint must advance to before this method returns- Throws:
InterruptedException- if the thread was interrupted while blocking on the condition
-
hasSnapshottedCommits
public static boolean hasSnapshottedCommits(org.opensearch.index.engine.Engine engine) -
getNumVersionLookups
public static long getNumVersionLookups(org.opensearch.index.engine.Engine engine) Returns the number of times a version was looked up either from version map or from the index. -
getInFlightDocCount
public static long getInFlightDocCount(org.opensearch.index.engine.Engine engine) -
assertNoInFlightDocuments
-