fix incorrect ramUSED message to IW infoStream

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@998055 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2010-09-17 10:30:03 +00:00
parent 193d4fab57
commit 34cc899c7d
1 changed files with 4 additions and 2 deletions

View File

@ -636,6 +636,8 @@ final class DocumentsWriter {
Collection<DocConsumerPerThread> threads = new HashSet<DocConsumerPerThread>();
for(int i=0;i<threadStates.length;i++)
threads.add(threadStates[i].consumer);
final long startNumBytesUsed = numBytesUsed;
consumer.flush(threads, flushState);
if (infoStream != null) {
@ -643,10 +645,10 @@ final class DocumentsWriter {
flushState.numDocs, directory, false, -1, flushState.segmentName,
false, hasProx(), flushState.codec);
final long newSegmentSize = si.sizeInBytes();
String message = " ramUsed=" + nf.format(numBytesUsed/1024./1024.) + " MB" +
String message = " ramUsed=" + nf.format(startNumBytesUsed/1024./1024.) + " MB" +
" newFlushedSize=" + newSegmentSize +
" docs/MB=" + nf.format(numDocsInRAM/(newSegmentSize/1024./1024.)) +
" new/old=" + nf.format(100.0*newSegmentSize/numBytesUsed) + "%";
" new/old=" + nf.format(100.0*newSegmentSize/startNumBytesUsed) + "%";
message(message);
}