public final class ShadowIndexShard extends IndexShard
IndexShard
to add file synchronization
from the primary when a flush happens. It also ensures that a replica being
promoted to a primary causes the shard to fail, kicking off a re-allocation
of the primary shard.IndexShard.ShardFailure
currentEngineReference, engineFactory, primaryTerm, shardRouting, state, writeAllowedStatesForPrimary
deprecationLogger, indexSettings, logger, shardId
Constructor and Description |
---|
ShadowIndexShard(ShardId shardId,
IndexSettings indexSettings,
ShardPath path,
Store store,
IndexCache indexCache,
MapperService mapperService,
SimilarityService similarityService,
IndexFieldDataService indexFieldDataService,
EngineFactory engineFactory,
IndexEventListener indexEventListener,
IndexSearcherWrapper wrapper,
ThreadPool threadPool,
BigArrays bigArrays,
Engine.Warmer engineWarmer,
java.util.List<SearchOperationListener> searchOperationListeners) |
Modifier and Type | Method and Description |
---|---|
boolean |
allowsPrimaryPromotion()
Returns
true iff this shard allows primary promotion, otherwise false |
boolean |
canIndex()
returns true if this shard supports indexing (i.e., write) operations.
|
MergeStats |
mergeStats() |
protected Engine |
newEngine(EngineConfig config) |
boolean |
shouldFlush()
Returns
true iff this shard needs to be flushed due to too many translog operation or a too large transaction log. |
TranslogStats |
translogStats() |
void |
updateRoutingEntry(ShardRouting newRouting,
boolean persistState)
In addition to the regular accounting done in
IndexShard.updateRoutingEntry(ShardRouting, boolean) ,
if this shadow replica needs to be promoted to a primary, the shard is
failed in order to allow a new primary to be re-allocated. |
acquirePrimaryOperationLock, acquireReplicaOperationLock, acquireSearcher, acquireTranslogView, activateThrottling, addShardFailureCallback, checkIdle, close, commitStats, completionStats, deactivateThrottling, delete, docStats, failShard, fieldData, fieldDataStats, finalizeRecovery, flush, flushAndCloseEngine, flushStats, forceMerge, get, getActiveOperationsCount, getEngineOrNull, getIndexBufferRAMBytesUsed, getIndexEventListener, getPrimaryTerm, getQueryCachingPolicy, getSearchOperationListener, getService, getStats, getTranslog, getTranslogDurability, getWritingBytes, ignoreRecoveryAttempt, index, indexFieldDataService, indexingStats, isActive, isRefreshNeeded, mapperService, markAsRecovering, maybeFlush, minimumCompatibleVersion, noopUpdate, onSettingsChanged, performBatchRecovery, performRecoveryRestart, performTranslogRecovery, postRecovery, prepareDeleteOnPrimary, prepareDeleteOnReplica, prepareForIndexRecovery, prepareIndexOnPrimary, prepareIndexOnReplica, readAllowed, recoverFromStore, recoveryState, recoveryStats, refresh, refreshStats, releaseSnapshot, relocated, requestCache, restoreFromRepository, routingEntry, searchStats, segments, segmentStats, shardBitsetFilterCache, shardPath, skipTranslogRecovery, snapshotIndex, state, store, storeStats, sync, syncFlush, updatePrimaryTerm, upgrade, verifyStarted, verifyStartedOrRecovering, warmerService, warmerStats, writeIndexingBuffer
indexSettings, nodeName, shardId
public ShadowIndexShard(ShardId shardId, IndexSettings indexSettings, ShardPath path, Store store, IndexCache indexCache, MapperService mapperService, SimilarityService similarityService, IndexFieldDataService indexFieldDataService, @Nullable EngineFactory engineFactory, IndexEventListener indexEventListener, IndexSearcherWrapper wrapper, ThreadPool threadPool, BigArrays bigArrays, Engine.Warmer engineWarmer, java.util.List<SearchOperationListener> searchOperationListeners) throws java.io.IOException
java.io.IOException
public void updateRoutingEntry(ShardRouting newRouting, boolean persistState) throws java.io.IOException
IndexShard.updateRoutingEntry(ShardRouting, boolean)
,
if this shadow replica needs to be promoted to a primary, the shard is
failed in order to allow a new primary to be re-allocated.updateRoutingEntry
in class IndexShard
java.io.IOException
- if shard state could not be persistedpublic MergeStats mergeStats()
mergeStats
in class IndexShard
public boolean canIndex()
IndexShard
canIndex
in class IndexShard
protected Engine newEngine(EngineConfig config)
newEngine
in class IndexShard
public boolean shouldFlush()
IndexShard
true
iff this shard needs to be flushed due to too many translog operation or a too large transaction log.
Otherwise false
.public boolean allowsPrimaryPromotion()
IndexShard
true
iff this shard allows primary promotion, otherwise false
allowsPrimaryPromotion
in class IndexShard
public TranslogStats translogStats()
translogStats
in class IndexShard