added some debug information

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/realtime_search@1097138 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Simon Willnauer 2011-04-27 15:11:23 +00:00
parent 8fb4f5a766
commit f89d7b4ee0
2 changed files with 20 additions and 2 deletions

View File

@ -72,6 +72,8 @@ final class DocumentsWriterDeleteQueue {
private final BufferedDeletes globalBufferedDeletes;
/* only acquired to update the global deletes */
private final ReentrantLock globalBufferLock = new ReentrantLock();
long generation;
DocumentsWriterDeleteQueue() {
this(new BufferedDeletes(false));
@ -379,4 +381,11 @@ final class DocumentsWriterDeleteQueue {
public long bytesUsed() {
return globalBufferedDeletes.bytesUsed.get();
}
@Override
public String toString() {
return "DWDQ: [ generation: " + generation + " ]";
}
}

View File

@ -303,7 +303,9 @@ public final class DocumentsWriterFlushControl {
flushingQueue = documentsWriter.deleteQueue;
// Set a new delete queue - all subsequent DWPT will use this queue until
// we do another full flush
documentsWriter.deleteQueue = new DocumentsWriterDeleteQueue(new BufferedDeletes(false));
DocumentsWriterDeleteQueue newQueue = new DocumentsWriterDeleteQueue();
newQueue.generation = flushingQueue.generation + 1;
documentsWriter.deleteQueue = newQueue;
}
final Iterator<ThreadState> allActiveThreads = perThreadPool
.getActivePerThreadsIterator();
@ -315,7 +317,14 @@ public final class DocumentsWriterFlushControl {
if (!next.isActive()) {
continue;
}
assert next.perThread.deleteQueue == flushingQueue || next.perThread.deleteQueue == documentsWriter.deleteQueue;
assert next.perThread.deleteQueue == flushingQueue
|| next.perThread.deleteQueue == documentsWriter.deleteQueue : " flushingQueue: "
+ flushingQueue
+ " currentqueue: "
+ documentsWriter.deleteQueue
+ " perThread queue: "
+ next.perThread.deleteQueue
+ " numDocsInRam: " + next.perThread.getNumDocsInRAM();
if (next.perThread.deleteQueue != flushingQueue) {
// this one is already a new DWPT
continue;