primaryTerm
protected long primaryTerm
ESIndexLevelReplicationTestCaseIndexShard instances easily,
containing utilities for shard creation and recoveries. See {newShard(boolean)} and
newStartedShard() for a good starting pointsESTestCase.DeprecationWarning, ESTestCase.GeohashGenerator, ESTestCase.TestAnalysis, ESTestCase.WithoutSecurityManagerorg.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.Weeklyprotected static AtomicLongstatic final IndexEventListenerprotected NodeEnvironmentstatic final GlobalCheckpointSyncerprotected longprotected static final PeerRecoveryTargetService.RecoveryListenerprotected ThreadPoolprotected ThreadPoolMergeExecutorServiceprotected ExecutorcheckIndexFailures, DEFAULT_TEST_WORKER_ID, failureAndSuccessEvents, FIPS_SYSPROP, JAVA_TIMEZONE_IDS, JAVA_ZONE_IDS, logger, MIN_PRIVATE_PORT, SAFE_AWAIT_TIMEOUT, TEST_REQUEST_TIMEOUT, TEST_WORKER_SYS_PROPERTY, TEST_WORKER_VM_ID, UNSIGNED_LONG_MAXassertsAreEnabled, 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, VERBOSEstatic voidprotected voidstatic voidprotected voidassertDocCount(IndexShard shard,
int docDount) protected voidassertDocs(IndexShard shard,
String... ids) protected voidcloseShard(IndexShard shard,
boolean assertConsistencyBetweenTranslogAndLucene) static voidcloseShardNoCheck(IndexShard indexShard) IndexShard without flushing or performing the consistency checks that closeShard(org.elasticsearch.index.shard.IndexShard, boolean) performs.static voidcloseShardNoCheck(IndexShard indexShard,
boolean flushEngine) IndexShard, optionally flushing first, without performing the consistency checks that closeShard(org.elasticsearch.index.shard.IndexShard, boolean) performs.protected voidcloseShards(Iterable<IndexShard> shards) protected voidcloseShards(IndexShard... shards) protected StorecreateStore(IndexSettings indexSettings,
ShardPath shardPath) protected StorecreateStore(ShardId shardId,
IndexSettings indexSettings,
org.apache.lucene.store.Directory directory) static Engine.WarmercreateTestWarmer(IndexSettings indexSettings) protected Engine.DeleteResultdeleteDoc(IndexShard shard,
String id) protected voidstatic voidflushAndCloseShardNoCheck(IndexShard indexShard) IndexShard, without performing the consistency checks that closeShard(org.elasticsearch.index.shard.IndexShard, boolean) performs.protected voidflushShard(IndexShard shard) protected voidflushShard(IndexShard shard,
boolean force) static List<DocIdSeqNoAndSource> getDocIdAndSeqNos(IndexShard shard) static EnginegetEngine(IndexShard indexShard) protected DiscoveryNodestatic org.elasticsearch.core.ReleasablegetOperationPermit(IndexShard shard) static ReplicationTrackergetReplicationTracker(IndexShard indexShard) getShardDocUIDs(IndexShard shard) static TransloggetTranslog(IndexShard shard) protected Engine.IndexResultindexDoc(IndexShard shard,
String id,
long version,
String source,
org.elasticsearch.xcontent.XContentType xContentType,
String routing) protected Engine.IndexResultindexDoc(IndexShard shard,
String type,
String id) protected Engine.IndexResultindexDoc(IndexShard shard,
String type,
String id,
String source) protected Engine.IndexResultindexDoc(IndexShard shard,
String id,
String source,
org.elasticsearch.xcontent.XContentType xContentType,
String routing) protected IndexShardnewShard(boolean primary) protected IndexShardprotected IndexShardnewShard(boolean primary,
Settings settings,
EngineFactory engineFactory,
IndexingOperationListener... listeners) protected IndexShardnewShard(boolean primary,
ShardId shardId,
Settings settings,
EngineFactory engineFactory,
IndexingOperationListener... listeners) protected IndexShardnewShard(ShardRouting routing,
IndexMetadata indexMetadata,
org.elasticsearch.core.CheckedFunction<org.apache.lucene.index.DirectoryReader,org.apache.lucene.index.DirectoryReader,IOException> indexReaderWrapper,
EngineFactory engineFactory,
GlobalCheckpointSyncer globalCheckpointSyncer,
RetentionLeaseSyncer retentionLeaseSyncer,
IndexingOperationListener... listeners) protected IndexShardnewShard(ShardRouting routing,
IndexMetadata indexMetadata,
org.elasticsearch.core.CheckedFunction<org.apache.lucene.index.DirectoryReader,org.apache.lucene.index.DirectoryReader,IOException> indexReaderWrapper,
EngineFactory engineFactory,
IndexingOperationListener... listeners) protected IndexShardnewShard(ShardRouting shardRouting,
Settings settings,
EngineFactory engineFactory,
IndexingOperationListener... listeners) protected IndexShardnewShard(ShardRouting shardRouting,
Settings settings,
IndexingOperationListener... listeners) protected IndexShardnewShard(ShardRouting shardRouting,
IndexingOperationListener... listeners) protected IndexShardnewShard(ShardRouting routing,
ShardPath shardPath,
IndexMetadata indexMetadata,
org.elasticsearch.core.CheckedFunction<IndexSettings,Store,IOException> storeProvider,
org.elasticsearch.core.CheckedFunction<org.apache.lucene.index.DirectoryReader,org.apache.lucene.index.DirectoryReader,IOException> indexReaderWrapper,
EngineFactory engineFactory,
GlobalCheckpointSyncer globalCheckpointSyncer,
RetentionLeaseSyncer retentionLeaseSyncer,
IndexEventListener indexEventListener,
LongSupplier relativeTimeSupplier,
IndexingOperationListener... listeners) protected IndexShardnewShard(ShardRouting routing,
ShardPath shardPath,
IndexMetadata indexMetadata,
org.elasticsearch.core.CheckedFunction<IndexSettings,Store,IOException> storeProvider,
org.elasticsearch.core.CheckedFunction<org.apache.lucene.index.DirectoryReader,org.apache.lucene.index.DirectoryReader,IOException> indexReaderWrapper,
EngineFactory engineFactory,
GlobalCheckpointSyncer globalCheckpointSyncer,
RetentionLeaseSyncer retentionLeaseSyncer,
IndexEventListener indexEventListener,
IndexingOperationListener... listeners) protected IndexShardnewShard(ShardId shardId,
boolean primary,
String nodeId,
IndexMetadata indexMetadata,
org.elasticsearch.core.CheckedFunction<org.apache.lucene.index.DirectoryReader,org.apache.lucene.index.DirectoryReader,IOException> readerWrapper) protected IndexShardnewShard(ShardId shardId,
boolean primary,
String nodeId,
IndexMetadata indexMetadata,
org.elasticsearch.core.CheckedFunction<org.apache.lucene.index.DirectoryReader,org.apache.lucene.index.DirectoryReader,IOException> readerWrapper,
GlobalCheckpointSyncer globalCheckpointSyncer) protected IndexShardnewShard(ShardId shardId,
boolean primary,
IndexingOperationListener... listeners) protected IndexShardprotected IndexShardnewStartedShard(boolean primary) protected IndexShardnewStartedShard(boolean primary,
Settings settings,
EngineFactory engineFactory,
IndexingOperationListener... listeners) protected IndexShardnewStartedShard(boolean primary,
Settings settings,
IndexingOperationListener... listeners) protected IndexShardnewStartedShard(Settings settings) protected IndexShardnewStartedShard(org.elasticsearch.core.CheckedFunction<Boolean,IndexShard,IOException> shardFunction,
boolean primary) protected voidpromoteReplica(IndexShard replica,
Set<String> inSyncIds,
IndexShardRoutingTable routingTable) static booleanrecoverFromStore(IndexShard newShard) static longrecoverLocallyUpToGlobalCheckpoint(IndexShard indexShard) protected voidrecoverReplica(IndexShard replica,
IndexShard primary,
boolean startReplica) protected voidrecoverReplica(IndexShard replica,
IndexShard primary,
BiFunction<IndexShard,DiscoveryNode,RecoveryTarget> targetSupplier,
boolean markAsRecovering,
boolean markAsStarted) protected voidrecoverShardFromSnapshot(IndexShard shard,
Snapshot snapshot,
Repository repository) protected voidrecoverShardFromStore(IndexShard primary) protected final voidrecoverUnstartedReplica(IndexShard replica,
IndexShard primary,
BiFunction<IndexShard,DiscoveryNode,RecoveryTarget> targetSupplier,
boolean markAsRecovering,
Set<String> inSyncIds,
IndexShardRoutingTable routingTable) protected voidrecoveryEmptyReplica(IndexShard replica,
boolean startReplica) protected IndexShardreinitShard(IndexShard current,
ShardRouting routing,
IndexMetadata indexMetadata,
EngineFactory engineFactory,
IndexingOperationListener... listeners) protected IndexShardreinitShard(IndexShard current,
ShardRouting routing,
IndexingOperationListener... listeners) protected IndexShardreinitShard(IndexShard current,
IndexingOperationListener... listeners) voidsetUp()protected ThreadPoolsetUpThreadPool(Settings settings) protected ShardGenerationsnapshotShard(IndexShard shard,
Snapshot snapshot,
Repository repository) protected voidstartReplicaAfterRecovery(IndexShard replica,
IndexShard primary,
Set<String> inSyncIds,
IndexShardRoutingTable routingTable) voidtearDown()protected voidprotected voidupdateMappings(IndexShard shard,
IndexMetadata indexMetadata) static voidupdateRoutingEntry(IndexShard shard,
ShardRouting shardRouting) after, afterIfFailed, afterIfSuccessful, allBreakersMemoryReleased, asInstanceOf, assertArrayEquals, assertBusy, assertBusy, assertCriticalWarnings, assertEquals, assertLeakDetected, assertSettingDeprecationsAndWarnings, assertThat, assertThat, assertWarnings, assertWarnings, before, between, buildEnvSettings, buildNewFakeTransportAddress, captureLoggingLevel, checkStaticState, compatibleMediaType, copyInstance, copyNamedWriteable, copyNamedWriteable, copyWriteable, copyWriteable, createDefaultIndexAnalyzers, createParser, createParser, createParser, createParser, createParser, createParser, createParserWithCompatibilityFor, createTestAnalysis, createTestAnalysis, createTestAnalysis, createThreadPool, enableBigArraysReleasedCheck, enableWarningsCheck, ensureAllContextsReleased, ensureAllSearchContextsReleased, ensureCheckIndexPassed, ensureNoWarnings, ensureSupportedLocale, expectThrows, expectThrows, fail, fail, filteredWarnings, flushThreadPoolExecutor, frequently, generateRandomStringArray, generateRandomStringArray, getDataPath, getPortRange, getResourceDataPath, getSuiteFailureMarker, getTestTransportPlugin, getTestTransportType, getWorkerBasePort, indexSettings, indexSettings, inFipsJvm, initTestSeed, isTurkishLocale, iterations, maybeRestoreClassSecurityManager, maybeSet, maybeStashClassSecurityManager, mockScript, newEnvironment, newEnvironment, newLimitedBreaker, newNodeEnvironment, newNodeEnvironment, newSearcher, newSearcher, newSearcher, newSearcher, parserConfig, randomAlphanumericOfLength, randomAlphaOfLength, randomAlphaOfLengthBetween, randomAlphaOfLengthOrNull, randomArray, randomArray, randomBigInteger, randomBoolean, randomByte, randomByteArrayOfLength, randomByteBetween, randomBytesBetween, randomByteSizeValue, randomBytesReference, randomCompatibleMediaType, randomDateFormatterPattern, randomDouble, randomDoubleBetween, randomDoubles, randomDoubles, randomExecutor, randomFloat, randomFloatBetween, randomFloatOrNull, randomFrom, randomFrom, randomFrom, randomFrom, randomFrom, randomFrom, randomGeohash, randomIdentifier, randomInstantBetween, randomInt, randomInt, randomIntBetween, randomIntOrNull, randomInts, randomInts, randomIp, randomList, randomList, randomLong, randomLongBetween, randomLongOrNull, randomLongs, randomLongs, randomMap, randomMillisUpToYear9999, randomNegativeInt, randomNegativeLong, randomNonEmptySubsetOf, randomNonNegativeByte, randomNonNegativeInt, randomNonNegativeIntOrNull, randomNonNegativeLong, randomNonNegativeLongOrNull, randomOptionalBoolean, randomPositiveTimeValue, randomRealisticUnicodeOfCodepointLength, randomRealisticUnicodeOfCodepointLengthBetween, randomRealisticUnicodeOfLength, randomRealisticUnicodeOfLengthBetween, randomSecretKey, randomSecureStringOfLength, randomSet, randomShort, randomSubsetOf, randomSubsetOf, randomSubsetOf, randomTimeValue, randomTimeValue, randomTimeValue, randomTimeZone, randomUnicodeOfCodepointLength, randomUnicodeOfCodepointLengthBetween, randomUnicodeOfLength, randomUnicodeOfLengthBetween, randomUnique, randomUnsignedLongBetween, randomUUID, randomValueOtherThan, randomValueOtherThanMany, randomVendorType, randomZone, removeHeaderWarningAppender, resetCheckIndexStatus, resetPortCounter, restoreContentType, restoreFileSystem, restoreLoggingLevel, runInParallel, safeAcquire, safeAcquire, safeAwait, safeAwait, safeAwait, safeAwait, safeAwait, safeAwait, safeAwaitAndUnwrapFailure, safeAwaitFailure, safeAwaitFailure, safeAwaitFailure, safeAwaitFailure, safeExecute, safeGet, safeGet, safeGet, safeSleep, safeSleep, scaledRandomIntBetween, secureRandom, secureRandom, secureRandomFips, secureRandomFips, secureRandomNonFips, secureRandomNonFips, setContentType, setFileSystem, setHeaderWarningAppender, settings, shuffledList, shuffleMap, shuffleXContent, shuffleXContent, skipTestWaitingForLuceneFix, spinForAtLeastNMilliseconds, spinForAtLeastOneMillisecond, startInParallel, terminate, terminate, tmpPaths, toShuffledXContent, toShuffledXContent, waitUntil, waitUntil, writableRegistry, xContentRegistryaddVirusChecker, assertDeletedDocsEquals, assertDocsAndPositionsEnumEquals, assertDocsEnumEquals, assertDocsSkippingEquals, assertDocValuesEquals, assertDocValuesEquals, assertDoubleUlpEquals, assertFieldInfosEquals, assertFloatUlpEquals, assertNormsEquals, assertPointsEquals, assertPositionsSkippingEquals, assertReaderEquals, assertReaderStatisticsEquals, assertStoredFieldEquals, assertStoredFieldsEquals, assertTermsEnumEquals, assertTermsEquals, assertTermsEquals, assertTermsStatisticsEquals, assertTermStatsEquals, assertTermVectorsEquals, 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, 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, wrapReaderassertArrayEquals, 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, failIOExceptionsetUp in class org.apache.lucene.tests.util.LuceneTestCaseExceptiontearDown in class org.apache.lucene.tests.util.LuceneTestCaseExceptionIOExceptionIOExceptionprimary - indicates whether to a primary shard (ready to recover from an empty store) or a replica (ready to recover from
another shard)IOExceptionprimary - indicates whether to a primary shard (ready to recover from an empty store) or a replica (ready to recover from
another shard)IOExceptionprimary - indicates whether to a primary shard (ready to recover from an empty store) or a replica (ready to recover from
another shard)settings - the settings to use for this shardengineFactory - the engine factory to use for this shardlisteners - the indexing operation listeners to addIOExceptionprimary - indicates whether to a primary shard (ready to recover from an empty store) or a replica (ready to recover from
another shard)shardId - the shard ID for this shardsettings - the settings to use for this shardengineFactory - the engine factory to use for this shardlisteners - the indexing operation listeners to addIOExceptionIOExceptionIOExceptionshardRouting - the ShardRouting to use for this shardsettings - the settings to use for this shardengineFactory - the engine factory to use for this shardlisteners - an optional set of listeners to add to the shardIOExceptionshardId - the shard id to useprimary - indicates whether to a primary shard (ready to recover from an empty store) or a replica
(ready to recover from another shard)listeners - an optional set of listeners to add to the shardIOExceptionshardId - the shard id to useprimary - indicates whether to a primary shard (ready to recover from an empty store) or a replica
(ready to recover from another shard)IOExceptionshardId - the shard id to useprimary - indicates whether to a primary shard (ready to recover from an empty store) or a replica
(ready to recover from another shard)IOExceptionrouting - shard routing to useindexMetadata - indexMetadata for the shard, including any mappinglisteners - an optional set of listeners to add to the shardIOExceptionrouting - shard routing to useindexMetadata - indexMetadata for the shard, including any mappingindexReaderWrapper - an optional wrapper to be used during searchglobalCheckpointSyncer - callback for syncing global checkpointslisteners - an optional set of listeners to add to the shardIOExceptionrouting - shard routing to useshardPath - path to use for shard dataindexMetadata - indexMetadata for the shard, including any mappingstoreProvider - an optional custom store provider to use. If null a default file based store will be createdindexReaderWrapper - an optional wrapper to be used during searchglobalCheckpointSyncer - callback for syncing global checkpointsindexEventListener - index event listenerlisteners - an optional set of listeners to add to the shardIOExceptionrouting - shard routing to useshardPath - path to use for shard dataindexMetadata - indexMetadata for the shard, including any mappingstoreProvider - an optional custom store provider to use. If null a default file based store will be createdindexReaderWrapper - an optional wrapper to be used during searchglobalCheckpointSyncer - callback for syncing global checkpointsindexEventListener - index event listenerrelativeTimeSupplier - the clock used to measure relative timelisteners - an optional set of listeners to add to the shardIOExceptionlisteners - new listerns to use for the newly created shardIOExceptionrouting - the shard routing to use for the newly created shard.listeners - new listerns to use for the newly created shardIOExceptionrouting - the shard routing to use for the newly created shard.indexMetadata - the index metadata to use for the newly created shardengineFactory - the engine factory for the new shardlisteners - new listerns to use for the newly created shardIOExceptionIOExceptionsettings - the settings to use for this shardIOExceptionprimary - controls whether the shard will be a primary or a replica.IOExceptionprimary - controls whether the shard will be a primary or a replica.settings - the settings to use for this shardlisteners - the indexing operation listeners to addIOExceptionprimary - controls whether the shard will be a primary or a replica.settings - the settings to use for this shardengineFactory - the engine factory to use for this shardlisteners - the indexing operation listeners to addIOExceptionshardFunction - shard factory functionprimary - controls whether the shard will be a primary or a replica.IOExceptionIOExceptionIOExceptionIOExceptionIndexShard, optionally flushing first, without performing the consistency checks that closeShard(org.elasticsearch.index.shard.IndexShard, boolean) performs.IOExceptionIndexShard without flushing or performing the consistency checks that closeShard(org.elasticsearch.index.shard.IndexShard, boolean) performs.IOExceptionIndexShard, without performing the consistency checks that closeShard(org.elasticsearch.index.shard.IndexShard, boolean) performs.IOExceptionIOExceptionIOExceptionIOExceptionIOExceptionIOExceptionIndexShardState.POST_RECOVERY and doesn't start it.replica - the recovery target shardprimary - the recovery source shardtargetSupplier - supplies an instance of RecoveryTargetmarkAsRecovering - set to false if the replica is marked as recoveringIOExceptionIOExceptionIOExceptionIOExceptionIOExceptionIOExceptionIOExceptionIOExceptionIOExceptionIOExceptionIOExceptionIOExceptionIOExceptionIOException