public class IndexShard extends AbstractIndexShardComponent
Modifier and Type | Field and Description |
---|---|
protected EngineConfig |
config |
protected AtomicReference<Engine> |
currentEngineReference |
protected EngineFactory |
engineFactory |
static String |
INDEX_FLUSH_ON_CLOSE
Index setting to control if a flush is executed before engine is closed
This setting is realtime updateable.
|
static String |
INDEX_REFRESH_INTERVAL
Controls how frequently we automatically refresh the near-real-time searcher.
|
protected ShardRouting |
shardRouting |
protected IndexShardState |
state |
componentSettings, indexSettings, logger, shardId
Constructor and Description |
---|
IndexShard(ShardId shardId,
Settings indexSettings,
IndexSettingsService indexSettingsService,
IndicesLifecycle indicesLifecycle,
Store store,
MergeSchedulerProvider mergeScheduler,
Translog translog,
ThreadPool threadPool,
MapperService mapperService,
IndexQueryParserService queryParserService,
IndexCache indexCache,
IndexAliasesService indexAliasesService,
ShardIndexingService indexingService,
ShardGetService getService,
ShardSearchService searchService,
ShardIndexWarmerService shardWarmerService,
ShardFilterCache shardFilterCache,
ShardFieldData shardFieldData,
PercolatorQueriesRegistry percolatorQueriesRegistry,
ShardPercolateService shardPercolateService,
CodecService codecService,
ShardTermVectorService termVectorService,
IndexFieldDataService indexFieldDataService,
IndexService indexService,
ShardSuggestService shardSuggestService,
ShardQueryCache shardQueryCache,
ShardFixedBitSetFilterCache shardFixedBitSetFilterCache,
IndicesWarmer warmer,
SnapshotDeletionPolicy deletionPolicy,
AnalysisService analysisService,
SimilarityService similarityService,
MergePolicyProvider mergePolicyProvider,
EngineFactory factory,
ClusterService clusterService) |
indexSettings, nodeName, shardId
protected volatile ShardRouting shardRouting
protected volatile IndexShardState state
protected final AtomicReference<Engine> currentEngineReference
protected final EngineConfig config
protected final EngineFactory engineFactory
public static final String INDEX_FLUSH_ON_CLOSE
public static final String INDEX_REFRESH_INTERVAL
@Inject public IndexShard(ShardId shardId, @IndexSettings Settings indexSettings, IndexSettingsService indexSettingsService, IndicesLifecycle indicesLifecycle, Store store, MergeSchedulerProvider mergeScheduler, Translog translog, ThreadPool threadPool, MapperService mapperService, IndexQueryParserService queryParserService, IndexCache indexCache, IndexAliasesService indexAliasesService, ShardIndexingService indexingService, ShardGetService getService, ShardSearchService searchService, ShardIndexWarmerService shardWarmerService, ShardFilterCache shardFilterCache, ShardFieldData shardFieldData, PercolatorQueriesRegistry percolatorQueriesRegistry, ShardPercolateService shardPercolateService, CodecService codecService, ShardTermVectorService termVectorService, IndexFieldDataService indexFieldDataService, IndexService indexService, ShardSuggestService shardSuggestService, ShardQueryCache shardQueryCache, ShardFixedBitSetFilterCache shardFixedBitSetFilterCache, @Nullable IndicesWarmer warmer, SnapshotDeletionPolicy deletionPolicy, AnalysisService analysisService, SimilarityService similarityService, MergePolicyProvider mergePolicyProvider, EngineFactory factory, ClusterService clusterService)
public MergeSchedulerProvider mergeScheduler()
public Store store()
public Translog translog()
public ShardIndexingService indexingService()
public ShardGetService getService()
public ShardTermVectorService termVectorService()
public ShardSuggestService shardSuggestService()
public ShardFixedBitSetFilterCache shardFixedBitSetFilterCache()
public IndexFieldDataService indexFieldDataService()
public MapperService mapperService()
public IndexService indexService()
public ShardSearchService searchService()
public ShardIndexWarmerService warmerService()
public ShardFilterCache filterCache()
public ShardQueryCache queryCache()
public ShardFieldData fieldData()
public ShardRouting routingEntry()
public IndexShard routingEntry(ShardRouting newRouting)
public IndexShardState recovering(String reason, RecoveryState.Type type, DiscoveryNode sourceNode) throws IndexShardStartedException, IndexShardRelocatedException, IndexShardRecoveringException, IndexShardClosedException
public IndexShardState recovering(String reason, RecoveryState.Type type, RestoreSource restoreSource) throws IndexShardStartedException
IndexShardStartedException
public IndexShard relocated(String reason) throws IndexShardNotStartedException
IndexShardNotStartedException
public IndexShardState state()
public Engine.Create prepareCreate(SourceToParse source, long version, VersionType versionType, Engine.Operation.Origin origin, boolean canHaveDuplicates, boolean autoGeneratedId) throws ElasticsearchException
ElasticsearchException
public ParsedDocument create(Engine.Create create) throws ElasticsearchException
ElasticsearchException
public Engine.Index prepareIndex(SourceToParse source, long version, VersionType versionType, Engine.Operation.Origin origin, boolean canHaveDuplicates) throws ElasticsearchException
ElasticsearchException
public ParsedDocument index(Engine.Index index) throws ElasticsearchException
ElasticsearchException
public Engine.Delete prepareDelete(String type, String id, long version, VersionType versionType, Engine.Operation.Origin origin) throws ElasticsearchException
ElasticsearchException
public void delete(Engine.Delete delete) throws ElasticsearchException
ElasticsearchException
public Engine.DeleteByQuery prepareDeleteByQuery(BytesReference source, @Nullable String[] filteringAliases, Engine.Operation.Origin origin, String... types) throws ElasticsearchException
ElasticsearchException
public void deleteByQuery(Engine.DeleteByQuery deleteByQuery) throws ElasticsearchException
ElasticsearchException
public Engine.GetResult get(Engine.Get get) throws ElasticsearchException
ElasticsearchException
public void refresh(String source) throws ElasticsearchException
ElasticsearchException
public RefreshStats refreshStats()
public FlushStats flushStats()
public DocsStats docStats()
public IndexingStats indexingStats(String... types)
public SearchStats searchStats(String... groups)
public GetStats getStats()
public StoreStats storeStats()
public MergeStats mergeStats()
public SegmentsStats segmentStats()
public WarmerStats warmerStats()
public FilterCacheStats filterCacheStats()
public FieldDataStats fieldDataStats(String... fields)
public PercolatorQueriesRegistry percolateRegistry()
public ShardPercolateService shardPercolateService()
public IdCacheStats idCacheStats()
public TranslogStats translogStats()
public SuggestStats suggestStats()
public CompletionStats completionStats(String... fields)
public void flush(FlushRequest request) throws ElasticsearchException
ElasticsearchException
public void optimize(OptimizeRequest optimize) throws ElasticsearchException
ElasticsearchException
public SnapshotIndexCommit snapshotIndex() throws EngineException
EngineException
public void recover(Engine.RecoveryHandler recoveryHandler) throws EngineException
EngineException
public Engine.Searcher acquireSearcher(String source)
public Engine.Searcher acquireSearcher(String source, boolean searcherForWriteOperation)
public void close(String reason, boolean flushEngine) throws IOException
IOException
public IndexShard postRecovery(String reason) throws IndexShardStartedException, IndexShardRelocatedException, IndexShardClosedException
public void prepareForIndexRecovery() throws ElasticsearchException
ElasticsearchException
public void prepareForTranslogRecovery() throws ElasticsearchException
ElasticsearchException
public void performRecoveryRestart() throws IOException
IOException
public RecoveryStats recoveryStats()
public RecoveryState recoveryState()
RecoveryState
if this shard is recovering or has been recovering.
Returns null if the recovery has not yet started or shard was not recovered (created via an API).public void finalizeRecovery()
postRecovery(String)
.public Engine.IndexingOperation performRecoveryOperation(Translog.Operation operation) throws ElasticsearchException
ElasticsearchException
protected void clearUnreferencedTranslogs()
public boolean ignoreRecoveryAttempt()
public void readAllowed() throws IllegalIndexShardStateException
IllegalIndexShardStateException
protected final void verifyStartedOrRecovering() throws IllegalIndexShardStateException
IllegalIndexShardStateException
protected final void verifyStarted() throws IllegalIndexShardStateException
IllegalIndexShardStateException
public void addFailedEngineListener(Engine.FailedEngineListener failedEngineListener)
public void updateBufferSize(ByteSizeValue shardIndexingBufferSize, ByteSizeValue shardTranslogBufferSize)
public void markAsInactive()
public final boolean isFlushOnClose()
public Engine engine()
protected Engine engineUnsafe()
protected Engine newEngine()
public boolean allowsPrimaryPromotion()
true
iff this shard allows primary promotion, otherwise false
Copyright © 2009–2015. All rights reserved.