mirror of https://github.com/apache/lucene.git
move flush policy default into IWC, matching other configs
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1151187 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6edb2422f7
commit
25477c33ba
|
@ -134,12 +134,8 @@ final class DocumentsWriter {
|
|||
this.perThreadPool = config.getIndexerThreadPool();
|
||||
this.chain = config.getIndexingChain();
|
||||
this.perThreadPool.initialize(this, globalFieldNumbers, config);
|
||||
final FlushPolicy configuredPolicy = config.getFlushPolicy();
|
||||
if (configuredPolicy == null) {
|
||||
flushPolicy = new FlushByRamOrCountsPolicy();
|
||||
} else {
|
||||
flushPolicy = configuredPolicy;
|
||||
}
|
||||
flushPolicy = config.getFlushPolicy();
|
||||
assert flushPolicy != null;
|
||||
flushPolicy.init(this);
|
||||
flushControl = new DocumentsWriterFlushControl(this, config);
|
||||
}
|
||||
|
|
|
@ -164,6 +164,7 @@ public final class IndexWriterConfig implements Cloneable {
|
|||
} else {
|
||||
mergePolicy = new LogByteSizeMergePolicy();
|
||||
}
|
||||
flushPolicy = new FlushByRamOrCountsPolicy();
|
||||
readerPooling = DEFAULT_READER_POOLING;
|
||||
indexerThreadPool = new ThreadAffinityDocumentsWriterThreadPool();
|
||||
readerTermsIndexDivisor = DEFAULT_READER_TERMS_INDEX_DIVISOR;
|
||||
|
|
|
@ -69,7 +69,7 @@ public class TestIndexWriterConfig extends LuceneTestCase {
|
|||
assertEquals(IndexWriterConfig.DEFAULT_READER_TERMS_INDEX_DIVISOR, conf.getReaderTermsIndexDivisor());
|
||||
assertEquals(TieredMergePolicy.class, conf.getMergePolicy().getClass());
|
||||
assertEquals(ThreadAffinityDocumentsWriterThreadPool.class, conf.getIndexerThreadPool().getClass());
|
||||
assertNull(conf.getFlushPolicy());
|
||||
assertEquals(FlushByRamOrCountsPolicy.class, conf.getFlushPolicy().getClass());
|
||||
assertEquals(IndexWriterConfig.DEFAULT_RAM_PER_THREAD_HARD_LIMIT_MB, conf.getRAMPerThreadHardLimitMB());
|
||||
// Sanity check - validate that all getters are covered.
|
||||
Set<String> getters = new HashSet<String>();
|
||||
|
|
Loading…
Reference in New Issue