just adding some further asserts on the size of the term vector & stored fields index files

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@639399 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2008-03-20 18:21:33 +00:00
parent c172010da0
commit 10230efa5d
2 changed files with 10 additions and 0 deletions

View File

@ -283,12 +283,16 @@ final class DocumentsWriter {
tvf.close();
tvd.close();
tvx = null;
assert 4+numDocsInStore*16 == 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;

View File

@ -338,6 +338,9 @@ final class SegmentMerger {
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
@ -402,6 +405,9 @@ final class SegmentMerger {
} finally {
termVectorsWriter.close();
}
assert 4+mergedDocs*16 == 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;