LUCENE-6980: fix a few more tests to just use default (true) for applyAllDeletes

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1726106 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2016-01-21 21:32:31 +00:00
parent 5517929f9d
commit fb371af1f9
16 changed files with 22 additions and 25 deletions

View File

@ -895,7 +895,7 @@ public class TestBinaryDocValuesUpdates extends LuceneTestCase {
reader = DirectoryReader.open(writer);
} else {
// System.out.println("[" + Thread.currentThread().getName() + "] reopen NRT");
DirectoryReader r2 = DirectoryReader.openIfChanged(reader, writer, true);
DirectoryReader r2 = DirectoryReader.openIfChanged(reader, writer);
if (r2 != null) {
reader.close();
reader = r2;

View File

@ -2000,7 +2000,7 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
}
// Trigger writeLiveDocs + writeFieldUpdates so we hit fake exc:
IndexReader r = w.getReader(true);
IndexReader r = w.getReader();
// Sometimes we will make it here (we only randomly
// throw the exc):

View File

@ -93,7 +93,7 @@ public class TestIndexWriterNRTIsCurrent extends LuceneTestCase {
Document doc = new Document();
doc.add(new TextField("id", "1", Field.Store.NO));
writer.addDocument(doc);
holder.reader = currentReader = writer.getReader(true);
holder.reader = currentReader = writer.getReader();
Term term = new Term("id");
for (int i = 0; i < numOps && !holder.stop; i++) {
float nextOp = random.nextFloat();

View File

@ -1062,7 +1062,7 @@ public class TestIndexWriterReader extends LuceneTestCase {
// Deletes nothing in reality...:
w.deleteDocuments(new Term("foo", "bar"));
DirectoryReader r5 = DirectoryReader.openIfChanged(r3, w, true);
DirectoryReader r5 = DirectoryReader.openIfChanged(r3, w);
assertNull(r5);
r3.close();

View File

@ -226,7 +226,7 @@ public class TestMixedDocValuesUpdates extends LuceneTestCase {
reader = DirectoryReader.open(writer);
} else {
// System.out.println("[" + Thread.currentThread().getName() + "] reopen NRT");
DirectoryReader r2 = DirectoryReader.openIfChanged(reader, writer, true);
DirectoryReader r2 = DirectoryReader.openIfChanged(reader, writer);
if (r2 != null) {
reader.close();
reader = r2;

View File

@ -979,7 +979,7 @@ public class TestNumericDocValuesUpdates extends LuceneTestCase {
reader = DirectoryReader.open(writer);
} else {
// System.out.println("[" + Thread.currentThread().getName() + "] reopen NRT");
DirectoryReader r2 = DirectoryReader.openIfChanged(reader, writer, true);
DirectoryReader r2 = DirectoryReader.openIfChanged(reader, writer);
if (r2 != null) {
reader.close();
reader = r2;

View File

@ -141,12 +141,12 @@ public class TestStressNRT extends LuceneTestCase {
if (VERBOSE) {
System.out.println("TEST: " + Thread.currentThread().getName() + ": call writer.getReader");
}
newReader = writer.getReader(true);
newReader = writer.getReader();
} else {
if (VERBOSE) {
System.out.println("TEST: " + Thread.currentThread().getName() + ": reopen reader=" + oldReader + " version=" + version);
}
newReader = DirectoryReader.openIfChanged(oldReader, writer.w, true);
newReader = DirectoryReader.openIfChanged(oldReader, writer.w);
}
} else {
// assertU(commit());

View File

@ -77,7 +77,6 @@ public class TestTryDelete extends LuceneTestCase
IndexWriter writer = getWriter(directory);
ReferenceManager<IndexSearcher> mgr = new SearcherManager(writer,
true,
new SearcherFactory());
TrackingIndexWriter mgrWriter = new TrackingIndexWriter(writer);
@ -125,7 +124,6 @@ public class TestTryDelete extends LuceneTestCase
IndexWriter writer = getWriter(directory);
ReferenceManager<IndexSearcher> mgr = new SearcherManager(writer,
true,
new SearcherFactory());
IndexSearcher searcher = mgr.acquire();
@ -169,7 +167,6 @@ public class TestTryDelete extends LuceneTestCase
IndexWriter writer = getWriter(directory);
ReferenceManager<IndexSearcher> mgr = new SearcherManager(writer,
true,
new SearcherFactory());
IndexSearcher searcher = mgr.acquire();

View File

@ -232,7 +232,7 @@ public class TestControlledRealTimeReopenThread extends ThreadedIndexingAndSearc
};
nrtNoDeletes = new SearcherManager(writer, false, sf);
nrtDeletes = new SearcherManager(writer, true, sf);
nrtDeletes = new SearcherManager(writer, sf);
nrtDeletesThread = new ControlledRealTimeReopenThread<>(genWriter, nrtDeletes, maxReopenSec, minReopenSec);
nrtDeletesThread.setName("NRTDeletes Reopen Thread");
@ -437,7 +437,7 @@ public class TestControlledRealTimeReopenThread extends ThreadedIndexingAndSearc
Directory dir = newDirectory();
IndexWriter iw = new IndexWriter(dir, new IndexWriterConfig(null));
final AtomicBoolean afterRefreshCalled = new AtomicBoolean(false);
SearcherManager sm = new SearcherManager(iw, true, new SearcherFactory());
SearcherManager sm = new SearcherManager(iw, new SearcherFactory());
sm.addListener(new ReferenceManager.RefreshListener() {
@Override
public void beforeRefresh() {
@ -484,7 +484,7 @@ public class TestControlledRealTimeReopenThread extends ThreadedIndexingAndSearc
config.setIndexDeletionPolicy(sdp);
config.setOpenMode(IndexWriterConfig.OpenMode.CREATE_OR_APPEND);
final IndexWriter iw = new IndexWriter(dir, config);
SearcherManager sm = new SearcherManager(iw, true, new SearcherFactory());
SearcherManager sm = new SearcherManager(iw, new SearcherFactory());
final TrackingIndexWriter tiw = new TrackingIndexWriter(iw);
ControlledRealTimeReopenThread<IndexSearcher> controlledRealTimeReopenThread =
new ControlledRealTimeReopenThread<>(tiw, sm, maxStaleSecs, 0);

View File

@ -48,7 +48,7 @@ public class TestLiveFieldValues extends LuceneTestCase {
final IndexWriter w = new IndexWriter(dir, iwc);
final SearcherManager mgr = new SearcherManager(w, true, new SearcherFactory() {
final SearcherManager mgr = new SearcherManager(w, new SearcherFactory() {
@Override
public IndexSearcher newSearcher(IndexReader r, IndexReader previous) {
return new IndexSearcher(r);

View File

@ -89,7 +89,7 @@ public class TestSearcherManager extends ThreadedIndexingAndSearchingTestCase {
// TODO: can we randomize the applyAllDeletes? But
// somehow for final searcher we must apply
// deletes...
mgr = new SearcherManager(writer, true, factory);
mgr = new SearcherManager(writer, factory);
isNRT = true;
} else {
// SearcherManager needs to see empty commit:

View File

@ -269,7 +269,7 @@ public class TestIDVersionPostingsFormat extends LuceneTestCase {
}
IndexReader r = w.getReader();
//IndexReader r = DirectoryReader.open(w, true);
//IndexReader r = DirectoryReader.open(w);
PerThreadVersionPKLookup lookup = new PerThreadVersionPKLookup(r, "id");
List<Map.Entry<String,Long>> idValuesList = new ArrayList<>(idValues.entrySet());
@ -655,7 +655,7 @@ public class TestIDVersionPostingsFormat extends LuceneTestCase {
final AtomicLong nextVersion = new AtomicLong();
final SearcherManager mgr = new SearcherManager(w.w, true, new SearcherFactory());
final SearcherManager mgr = new SearcherManager(w.w, new SearcherFactory());
final Long missingValue = -1L;

View File

@ -109,7 +109,7 @@ public class TestGeo3DPoint extends LuceneTestCase {
Document doc = new Document();
doc.add(new Geo3DPoint("field", PlanetModel.WGS84, toRadians(50.7345267), toRadians(-97.5303555)));
w.addDocument(doc);
IndexReader r = DirectoryReader.open(w, true);
IndexReader r = DirectoryReader.open(w);
// We can't wrap with "exotic" readers because the query must see the BKD3DDVFormat:
IndexSearcher s = newSearcher(r, false);
assertEquals(1, s.search(new PointInGeo3DShapeQuery(PlanetModel.WGS84,
@ -678,7 +678,7 @@ public class TestGeo3DPoint extends LuceneTestCase {
if (random().nextBoolean()) {
w.forceMerge(1);
}
final IndexReader r = DirectoryReader.open(w, true);
final IndexReader r = DirectoryReader.open(w);
w.close();
// We can't wrap with "exotic" readers because the geo3d query must see the Geo3DDVFormat:

View File

@ -219,7 +219,7 @@ public class AnalyzingInfixSuggester extends Lookup implements Closeable {
// Already built; open it:
writer = new IndexWriter(dir,
getIndexWriterConfig(getGramAnalyzer(), IndexWriterConfig.OpenMode.APPEND));
searcherMgr = new SearcherManager(writer, true, null);
searcherMgr = new SearcherManager(writer, null);
}
}
@ -281,7 +281,7 @@ public class AnalyzingInfixSuggester extends Lookup implements Closeable {
if (commitOnBuild) {
commit();
}
searcherMgr = new SearcherManager(writer, true, null);
searcherMgr = new SearcherManager(writer, null);
success = true;
} finally {
if (success == false && writer != null) {
@ -329,7 +329,7 @@ public class AnalyzingInfixSuggester extends Lookup implements Closeable {
}
writer = new IndexWriter(dir,
getIndexWriterConfig(getGramAnalyzer(), IndexWriterConfig.OpenMode.CREATE));
searcherMgr = new SearcherManager(writer, true, null);
searcherMgr = new SearcherManager(writer, null);
}
}

View File

@ -461,7 +461,7 @@ public abstract class ShardSearchingTestBase extends LuceneTestCase {
iwc.setInfoStream(new PrintStreamInfoStream(System.out));
}
writer = new IndexWriter(dir, iwc);
mgr = new SearcherManager(writer, true, null);
mgr = new SearcherManager(writer, null);
searchers = new SearcherLifetimeManager();
// Init w/ 0s... caller above will do initial

View File

@ -287,7 +287,7 @@ public class TestCompressingStoredFieldsFormat extends BaseStoredFieldsFormatTes
// by this test.
iwConf.setCodec(CompressingCodec.randomInstance(random(), 4*1024, 100, false, 8));
IndexWriter iw = new IndexWriter(dir, iwConf);
DirectoryReader ir = DirectoryReader.open(iw, true);
DirectoryReader ir = DirectoryReader.open(iw);
for (int i = 0; i < 5; i++) {
Document doc = new Document();
doc.add(new StoredField("text", "not very long at all"));