lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sim...@apache.org
Subject svn commit: r1097138 - in /lucene/dev/branches/realtime_search/lucene/src/java/org/apache/lucene/index: DocumentsWriterDeleteQueue.java DocumentsWriterFlushControl.java
Date Wed, 27 Apr 2011 15:11:23 GMT
Author: simonw
Date: Wed Apr 27 15:11:23 2011
New Revision: 1097138

URL: http://svn.apache.org/viewvc?rev=1097138&view=rev
Log:
added some debug information

Modified:
    lucene/dev/branches/realtime_search/lucene/src/java/org/apache/lucene/index/DocumentsWriterDeleteQueue.java
    lucene/dev/branches/realtime_search/lucene/src/java/org/apache/lucene/index/DocumentsWriterFlushControl.java

Modified: lucene/dev/branches/realtime_search/lucene/src/java/org/apache/lucene/index/DocumentsWriterDeleteQueue.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/lucene/src/java/org/apache/lucene/index/DocumentsWriterDeleteQueue.java?rev=1097138&r1=1097137&r2=1097138&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/lucene/src/java/org/apache/lucene/index/DocumentsWriterDeleteQueue.java
(original)
+++ lucene/dev/branches/realtime_search/lucene/src/java/org/apache/lucene/index/DocumentsWriterDeleteQueue.java
Wed Apr 27 15:11:23 2011
@@ -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 + " ]";
+  }
+  
+  
 }

Modified: lucene/dev/branches/realtime_search/lucene/src/java/org/apache/lucene/index/DocumentsWriterFlushControl.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/lucene/src/java/org/apache/lucene/index/DocumentsWriterFlushControl.java?rev=1097138&r1=1097137&r2=1097138&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/lucene/src/java/org/apache/lucene/index/DocumentsWriterFlushControl.java
(original)
+++ lucene/dev/branches/realtime_search/lucene/src/java/org/apache/lucene/index/DocumentsWriterFlushControl.java
Wed Apr 27 15:11:23 2011
@@ -303,7 +303,9 @@ public final class DocumentsWriterFlushC
       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 DocumentsWriterFlushC
         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;



Mime
View raw message