From 8824011aff380b74afc707a56c0d75baf4523fb1 Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Wed, 23 May 2012 00:28:05 +0000 Subject: [PATCH] LUCENE-4055: clean up some nocommits git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene4055@1341688 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/lucene/codecs/sep/SepDocValuesConsumer.java | 4 ++-- .../lucene/codecs/simpletext/SimpleTextNormsFormat.java | 4 ++-- .../lucene/codecs/simpletext/SimpleTextPerDocConsumer.java | 4 ++-- .../lucene/codecs/simpletext/SimpleTextSegmentInfoFormat.java | 2 -- .../lucene/codecs/simpletext/SimpleTextSegmentInfoReader.java | 2 -- .../lucene/codecs/simpletext/SimpleTextSegmentInfoWriter.java | 2 -- .../org/apache/lucene/index/DocumentsWriterPerThread.java | 1 + lucene/core/src/java/org/apache/lucene/index/IndexWriter.java | 3 +++ 8 files changed, 10 insertions(+), 12 deletions(-) diff --git a/lucene/core/src/java/org/apache/lucene/codecs/sep/SepDocValuesConsumer.java b/lucene/core/src/java/org/apache/lucene/codecs/sep/SepDocValuesConsumer.java index f824c264d0d..10d708a3f7b 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/sep/SepDocValuesConsumer.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/sep/SepDocValuesConsumer.java @@ -51,7 +51,7 @@ public class SepDocValuesConsumer extends DocValuesWriterBase { @Override public void abort() { - // nocommit must we really delete the files...? IFD - // will do so I think? + // We don't have to remove files here: IndexFileDeleter + // will do so } } diff --git a/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextNormsFormat.java b/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextNormsFormat.java index a2c1c71dcec..73fec4c2bff 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextNormsFormat.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextNormsFormat.java @@ -123,8 +123,8 @@ public class SimpleTextNormsFormat extends NormsFormat { @Override public void abort() { - // nocommit must we really delete the files...? IFD - // will do so I think? + // We don't have to remove files here: IndexFileDeleter + // will do so } } } diff --git a/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextPerDocConsumer.java b/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextPerDocConsumer.java index fe5b45fb067..9eeef236fa0 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextPerDocConsumer.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextPerDocConsumer.java @@ -57,8 +57,8 @@ class SimpleTextPerDocConsumer extends PerDocConsumer { @Override public void abort() { - // nocommit must we really delete the files...? IFD - // will do so I think? + // We don't have to remove files here: IndexFileDeleter + // will do so } static String docValuesId(String segmentsName, int fieldId) { diff --git a/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextSegmentInfoFormat.java b/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextSegmentInfoFormat.java index 52c8f0c9d40..151fd382b38 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextSegmentInfoFormat.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextSegmentInfoFormat.java @@ -25,8 +25,6 @@ import org.apache.lucene.codecs.SegmentInfoWriter; import org.apache.lucene.index.IndexFileNames; import org.apache.lucene.index.SegmentInfo; -// nocommit rename (remove s) - /** * plain text segments file format. *

diff --git a/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextSegmentInfoReader.java b/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextSegmentInfoReader.java index 9572db9755a..6356a78d09a 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextSegmentInfoReader.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextSegmentInfoReader.java @@ -40,8 +40,6 @@ import org.apache.lucene.util.StringHelper; import static org.apache.lucene.codecs.simpletext.SimpleTextSegmentInfoWriter.*; -// nocommit rename (remove s) - /** * reads plaintext segments files *

diff --git a/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextSegmentInfoWriter.java b/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextSegmentInfoWriter.java index c9c496fba1f..11f1c4148de 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextSegmentInfoWriter.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextSegmentInfoWriter.java @@ -35,8 +35,6 @@ import org.apache.lucene.store.IndexOutput; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -// nocommit rename (remove s) - /** * writes plaintext segments files *

diff --git a/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java b/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java index 61c078cc3b6..d37775c3ba4 100644 --- a/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java +++ b/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java @@ -485,6 +485,7 @@ class DocumentsWriterPerThread { try { consumer.flush(flushState); pendingDeletes.terms.clear(); + // nocommit use setter and make this a SetOnce: segmentInfo.docCount = flushState.numDocs; segmentInfo.setFiles(new HashSet(directory.getCreatedFiles())); diff --git a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java index 152d5d5a15e..7891bf41da2 100644 --- a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java +++ b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java @@ -2302,6 +2302,8 @@ public class IndexWriter implements Closeable, TwoPhaseCommit { } MergeState mergeState = merger.merge(); // merge 'em + + // nocommit use setter and make this a SetOnce: info.docCount = mergeState.mergedDocCount; SegmentInfoPerCommit infoPerCommit = new SegmentInfoPerCommit(info, 0, -1L); @@ -3499,6 +3501,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit { // This is where all the work happens: MergeState mergeState = merger.merge(); + // nocommit use setter and make this a SetOnce: merge.info.info.docCount = mergeState.mergedDocCount; merge.info.info.setFiles(new HashSet(dirWrapper.getCreatedFiles()));