Package org.elasticsearch.index.engine
Class EngineConfig
java.lang.Object
org.elasticsearch.index.engine.EngineConfig
public final class EngineConfig
extends java.lang.Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceEngineConfig.TombstoneDocSupplierA supplier supplies tombstone documents which will be used in soft-update methods. -
Field Summary
Fields Modifier and Type Field Description static Setting<java.lang.String>INDEX_CODEC_SETTINGIndex setting to change the low level lucene codec used for writing new segments.static Setting<java.lang.Boolean>INDEX_OPTIMIZE_AUTO_GENERATED_IDSConfigures an index to optimize documents with auto generated ids for append only. -
Constructor Summary
Constructors Constructor Description EngineConfig(ShardId shardId, java.lang.String allocationId, ThreadPool threadPool, IndexSettings indexSettings, Engine.Warmer warmer, Store store, org.apache.lucene.index.MergePolicy mergePolicy, org.apache.lucene.analysis.Analyzer analyzer, org.apache.lucene.search.similarities.Similarity similarity, CodecService codecService, Engine.EventListener eventListener, org.apache.lucene.search.QueryCache queryCache, org.apache.lucene.search.QueryCachingPolicy queryCachingPolicy, TranslogConfig translogConfig, org.elasticsearch.common.unit.TimeValue flushMergesAfter, java.util.List<org.apache.lucene.search.ReferenceManager.RefreshListener> externalRefreshListener, java.util.List<org.apache.lucene.search.ReferenceManager.RefreshListener> internalRefreshListener, org.apache.lucene.search.Sort indexSort, CircuitBreakerService circuitBreakerService, java.util.function.LongSupplier globalCheckpointSupplier, java.util.function.Supplier<RetentionLeases> retentionLeasesSupplier, java.util.function.LongSupplier primaryTermSupplier, EngineConfig.TombstoneDocSupplier tombstoneDocSupplier)Creates a newEngineConfig -
Method Summary
Modifier and Type Method Description java.lang.StringgetAllocationId()Returns the allocation ID for the shard.org.apache.lucene.analysis.AnalyzergetAnalyzer()Returns the analyzer as the default analyzer in the enginesIndexWriterCircuitBreakerServicegetCircuitBreakerService()Returns the circuit breaker service for this engine, ornullif none is to be used.org.apache.lucene.codecs.CodecgetCodec()Returns theCodecused in the enginesIndexWriterEngine.EventListenergetEventListener()Returns a listener that should be called on engine failurejava.util.List<org.apache.lucene.search.ReferenceManager.RefreshListener>getExternalRefreshListener()The refresh listeners to add to Lucene for externally visible refreshesorg.elasticsearch.common.unit.TimeValuegetFlushMergesAfter()Returns aTimeValueat what time interval after the last write modification to the engine finished merges should be automatically flushed.java.util.function.LongSuppliergetGlobalCheckpointSupplier()Returns the global checkpoint trackerByteSizeValuegetIndexingBufferSize()Returns the initial index buffer size.IndexSettingsgetIndexSettings()Returns the index settings for this index.org.apache.lucene.search.SortgetIndexSort()Return the sort order of this index, or null if the index has no sort.java.util.List<org.apache.lucene.search.ReferenceManager.RefreshListener>getInternalRefreshListener()The refresh listeners to add to Lucene for internally visible refreshes.org.apache.lucene.index.MergePolicygetMergePolicy()Returns theMergePolicyfor the enginesIndexWriterjava.util.function.LongSuppliergetPrimaryTermSupplier()Returns a supplier that supplies the latest primary term value of the associated shard.org.apache.lucene.search.QueryCachegetQueryCache()Return the cache to use for queries.org.apache.lucene.search.QueryCachingPolicygetQueryCachingPolicy()Return the policy to use when caching queries.ShardIdgetShardId()Returns the engines shard IDorg.apache.lucene.search.similarities.SimilaritygetSimilarity()Returns theSimilarityused for indexing and searching.StoregetStore()Returns theStoreinstance that provides access to theDirectoryused for the enginesIndexWriterto write it's index files to.ThreadPoolgetThreadPool()Returns a thread-pool mainly used to get estimated time stamps fromThreadPool.relativeTimeInMillis()and to schedule async force merge calls on theThreadPool.Names.FORCE_MERGEthread-poolEngineConfig.TombstoneDocSuppliergetTombstoneDocSupplier()TranslogConfiggetTranslogConfig()Returns the translog config for this engineEngine.WarmergetWarmer()Returns anEngine.Warmerused to warm new searchers before they are used for searching.booleanisAutoGeneratedIDsOptimizationEnabled()returns true if the engine is allowed to optimize indexing operations with an auto-generated IDbooleanisEnableGcDeletes()Returnstrueiff delete garbage collection in the engine should be enabled.java.util.function.Supplier<RetentionLeases>retentionLeasesSupplier()A supplier of the outstanding retention leases.voidsetEnableGcDeletes(boolean enableGcDeletes)Enables / disables gc deletes
-
Field Details
-
INDEX_CODEC_SETTING
Index setting to change the low level lucene codec used for writing new segments. This setting is not realtime updateable. This setting is also settable on the node and the index level, it's commonly used in hot/cold node archs where index is likely allocated on both `kind` of nodes. -
INDEX_OPTIMIZE_AUTO_GENERATED_IDS
Configures an index to optimize documents with auto generated ids for append only. If this setting is updated fromfalsetotruemight not take effect immediately. In other words, disabling the optimization will be immediately applied while re-enabling it might not be applied until the engine is in a safe state to do so. Depending on the engine implementation a change to this setting won't be reflected re-enabled optimization until the engine is restarted or the index is closed and reopened. The default istrue
-
-
Constructor Details
-
EngineConfig
public EngineConfig(ShardId shardId, java.lang.String allocationId, ThreadPool threadPool, IndexSettings indexSettings, Engine.Warmer warmer, Store store, org.apache.lucene.index.MergePolicy mergePolicy, org.apache.lucene.analysis.Analyzer analyzer, org.apache.lucene.search.similarities.Similarity similarity, CodecService codecService, Engine.EventListener eventListener, org.apache.lucene.search.QueryCache queryCache, org.apache.lucene.search.QueryCachingPolicy queryCachingPolicy, TranslogConfig translogConfig, org.elasticsearch.common.unit.TimeValue flushMergesAfter, java.util.List<org.apache.lucene.search.ReferenceManager.RefreshListener> externalRefreshListener, java.util.List<org.apache.lucene.search.ReferenceManager.RefreshListener> internalRefreshListener, org.apache.lucene.search.Sort indexSort, CircuitBreakerService circuitBreakerService, java.util.function.LongSupplier globalCheckpointSupplier, java.util.function.Supplier<RetentionLeases> retentionLeasesSupplier, java.util.function.LongSupplier primaryTermSupplier, EngineConfig.TombstoneDocSupplier tombstoneDocSupplier)Creates a newEngineConfig
-
-
Method Details
-
retentionLeasesSupplier
A supplier of the outstanding retention leases. This is used during merged operations to determine which operations that have been soft deleted should be retained.- Returns:
- a supplier of outstanding retention leases
-
setEnableGcDeletes
public void setEnableGcDeletes(boolean enableGcDeletes)Enables / disables gc deletes- See Also:
isEnableGcDeletes()
-
getIndexingBufferSize
Returns the initial index buffer size. This setting is only read on startup and otherwise controlled byIndexingMemoryController -
isEnableGcDeletes
public boolean isEnableGcDeletes()Returnstrueiff delete garbage collection in the engine should be enabled. This setting is updateable in realtime and forces a volatile read. Consumers can safely read this value directly go fetch it's latest value. The default istrueEngine GC deletion if enabled collects deleted documents from in-memory realtime data structures after a certain amount of time (
IndexSettings.getGcDeletesInMillis()if enabled. Before deletes are GCed they will cause re-adding the document that was deleted to fail. -
getCodec
public org.apache.lucene.codecs.Codec getCodec()Returns theCodecused in the enginesIndexWriterNote: this settings is only read on startup.
-
getThreadPool
Returns a thread-pool mainly used to get estimated time stamps fromThreadPool.relativeTimeInMillis()and to schedule async force merge calls on theThreadPool.Names.FORCE_MERGEthread-pool -
getWarmer
Returns anEngine.Warmerused to warm new searchers before they are used for searching. -
getStore
Returns theStoreinstance that provides access to theDirectoryused for the enginesIndexWriterto write it's index files to.Note: In order to use this instance the consumer needs to increment the stores reference before it's used the first time and hold it's reference until it's not needed anymore.
-
getGlobalCheckpointSupplier
public java.util.function.LongSupplier getGlobalCheckpointSupplier()Returns the global checkpoint tracker -
getMergePolicy
public org.apache.lucene.index.MergePolicy getMergePolicy()Returns theMergePolicyfor the enginesIndexWriter -
getEventListener
Returns a listener that should be called on engine failure -
getIndexSettings
Returns the index settings for this index. -
getShardId
Returns the engines shard ID -
getAllocationId
public java.lang.String getAllocationId()Returns the allocation ID for the shard.- Returns:
- the allocation ID
-
getAnalyzer
public org.apache.lucene.analysis.Analyzer getAnalyzer()Returns the analyzer as the default analyzer in the enginesIndexWriter -
getSimilarity
public org.apache.lucene.search.similarities.Similarity getSimilarity()Returns theSimilarityused for indexing and searching. -
getQueryCache
public org.apache.lucene.search.QueryCache getQueryCache()Return the cache to use for queries. -
getQueryCachingPolicy
public org.apache.lucene.search.QueryCachingPolicy getQueryCachingPolicy()Return the policy to use when caching queries. -
getTranslogConfig
Returns the translog config for this engine -
getFlushMergesAfter
public org.elasticsearch.common.unit.TimeValue getFlushMergesAfter()Returns aTimeValueat what time interval after the last write modification to the engine finished merges should be automatically flushed. This is used to free up transient disk usage of potentially large segments that are written after the engine became inactive from an indexing perspective. -
getExternalRefreshListener
public java.util.List<org.apache.lucene.search.ReferenceManager.RefreshListener> getExternalRefreshListener()The refresh listeners to add to Lucene for externally visible refreshes -
getInternalRefreshListener
public java.util.List<org.apache.lucene.search.ReferenceManager.RefreshListener> getInternalRefreshListener()The refresh listeners to add to Lucene for internally visible refreshes. These listeners will also be invoked on external refreshes -
isAutoGeneratedIDsOptimizationEnabled
public boolean isAutoGeneratedIDsOptimizationEnabled()returns true if the engine is allowed to optimize indexing operations with an auto-generated ID -
getIndexSort
public org.apache.lucene.search.Sort getIndexSort()Return the sort order of this index, or null if the index has no sort. -
getCircuitBreakerService
Returns the circuit breaker service for this engine, ornullif none is to be used. -
getPrimaryTermSupplier
public java.util.function.LongSupplier getPrimaryTermSupplier()Returns a supplier that supplies the latest primary term value of the associated shard. -
getTombstoneDocSupplier
-