lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r639389 - in /lucene/java/branches/lucene_2_3/src/java/org/apache/lucene/index: DocumentsWriter.java SegmentMerger.java
Date Thu, 20 Mar 2008 17:59:00 GMT
Author: mikemccand
Date: Thu Mar 20 10:58:47 2008
New Revision: 639389

URL: http://svn.apache.org/viewvc?rev=639389&view=rev
Log:
just adding some further asserts on the size of the term vector & stored fields index
files

Modified:
    lucene/java/branches/lucene_2_3/src/java/org/apache/lucene/index/DocumentsWriter.java
    lucene/java/branches/lucene_2_3/src/java/org/apache/lucene/index/SegmentMerger.java

Modified: lucene/java/branches/lucene_2_3/src/java/org/apache/lucene/index/DocumentsWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_3/src/java/org/apache/lucene/index/DocumentsWriter.java?rev=639389&r1=639388&r2=639389&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_3/src/java/org/apache/lucene/index/DocumentsWriter.java
(original)
+++ lucene/java/branches/lucene_2_3/src/java/org/apache/lucene/index/DocumentsWriter.java
Thu Mar 20 10:58:47 2008
@@ -270,12 +270,16 @@
         tvf.close();
         tvd.close();
         tvx = null;
+        assert 4+numDocsInStore*8 == directory.fileLength(docStoreSegment + "." + IndexFileNames.VECTORS_INDEX_EXTENSION):
+          "after flush: tvx size mismatch: " + numDocsInStore + " docs vs " + directory.fileLength(docStoreSegment
+ "." + IndexFileNames.VECTORS_INDEX_EXTENSION) + " length in bytes of " + docStoreSegment
+ "." + IndexFileNames.VECTORS_INDEX_EXTENSION;
       }
 
       if (fieldsWriter != null) {
         assert docStoreSegment != null;
         fieldsWriter.close();
         fieldsWriter = null;
+        assert numDocsInStore*8 == directory.fileLength(docStoreSegment + "." + IndexFileNames.FIELDS_INDEX_EXTENSION):
+          "after flush: fdx size mismatch: " + numDocsInStore + " docs vs " + directory.fileLength(docStoreSegment
+ "." + IndexFileNames.FIELDS_INDEX_EXTENSION) + " length in bytes of " + docStoreSegment
+ "." + IndexFileNames.FIELDS_INDEX_EXTENSION;
       }
 
       String s = docStoreSegment;

Modified: lucene/java/branches/lucene_2_3/src/java/org/apache/lucene/index/SegmentMerger.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_3/src/java/org/apache/lucene/index/SegmentMerger.java?rev=639389&r1=639388&r2=639389&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_3/src/java/org/apache/lucene/index/SegmentMerger.java (original)
+++ lucene/java/branches/lucene_2_3/src/java/org/apache/lucene/index/SegmentMerger.java Thu
Mar 20 10:58:47 2008
@@ -330,6 +330,9 @@
         fieldsWriter.close();
       }
 
+      assert docCount*8 == directory.fileLength(segment + "." + IndexFileNames.FIELDS_INDEX_EXTENSION)
:
+        "after mergeFields: fdx size mismatch: " + docCount + " docs vs " + directory.fileLength(segment
+ "." + IndexFileNames.FIELDS_INDEX_EXTENSION) + " length in bytes of " + segment + "." +
IndexFileNames.FIELDS_INDEX_EXTENSION;
+
     } else
       // If we are skipping the doc stores, that means there
       // are no deletions in any of these segments, so we
@@ -364,6 +367,9 @@
     } finally {
       termVectorsWriter.close();
     }
+
+    assert 4+mergedDocs*8 == directory.fileLength(segment + "." + IndexFileNames.VECTORS_INDEX_EXTENSION)
:
+      "after mergeVectors: tvx size mismatch: " + mergedDocs + " docs vs " + directory.fileLength(segment
+ "." + IndexFileNames.VECTORS_INDEX_EXTENSION) + " length in bytes of " + segment + "." +
IndexFileNames.VECTORS_INDEX_EXTENSION;
   }
 
   private IndexOutput freqOutput = null;



Mime
View raw message