improve test coverage for IW.expungeDeletes; fix infoStream logging in BDS to write something meaningful

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1595324 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2014-05-16 19:45:46 +00:00
parent 0014d19919
commit c5b8eead41
3 changed files with 16 additions and 5 deletions

View File

@ -30,6 +30,7 @@ import org.apache.lucene.search.DocIdSet;
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.QueryWrapperFilter;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.IOContext;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.InfoStream;
@ -332,7 +333,13 @@ class BufferedUpdatesStream {
}
if (infoStream.isEnabled("BD")) {
infoStream.message("BD", "prune sis=" + segmentInfos + " minGen=" + minGen + " packetCount=" + updates.size());
Directory dir;
if (segmentInfos.size() > 0) {
dir = segmentInfos.info(0).info.dir;
} else {
dir = null;
}
infoStream.message("BD", "prune sis=" + segmentInfos.toString(dir) + " minGen=" + minGen + " packetCount=" + updates.size());
}
final int limit = updates.size();
for(int delIDX=0;delIDX<limit;delIDX++) {

View File

@ -52,8 +52,8 @@ import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
import org.apache.lucene.util.TestUtil;
// Need SSDV
@SuppressCodecs({"Lucene40", "Lucene41"})
// Need SSDV, ord=-1 for missing:
@SuppressCodecs({"Lucene40", "Lucene41", "Lucene42"})
public class GroupFacetCollectorTest extends AbstractGroupingTestCase {
public void testSimple() throws Exception {
@ -321,7 +321,6 @@ public class GroupFacetCollectorTest extends AbstractGroupingTestCase {
doc = new Document();
addField(doc, groupField, "a", useDv);
doc.add(new SortedSetDocValuesField("airport", new BytesRef("dus")));
w.addDocument(doc);
// 4

View File

@ -301,7 +301,7 @@ public class RandomIndexWriter implements Closeable {
System.out.println("RIW: doRandomForceMerge(1)");
}
w.forceMerge(1);
} else {
} else if (r.nextBoolean()) {
// partial forceMerge
final int limit = TestUtil.nextInt(r, 1, segCount);
if (LuceneTestCase.VERBOSE) {
@ -309,6 +309,11 @@ public class RandomIndexWriter implements Closeable {
}
w.forceMerge(limit);
assert !doRandomForceMergeAssert || w.getSegmentCount() <= limit: "limit=" + limit + " actual=" + w.getSegmentCount();
} else {
if (LuceneTestCase.VERBOSE) {
System.out.println("RIW: do random forceMergeDeletes()");
}
w.forceMergeDeletes();
}
}
}