mirror of https://github.com/apache/lucene.git
sequence numbers: remove dead variable, improve comments
This commit is contained in:
parent
817c7f069a
commit
34673adab2
|
@ -77,17 +77,17 @@ final class DocumentsWriterDeleteQueue implements Accountable {
|
|||
|
||||
private final DeleteSlice globalSlice;
|
||||
private final BufferedUpdates globalBufferedUpdates;
|
||||
private long gen;
|
||||
|
||||
// only acquired to update the global deletes, pkg-private for access by tests:
|
||||
final ReentrantLock globalBufferLock = new ReentrantLock();
|
||||
|
||||
final long generation;
|
||||
|
||||
/** Generates the sequence number that IW returns to callers changing the index, showing the effective serialization of all operations. */
|
||||
final AtomicLong seqNo;
|
||||
|
||||
DocumentsWriterDeleteQueue() {
|
||||
// seqNo must start at 1 because some APIs negate this to encode a boolean
|
||||
// seqNo must start at 1 because some APIs negate this to also return a boolean
|
||||
this(0, 1);
|
||||
}
|
||||
|
||||
|
|
|
@ -481,11 +481,10 @@ final class DocumentsWriterFlushControl implements Accountable {
|
|||
// we do another full flush
|
||||
//System.out.println("DWFC: fullFLush old seqNo=" + documentsWriter.deleteQueue.seqNo.get() + " activeThreadCount=" + perThreadPool.getActiveThreadStateCount());
|
||||
|
||||
// jump over any possible in flight ops:
|
||||
seqNo = documentsWriter.deleteQueue.seqNo.get() + perThreadPool.getActiveThreadStateCount();
|
||||
|
||||
// Insert a gap in seqNo of current active thread count, in the worst case those threads now have one operation in flight. It's fine
|
||||
// if we have some sequence numbers that were never assigned:
|
||||
seqNo = documentsWriter.deleteQueue.seqNo.get() + perThreadPool.getActiveThreadStateCount();
|
||||
|
||||
DocumentsWriterDeleteQueue newQueue = new DocumentsWriterDeleteQueue(flushingQueue.generation+1, seqNo+1);
|
||||
|
||||
documentsWriter.deleteQueue = newQueue;
|
||||
|
|
Loading…
Reference in New Issue