mirror of https://github.com/apache/lucene.git
LUCENE-3350: fix failure due to shared Term instance
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1152278 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
15544c3088
commit
b7e7683968
|
@ -24,6 +24,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||
|
||||
import org.apache.lucene.index.DocumentsWriterDeleteQueue.DeleteSlice;
|
||||
import org.apache.lucene.search.TermQuery;
|
||||
import org.apache.lucene.util.BytesRef;
|
||||
import org.apache.lucene.util.LuceneTestCase;
|
||||
import org.apache.lucene.util.ThreadInterruptedException;
|
||||
|
||||
|
@ -171,13 +172,17 @@ public class TestDocumentsWriterDeleteQueue extends LuceneTestCase {
|
|||
assertEquals(uniqueValues, deletes.terms.keySet());
|
||||
}
|
||||
queue.tryApplyGlobalSlice();
|
||||
HashSet<Term> frozenSet = new HashSet<Term>();
|
||||
Set<Term> frozenSet = new HashSet<Term>();
|
||||
for (Term t : queue.freezeGlobalBuffer(null).termsIterable()) {
|
||||
frozenSet.add(t);
|
||||
BytesRef bytesRef = new BytesRef();
|
||||
bytesRef.copy(t.bytes);
|
||||
frozenSet.add(new Term(t.field, bytesRef));
|
||||
}
|
||||
assertEquals(uniqueValues, frozenSet);
|
||||
assertEquals("num deletes must be 0 after freeze", 0, queue
|
||||
.numGlobalTermDeletes());
|
||||
assertEquals(uniqueValues.size(), frozenSet.size());
|
||||
assertEquals(uniqueValues, frozenSet);
|
||||
|
||||
}
|
||||
|
||||
private static class UpdateThread extends Thread {
|
||||
|
|
Loading…
Reference in New Issue