public final class EngineConfig
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
EngineConfig.OpenMode
Engine open mode defines how the engine should be opened or in other words what the engine should expect
to recover from.
|
Modifier and Type | Field and Description |
---|---|
static Setting<java.lang.String> |
INDEX_CODEC_SETTING
Index setting to change the low level lucene codec used for writing new segments.
|
static Setting<java.lang.Boolean> |
INDEX_OPTIMIZE_AUTO_GENERATED_IDS
Configures an index to optimize documents with auto generated ids for append only.
|
Constructor and Description |
---|
EngineConfig(EngineConfig.OpenMode openMode,
ShardId shardId,
ThreadPool threadPool,
IndexSettings indexSettings,
Engine.Warmer warmer,
Store store,
org.apache.lucene.index.SnapshotDeletionPolicy deletionPolicy,
org.apache.lucene.index.MergePolicy mergePolicy,
org.apache.lucene.analysis.Analyzer analyzer,
org.apache.lucene.search.similarities.Similarity similarity,
CodecService codecService,
Engine.EventListener eventListener,
TranslogRecoveryPerformer translogRecoveryPerformer,
org.apache.lucene.search.QueryCache queryCache,
org.apache.lucene.search.QueryCachingPolicy queryCachingPolicy,
TranslogConfig translogConfig,
TimeValue flushMergesAfter,
java.util.List<org.apache.lucene.search.ReferenceManager.RefreshListener> refreshListeners,
long maxUnsafeAutoIdTimestamp)
Creates a new
EngineConfig |
Modifier and Type | Method and Description |
---|---|
org.apache.lucene.analysis.Analyzer |
getAnalyzer()
Returns the analyzer as the default analyzer in the engines
IndexWriter |
org.apache.lucene.codecs.Codec |
getCodec()
Returns the
Codec used in the engines IndexWriter |
org.apache.lucene.index.SnapshotDeletionPolicy |
getDeletionPolicy()
Returns a
SnapshotDeletionPolicy used in the engines
IndexWriter . |
Engine.EventListener |
getEventListener()
Returns a listener that should be called on engine failure
|
TimeValue |
getFlushMergesAfter()
Returns a
TimeValue at what time interval after the last write modification to the engine finished merges
should be automatically flushed. |
ByteSizeValue |
getIndexingBufferSize()
Returns the initial index buffer size.
|
IndexSettings |
getIndexSettings()
Returns the index settings for this index.
|
long |
getMaxUnsafeAutoIdTimestamp()
Returns the max timestamp that is used to de-optimize documents with auto-generated IDs in the engine.
|
org.apache.lucene.index.MergePolicy |
getMergePolicy()
Returns the
MergePolicy for the engines IndexWriter |
EngineConfig.OpenMode |
getOpenMode()
Returns the
EngineConfig.OpenMode for this engine config. |
org.apache.lucene.search.QueryCache |
getQueryCache()
Return the cache to use for queries.
|
org.apache.lucene.search.QueryCachingPolicy |
getQueryCachingPolicy()
Return the policy to use when caching queries.
|
java.util.List<org.apache.lucene.search.ReferenceManager.RefreshListener> |
getRefreshListeners()
The refresh listeners to add to Lucene
|
ShardId |
getShardId()
Returns the engines shard ID
|
org.apache.lucene.search.similarities.Similarity |
getSimilarity()
Returns the
Similarity used for indexing and searching. |
Store |
getStore()
Returns the
Store instance that provides access to the
Directory used for the engines IndexWriter to write it's index files
to. |
ThreadPool |
getThreadPool()
Returns a thread-pool mainly used to get estimated time stamps from
ThreadPool.relativeTimeInMillis() and to schedule
async force merge calls on the ThreadPool.Names.FORCE_MERGE thread-pool |
TranslogConfig |
getTranslogConfig()
Returns the translog config for this engine
|
TranslogRecoveryPerformer |
getTranslogRecoveryPerformer()
Returns the
TranslogRecoveryPerformer for this engine. |
Engine.Warmer |
getWarmer()
Returns an
Engine.Warmer used to warm new searchers before they are used for searching. |
boolean |
isEnableGcDeletes()
Returns
true iff delete garbage collection in the engine should be enabled. |
void |
setEnableGcDeletes(boolean enableGcDeletes)
Enables / disables gc deletes
|
public static final Setting<java.lang.String> INDEX_CODEC_SETTING
public static final Setting<java.lang.Boolean> INDEX_OPTIMIZE_AUTO_GENERATED_IDS
false
to true
might not take effect immediately. In other words, disabling the optimiation 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 is true
public EngineConfig(EngineConfig.OpenMode openMode, ShardId shardId, ThreadPool threadPool, IndexSettings indexSettings, Engine.Warmer warmer, Store store, org.apache.lucene.index.SnapshotDeletionPolicy deletionPolicy, org.apache.lucene.index.MergePolicy mergePolicy, org.apache.lucene.analysis.Analyzer analyzer, org.apache.lucene.search.similarities.Similarity similarity, CodecService codecService, Engine.EventListener eventListener, TranslogRecoveryPerformer translogRecoveryPerformer, org.apache.lucene.search.QueryCache queryCache, org.apache.lucene.search.QueryCachingPolicy queryCachingPolicy, TranslogConfig translogConfig, TimeValue flushMergesAfter, java.util.List<org.apache.lucene.search.ReferenceManager.RefreshListener> refreshListeners, long maxUnsafeAutoIdTimestamp)
EngineConfig
public void setEnableGcDeletes(boolean enableGcDeletes)
isEnableGcDeletes()
public ByteSizeValue getIndexingBufferSize()
IndexingMemoryController
public boolean isEnableGcDeletes()
true
iff 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 is true
Engine 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.
public org.apache.lucene.codecs.Codec getCodec()
Codec
used in the engines IndexWriter
Note: this settings is only read on startup.
public ThreadPool getThreadPool()
ThreadPool.relativeTimeInMillis()
and to schedule
async force merge calls on the ThreadPool.Names.FORCE_MERGE
thread-poolpublic Engine.Warmer getWarmer()
Engine.Warmer
used to warm new searchers before they are used for searching.public Store getStore()
Store
instance that provides access to the
Directory
used for the engines IndexWriter
to 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.
public org.apache.lucene.index.SnapshotDeletionPolicy getDeletionPolicy()
SnapshotDeletionPolicy
used in the engines
IndexWriter
.public org.apache.lucene.index.MergePolicy getMergePolicy()
MergePolicy
for the engines IndexWriter
public Engine.EventListener getEventListener()
public IndexSettings getIndexSettings()
public ShardId getShardId()
public org.apache.lucene.analysis.Analyzer getAnalyzer()
IndexWriter
public org.apache.lucene.search.similarities.Similarity getSimilarity()
Similarity
used for indexing and searching.public TranslogRecoveryPerformer getTranslogRecoveryPerformer()
TranslogRecoveryPerformer
for this engine. This class is used
to apply transaction log operations to the engine. It encapsulates all the logic to transfer the translog entry into
an indexing operation.public org.apache.lucene.search.QueryCache getQueryCache()
public org.apache.lucene.search.QueryCachingPolicy getQueryCachingPolicy()
public TranslogConfig getTranslogConfig()
public TimeValue getFlushMergesAfter()
TimeValue
at 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.public EngineConfig.OpenMode getOpenMode()
EngineConfig.OpenMode
for this engine config.public java.util.List<org.apache.lucene.search.ReferenceManager.RefreshListener> getRefreshListeners()
public long getMaxUnsafeAutoIdTimestamp()