primaryTerm
protected long primaryTerm
ESIndexLevelReplicationTestCase
IndexShard
instances easily,
containing utilities for shard creation and recoveries. See {newShard(boolean)
} and
newStartedShard()
for a good starting pointsESTestCase.DeprecationWarning, ESTestCase.GeohashGenerator, ESTestCase.TestAnalysis
org.apache.lucene.util.LuceneTestCase.AwaitsFix, org.apache.lucene.util.LuceneTestCase.BadApple, org.apache.lucene.util.LuceneTestCase.Monster, org.apache.lucene.util.LuceneTestCase.Nightly, org.apache.lucene.util.LuceneTestCase.Slow, org.apache.lucene.util.LuceneTestCase.SuppressCodecs, org.apache.lucene.util.LuceneTestCase.SuppressFileSystems, org.apache.lucene.util.LuceneTestCase.SuppressFsync, org.apache.lucene.util.LuceneTestCase.SuppressReproduceLine, org.apache.lucene.util.LuceneTestCase.SuppressSysoutChecks, org.apache.lucene.util.LuceneTestCase.SuppressTempFileChecks, org.apache.lucene.util.LuceneTestCase.ThrowingRunnable, org.apache.lucene.util.LuceneTestCase.Weekly
protected static AtomicLong
static final org.elasticsearch.index.shard.IndexEventListener
protected long
protected static final org.elasticsearch.indices.recovery.PeerRecoveryTargetService.RecoveryListener
protected org.elasticsearch.threadpool.ThreadPool
checkIndexFailures, DEFAULT_TEST_WORKER_ID, failureAndSuccessEvents, FIPS_SYSPROP, JAVA_TIMEZONE_IDS, JAVA_ZONE_IDS, logger, MIN_PRIVATE_PORT, TEST_WORKER_SYS_PROPERTY, TEST_WORKER_VM_ID
assertsAreEnabled, classRules, DEFAULT_LINE_DOCS_FILE, INFOSTREAM, JENKINS_LARGE_LINE_DOCS_FILE, LEAVE_TEMPORARY, MAYBE_CACHE_POLICY, RANDOM_MULTIPLIER, ruleChain, suiteFailureMarker, SYSPROP_AWAITSFIX, SYSPROP_BADAPPLES, SYSPROP_FAILFAST, SYSPROP_MAXFAILURES, SYSPROP_MONSTER, SYSPROP_NIGHTLY, SYSPROP_SLOW, SYSPROP_WEEKLY, TEST_ASSERTS_ENABLED, TEST_AWAITSFIX, TEST_BADAPPLES, TEST_CODEC, TEST_DIRECTORY, TEST_DOCVALUESFORMAT, TEST_LINE_DOCS_FILE, TEST_MONSTER, TEST_NIGHTLY, TEST_POSTINGSFORMAT, TEST_SLOW, TEST_THROTTLING, TEST_WEEKLY, VERBOSE
protected void
static void
assertConsistentHistoryBetweenTranslogAndLucene(org.elasticsearch.index.shard.IndexShard shard)
protected void
assertDocCount(org.elasticsearch.index.shard.IndexShard shard,
int docDount)
protected void
assertDocs(org.elasticsearch.index.shard.IndexShard shard,
String... ids)
protected void
closeShard(org.elasticsearch.index.shard.IndexShard shard,
boolean assertConsistencyBetweenTranslogAndLucene)
protected void
closeShards(Iterable<org.elasticsearch.index.shard.IndexShard> shards)
protected void
closeShards(org.elasticsearch.index.shard.IndexShard... shards)
protected org.elasticsearch.index.store.Store
createStore(org.elasticsearch.index.IndexSettings indexSettings,
org.elasticsearch.index.shard.ShardPath shardPath)
protected org.elasticsearch.index.store.Store
createStore(org.elasticsearch.index.shard.ShardId shardId,
org.elasticsearch.index.IndexSettings indexSettings,
org.apache.lucene.store.Directory directory)
static org.elasticsearch.index.engine.Engine.Warmer
createTestWarmer(org.elasticsearch.index.IndexSettings indexSettings)
protected org.elasticsearch.index.engine.Engine.DeleteResult
protected void
protected void
flushShard(org.elasticsearch.index.shard.IndexShard shard)
protected void
flushShard(org.elasticsearch.index.shard.IndexShard shard,
boolean force)
static List<DocIdSeqNoAndSource>
getDocIdAndSeqNos(org.elasticsearch.index.shard.IndexShard shard)
static org.elasticsearch.index.engine.Engine
getEngine(org.elasticsearch.index.shard.IndexShard indexShard)
protected org.elasticsearch.cluster.node.DiscoveryNode
static org.elasticsearch.index.seqno.ReplicationTracker
getReplicationTracker(org.elasticsearch.index.shard.IndexShard indexShard)
getShardDocUIDs(org.elasticsearch.index.shard.IndexShard shard)
static org.elasticsearch.index.translog.Translog
getTranslog(org.elasticsearch.index.shard.IndexShard shard)
protected org.elasticsearch.index.engine.Engine.IndexResult
protected org.elasticsearch.index.engine.Engine.IndexResult
protected org.elasticsearch.index.engine.Engine.IndexResult
indexDoc(org.elasticsearch.index.shard.IndexShard shard,
String id,
String source,
org.elasticsearch.xcontent.XContentType xContentType,
String routing)
protected org.elasticsearch.index.shard.IndexShard
newShard(boolean primary)
protected org.elasticsearch.index.shard.IndexShard
newShard(boolean primary,
org.elasticsearch.common.settings.Settings settings)
protected org.elasticsearch.index.shard.IndexShard
newShard(boolean primary,
org.elasticsearch.common.settings.Settings settings,
org.elasticsearch.index.engine.EngineFactory engineFactory)
protected org.elasticsearch.index.shard.IndexShard
newShard(org.elasticsearch.cluster.routing.ShardRouting routing,
org.elasticsearch.cluster.metadata.IndexMetadata indexMetadata,
org.elasticsearch.core.CheckedFunction<org.apache.lucene.index.DirectoryReader,org.apache.lucene.index.DirectoryReader,IOException> indexReaderWrapper,
org.elasticsearch.index.engine.EngineFactory engineFactory,
Runnable globalCheckpointSyncer,
org.elasticsearch.index.seqno.RetentionLeaseSyncer retentionLeaseSyncer,
org.elasticsearch.index.shard.IndexingOperationListener... listeners)
protected org.elasticsearch.index.shard.IndexShard
newShard(org.elasticsearch.cluster.routing.ShardRouting routing,
org.elasticsearch.cluster.metadata.IndexMetadata indexMetadata,
org.elasticsearch.core.CheckedFunction<org.apache.lucene.index.DirectoryReader,org.apache.lucene.index.DirectoryReader,IOException> indexReaderWrapper,
org.elasticsearch.index.engine.EngineFactory engineFactory,
org.elasticsearch.index.shard.IndexingOperationListener... listeners)
protected org.elasticsearch.index.shard.IndexShard
newShard(org.elasticsearch.cluster.routing.ShardRouting shardRouting,
org.elasticsearch.common.settings.Settings settings,
org.elasticsearch.index.engine.EngineFactory engineFactory,
org.elasticsearch.index.shard.IndexingOperationListener... listeners)
protected org.elasticsearch.index.shard.IndexShard
newShard(org.elasticsearch.cluster.routing.ShardRouting shardRouting,
org.elasticsearch.common.settings.Settings settings,
org.elasticsearch.index.shard.IndexingOperationListener... listeners)
protected org.elasticsearch.index.shard.IndexShard
newShard(org.elasticsearch.cluster.routing.ShardRouting shardRouting,
org.elasticsearch.index.shard.IndexingOperationListener... listeners)
protected org.elasticsearch.index.shard.IndexShard
newShard(org.elasticsearch.cluster.routing.ShardRouting routing,
org.elasticsearch.index.shard.ShardPath shardPath,
org.elasticsearch.cluster.metadata.IndexMetadata indexMetadata,
org.elasticsearch.core.CheckedFunction<org.elasticsearch.index.IndexSettings,org.elasticsearch.index.store.Store,IOException> storeProvider,
org.elasticsearch.core.CheckedFunction<org.apache.lucene.index.DirectoryReader,org.apache.lucene.index.DirectoryReader,IOException> indexReaderWrapper,
org.elasticsearch.index.engine.EngineFactory engineFactory,
Runnable globalCheckpointSyncer,
org.elasticsearch.index.seqno.RetentionLeaseSyncer retentionLeaseSyncer,
org.elasticsearch.index.shard.IndexEventListener indexEventListener,
org.elasticsearch.index.shard.IndexingOperationListener... listeners)
protected org.elasticsearch.index.shard.IndexShard
newShard(org.elasticsearch.index.shard.ShardId shardId,
boolean primary,
String nodeId,
org.elasticsearch.cluster.metadata.IndexMetadata indexMetadata,
org.elasticsearch.core.CheckedFunction<org.apache.lucene.index.DirectoryReader,org.apache.lucene.index.DirectoryReader,IOException> readerWrapper)
protected org.elasticsearch.index.shard.IndexShard
newShard(org.elasticsearch.index.shard.ShardId shardId,
boolean primary,
String nodeId,
org.elasticsearch.cluster.metadata.IndexMetadata indexMetadata,
org.elasticsearch.core.CheckedFunction<org.apache.lucene.index.DirectoryReader,org.apache.lucene.index.DirectoryReader,IOException> readerWrapper,
Runnable globalCheckpointSyncer)
protected org.elasticsearch.index.shard.IndexShard
newShard(org.elasticsearch.index.shard.ShardId shardId,
boolean primary,
org.elasticsearch.index.shard.IndexingOperationListener... listeners)
protected org.elasticsearch.index.shard.IndexShard
protected org.elasticsearch.index.shard.IndexShard
newStartedShard(boolean primary)
protected org.elasticsearch.index.shard.IndexShard
newStartedShard(boolean primary,
org.elasticsearch.common.settings.Settings settings)
protected org.elasticsearch.index.shard.IndexShard
newStartedShard(boolean primary,
org.elasticsearch.common.settings.Settings settings,
org.elasticsearch.index.engine.EngineFactory engineFactory)
protected org.elasticsearch.index.shard.IndexShard
newStartedShard(org.elasticsearch.common.settings.Settings settings)
protected org.elasticsearch.index.shard.IndexShard
newStartedShard(org.elasticsearch.core.CheckedFunction<Boolean,org.elasticsearch.index.shard.IndexShard,IOException> shardFunction,
boolean primary)
protected void
promoteReplica(org.elasticsearch.index.shard.IndexShard replica,
Set<String> inSyncIds,
org.elasticsearch.cluster.routing.IndexShardRoutingTable routingTable)
static boolean
recoverFromStore(org.elasticsearch.index.shard.IndexShard newShard)
protected void
recoverReplica(org.elasticsearch.index.shard.IndexShard replica,
org.elasticsearch.index.shard.IndexShard primary,
boolean startReplica)
protected void
recoverReplica(org.elasticsearch.index.shard.IndexShard replica,
org.elasticsearch.index.shard.IndexShard primary,
BiFunction<org.elasticsearch.index.shard.IndexShard,org.elasticsearch.cluster.node.DiscoveryNode,org.elasticsearch.indices.recovery.RecoveryTarget> targetSupplier,
boolean markAsRecovering,
boolean markAsStarted)
protected void
recoverShardFromSnapshot(org.elasticsearch.index.shard.IndexShard shard,
org.elasticsearch.snapshots.Snapshot snapshot,
org.elasticsearch.repositories.Repository repository)
protected void
recoverShardFromStore(org.elasticsearch.index.shard.IndexShard primary)
protected final void
recoverUnstartedReplica(org.elasticsearch.index.shard.IndexShard replica,
org.elasticsearch.index.shard.IndexShard primary,
BiFunction<org.elasticsearch.index.shard.IndexShard,org.elasticsearch.cluster.node.DiscoveryNode,org.elasticsearch.indices.recovery.RecoveryTarget> targetSupplier,
boolean markAsRecovering,
Set<String> inSyncIds,
org.elasticsearch.cluster.routing.IndexShardRoutingTable routingTable)
protected void
recoveryEmptyReplica(org.elasticsearch.index.shard.IndexShard replica,
boolean startReplica)
protected org.elasticsearch.index.shard.IndexShard
reinitShard(org.elasticsearch.index.shard.IndexShard current,
org.elasticsearch.cluster.routing.ShardRouting routing,
org.elasticsearch.cluster.metadata.IndexMetadata indexMetadata,
org.elasticsearch.index.engine.EngineFactory engineFactory,
org.elasticsearch.index.shard.IndexingOperationListener... listeners)
protected org.elasticsearch.index.shard.IndexShard
reinitShard(org.elasticsearch.index.shard.IndexShard current,
org.elasticsearch.cluster.routing.ShardRouting routing,
org.elasticsearch.index.shard.IndexingOperationListener... listeners)
protected org.elasticsearch.index.shard.IndexShard
reinitShard(org.elasticsearch.index.shard.IndexShard current,
org.elasticsearch.index.shard.IndexingOperationListener... listeners)
void
setUp()
protected org.elasticsearch.threadpool.ThreadPool
protected org.elasticsearch.repositories.ShardGeneration
snapshotShard(org.elasticsearch.index.shard.IndexShard shard,
org.elasticsearch.snapshots.Snapshot snapshot,
org.elasticsearch.repositories.Repository repository)
protected void
startReplicaAfterRecovery(org.elasticsearch.index.shard.IndexShard replica,
org.elasticsearch.index.shard.IndexShard primary,
Set<String> inSyncIds,
org.elasticsearch.cluster.routing.IndexShardRoutingTable routingTable)
void
tearDown()
protected void
org.elasticsearch.common.settings.Settings
protected void
updateMappings(org.elasticsearch.index.shard.IndexShard shard,
org.elasticsearch.cluster.metadata.IndexMetadata indexMetadata)
static void
updateRoutingEntry(org.elasticsearch.index.shard.IndexShard shard,
org.elasticsearch.cluster.routing.ShardRouting shardRouting)
after, afterIfFailed, afterIfSuccessful, assertArrayEquals, assertBusy, assertBusy, assertCriticalWarnings, assertEquals, assertSettingDeprecationsAndWarnings, assertWarnings, assertWarnings, before, between, buildEnvSettings, buildNewFakeTransportAddress, checkStaticState, compatibleMediaType, copyInstance, copyNamedWriteable, copyNamedWriteable, copyWriteable, copyWriteable, createDefaultIndexAnalyzers, createParser, createParser, createParser, createParser, createParser, createParser, createParserWithCompatibilityFor, createTestAnalysis, createTestAnalysis, createTestAnalysis, enableWarningsCheck, ensureAllSearchContextsReleased, ensureCheckIndexPassed, ensureNoWarnings, ensureSupportedLocale, filteredWarnings, frequently, generateRandomStringArray, generateRandomStringArray, getBasePort, getDataPath, getPortRange, getSuiteFailureMarker, getTestTransportPlugin, getTestTransportType, inFipsJvm, iterations, maybeSet, mockScript, newEnvironment, newEnvironment, newNodeEnvironment, newNodeEnvironment, parserConfig, randomAlphaOfLength, randomAlphaOfLengthBetween, randomArray, randomArray, randomBigInteger, randomBoolean, randomByte, randomByteArrayOfLength, randomCompatibleMediaType, randomDateFormatterPattern, randomDouble, randomDoubleBetween, randomFloat, randomFrom, randomFrom, randomFrom, randomFrom, randomFrom, randomFrom, randomGeohash, randomInt, randomInt, randomIntBetween, randomIp, randomList, randomList, randomLong, randomLongBetween, randomMap, randomMillisUpToYear9999, randomNonNegativeByte, randomNonNegativeLong, randomPositiveTimeValue, randomRealisticUnicodeOfCodepointLength, randomRealisticUnicodeOfCodepointLengthBetween, randomRealisticUnicodeOfLength, randomRealisticUnicodeOfLengthBetween, randomShort, randomSubsetOf, randomSubsetOf, randomSubsetOf, randomTimeValue, randomTimeValue, randomTimeValue, randomTimeZone, randomUnicodeOfCodepointLength, randomUnicodeOfCodepointLengthBetween, randomUnicodeOfLength, randomUnicodeOfLengthBetween, randomUnique, randomValueOtherThan, randomValueOtherThanMany, randomVendorType, randomZone, removeHeaderWarningAppender, resetCheckIndexStatus, resetPortCounter, restoreContentType, restoreFileSystem, scaledRandomIntBetween, setContentType, setFileSystem, setHeaderWarningAppender, settings, shuffleMap, shuffleXContent, shuffleXContent, skipTestWaitingForLuceneFix, spinForAtLeastNMilliseconds, spinForAtLeastOneMillisecond, terminate, terminate, tmpPaths, toShuffledXContent, waitUntil, waitUntil, writableRegistry, xContentRegistry
addVirusChecker, assertDeletedDocsEquals, assertDocsAndPositionsEnumEquals, assertDocsEnumEquals, assertDocsSkippingEquals, assertDocValuesEquals, assertDocValuesEquals, assertFieldInfosEquals, assertNormsEquals, assertPointsEquals, assertPositionsSkippingEquals, assertReaderEquals, assertReaderStatisticsEquals, assertStoredFieldEquals, assertStoredFieldsEquals, assertTermsEnumEquals, assertTermsEquals, assertTermsEquals, assertTermsStatisticsEquals, assertTermStatsEquals, assertTermVectorsEquals, asSet, assumeFalse, assumeNoException, assumeTrue, assumeWorkingMMapOnWindows, atLeast, atLeast, callStackContains, callStackContains, callStackContainsAnyOf, closeAfterSuite, closeAfterTest, collate, createTempDir, createTempDir, createTempFile, createTempFile, dumpArray, dumpIterator, ensureSaneIWCOnNightly, expectThrows, expectThrows, expectThrows, expectThrowsAnyOf, expectThrowsAnyOf, getDataInputStream, getOnlyLeafReader, getTestClass, getTestName, hasWorkingMMapOnWindows, 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, newStringField, newStringField, newStringField, newStringField, newTextField, newTextField, newTieredMergePolicy, newTieredMergePolicy, overrideDefaultQueryCache, overrideTestDefaultQueryCache, random, randomLocale, randomTimeZone, rarely, rarely, replaceMaxFailureRule, resetDefaultQueryCache, restoreCPUCoreCount, restoreIndexWriterMaxDocs, runWithRestrictedPermissions, setIndexWriterMaxDocs, setupCPUCoreCount, slowFileExists, usually, usually, wrapReader
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, assertThat, assertThat, assertTrue, assertTrue, fail, fail
setUp
in class org.apache.lucene.util.LuceneTestCase
Exception
tearDown
in class org.apache.lucene.util.LuceneTestCase
Exception
IOException
IOException
primary
- indicates whether to a primary shard (ready to recover from an empty store) or a replica (ready to recover from
another shard)IOException
primary
- indicates whether to a primary shard (ready to recover from an empty store) or a replica (ready to recover from
another shard)IOException
primary
- 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 shardIOException
IOException
IOException
shardRouting
- 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 shardIOException
shardId
- 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 shardIOException
shardId
- 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)IOException
shardId
- 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)IOException
routing
- shard routing to useindexMetadata
- indexMetadata for the shard, including any mappinglisteners
- an optional set of listeners to add to the shardIOException
routing
- 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 shardIOException
routing
- 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 shardIOException
listeners
- new listerns to use for the newly created shardIOException
routing
- the shard routing to use for the newly created shard.listeners
- new listerns to use for the newly created shardIOException
routing
- the shard routing to use for the newly created shard.listeners
- new listerns to use for the newly created shardindexMetadata
- the index metadata to use for the newly created shardengineFactory
- the engine factory for the new shardIOException
IOException
settings
- the settings to use for this shardIOException
primary
- controls whether the shard will be a primary or a replica.IOException
primary
- controls whether the shard will be a primary or a replica.settings
- the settings to use for this shardIOException
primary
- 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 shardIOException
shardFunction
- shard factory functionprimary
- controls whether the shard will be a primary or a replica.IOException
IOException
IOException
IOException
IOException
IOException
IOException
IOException
IOException
IndexShardState.POST_RECOVERY
and doesn't start it.replica
- the recovery target shardprimary
- the recovery source shardtargetSupplier
- supplies an instance of RecoveryTarget
markAsRecovering
- set to false
if the replica is marked as recoveringIOException
IOException
IOException
IOException
IOException
IOException
IOException
IOException
IOException
IOException
IOException
IOException
IOException