public final class MergeSchedulerConfig extends Object
ConcurrentMergeScheduler
) controls the execution of
merge operations once they are needed (according to the merge policy). Merges
run in separate threads, and when the maximum number of threads is reached,
further merges will wait until a merge thread becomes available.
The merge scheduler supports the following dynamic settings:
index.merge.scheduler.max_thread_count
:
The maximum number of threads that may be merging at once. Defaults to
Math.max(1, Math.min(4, Runtime.getRuntime().availableProcessors() / 2))
which works well for a good solid-state-disk (SSD). If your index is on
spinning platter drives instead, decrease this to 1.
index.merge.scheduler.auto_throttle
:
If this is true (the default), then the merge scheduler will rate-limit IO
(writes) for merges to an adaptive value depending on how many merges are
requested over time. An application with a low indexing rate that
unluckily suddenly requires a large merge will see that merge aggressively
throttled, while an application doing heavy indexing will see the throttle
move higher to allow merges to keep up with ongoing indexing.
Modifier and Type | Field and Description |
---|---|
static String |
AUTO_THROTTLE |
static String |
MAX_MERGE_COUNT |
static String |
MAX_THREAD_COUNT |
static String |
NOTIFY_ON_MERGE_FAILURE |
Constructor and Description |
---|
MergeSchedulerConfig(Settings indexSettings) |
Modifier and Type | Method and Description |
---|---|
int |
getMaxMergeCount()
Returns
maxMergeCount . |
int |
getMaxThreadCount()
Returns
maxThreadCount . |
boolean |
isAutoThrottle()
Returns
true iff auto throttle is enabled. |
boolean |
isNotifyOnMergeFailure()
Returns
true iff we fail the engine on a merge failure. |
void |
setAutoThrottle(boolean autoThrottle)
Enables / disables auto throttling on the
ConcurrentMergeScheduler |
void |
setMaxMergeCount(int maxMergeCount)
Expert: set the maximum number of simultaneous merges allowed.
|
void |
setMaxThreadCount(int maxThreadCount)
Expert: directly set the maximum number of merge threads and
simultaneous merges allowed.
|
public static final String MAX_THREAD_COUNT
public static final String MAX_MERGE_COUNT
public static final String AUTO_THROTTLE
public static final String NOTIFY_ON_MERGE_FAILURE
public MergeSchedulerConfig(Settings indexSettings)
public boolean isAutoThrottle()
true
iff auto throttle is enabled.ConcurrentMergeScheduler.enableAutoIOThrottle()
public void setAutoThrottle(boolean autoThrottle)
ConcurrentMergeScheduler
public int getMaxThreadCount()
maxThreadCount
.public void setMaxThreadCount(int maxThreadCount)
public int getMaxMergeCount()
maxMergeCount
.public void setMaxMergeCount(int maxMergeCount)
public boolean isNotifyOnMergeFailure()
true
iff we fail the engine on a merge failure. Default is true
Copyright © 2009–2016. All rights reserved.