Skip to content

Apache Lucene open-source search software

LUCENE-7427: in DocumentsWriterDeleteQueue remove unused private members and tweak javadoc.

Christine Poerschke4abbdbe78a3e
diff --git a/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterDeleteQueue.java b/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterDeleteQueue.java
index dac2e4c3811..db0e571d380 100644
--- a/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterDeleteQueue.java
+++ b/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterDeleteQueue.java
@@ -18,7 +18,6 @@ package org.apache.lucene.index;
import java.util.Arrays;
import java.util.concurrent.atomic.AtomicLong;
-import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
import java.util.concurrent.locks.ReentrantLock;
import org.apache.lucene.index.DocValuesUpdate.BinaryDocValuesUpdate;
@@ -32,7 +31,8 @@ import org.apache.lucene.util.BytesRef;
* queue. In contrast to other queue implementation we only maintain the
* tail of the queue. A delete queue is always used in a context of a set of
* DWPTs and a global delete pool. Each of the DWPT and the global pool need to
- * maintain their 'own' head of the queue (as a DeleteSlice instance per DWPT).
+ * maintain their 'own' head of the queue (as a DeleteSlice instance per
+ * {@link DocumentsWriterPerThread}).
* The difference between the DWPT and the global pool is that the DWPT starts
* maintaining a head once it has added its first document since for its segments
* private deletes only the deletes after that document are relevant. The global
@@ -71,10 +71,6 @@ final class DocumentsWriterDeleteQueue implements Accountable {
// the current end (latest delete operation) in the delete queue:
private volatile Node<?> tail;
-
- @SuppressWarnings("rawtypes")
- private static final AtomicReferenceFieldUpdater<DocumentsWriterDeleteQueue,Node> tailUpdater = AtomicReferenceFieldUpdater
- .newUpdater(DocumentsWriterDeleteQueue.class, Node.class, "tail");
/** Used to record deletes against all prior (already written to disk) segments. Whenever any segment flushes, we bundle up this set of
* deletes and insert into the buffered updates stream before the newly flushed segment(s). */
@@ -322,17 +318,9 @@ final class DocumentsWriterDeleteQueue implements Accountable {
this.item = item;
}
- @SuppressWarnings("rawtypes")
- static final AtomicReferenceFieldUpdater<Node,Node> nextUpdater = AtomicReferenceFieldUpdater
- .newUpdater(Node.class, Node.class, "next");
-
void apply(BufferedUpdates bufferedDeletes, int docIDUpto) {
throw new IllegalStateException("sentinel item must never be applied");
}
-
- boolean casNext(Node<?> cmp, Node<?> val) {
- return nextUpdater.compareAndSet(this, cmp, val);
- }
}
private static final class TermNode extends Node<Term> {