mirror of https://github.com/apache/lucene.git
don't allow O(N^2) merging in this test
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1642829 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ce164ff8de
commit
facb9a0158
|
@ -120,6 +120,9 @@ public class TestDemoParallelLeafReader extends LuceneTestCase {
|
||||||
|
|
||||||
IndexWriterConfig iwc = getIndexWriterConfig();
|
IndexWriterConfig iwc = getIndexWriterConfig();
|
||||||
iwc.setMergePolicy(new ReindexingMergePolicy(iwc.getMergePolicy()));
|
iwc.setMergePolicy(new ReindexingMergePolicy(iwc.getMergePolicy()));
|
||||||
|
if (DEBUG) {
|
||||||
|
System.out.println("TEST: use IWC:\n" + iwc);
|
||||||
|
}
|
||||||
w = new IndexWriter(indexDir, iwc);
|
w = new IndexWriter(indexDir, iwc);
|
||||||
|
|
||||||
w.getConfig().setMergedSegmentWarmer(new IndexWriter.IndexReaderWarmer() {
|
w.getConfig().setMergedSegmentWarmer(new IndexWriter.IndexReaderWarmer() {
|
||||||
|
@ -644,7 +647,12 @@ public class TestDemoParallelLeafReader extends LuceneTestCase {
|
||||||
return new ReindexingReader(root) {
|
return new ReindexingReader(root) {
|
||||||
@Override
|
@Override
|
||||||
protected IndexWriterConfig getIndexWriterConfig() throws IOException {
|
protected IndexWriterConfig getIndexWriterConfig() throws IOException {
|
||||||
return newIndexWriterConfig();
|
IndexWriterConfig iwc = newIndexWriterConfig();
|
||||||
|
TieredMergePolicy tmp = new TieredMergePolicy();
|
||||||
|
// We write tiny docs, so we need tiny floor to avoid O(N^2) merging:
|
||||||
|
tmp.setFloorSegmentMB(.01);
|
||||||
|
iwc.setMergePolicy(tmp);
|
||||||
|
return iwc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -694,7 +702,12 @@ public class TestDemoParallelLeafReader extends LuceneTestCase {
|
||||||
return new ReindexingReader(root) {
|
return new ReindexingReader(root) {
|
||||||
@Override
|
@Override
|
||||||
protected IndexWriterConfig getIndexWriterConfig() throws IOException {
|
protected IndexWriterConfig getIndexWriterConfig() throws IOException {
|
||||||
return newIndexWriterConfig();
|
IndexWriterConfig iwc = newIndexWriterConfig();
|
||||||
|
TieredMergePolicy tmp = new TieredMergePolicy();
|
||||||
|
// We write tiny docs, so we need tiny floor to avoid O(N^2) merging:
|
||||||
|
tmp.setFloorSegmentMB(.01);
|
||||||
|
iwc.setMergePolicy(tmp);
|
||||||
|
return iwc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -780,7 +793,12 @@ public class TestDemoParallelLeafReader extends LuceneTestCase {
|
||||||
return new ReindexingReader(root) {
|
return new ReindexingReader(root) {
|
||||||
@Override
|
@Override
|
||||||
protected IndexWriterConfig getIndexWriterConfig() throws IOException {
|
protected IndexWriterConfig getIndexWriterConfig() throws IOException {
|
||||||
return newIndexWriterConfig();
|
IndexWriterConfig iwc = newIndexWriterConfig();
|
||||||
|
TieredMergePolicy tmp = new TieredMergePolicy();
|
||||||
|
// We write tiny docs, so we need tiny floor to avoid O(N^2) merging:
|
||||||
|
tmp.setFloorSegmentMB(.01);
|
||||||
|
iwc.setMergePolicy(tmp);
|
||||||
|
return iwc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue