public final class EngineConfig extends Object
Modifier and Type | Field and Description |
---|---|
static TimeValue |
DEFAULT_GC_DELETES |
static TimeValue |
DEFAULT_REFRESH_INTERVAL |
static String |
DEFAULT_VERSION_MAP_SIZE |
static ByteSizeValue |
DEFAUTL_INDEX_BUFFER_SIZE |
static ByteSizeValue |
INACTIVE_SHARD_INDEXING_BUFFER |
static String |
INDEX_BUFFER_SIZE_SETTING
Index setting to control the initial index buffer size.
|
static String |
INDEX_CHECKSUM_ON_MERGE
Index setting to enable / disable checksum checks on merge
This setting is realtime updateable.
|
static String |
INDEX_CODEC_SETTING
Index setting to change the low level lucene codec used for writing new segments.
|
static String |
INDEX_COMPOUND_ON_FLUSH
Index setting for compound file on flush.
|
static String |
INDEX_CONCURRENCY_SETTING
Index setting for index concurrency / number of threadstates in the indexwriter.
|
static String |
INDEX_FAIL_ON_CORRUPTION_SETTING
Index setting to enable / disable engine failures on detected index corruptions.
|
static String |
INDEX_FAIL_ON_MERGE_FAILURE_SETTING
Index setting to enable / disable engine failures on merge exceptions.
|
static String |
INDEX_GC_DELETES_SETTING
Index setting to enable / disable deletes garbage collection.
|
static String |
INDEX_OPTIMIZE_AUTOGENERATED_ID_SETTING
Setting to control auto generated ID optimizations.
|
static String |
INDEX_VERSION_MAP_SIZE
The maximum size the version map should grow to before issuing a refresh.
|
Constructor and Description |
---|
EngineConfig(ShardId shardId,
boolean optimizeAutoGenerateId,
ThreadPool threadPool,
ShardIndexingService indexingService,
IndexSettingsService indexSettingsService,
IndicesWarmer warmer,
Store store,
SnapshotDeletionPolicy deletionPolicy,
Translog translog,
MergePolicyProvider mergePolicyProvider,
MergeSchedulerProvider mergeScheduler,
org.apache.lucene.analysis.Analyzer analyzer,
org.apache.lucene.search.similarities.Similarity similarity,
CodecService codecService,
Engine.FailedEngineListener failedEngineListener)
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 |
SnapshotDeletionPolicy |
getDeletionPolicy()
Returns a
SnapshotDeletionPolicy used in the engines
IndexWriter . |
Engine.FailedEngineListener |
getFailedEngineListener()
Returns a listener that should be called on engine failure
|
long |
getGcDeletesInMillis()
Returns the GC deletes cycle in milliseconds.
|
int |
getIndexConcurrency()
Returns the index concurrency that directly translates into the number of thread states used in the engines
IndexWriter . |
ByteSizeValue |
getIndexingBufferSize()
Returns the initial index buffer size.
|
ShardIndexingService |
getIndexingService()
Returns a
ShardIndexingService used inside the engine to inform about
pre and post index and create operations. |
Settings |
getIndexSettings()
Returns the latest index settings directly from the index settings service.
|
MergePolicyProvider |
getMergePolicyProvider()
|
MergeSchedulerProvider |
getMergeScheduler()
|
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.estimatedTimeInMillis() and to schedule
async force merge calls on the ThreadPool.Names.OPTIMIZE thread-pool |
Translog |
getTranslog()
Returns a
instance |
ByteSizeValue |
getVersionMapSize()
returns the size of the version map that should trigger a refresh
|
String |
getVersionMapSizeSetting()
current setting for the version map size that should trigger a refresh.
|
IndicesWarmer |
getWarmer()
Returns an
IndicesWarmer used to warm new searchers before they are used for searching. |
boolean |
isChecksumOnMerge()
Returns
true iff checksums are checked on merge |
boolean |
isCompoundOnFlush()
Returns
true iff flushed segments should be written as compound file system. |
boolean |
isEnableGcDeletes()
Returns
true iff delete garbage collection in the engine should be enabled. |
boolean |
isFailEngineOnCorruption()
Returns
true if the engine should be failed in the case of a corrupted index. |
boolean |
isFailOnMergeFailure()
Returns
true iff the engine should be failed if a merge error is hit. |
boolean |
isOptimizeAutoGenerateId()
Returns
true iff documents with auto-generated IDs are optimized if possible. |
void |
setChecksumOnMerge(boolean checksumOnMerge)
Sets if checksums should be validated on merge
|
void |
setCompoundOnFlush(boolean compoundOnFlush)
Sets if flushed segments should be written as compound file system.
|
void |
setEnableGcDeletes(boolean enableGcDeletes)
Enables / disables gc deletes
|
void |
setFailEngineOnCorruption(boolean failEngineOnCorruption)
Sets if the engine should be failed in the case of a corrupted index.
|
void |
setFailOnMergeFailure(boolean failOnMergeFailure)
Sets if the engine should be failed if a merge error is hit.
|
void |
setGcDeletesInMillis(long gcDeletesInMillis)
Sets the GC deletes cycle in milliseconds.
|
void |
setIndexingBufferSize(ByteSizeValue indexingBufferSize)
Sets the indexing buffer
|
void |
setVersionMapSizeSetting(String versionMapSizeSetting)
Settings the version map size that should trigger a refresh.
|
public static final String INDEX_CONCURRENCY_SETTING
public static final String INDEX_COMPOUND_ON_FLUSH
public static final String INDEX_OPTIMIZE_AUTOGENERATED_ID_SETTING
true
if not present.
This setting is not realtime updateable.public static final String INDEX_GC_DELETES_SETTING
public static final String INDEX_FAIL_ON_MERGE_FAILURE_SETTING
true
/ enabled.
This setting is realtime updateable.public static final String INDEX_FAIL_ON_CORRUPTION_SETTING
true
/ enabled.
This setting is realtime updateable.public static final String INDEX_BUFFER_SIZE_SETTING
public static final String INDEX_CODEC_SETTING
public static final String INDEX_CHECKSUM_ON_MERGE
public static final String INDEX_VERSION_MAP_SIZE
public static final TimeValue DEFAULT_REFRESH_INTERVAL
public static final TimeValue DEFAULT_GC_DELETES
public static final ByteSizeValue DEFAUTL_INDEX_BUFFER_SIZE
public static final ByteSizeValue INACTIVE_SHARD_INDEXING_BUFFER
public static final String DEFAULT_VERSION_MAP_SIZE
public EngineConfig(ShardId shardId, boolean optimizeAutoGenerateId, ThreadPool threadPool, ShardIndexingService indexingService, IndexSettingsService indexSettingsService, IndicesWarmer warmer, Store store, SnapshotDeletionPolicy deletionPolicy, Translog translog, MergePolicyProvider mergePolicyProvider, MergeSchedulerProvider mergeScheduler, org.apache.lucene.analysis.Analyzer analyzer, org.apache.lucene.search.similarities.Similarity similarity, CodecService codecService, Engine.FailedEngineListener failedEngineListener)
EngineConfig
public void setVersionMapSizeSetting(String versionMapSizeSetting)
INDEX_VERSION_MAP_SIZE
for details.public String getVersionMapSizeSetting()
INDEX_VERSION_MAP_SIZE
for details.public ByteSizeValue getVersionMapSize()
public void setIndexingBufferSize(ByteSizeValue indexingBufferSize)
public void setEnableGcDeletes(boolean enableGcDeletes)
isEnableGcDeletes()
public boolean isFailOnMergeFailure()
true
iff the engine should be failed if a merge error is hit. Defaults to true
public boolean isFailEngineOnCorruption()
true
if the engine should be failed in the case of a corrupted index. Defaults to true
public ByteSizeValue getIndexingBufferSize()
IndexingMemoryController
public int getIndexConcurrency()
IndexWriter
.IndexWriterConfig.getMaxThreadStates()
public boolean isCompoundOnFlush()
true
iff flushed segments should be written as compound file system. Defaults to true
public long getGcDeletesInMillis()
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 (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 boolean isOptimizeAutoGenerateId()
true
iff documents with auto-generated IDs are optimized if possible. This mainly means that
they are simply appended to the index if no update call is necessary.public ThreadPool getThreadPool()
ThreadPool.estimatedTimeInMillis()
and to schedule
async force merge calls on the ThreadPool.Names.OPTIMIZE
thread-poolpublic ShardIndexingService getIndexingService()
ShardIndexingService
used inside the engine to inform about
pre and post index and create operations. The operations are used for statistic purposes etc.@Nullable public IndicesWarmer getWarmer()
IndicesWarmer
used to warm new searchers before they are used for searching.
Note: This method might retrun null
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 SnapshotDeletionPolicy getDeletionPolicy()
SnapshotDeletionPolicy
used in the engines
IndexWriter
.public MergePolicyProvider getMergePolicyProvider()
public MergeSchedulerProvider getMergeScheduler()
public Engine.FailedEngineListener getFailedEngineListener()
public Settings 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 boolean isChecksumOnMerge()
true
iff checksums are checked on mergepublic void setGcDeletesInMillis(long gcDeletesInMillis)
public void setCompoundOnFlush(boolean compoundOnFlush)
true
public void setFailEngineOnCorruption(boolean failEngineOnCorruption)
true
public void setFailOnMergeFailure(boolean failOnMergeFailure)
true
public void setChecksumOnMerge(boolean checksumOnMerge)
Copyright © 2009–2015. All rights reserved.