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 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_FORCE_NEW_TRANSLOG
if set to true the engine will start even if the translog id in the commit point can not be found
|
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,
ThreadPool threadPool,
ShardIndexingService indexingService,
Settings indexSettings,
IndicesWarmer warmer,
Store store,
SnapshotDeletionPolicy deletionPolicy,
org.apache.lucene.index.MergePolicy mergePolicy,
MergeSchedulerConfig mergeSchedulerConfig,
org.apache.lucene.analysis.Analyzer analyzer,
org.apache.lucene.search.similarities.Similarity similarity,
CodecService codecService,
Engine.FailedEngineListener failedEngineListener,
TranslogRecoveryPerformer translogRecoveryPerformer,
org.apache.lucene.search.QueryCache queryCache,
org.apache.lucene.search.QueryCachingPolicy queryCachingPolicy,
IndexSearcherWrappingService wrappingService,
TranslogConfig translogConfig)
Creates a new
EngineConfig |
Modifier and Type | Method and Description |
---|---|
boolean |
forceNewTranslog()
if true the engine will start even if the translog id in the commit point can not be found
|
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.
|
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.
|
org.apache.lucene.index.MergePolicy |
getMergePolicy()
Returns the
MergePolicy for the engines IndexWriter |
MergeSchedulerConfig |
getMergeSchedulerConfig()
Returns the
MergeSchedulerConfig |
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.
|
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.FORCE_MERGE thread-pool |
TranslogConfig |
getTranslogConfig()
Returns the translog config for this engine
|
TranslogRecoveryPerformer |
getTranslogRecoveryPerformer()
Returns the
TranslogRecoveryPerformer for this engine. |
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. |
IndexSearcherWrappingService |
getWrappingService() |
boolean |
isCompoundOnFlush()
Returns
true iff flushed segments should be written as compound file system. |
boolean |
isCreate()
Iff
true the engine should create a new lucene index when opening the engine. |
boolean |
isEnableGcDeletes()
Returns
true iff delete garbage collection in the engine should be enabled. |
boolean |
isOptimizeAutoGenerateId()
Returns
true iff documents with auto-generated IDs are optimized if possible. |
void |
setCompoundOnFlush(boolean compoundOnFlush)
Sets if flushed segments should be written as compound file system.
|
void |
setCreate(boolean create)
Iff set to
true the engine will create a new lucene index when opening the engine. |
void |
setEnableGcDeletes(boolean enableGcDeletes)
Enables / disables gc deletes
|
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_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_CODEC_SETTING
public static final String INDEX_VERSION_MAP_SIZE
public static final String INDEX_FORCE_NEW_TRANSLOG
public static final TimeValue DEFAULT_REFRESH_INTERVAL
public static final TimeValue DEFAULT_GC_DELETES
public static final String DEFAULT_VERSION_MAP_SIZE
public EngineConfig(ShardId shardId, ThreadPool threadPool, ShardIndexingService indexingService, Settings indexSettings, IndicesWarmer warmer, Store store, SnapshotDeletionPolicy deletionPolicy, org.apache.lucene.index.MergePolicy mergePolicy, MergeSchedulerConfig mergeSchedulerConfig, org.apache.lucene.analysis.Analyzer analyzer, org.apache.lucene.search.similarities.Similarity similarity, CodecService codecService, Engine.FailedEngineListener failedEngineListener, TranslogRecoveryPerformer translogRecoveryPerformer, org.apache.lucene.search.QueryCache queryCache, org.apache.lucene.search.QueryCachingPolicy queryCachingPolicy, IndexSearcherWrappingService wrappingService, TranslogConfig translogConfig)
EngineConfig
public void setVersionMapSizeSetting(String versionMapSizeSetting)
INDEX_VERSION_MAP_SIZE
for details.public String getVersionMapSizeSetting()
INDEX_VERSION_MAP_SIZE
for details.public boolean forceNewTranslog()
public ByteSizeValue getVersionMapSize()
public void setIndexingBufferSize(ByteSizeValue indexingBufferSize)
public void setEnableGcDeletes(boolean enableGcDeletes)
isEnableGcDeletes()
public ByteSizeValue getIndexingBufferSize()
IndexingMemoryController
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.FORCE_MERGE
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 org.apache.lucene.index.MergePolicy getMergePolicy()
MergePolicy
for the engines IndexWriter
public MergeSchedulerConfig getMergeSchedulerConfig()
MergeSchedulerConfig
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 void setGcDeletesInMillis(long gcDeletesInMillis)
public void setCompoundOnFlush(boolean compoundOnFlush)
true
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 IndexSearcherWrappingService getWrappingService()
public TranslogConfig getTranslogConfig()
public void setCreate(boolean create)
true
the engine will create a new lucene index when opening the engine.
Otherwise the lucene index writer is opened in append mode. The default is false
public boolean isCreate()
true
the engine should create a new lucene index when opening the engine.
Otherwise the lucene index writer should be opened in append mode. The default is false
Copyright © 2009–2016. All rights reserved.