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, ESTestCase.WithoutSecurityManager
org.apache.lucene.tests.util.LuceneTestCase.AwaitsFix, org.apache.lucene.tests.util.LuceneTestCase.BadApple, 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 extends Object>, org.apache.lucene.tests.util.LuceneTestCase.ThrowingRunnable, org.apache.lucene.tests.util.LuceneTestCase.Weekly
protected static AtomicLong
static final IndexEventListener
protected long
protected static final PeerRecoveryTargetService.RecoveryListener
protected 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_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_THROTTLING, TEST_WEEKLY, VERBOSE
protected void
static void
protected void
assertDocCount(IndexShard shard,
int docDount)
protected void
assertDocs(IndexShard shard,
String... ids)
protected void
closeShard(IndexShard shard,
boolean assertConsistencyBetweenTranslogAndLucene)
protected void
closeShards(Iterable<IndexShard> shards)
protected void
closeShards(IndexShard... shards)
protected Store
createStore(IndexSettings indexSettings,
ShardPath shardPath)
protected Store
createStore(ShardId shardId,
IndexSettings indexSettings,
org.apache.lucene.store.Directory directory)
static Engine.Warmer
createTestWarmer(IndexSettings indexSettings)
protected Engine.DeleteResult
deleteDoc(IndexShard shard,
String id)
protected void
protected void
flushShard(IndexShard shard)
protected void
flushShard(IndexShard shard,
boolean force)
static List<DocIdSeqNoAndSource>
getDocIdAndSeqNos(IndexShard shard)
static Engine
getEngine(IndexShard indexShard)
protected DiscoveryNode
static ReplicationTracker
getReplicationTracker(IndexShard indexShard)
getShardDocUIDs(IndexShard shard)
static Translog
getTranslog(IndexShard shard)
protected Engine.IndexResult
indexDoc(IndexShard shard,
String type,
String id)
protected Engine.IndexResult
indexDoc(IndexShard shard,
String type,
String id,
String source)
protected Engine.IndexResult
indexDoc(IndexShard shard,
String id,
String source,
org.elasticsearch.xcontent.XContentType xContentType,
String routing)
protected IndexShard
newShard(boolean primary)
protected IndexShard
protected IndexShard
newShard(boolean primary,
Settings settings,
EngineFactory engineFactory)
protected IndexShard
newShard(ShardRouting routing,
IndexMetadata indexMetadata,
org.elasticsearch.core.CheckedFunction<org.apache.lucene.index.DirectoryReader,org.apache.lucene.index.DirectoryReader,IOException> indexReaderWrapper,
EngineFactory engineFactory,
Runnable globalCheckpointSyncer,
RetentionLeaseSyncer retentionLeaseSyncer,
IndexingOperationListener... listeners)
protected IndexShard
newShard(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 IndexShard
newShard(ShardRouting shardRouting,
Settings settings,
EngineFactory engineFactory,
IndexingOperationListener... listeners)
protected IndexShard
newShard(ShardRouting shardRouting,
Settings settings,
IndexingOperationListener... listeners)
protected IndexShard
newShard(ShardRouting shardRouting,
IndexingOperationListener... listeners)
protected IndexShard
newShard(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,
Runnable globalCheckpointSyncer,
RetentionLeaseSyncer retentionLeaseSyncer,
IndexEventListener indexEventListener,
IndexingOperationListener... listeners)
protected IndexShard
newShard(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 IndexShard
newShard(ShardId shardId,
boolean primary,
String nodeId,
IndexMetadata indexMetadata,
org.elasticsearch.core.CheckedFunction<org.apache.lucene.index.DirectoryReader,org.apache.lucene.index.DirectoryReader,IOException> readerWrapper,
Runnable globalCheckpointSyncer)
protected IndexShard
newShard(ShardId shardId,
boolean primary,
IndexingOperationListener... listeners)
protected IndexShard
protected IndexShard
newStartedShard(boolean primary)
protected IndexShard
newStartedShard(boolean primary,
Settings settings)
protected IndexShard
newStartedShard(boolean primary,
Settings settings,
EngineFactory engineFactory)
protected IndexShard
newStartedShard(Settings settings)
protected IndexShard
newStartedShard(org.elasticsearch.core.CheckedFunction<Boolean,IndexShard,IOException> shardFunction,
boolean primary)
protected void
promoteReplica(IndexShard replica,
Set<String> inSyncIds,
IndexShardRoutingTable routingTable)
static boolean
recoverFromStore(IndexShard newShard)
protected void
recoverReplica(IndexShard replica,
IndexShard primary,
boolean startReplica)
protected void
recoverReplica(IndexShard replica,
IndexShard primary,
BiFunction<IndexShard,DiscoveryNode,RecoveryTarget> targetSupplier,
boolean markAsRecovering,
boolean markAsStarted)
protected void
recoverShardFromSnapshot(IndexShard shard,
Snapshot snapshot,
Repository repository)
protected void
recoverShardFromStore(IndexShard primary)
protected final void
recoverUnstartedReplica(IndexShard replica,
IndexShard primary,
BiFunction<IndexShard,DiscoveryNode,RecoveryTarget> targetSupplier,
boolean markAsRecovering,
Set<String> inSyncIds,
IndexShardRoutingTable routingTable)
protected void
recoveryEmptyReplica(IndexShard replica,
boolean startReplica)
protected IndexShard
reinitShard(IndexShard current,
ShardRouting routing,
IndexMetadata indexMetadata,
EngineFactory engineFactory,
IndexingOperationListener... listeners)
protected IndexShard
reinitShard(IndexShard current,
ShardRouting routing,
IndexingOperationListener... listeners)
protected IndexShard
reinitShard(IndexShard current,
IndexingOperationListener... listeners)
void
setUp()
protected ThreadPool
protected ShardGeneration
snapshotShard(IndexShard shard,
Snapshot snapshot,
Repository repository)
protected void
startReplicaAfterRecovery(IndexShard replica,
IndexShard primary,
Set<String> inSyncIds,
IndexShardRoutingTable routingTable)
void
tearDown()
protected void
protected void
updateMappings(IndexShard shard,
IndexMetadata indexMetadata)
static void
updateRoutingEntry(IndexShard shard,
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, getDataPath, getPortRange, getSuiteFailureMarker, getTestTransportPlugin, getTestTransportType, getWorkerBasePort, inFipsJvm, iterations, maybeRestoreClassSecurityManager, maybeSet, maybeStashClassSecurityManager, 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, randomNonEmptySubsetOf, randomNonNegativeByte, randomNonNegativeLong, randomPositiveTimeValue, randomRealisticUnicodeOfCodepointLength, randomRealisticUnicodeOfCodepointLengthBetween, randomRealisticUnicodeOfLength, randomRealisticUnicodeOfLengthBetween, randomSet, 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, shuffledList, 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, getJvmForkArguments, 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.tests.util.LuceneTestCase
Exception
tearDown
in class org.apache.lucene.tests.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