Remove 'term_index_interval' and 'term_index_divisor'

These settings are no longer relevant since they are codec /
postingsformat level settings since Lucene 4.0

Closes #3912
This commit is contained in:
Simon Willnauer 2013-12-08 21:36:06 +01:00
parent 38cff53a0f
commit 6c189310b9
4 changed files with 1 additions and 49 deletions

View File

@ -36,24 +36,6 @@ otherwise it is written in non-compound format. added[0.90.2]
in compound format or non-compound format? Defaults to `true`.
This is a dynamic setting.
`index.term_index_interval`::
Set the interval between indexed terms.
Large values cause less memory to be used by a reader / searcher, but
slow random-access to terms. Small values cause more memory to be used
by a reader / searcher, and speed random-access to terms. Defaults to
`128`.
`index.term_index_divisor`::
Subsamples which indexed terms are loaded
into RAM. This has the same effect as `index.term_index_interval` except
that setting must be done at indexing time while this setting can be set
per reader / searcher. When set to N, then one in every
N*termIndexInterval terms in the index is loaded into memory. By setting
this to a value > 1 you can reduce memory usage, at the expense of
higher latency when loading a TermInfo. The default value is 1. Set this
to -1 to skip loading the terms index entirely.
`index.refresh_interval`::
A time setting controlling how often the
refresh operation will be executed. Defaults to `1s`. Can be set to `-1`

View File

@ -53,12 +53,6 @@ settings API:
`index.refresh_interval`::
The async refresh interval of a shard.
`index.term_index_interval`::
The Lucene index term interval. Only applies to newly created docs.
`index.term_index_divisor`::
The Lucene reader term index divisor.
`index.index_concurrency`::
Defaults to `8`.

View File

@ -91,8 +91,6 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
public class RobinEngine extends AbstractIndexShardComponent implements Engine {
private volatile ByteSizeValue indexingBufferSize;
private volatile int termIndexInterval;
private volatile int termIndexDivisor;
private volatile int indexConcurrency;
private volatile boolean compoundOnFlush = true;
@ -172,8 +170,6 @@ public class RobinEngine extends AbstractIndexShardComponent implements Engine {
this.gcDeletesInMillis = indexSettings.getAsTime(INDEX_GC_DELETES, TimeValue.timeValueSeconds(60)).millis();
this.indexingBufferSize = componentSettings.getAsBytesSize("index_buffer_size", new ByteSizeValue(64, ByteSizeUnit.MB)); // not really important, as it is set by the IndexingMemory manager
this.termIndexInterval = indexSettings.getAsInt(INDEX_TERM_INDEX_INTERVAL, IndexWriterConfig.DEFAULT_TERM_INDEX_INTERVAL);
this.termIndexDivisor = indexSettings.getAsInt(INDEX_TERM_INDEX_DIVISOR, 1); // IndexReader#DEFAULT_TERMS_INDEX_DIVISOR
this.codecName = indexSettings.get(INDEX_CODEC, "default");
this.threadPool = threadPool;
@ -1349,8 +1345,6 @@ public class RobinEngine extends AbstractIndexShardComponent implements Engine {
config.setMergePolicy(mergePolicy);
config.setSimilarity(similarityService.similarity());
config.setRAMBufferSizeMB(indexingBufferSize.mbFrac());
config.setTermIndexInterval(termIndexInterval);
config.setReaderTermsIndexDivisor(termIndexDivisor);
config.setMaxThreadStates(indexConcurrency);
config.setCodec(codecService.codec(codecName));
/* We set this timeout to a highish value to work around
@ -1390,8 +1384,6 @@ public class RobinEngine extends AbstractIndexShardComponent implements Engine {
}
}
public static final String INDEX_TERM_INDEX_INTERVAL = "index.term_index_interval";
public static final String INDEX_TERM_INDEX_DIVISOR = "index.term_index_divisor";
public static final String INDEX_INDEX_CONCURRENCY = "index.index_concurrency";
public static final String INDEX_COMPOUND_ON_FLUSH = "index.compound_on_flush";
public static final String INDEX_GC_DELETES = "index.gc_deletes";
@ -1414,27 +1406,13 @@ public class RobinEngine extends AbstractIndexShardComponent implements Engine {
indexWriter.getConfig().setUseCompoundFile(compoundOnFlush);
}
int termIndexInterval = settings.getAsInt(INDEX_TERM_INDEX_INTERVAL, RobinEngine.this.termIndexInterval);
int termIndexDivisor = settings.getAsInt(INDEX_TERM_INDEX_DIVISOR, RobinEngine.this.termIndexDivisor); // IndexReader#DEFAULT_TERMS_INDEX_DIVISOR
int indexConcurrency = settings.getAsInt(INDEX_INDEX_CONCURRENCY, RobinEngine.this.indexConcurrency);
boolean failOnMergeFailure = settings.getAsBoolean(INDEX_FAIL_ON_MERGE_FAILURE, RobinEngine.this.failOnMergeFailure);
String codecName = settings.get(INDEX_CODEC, RobinEngine.this.codecName);
boolean requiresFlushing = false;
if (termIndexInterval != RobinEngine.this.termIndexInterval || termIndexDivisor != RobinEngine.this.termIndexDivisor || indexConcurrency != RobinEngine.this.indexConcurrency || !codecName.equals(RobinEngine.this.codecName) || failOnMergeFailure != RobinEngine.this.failOnMergeFailure) {
if (indexConcurrency != RobinEngine.this.indexConcurrency || !codecName.equals(RobinEngine.this.codecName) || failOnMergeFailure != RobinEngine.this.failOnMergeFailure) {
rwl.readLock().lock();
try {
if (termIndexInterval != RobinEngine.this.termIndexInterval) {
logger.info("updating index.term_index_interval from [{}] to [{}]", RobinEngine.this.termIndexInterval, termIndexInterval);
RobinEngine.this.termIndexInterval = termIndexInterval;
indexWriter.getConfig().setTermIndexInterval(termIndexInterval);
}
if (termIndexDivisor != RobinEngine.this.termIndexDivisor) {
logger.info("updating index.term_index_divisor from [{}] to [{}]", RobinEngine.this.termIndexDivisor, termIndexDivisor);
RobinEngine.this.termIndexDivisor = termIndexDivisor;
indexWriter.getConfig().setReaderTermsIndexDivisor(termIndexDivisor);
// we want to apply this right now for readers, even "current" ones
requiresFlushing = true;
}
if (indexConcurrency != RobinEngine.this.indexConcurrency) {
logger.info("updating index.index_concurrency from [{}] to [{}]", RobinEngine.this.indexConcurrency, indexConcurrency);
RobinEngine.this.indexConcurrency = indexConcurrency;

View File

@ -77,8 +77,6 @@ public class IndexDynamicSettingsModule extends AbstractModule {
indexDynamicSettings.addDynamicSetting(LogDocMergePolicyProvider.INDEX_MERGE_POLICY_MAX_MERGE_DOCS, Validator.POSITIVE_INTEGER);
indexDynamicSettings.addDynamicSetting(LogDocMergePolicyProvider.INDEX_MERGE_POLICY_MERGE_FACTOR, Validator.INTEGER_GTE_2);
indexDynamicSettings.addDynamicSetting(LogDocMergePolicyProvider.INDEX_COMPOUND_FORMAT);
indexDynamicSettings.addDynamicSetting(RobinEngine.INDEX_TERM_INDEX_INTERVAL, Validator.POSITIVE_INTEGER);
indexDynamicSettings.addDynamicSetting(RobinEngine.INDEX_TERM_INDEX_DIVISOR, Validator.POSITIVE_INTEGER);
indexDynamicSettings.addDynamicSetting(RobinEngine.INDEX_INDEX_CONCURRENCY, Validator.NON_NEGATIVE_INTEGER);
indexDynamicSettings.addDynamicSetting(RobinEngine.INDEX_COMPOUND_ON_FLUSH, Validator.BOOLEAN);
indexDynamicSettings.addDynamicSetting(RobinEngine.INDEX_GC_DELETES, Validator.TIME);