Return-Path: X-Original-To: apmail-lucene-commits-archive@www.apache.org Delivered-To: apmail-lucene-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 500AEC599 for ; Tue, 22 May 2012 02:50:52 +0000 (UTC) Received: (qmail 65466 invoked by uid 500); 22 May 2012 02:50:51 -0000 Mailing-List: contact commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list commits@lucene.apache.org Received: (qmail 65445 invoked by uid 99); 22 May 2012 02:50:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 May 2012 02:50:50 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 May 2012 02:50:46 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id DA6DC2388860; Tue, 22 May 2012 02:50:25 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1341291 - in /lucene/dev/branches/lucene4055/lucene: core/src/java/org/apache/lucene/codecs/ core/src/java/org/apache/lucene/codecs/appending/ core/src/java/org/apache/lucene/codecs/lucene3x/ core/src/java/org/apache/lucene/codecs/lucene40... Date: Tue, 22 May 2012 02:50:24 -0000 To: commits@lucene.apache.org From: rmuir@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120522025025.DA6DC2388860@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rmuir Date: Tue May 22 02:50:22 2012 New Revision: 1341291 URL: http://svn.apache.org/viewvc?rev=1341291&view=rev Log: LUCENE-4055: javadocs, file formats docs, clear some nocommits Added: lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/SegmentInfoFormat.java - copied, changed from r1341287, lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/SegmentInfosFormat.java lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/SegmentInfoReader.java - copied, changed from r1341287, lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/SegmentInfosReader.java lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/SegmentInfoWriter.java - copied, changed from r1341287, lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/SegmentInfosWriter.java lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xSegmentInfoFormat.java - copied, changed from r1341287, lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xSegmentInfosFormat.java lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xSegmentInfoReader.java - copied, changed from r1341287, lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xSegmentInfosReader.java lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoFormat.java - copied, changed from r1341287, lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfosFormat.java lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoReader.java - copied, changed from r1341287, lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfosReader.java lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoWriter.java - copied, changed from r1341287, lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfosWriter.java Removed: lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/SegmentInfosFormat.java lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/SegmentInfosReader.java lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/SegmentInfosWriter.java lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xSegmentInfosFormat.java lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xSegmentInfosReader.java lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfosFormat.java lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfosReader.java lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfosWriter.java Modified: lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/Codec.java lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/appending/AppendingCodec.java lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xCodec.java lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40Codec.java lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/package.html lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldPostingsFormat.java lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextCodec.java lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextSegmentInfosFormat.java lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextSegmentInfosReader.java lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextSegmentInfosWriter.java lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/index/SegmentInfo.java lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/store/ChecksumIndexOutput.java lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/util/CodecUtil.java lucene/dev/branches/lucene4055/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java lucene/dev/branches/lucene4055/lucene/test-framework/src/java/org/apache/lucene/codecs/lucene3x/PreFlexRWCodec.java lucene/dev/branches/lucene4055/lucene/test-framework/src/java/org/apache/lucene/codecs/lucene3x/PreFlexRWSegmentInfosFormat.java lucene/dev/branches/lucene4055/lucene/test-framework/src/java/org/apache/lucene/codecs/lucene3x/PreFlexRWSegmentInfosWriter.java Modified: lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/Codec.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/Codec.java?rev=1341291&r1=1341290&r2=1341291&view=diff ============================================================================== --- lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/Codec.java (original) +++ lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/Codec.java Tue May 22 02:50:22 2012 @@ -70,7 +70,7 @@ public abstract class Codec implements N public abstract FieldInfosFormat fieldInfosFormat(); /** Encodes/decodes segments file */ - public abstract SegmentInfosFormat segmentInfosFormat(); + public abstract SegmentInfoFormat segmentInfosFormat(); /** Encodes/decodes document normalization values */ public abstract NormsFormat normsFormat(); Copied: lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/SegmentInfoFormat.java (from r1341287, lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/SegmentInfosFormat.java) URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/SegmentInfoFormat.java?p2=lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/SegmentInfoFormat.java&p1=lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/SegmentInfosFormat.java&r1=1341287&r2=1341291&rev=1341291&view=diff ============================================================================== --- lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/SegmentInfosFormat.java (original) +++ lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/SegmentInfoFormat.java Tue May 22 02:50:22 2012 @@ -17,32 +17,17 @@ package org.apache.lucene.codecs; * limitations under the License. */ -import java.util.Set; - import org.apache.lucene.index.SegmentInfo; -import org.apache.lucene.index.SegmentInfos; // javadocs /** * Expert: Controls the format of the - * {@link SegmentInfos} (segments file). + * {@link SegmentInfo} (segment metadata file). *

- * NOTE: This isn't a per-segment file. If you change the format, other versions - * of lucene won't be able to read it. * - * @see SegmentInfos + * @see SegmentInfo * @lucene.experimental */ - -// nocommit rename (remove the s?) - -// TODO: would be great to handle this situation better. -// ideally a custom implementation could implement two-phase commit differently, -// (e.g. atomic rename), and ideally all versions of lucene could still read it. -// but this is just reflecting reality as it is today... -// -// also, perhaps the name should change (to cover all global files like .fnx?) -// then again, maybe we can just remove that file... -public abstract class SegmentInfosFormat { - public abstract SegmentInfosReader getSegmentInfosReader(); - public abstract SegmentInfosWriter getSegmentInfosWriter(); +public abstract class SegmentInfoFormat { + public abstract SegmentInfoReader getSegmentInfosReader(); + public abstract SegmentInfoWriter getSegmentInfosWriter(); } Copied: lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/SegmentInfoReader.java (from r1341287, lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/SegmentInfosReader.java) URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/SegmentInfoReader.java?p2=lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/SegmentInfoReader.java&p1=lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/SegmentInfosReader.java&r1=1341287&r2=1341291&rev=1341291&view=diff ============================================================================== --- lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/SegmentInfosReader.java (original) +++ lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/SegmentInfoReader.java Tue May 22 02:50:22 2012 @@ -20,26 +20,21 @@ package org.apache.lucene.codecs; import java.io.IOException; import org.apache.lucene.index.SegmentInfo; -import org.apache.lucene.index.SegmentInfos; -import org.apache.lucene.store.ChecksumIndexInput; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; /** - * Specifies an API for classes that can read {@link SegmentInfos} information. + * Specifies an API for classes that can read {@link SegmentInfo} information. * @lucene.experimental */ -// nocommit rename (remove the s?) - -public abstract class SegmentInfosReader { +public abstract class SegmentInfoReader { /** - * Read {@link SegmentInfos} data from a directory. + * Read {@link SegmentInfo} data from a directory. * @param directory directory to read from - * @param segmentsFileName name of the "segments_N" file - * @param header input of "segments_N" file after reading preamble - * @param infos empty instance to be populated with data + * @param segmentName name of the segment to read + * @return infos instance to be populated with data * @throws IOException */ public abstract SegmentInfo read(Directory directory, String segmentName, IOContext context) throws IOException; Copied: lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/SegmentInfoWriter.java (from r1341287, lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/SegmentInfosWriter.java) URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/SegmentInfoWriter.java?p2=lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/SegmentInfoWriter.java&p1=lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/SegmentInfosWriter.java&r1=1341287&r2=1341291&rev=1341291&view=diff ============================================================================== --- lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/SegmentInfosWriter.java (original) +++ lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/SegmentInfoWriter.java Tue May 22 02:50:22 2012 @@ -21,30 +21,18 @@ import java.io.IOException; import org.apache.lucene.index.FieldInfos; import org.apache.lucene.index.SegmentInfo; -import org.apache.lucene.index.SegmentInfos; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; -import org.apache.lucene.store.IndexOutput; /** - * Specifies an API for classes that can write out {@link SegmentInfos} data. + * Specifies an API for classes that can write out {@link SegmentInfo} data. * @lucene.experimental */ -// nocommit rename (remove the s?) - -public abstract class SegmentInfosWriter { +public abstract class SegmentInfoWriter { /** - * Write {@link SegmentInfos} data without closing the output. The returned - * output will become finished only after a successful completion of - * "two phase commit" that first calls {@link #prepareCommit(IndexOutput)} and - * then {@link #finishCommit(IndexOutput)}. - * @param dir directory to write data to - * @param segmentsFileName name of the "segments_N" file to create - * @param infos data to write - * @return an instance of {@link IndexOutput} to be used in subsequent "two - * phase commit" operations as described above. + * Write {@link SegmentInfo} data. * @throws IOException */ public abstract void write(Directory dir, SegmentInfo info, FieldInfos fis, IOContext ioContext) throws IOException; Modified: lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/appending/AppendingCodec.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/appending/AppendingCodec.java?rev=1341291&r1=1341290&r2=1341291&view=diff ============================================================================== --- lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/appending/AppendingCodec.java (original) +++ lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/appending/AppendingCodec.java Tue May 22 02:50:22 2012 @@ -23,7 +23,7 @@ import org.apache.lucene.codecs.FieldInf import org.apache.lucene.codecs.LiveDocsFormat; import org.apache.lucene.codecs.NormsFormat; import org.apache.lucene.codecs.PostingsFormat; -import org.apache.lucene.codecs.SegmentInfosFormat; +import org.apache.lucene.codecs.SegmentInfoFormat; import org.apache.lucene.codecs.StoredFieldsFormat; import org.apache.lucene.codecs.TermVectorsFormat; import org.apache.lucene.codecs.lucene40.Lucene40Codec; @@ -31,7 +31,7 @@ import org.apache.lucene.codecs.lucene40 import org.apache.lucene.codecs.lucene40.Lucene40FieldInfosFormat; import org.apache.lucene.codecs.lucene40.Lucene40LiveDocsFormat; import org.apache.lucene.codecs.lucene40.Lucene40NormsFormat; -import org.apache.lucene.codecs.lucene40.Lucene40SegmentInfosFormat; +import org.apache.lucene.codecs.lucene40.Lucene40SegmentInfoFormat; import org.apache.lucene.codecs.lucene40.Lucene40StoredFieldsFormat; import org.apache.lucene.codecs.lucene40.Lucene40TermVectorsFormat; @@ -47,7 +47,7 @@ public class AppendingCodec extends Code } private final PostingsFormat postings = new AppendingPostingsFormat(); - private final SegmentInfosFormat infos = new Lucene40SegmentInfosFormat(); + private final SegmentInfoFormat infos = new Lucene40SegmentInfoFormat(); private final StoredFieldsFormat fields = new Lucene40StoredFieldsFormat(); private final FieldInfosFormat fieldInfos = new Lucene40FieldInfosFormat(); private final TermVectorsFormat vectors = new Lucene40TermVectorsFormat(); @@ -76,7 +76,7 @@ public class AppendingCodec extends Code } @Override - public SegmentInfosFormat segmentInfosFormat() { + public SegmentInfoFormat segmentInfosFormat() { return infos; } Modified: lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xCodec.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xCodec.java?rev=1341291&r1=1341290&r2=1341291&view=diff ============================================================================== --- lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xCodec.java (original) +++ lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xCodec.java Tue May 22 02:50:22 2012 @@ -28,7 +28,7 @@ import org.apache.lucene.codecs.NormsFor import org.apache.lucene.codecs.PerDocConsumer; import org.apache.lucene.codecs.PerDocProducer; import org.apache.lucene.codecs.PostingsFormat; -import org.apache.lucene.codecs.SegmentInfosFormat; +import org.apache.lucene.codecs.SegmentInfoFormat; import org.apache.lucene.codecs.StoredFieldsFormat; import org.apache.lucene.codecs.TermVectorsFormat; import org.apache.lucene.codecs.lucene40.Lucene40LiveDocsFormat; @@ -58,7 +58,7 @@ public class Lucene3xCodec extends Codec private final FieldInfosFormat fieldInfosFormat = new Lucene3xFieldInfosFormat(); - private final SegmentInfosFormat infosFormat = new Lucene3xSegmentInfosFormat(); + private final SegmentInfoFormat infosFormat = new Lucene3xSegmentInfoFormat(); private final Lucene3xNormsFormat normsFormat = new Lucene3xNormsFormat(); @@ -112,7 +112,7 @@ public class Lucene3xCodec extends Codec } @Override - public SegmentInfosFormat segmentInfosFormat() { + public SegmentInfoFormat segmentInfosFormat() { return infosFormat; } Copied: lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xSegmentInfoFormat.java (from r1341287, lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xSegmentInfosFormat.java) URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xSegmentInfoFormat.java?p2=lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xSegmentInfoFormat.java&p1=lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xSegmentInfosFormat.java&r1=1341287&r2=1341291&rev=1341291&view=diff ============================================================================== --- lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xSegmentInfosFormat.java (original) +++ lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xSegmentInfoFormat.java Tue May 22 02:50:22 2012 @@ -19,21 +19,21 @@ package org.apache.lucene.codecs.lucene3 import java.util.Set; -import org.apache.lucene.codecs.SegmentInfosFormat; -import org.apache.lucene.codecs.SegmentInfosReader; -import org.apache.lucene.codecs.SegmentInfosWriter; +import org.apache.lucene.codecs.SegmentInfoFormat; +import org.apache.lucene.codecs.SegmentInfoReader; +import org.apache.lucene.codecs.SegmentInfoWriter; import org.apache.lucene.index.IndexFileNames; import org.apache.lucene.index.SegmentInfo; /** - * Lucene3x ReadOnly SegmentInfosFormat implementation + * Lucene3x ReadOnly SegmentInfoFormat implementation * @deprecated (4.0) This is only used to read indexes created * before 4.0. * @lucene.experimental */ @Deprecated -public class Lucene3xSegmentInfosFormat extends SegmentInfosFormat { - private final SegmentInfosReader reader = new Lucene3xSegmentInfosReader(); +public class Lucene3xSegmentInfoFormat extends SegmentInfoFormat { + private final SegmentInfoReader reader = new Lucene3xSegmentInfoReader(); /** This format adds optional per-segment String * diagnostics storage, and switches userData to Map */ @@ -54,12 +54,12 @@ public class Lucene3xSegmentInfosFormat public static final String SI_EXTENSION = "si"; @Override - public SegmentInfosReader getSegmentInfosReader() { + public SegmentInfoReader getSegmentInfosReader() { return reader; } @Override - public SegmentInfosWriter getSegmentInfosWriter() { + public SegmentInfoWriter getSegmentInfosWriter() { throw new UnsupportedOperationException("this codec can only be used for reading"); } } Copied: lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xSegmentInfoReader.java (from r1341287, lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xSegmentInfosReader.java) URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xSegmentInfoReader.java?p2=lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xSegmentInfoReader.java&p1=lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xSegmentInfosReader.java&r1=1341287&r2=1341291&rev=1341291&view=diff ============================================================================== --- lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xSegmentInfosReader.java (original) +++ lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xSegmentInfoReader.java Tue May 22 02:50:22 2012 @@ -24,7 +24,7 @@ import java.util.Map; import java.util.Set; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.codecs.SegmentInfosReader; +import org.apache.lucene.codecs.SegmentInfoReader; import org.apache.lucene.index.IndexFileNames; import org.apache.lucene.index.IndexFormatTooNewException; import org.apache.lucene.index.IndexFormatTooOldException; @@ -38,17 +38,17 @@ import org.apache.lucene.store.IndexInpu import org.apache.lucene.util.IOUtils; /** - * Lucene 3x implementation of {@link SegmentInfosReader}. + * Lucene 3x implementation of {@link SegmentInfoReader}. * @lucene.experimental * @deprecated */ @Deprecated -public class Lucene3xSegmentInfosReader extends SegmentInfosReader { +public class Lucene3xSegmentInfoReader extends SegmentInfoReader { public static void readLegacyInfos(SegmentInfos infos, Directory directory, IndexInput input, int format) throws IOException { infos.version = input.readLong(); // read version infos.counter = input.readInt(); // read counter - Lucene3xSegmentInfosReader reader = new Lucene3xSegmentInfosReader(); + Lucene3xSegmentInfoReader reader = new Lucene3xSegmentInfoReader(); for (int i = input.readInt(); i > 0; i--) { // read segmentInfos SegmentInfo si = reader.readSegmentInfo(null, directory, format, input); if (si.getVersion() == null) { @@ -92,13 +92,13 @@ public class Lucene3xSegmentInfosReader @Override public SegmentInfo read(Directory directory, String segmentName, IOContext context) throws IOException { - return read(directory, segmentName, Lucene3xSegmentInfosFormat.FORMAT_4X_UPGRADE, context); + return read(directory, segmentName, Lucene3xSegmentInfoFormat.FORMAT_4X_UPGRADE, context); } public SegmentInfo read(Directory directory, String segmentName, int format, IOContext context) throws IOException { // NOTE: this is NOT how 3.x is really written... - String fileName = IndexFileNames.segmentFileName(segmentName, "", Lucene3xSegmentInfosFormat.SI_EXTENSION); + String fileName = IndexFileNames.segmentFileName(segmentName, "", Lucene3xSegmentInfoFormat.SI_EXTENSION); boolean success = false; @@ -125,16 +125,16 @@ public class Lucene3xSegmentInfosReader private SegmentInfo readSegmentInfo(String segmentName, Directory dir, int format, IndexInput input) throws IOException { // check that it is a format we can understand - if (format > Lucene3xSegmentInfosFormat.FORMAT_DIAGNOSTICS) { + if (format > Lucene3xSegmentInfoFormat.FORMAT_DIAGNOSTICS) { throw new IndexFormatTooOldException(input, format, - Lucene3xSegmentInfosFormat.FORMAT_DIAGNOSTICS, Lucene3xSegmentInfosFormat.FORMAT_4X_UPGRADE); + Lucene3xSegmentInfoFormat.FORMAT_DIAGNOSTICS, Lucene3xSegmentInfoFormat.FORMAT_4X_UPGRADE); } - if (format < Lucene3xSegmentInfosFormat.FORMAT_4X_UPGRADE) { + if (format < Lucene3xSegmentInfoFormat.FORMAT_4X_UPGRADE) { throw new IndexFormatTooNewException(input, format, - Lucene3xSegmentInfosFormat.FORMAT_DIAGNOSTICS, Lucene3xSegmentInfosFormat.FORMAT_4X_UPGRADE); + Lucene3xSegmentInfoFormat.FORMAT_DIAGNOSTICS, Lucene3xSegmentInfoFormat.FORMAT_4X_UPGRADE); } final String version; - if (format <= Lucene3xSegmentInfosFormat.FORMAT_3_1) { + if (format <= Lucene3xSegmentInfoFormat.FORMAT_3_1) { version = input.readString(); } else { version = null; @@ -185,13 +185,13 @@ public class Lucene3xSegmentInfosReader final Map diagnostics = input.readStringStringMap(); - if (format <= Lucene3xSegmentInfosFormat.FORMAT_HAS_VECTORS) { + if (format <= Lucene3xSegmentInfoFormat.FORMAT_HAS_VECTORS) { // NOTE: unused final int hasVectors = input.readByte(); } final Set files; - if (format == Lucene3xSegmentInfosFormat.FORMAT_4X_UPGRADE) { + if (format == Lucene3xSegmentInfoFormat.FORMAT_4X_UPGRADE) { files = input.readStringSet(); } else { // Replicate logic from 3.x's SegmentInfo.files(): @@ -232,7 +232,7 @@ public class Lucene3xSegmentInfosReader // Definitely a separate norm file, with generation: files.add(IndexFileNames.fileNameFromGeneration(segmentName, "s" + ent.getKey(), gen)); } else if (gen == SegmentInfo.NO) { - // No seaprate norm + // No separate norm } else { // nocommit -- i thought _X_N.sY files were pre-3.0...???? assert false; Modified: lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40Codec.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40Codec.java?rev=1341291&r1=1341290&r2=1341291&view=diff ============================================================================== --- lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40Codec.java (original) +++ lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40Codec.java Tue May 22 02:50:22 2012 @@ -23,7 +23,7 @@ import org.apache.lucene.codecs.FieldInf import org.apache.lucene.codecs.LiveDocsFormat; import org.apache.lucene.codecs.NormsFormat; import org.apache.lucene.codecs.PostingsFormat; -import org.apache.lucene.codecs.SegmentInfosFormat; +import org.apache.lucene.codecs.SegmentInfoFormat; import org.apache.lucene.codecs.StoredFieldsFormat; import org.apache.lucene.codecs.TermVectorsFormat; import org.apache.lucene.codecs.perfield.PerFieldPostingsFormat; @@ -42,7 +42,7 @@ public class Lucene40Codec extends Codec private final TermVectorsFormat vectorsFormat = new Lucene40TermVectorsFormat(); private final FieldInfosFormat fieldInfosFormat = new Lucene40FieldInfosFormat(); private final DocValuesFormat docValuesFormat = new Lucene40DocValuesFormat(); - private final SegmentInfosFormat infosFormat = new Lucene40SegmentInfosFormat(); + private final SegmentInfoFormat infosFormat = new Lucene40SegmentInfoFormat(); private final NormsFormat normsFormat = new Lucene40NormsFormat(); private final LiveDocsFormat liveDocsFormat = new Lucene40LiveDocsFormat(); @@ -83,7 +83,7 @@ public class Lucene40Codec extends Codec } @Override - public SegmentInfosFormat segmentInfosFormat() { + public SegmentInfoFormat segmentInfosFormat() { return infosFormat; } Copied: lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoFormat.java (from r1341287, lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfosFormat.java) URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoFormat.java?p2=lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoFormat.java&p1=lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfosFormat.java&r1=1341287&r2=1341291&rev=1341291&view=diff ============================================================================== --- lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfosFormat.java (original) +++ lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoFormat.java Tue May 22 02:50:22 2012 @@ -17,121 +17,64 @@ package org.apache.lucene.codecs.lucene4 * limitations under the License. */ -import java.io.IOException; -import java.util.Set; - -import org.apache.lucene.codecs.Codec; // javadocs -import org.apache.lucene.codecs.LiveDocsFormat; // javadocs -import org.apache.lucene.codecs.SegmentInfosFormat; -import org.apache.lucene.codecs.SegmentInfosReader; -import org.apache.lucene.codecs.SegmentInfosWriter; -import org.apache.lucene.codecs.StoredFieldsFormat; // javadocs -import org.apache.lucene.codecs.TermVectorsFormat; // javadocs -import org.apache.lucene.index.FieldInfo.IndexOptions; // javadocs -import org.apache.lucene.index.IndexFileNames; +import org.apache.lucene.codecs.SegmentInfoFormat; +import org.apache.lucene.codecs.SegmentInfoReader; +import org.apache.lucene.codecs.SegmentInfoWriter; import org.apache.lucene.index.IndexWriter; // javadocs -import org.apache.lucene.index.SegmentInfo; import org.apache.lucene.index.SegmentInfos; // javadocs import org.apache.lucene.store.DataOutput; // javadocs /** - * Lucene 4.0 Segments format. + * Lucene 4.0 Segment info format. *

* Files: *

    - *
  • segments.gen: described in {@link SegmentInfos} - *
  • segments_N: Format, Codec, Version, NameCounter, SegCount, - * <SegVersion, SegName, SegSize, DelGen, DocStoreOffset, [DocStoreSegment, - * DocStoreIsCompoundFile], NumField, NormGenNumField, - * IsCompoundFile, DeletionCount, HasProx, SegCodec Diagnostics, - * HasVectors>SegCount, CommitUserData, Checksum + *
  • .si: SegVersion, SegSize, IsCompoundFile, Diagnostics, Files *
*

* Data types: *

*

    - *
  • Format, NameCounter, SegCount, SegSize, NumField, DocStoreOffset, - * DeletionCount --> {@link DataOutput#writeInt Int32}
  • - *
  • Version, DelGen, NormGen, Checksum --> - * {@link DataOutput#writeLong Int64}
  • - *
  • SegVersion, SegName, DocStoreSegment, Codec, SegCodec --> - * {@link DataOutput#writeString String}
  • - *
  • Diagnostics, CommitUserData --> - * {@link DataOutput#writeStringStringMap Map<String,String>}
  • - *
  • IsCompoundFile, DocStoreIsCompoundFile, HasProx, - * HasVectors --> {@link DataOutput#writeByte Int8}
  • + *
  • SegSize --> {@link DataOutput#writeInt Int32}
  • + *
  • SegVersion --> {@link DataOutput#writeString String}
  • + *
  • Files --> {@link DataOutput#writeStringSet Set<String>}
  • + *
  • Diagnostics--> {@link DataOutput#writeStringStringMap Map<String,String>}
  • + *
  • IsCompoundFile --> {@link DataOutput#writeByte Int8}
  • *
*

* Field Descriptions: *

*

    - *
  • Format is {@link SegmentInfos#FORMAT_4_0}.
  • - *
  • Codec is "Lucene40", its the {@link Codec} that wrote this particular segments file.
  • - *
  • Version counts how often the index has been changed by adding or deleting - * documents.
  • - *
  • NameCounter is used to generate names for new segment files.
  • *
  • SegVersion is the code version that created the segment.
  • - *
  • SegName is the name of the segment, and is used as the file name prefix for - * all of the files that compose the segment's index.
  • *
  • SegSize is the number of documents contained in the segment index.
  • - *
  • DelGen is the generation count of the deletes file. If this is -1, - * there are no deletes. Anything above zero means there are deletes - * stored by {@link LiveDocsFormat}.
  • - *
  • NumField is the size of the array for NormGen, or -1 if there are no - * NormGens stored.
  • - *
  • NormGen records the generation of the separate norms files. If NumField is - * -1, there are no normGens stored and all assumed to be -1. The generation - * then has the same meaning as delGen (above).
  • *
  • IsCompoundFile records whether the segment is written as a compound file or * not. If this is -1, the segment is not a compound file. If it is 1, the segment - * is a compound file. Else it is 0, which means we check filesystem to see if - * _X.cfs exists.
  • - *
  • DocStoreOffset, DocStoreSegment, DocStoreIsCompoundFile: If DocStoreOffset - * is -1, this segment has its own doc store (stored fields values and term - * vectors) files and DocStoreSegment and DocStoreIsCompoundFile are not stored. - * In this case all files for {@link StoredFieldsFormat stored field values} and - * {@link TermVectorsFormat term vectors} will be stored with this segment. - * Otherwise, DocStoreSegment is the name of the segment that has the shared doc - * store files; DocStoreIsCompoundFile is 1 if that segment is stored in compound - * file format (as a .cfx file); and DocStoreOffset is the starting document - * in the shared doc store files where this segment's documents begin. In this case, - * this segment does not store its own doc store files but instead shares a single - * set of these files with other segments.
  • + * is a compound file. *
  • Checksum contains the CRC32 checksum of all bytes in the segments_N file up * until the checksum. This is used to verify integrity of the file on opening the * index.
  • - *
  • DeletionCount records the number of deleted documents in this segment.
  • - *
  • HasProx is 1 if any fields in this segment have position data - * ({@link IndexOptions#DOCS_AND_FREQS_AND_POSITIONS DOCS_AND_FREQS_AND_POSITIONS} or - * {@link IndexOptions#DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS}); - * else, it's 0.
  • - *
  • SegCodec is the {@link Codec#getName() name} of the Codec that encoded - * this segment.
  • - *
  • CommitUserData stores an optional user-supplied opaque - * Map<String,String> that was passed to {@link IndexWriter#commit(java.util.Map)} - * or {@link IndexWriter#prepareCommit(java.util.Map)}.
  • *
  • The Diagnostics Map is privately written by IndexWriter, as a debugging aid, * for each segment it creates. It includes metadata like the current Lucene * version, OS, Java version, why the segment was created (merge, flush, * addIndexes), etc.
  • - *
  • HasVectors is 1 if this segment stores term vectors, else it's 0.
  • + *
  • Files is a list of files referred to by this segment.
  • *
*

* * @see SegmentInfos * @lucene.experimental */ -public class Lucene40SegmentInfosFormat extends SegmentInfosFormat { - private final SegmentInfosReader reader = new Lucene40SegmentInfosReader(); - private final SegmentInfosWriter writer = new Lucene40SegmentInfosWriter(); +public class Lucene40SegmentInfoFormat extends SegmentInfoFormat { + private final SegmentInfoReader reader = new Lucene40SegmentInfoReader(); + private final SegmentInfoWriter writer = new Lucene40SegmentInfoWriter(); @Override - public SegmentInfosReader getSegmentInfosReader() { + public SegmentInfoReader getSegmentInfosReader() { return reader; } @Override - public SegmentInfosWriter getSegmentInfosWriter() { + public SegmentInfoWriter getSegmentInfosWriter() { return writer; } Copied: lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoReader.java (from r1341287, lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfosReader.java) URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoReader.java?p2=lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoReader.java&p1=lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfosReader.java&r1=1341287&r2=1341291&rev=1341291&view=diff ============================================================================== --- lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfosReader.java (original) +++ lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoReader.java Tue May 22 02:50:22 2012 @@ -18,33 +18,28 @@ package org.apache.lucene.codecs.lucene4 */ import java.io.IOException; -import java.util.HashMap; -import java.util.HashSet; import java.util.Map; import java.util.Set; -import org.apache.lucene.codecs.Codec; -import org.apache.lucene.codecs.SegmentInfosReader; +import org.apache.lucene.codecs.SegmentInfoReader; import org.apache.lucene.index.IndexFileNames; import org.apache.lucene.index.SegmentInfo; -import org.apache.lucene.index.SegmentInfos; -import org.apache.lucene.store.ChecksumIndexInput; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.util.IOUtils; /** - * Lucene 4.0 implementation of {@link SegmentInfosReader}. + * Lucene 4.0 implementation of {@link SegmentInfoReader}. * - * @see Lucene40SegmentInfosFormat + * @see Lucene40SegmentInfoFormat * @lucene.experimental */ -public class Lucene40SegmentInfosReader extends SegmentInfosReader { +public class Lucene40SegmentInfoReader extends SegmentInfoReader { @Override public SegmentInfo read(Directory dir, String segment, IOContext context) throws IOException { - final String fileName = IndexFileNames.segmentFileName(segment, "", Lucene40SegmentInfosFormat.SI_EXTENSION); + final String fileName = IndexFileNames.segmentFileName(segment, "", Lucene40SegmentInfoFormat.SI_EXTENSION); final IndexInput input = dir.openInput(fileName, context); boolean success = false; try { Copied: lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoWriter.java (from r1341287, lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfosWriter.java) URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoWriter.java?p2=lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoWriter.java&p1=lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfosWriter.java&r1=1341287&r2=1341291&rev=1341291&view=diff ============================================================================== --- lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfosWriter.java (original) +++ lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoWriter.java Tue May 22 02:50:22 2012 @@ -18,36 +18,29 @@ package org.apache.lucene.codecs.lucene4 */ import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Map; -import java.util.Set; -import org.apache.lucene.codecs.SegmentInfosWriter; +import org.apache.lucene.codecs.SegmentInfoWriter; import org.apache.lucene.index.FieldInfos; import org.apache.lucene.index.IndexFileNames; import org.apache.lucene.index.SegmentInfo; -import org.apache.lucene.index.SegmentInfos; -import org.apache.lucene.store.ChecksumIndexOutput; import org.apache.lucene.store.Directory; -import org.apache.lucene.store.FlushInfo; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexOutput; import org.apache.lucene.util.IOUtils; /** - * Lucene 4.0 implementation of {@link SegmentInfosWriter}. + * Lucene 4.0 implementation of {@link SegmentInfoWriter}. * - * @see Lucene40SegmentInfosFormat + * @see Lucene40SegmentInfoFormat * @lucene.experimental */ -public class Lucene40SegmentInfosWriter extends SegmentInfosWriter { +public class Lucene40SegmentInfoWriter extends SegmentInfoWriter { /** Save a single segment's info. */ @Override public void write(Directory dir, SegmentInfo si, FieldInfos fis, IOContext ioContext) throws IOException { assert si.getDelCount() <= si.docCount: "delCount=" + si.getDelCount() + " docCount=" + si.docCount + " segment=" + si.name; - final String fileName = IndexFileNames.segmentFileName(si.name, "", Lucene40SegmentInfosFormat.SI_EXTENSION); + final String fileName = IndexFileNames.segmentFileName(si.name, "", Lucene40SegmentInfoFormat.SI_EXTENSION); assert si.getFiles() != null; si.getFiles().add(fileName); Modified: lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/package.html URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/package.html?rev=1341291&r1=1341290&r2=1341291&view=diff ============================================================================== --- lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/package.html (original) +++ lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/lucene40/package.html Tue May 22 02:50:22 2012 @@ -137,6 +137,11 @@ its numbering.

Each segment index maintains the following:

  • +{@link org.apache.lucene.codecs.lucene40.Lucene40SegmentInfoFormat Segment info}. + This contains metadata about a segment, such as the number of documents, + what files it uses, +
  • +
  • {@link org.apache.lucene.codecs.lucene40.Lucene40FieldInfosFormat Field names}. This contains the set of field names used in the index.
  • @@ -197,8 +202,9 @@ An optional file indicating which docume

    All files belonging to a segment have the same name with varying extensions. The extensions correspond to the different file formats described below. When -using the Compound File format (default in 1.4 and greater) these files are -collapsed into a single .cfs file (see below for details)

    +using the Compound File format (default in 1.4 and greater) these files (except +for the Segment info file, the Lock file, and Deleted documents file) are collapsed +into a single .cfs file (see below for details)

    Typically, all segments in an index are stored in a single directory, although this is not required.

    As of version 2.1 (lock-less commits), file names are never re-used (there @@ -220,9 +226,9 @@ Lucene:

    Brief Description -{@link org.apache.lucene.codecs.lucene40.Lucene40SegmentInfosFormat Segments File} +{@link org.apache.lucene.index.SegmentInfos Segments File} segments.gen, segments_N -Stores information about segments +Stores information about a commit point Lock File @@ -231,6 +237,11 @@ Lucene:

    file. +{@link org.apache.lucene.codecs.lucene40.Lucene40SegmentInfoFormat Segment Info} +.si +Stores metadata about a segment + + {@link org.apache.lucene.store.CompoundFileDirectory Compound File} .cfs, .cfe An optional "virtual" file consisting of all the other index files for Modified: lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldPostingsFormat.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldPostingsFormat.java?rev=1341291&r1=1341290&r2=1341291&view=diff ============================================================================== --- lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldPostingsFormat.java (original) +++ lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldPostingsFormat.java Tue May 22 02:50:22 2012 @@ -206,8 +206,6 @@ public abstract class PerFieldPostingsFo return new FieldsReader(state); } - // nocommit simplify now that we don't have files()...? - // NOTE: only called during writing; for reading we read // all we need from the index (ie we save the field -> // format mapping) Modified: lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextCodec.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextCodec.java?rev=1341291&r1=1341290&r2=1341291&view=diff ============================================================================== --- lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextCodec.java (original) +++ lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextCodec.java Tue May 22 02:50:22 2012 @@ -23,7 +23,7 @@ import org.apache.lucene.codecs.FieldInf import org.apache.lucene.codecs.LiveDocsFormat; import org.apache.lucene.codecs.NormsFormat; import org.apache.lucene.codecs.PostingsFormat; -import org.apache.lucene.codecs.SegmentInfosFormat; +import org.apache.lucene.codecs.SegmentInfoFormat; import org.apache.lucene.codecs.StoredFieldsFormat; import org.apache.lucene.codecs.TermVectorsFormat; @@ -36,7 +36,7 @@ import org.apache.lucene.codecs.TermVect public final class SimpleTextCodec extends Codec { private final PostingsFormat postings = new SimpleTextPostingsFormat(); private final StoredFieldsFormat storedFields = new SimpleTextStoredFieldsFormat(); - private final SegmentInfosFormat segmentInfos = new SimpleTextSegmentInfosFormat(); + private final SegmentInfoFormat segmentInfos = new SimpleTextSegmentInfosFormat(); private final FieldInfosFormat fieldInfosFormat = new SimpleTextFieldInfosFormat(); private final TermVectorsFormat vectorsFormat = new SimpleTextTermVectorsFormat(); // TODO: need a plain-text impl @@ -75,7 +75,7 @@ public final class SimpleTextCodec exten } @Override - public SegmentInfosFormat segmentInfosFormat() { + public SegmentInfoFormat segmentInfosFormat() { return segmentInfos; } Modified: lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextSegmentInfosFormat.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextSegmentInfosFormat.java?rev=1341291&r1=1341290&r2=1341291&view=diff ============================================================================== --- lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextSegmentInfosFormat.java (original) +++ lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextSegmentInfosFormat.java Tue May 22 02:50:22 2012 @@ -19,9 +19,9 @@ package org.apache.lucene.codecs.simplet import java.util.Set; -import org.apache.lucene.codecs.SegmentInfosFormat; -import org.apache.lucene.codecs.SegmentInfosReader; -import org.apache.lucene.codecs.SegmentInfosWriter; +import org.apache.lucene.codecs.SegmentInfoFormat; +import org.apache.lucene.codecs.SegmentInfoReader; +import org.apache.lucene.codecs.SegmentInfoWriter; import org.apache.lucene.index.IndexFileNames; import org.apache.lucene.index.SegmentInfo; @@ -31,19 +31,19 @@ import org.apache.lucene.index.SegmentIn * FOR RECREATIONAL USE ONLY * @lucene.experimental */ -public class SimpleTextSegmentInfosFormat extends SegmentInfosFormat { - private final SegmentInfosReader reader = new SimpleTextSegmentInfosReader(); - private final SegmentInfosWriter writer = new SimpleTextSegmentInfosWriter(); +public class SimpleTextSegmentInfosFormat extends SegmentInfoFormat { + private final SegmentInfoReader reader = new SimpleTextSegmentInfosReader(); + private final SegmentInfoWriter writer = new SimpleTextSegmentInfosWriter(); public static final String SI_EXTENSION = "si"; @Override - public SegmentInfosReader getSegmentInfosReader() { + public SegmentInfoReader getSegmentInfosReader() { return reader; } @Override - public SegmentInfosWriter getSegmentInfosWriter() { + public SegmentInfoWriter getSegmentInfosWriter() { return writer; } } Modified: lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextSegmentInfosReader.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextSegmentInfosReader.java?rev=1341291&r1=1341290&r2=1341291&view=diff ============================================================================== --- lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextSegmentInfosReader.java (original) +++ lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextSegmentInfosReader.java Tue May 22 02:50:22 2012 @@ -24,7 +24,7 @@ import java.util.Map; import java.util.Set; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.codecs.SegmentInfosReader; +import org.apache.lucene.codecs.SegmentInfoReader; import org.apache.lucene.index.CorruptIndexException; import org.apache.lucene.index.IndexFileNames; import org.apache.lucene.index.SegmentInfo; @@ -46,7 +46,7 @@ import static org.apache.lucene.codecs.s * FOR RECREATIONAL USE ONLY * @lucene.experimental */ -public class SimpleTextSegmentInfosReader extends SegmentInfosReader { +public class SimpleTextSegmentInfosReader extends SegmentInfoReader { @Override public SegmentInfo read(Directory directory, String segmentName, IOContext context) throws IOException { Modified: lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextSegmentInfosWriter.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextSegmentInfosWriter.java?rev=1341291&r1=1341290&r2=1341291&view=diff ============================================================================== --- lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextSegmentInfosWriter.java (original) +++ lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextSegmentInfosWriter.java Tue May 22 02:50:22 2012 @@ -22,7 +22,7 @@ import java.util.Map.Entry; import java.util.Map; import java.util.Set; -import org.apache.lucene.codecs.SegmentInfosWriter; +import org.apache.lucene.codecs.SegmentInfoWriter; import org.apache.lucene.index.FieldInfos; import org.apache.lucene.index.IndexFileNames; import org.apache.lucene.index.SegmentInfo; @@ -41,7 +41,7 @@ import org.apache.lucene.util.IOUtils; * FOR RECREATIONAL USE ONLY * @lucene.experimental */ -public class SimpleTextSegmentInfosWriter extends SegmentInfosWriter { +public class SimpleTextSegmentInfosWriter extends SegmentInfoWriter { final static BytesRef SI_VERSION = new BytesRef(" version "); final static BytesRef SI_DOCCOUNT = new BytesRef(" number of documents "); Modified: lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java?rev=1341291&r1=1341290&r2=1341291&view=diff ============================================================================== --- lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java (original) +++ lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java Tue May 22 02:50:22 2012 @@ -33,7 +33,7 @@ import java.util.concurrent.atomic.Atomi import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.codecs.lucene3x.Lucene3xSegmentInfosFormat; +import org.apache.lucene.codecs.lucene3x.Lucene3xSegmentInfoFormat; import org.apache.lucene.index.DocumentsWriterPerThread.FlushedSegment; import org.apache.lucene.index.FieldInfos.FieldNumberBiMap; import org.apache.lucene.index.IndexWriterConfig.OpenMode; @@ -2372,7 +2372,7 @@ public class IndexWriter implements Clos final boolean hasSharedDocStore = info.getDocStoreOffset() != -1; final String segmentInfoFileName3X = IndexFileNames.segmentFileName(info.name, "", - Lucene3xSegmentInfosFormat.SI_EXTENSION); + Lucene3xSegmentInfoFormat.SI_EXTENSION); if (hasSharedDocStore) { // only violate the codec this way if it's preflex & Modified: lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/index/SegmentInfo.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/index/SegmentInfo.java?rev=1341291&r1=1341290&r2=1341291&view=diff ============================================================================== --- lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/index/SegmentInfo.java (original) +++ lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/index/SegmentInfo.java Tue May 22 02:50:22 2012 @@ -34,16 +34,11 @@ import org.apache.lucene.store.Directory import org.apache.lucene.store.TrackingDirectoryWrapper; import org.apache.lucene.util.Constants; -// nocommit fix jdocs for all codec's SI writer impls to -// describe their format - // nocommit fix codec api to pass this around so they can // store attrs // nocommit add attrs api like FI -// nocommit fix PFPF to use attrs api instead of its .per file - /** * Information about a segment such as it's name, directory, and files related * to the segment. Modified: lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java?rev=1341291&r1=1341290&r2=1341291&view=diff ============================================================================== --- lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java (original) +++ lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java Tue May 22 02:50:22 2012 @@ -32,16 +32,14 @@ import java.util.Map; import java.util.Set; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.codecs.SegmentInfosReader; -import org.apache.lucene.codecs.SegmentInfosWriter; +import org.apache.lucene.codecs.LiveDocsFormat; import org.apache.lucene.codecs.lucene3x.Lucene3xCodec; -import org.apache.lucene.codecs.lucene3x.Lucene3xSegmentInfosFormat; -import org.apache.lucene.codecs.lucene3x.Lucene3xSegmentInfosReader; +import org.apache.lucene.codecs.lucene3x.Lucene3xSegmentInfoFormat; +import org.apache.lucene.codecs.lucene3x.Lucene3xSegmentInfoReader; import org.apache.lucene.store.ChecksumIndexInput; import org.apache.lucene.store.ChecksumIndexOutput; import org.apache.lucene.store.DataOutput; // javadocs import org.apache.lucene.store.Directory; -import org.apache.lucene.store.FlushInfo; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; @@ -60,9 +58,8 @@ import org.apache.lucene.util.ThreadInte * older segments_N files are present it's because they temporarily cannot be * deleted, or, a writer is in the process of committing, or a custom * {@link org.apache.lucene.index.IndexDeletionPolicy IndexDeletionPolicy} - * is in use). This file lists each segment by name, has details about the - * separate norms and deletion files, and also contains the size of each - * segment. + * is in use). This file lists each segment by name and has details about the + * codec and generation of deletes. *

    *

    There is also a file segments.gen. This file contains * the current generation (the _N in segments_N) of the index. @@ -72,27 +69,55 @@ import org.apache.lucene.util.ThreadInte * an {@link DataOutput#writeInt Int32} version header * ({@link #FORMAT_SEGMENTS_GEN_CURRENT}), followed by the * generation recorded as {@link DataOutput#writeLong Int64}, written twice.

    + *

    + * Files: + *

      + *
    • segments.gen: GenHeader, Generation, Generation + *
    • segments_N: Header, Version, NameCounter, SegCount, + * <SegName, SegCodec, DelGen, DeletionCount>SegCount, + * CommitUserData, Checksum + *
    + *

    + * Data types: + *

    + *

      + *
    • Header --> {@link CodecUtil#writeHeader CodecHeader}
    • + *
    • GenHeader, NameCounter, SegCount, DeletionCount --> {@link DataOutput#writeInt Int32}
    • + *
    • Generation, Version, DelGen, Checksum --> {@link DataOutput#writeLong Int64}
    • + *
    • SegName, SegCodec --> {@link DataOutput#writeString String}
    • + *
    • CommitUserData --> {@link DataOutput#writeStringStringMap Map<String,String>}
    • + *
    + *

    + * Field Descriptions: + *

    + *

      + *
    • Version counts how often the index has been changed by adding or deleting + * documents.
    • + *
    • NameCounter is used to generate names for new segment files.
    • + *
    • SegName is the name of the segment, and is used as the file name prefix for + * all of the files that compose the segment's index.
    • + *
    • DelGen is the generation count of the deletes file. If this is -1, + * there are no deletes. Anything above zero means there are deletes + * stored by {@link LiveDocsFormat}.
    • + *
    • DeletionCount records the number of deleted documents in this segment.
    • + *
    • Checksum contains the CRC32 checksum of all bytes in the segments_N file up + * until the checksum. This is used to verify integrity of the file on opening the + * index.
    • + *
    • SegCodec is the {@link Codec#getName() name} of the Codec that encoded + * this segment.
    • + *
    • CommitUserData stores an optional user-supplied opaque + * Map<String,String> that was passed to {@link IndexWriter#commit(java.util.Map)} + * or {@link IndexWriter#prepareCommit(java.util.Map)}.
    • + *
    + *

    * * @lucene.experimental */ public final class SegmentInfos implements Cloneable, Iterable { - /* - * The file format version, a negative number. - * - * NOTE: future format numbers must always be one smaller - * than the latest. With time, support for old formats will - * be removed, however the numbers should continue to decrease. + /** + * The file format version for the segments_N codec header */ - - // TODO: i don't think we need *all* these version numbers here? - // most codecs only need FORMAT_CURRENT? and we should rename it - // to FORMAT_FLEX? because the 'preamble' is just FORMAT_CURRENT + codecname - // after that the codec takes over. - - // also i think this class should write this, somehow we let - // preflexrw hackishly override this (like seek backwards and overwrite it) - public static final int VERSION_40 = 0; /** Used for the segments.gen file only! @@ -248,13 +273,9 @@ public final class SegmentInfos implemen lastGeneration = generation; - // TODO: scary to have default impl reopen the file... but to make it a bit more flexible, - // maybe we could use a plain indexinput here... could default impl rewind/wrap with checksumII, - // and any checksumming is then up to implementation? ChecksumIndexInput input = new ChecksumIndexInput(directory.openInput(segmentFileName, IOContext.READ)); try { final int format = input.readInt(); - final boolean checkCheckSum; if (format == CodecUtil.CODEC_MAGIC) { // 4.0+ CodecUtil.checkHeaderNoMagic(input, "segments", VERSION_40, VERSION_40); @@ -274,7 +295,7 @@ public final class SegmentInfos implemen } userData = input.readStringStringMap(); } else { - Lucene3xSegmentInfosReader.readLegacyInfos(this, directory, input, format); + Lucene3xSegmentInfoReader.readLegacyInfos(this, directory, input, format); Codec codec = Codec.forName("Lucene3x"); for (SegmentInfo info : this) { info.setCodec(codec); @@ -331,7 +352,7 @@ public final class SegmentInfos implemen ChecksumIndexOutput segnOutput = null; boolean success = false; - // nocommit document somewhere taht we store this + // nocommit document somewhere that we store this // list-of-segs plus delGen plus other stuff // "generically" and then codec gets to write SI @@ -343,7 +364,6 @@ public final class SegmentInfos implemen segnOutput.writeLong(version); segnOutput.writeInt(counter); // write counter segnOutput.writeInt(size()); // write infos - Codec codec3X = Codec.forName("Lucene3x"); for (SegmentInfo si : this) { segnOutput.writeString(si.name); segnOutput.writeString(si.getCodec().getName()); @@ -355,7 +375,7 @@ public final class SegmentInfos implemen // "ugprade" to write the .si file for it: String version = si.getVersion(); if (version == null || version.startsWith("3.")) { - String fileName = IndexFileNames.segmentFileName(si.name, "", Lucene3xSegmentInfosFormat.SI_EXTENSION); + String fileName = IndexFileNames.segmentFileName(si.name, "", Lucene3xSegmentInfoFormat.SI_EXTENSION); if (!directory.fileExists(fileName)) { upgradedSIFiles.add(write3xInfo(directory, si, IOContext.DEFAULT)); } @@ -393,7 +413,7 @@ public final class SegmentInfos implemen public static String write3xInfo(Directory dir, SegmentInfo si, IOContext context) throws IOException { // NOTE: this is NOT how 3.x is really written... - String fileName = IndexFileNames.segmentFileName(si.name, "", Lucene3xSegmentInfosFormat.SI_EXTENSION); + String fileName = IndexFileNames.segmentFileName(si.name, "", Lucene3xSegmentInfoFormat.SI_EXTENSION); si.getFiles().add(fileName); //System.out.println("UPGRADE write " + fileName); Modified: lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/store/ChecksumIndexOutput.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/store/ChecksumIndexOutput.java?rev=1341291&r1=1341290&r2=1341291&view=diff ============================================================================== --- lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/store/ChecksumIndexOutput.java (original) +++ lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/store/ChecksumIndexOutput.java Tue May 22 02:50:22 2012 @@ -71,7 +71,7 @@ public class ChecksumIndexOutput extends throw new UnsupportedOperationException(); } - /** See {@link #prepareCommit} */ + /** writes the checksum */ public void finishCommit() throws IOException { main.writeLong(getChecksum()); } Modified: lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/util/CodecUtil.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/util/CodecUtil.java?rev=1341291&r1=1341290&r2=1341291&view=diff ============================================================================== --- lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/util/CodecUtil.java (original) +++ lucene/dev/branches/lucene4055/lucene/core/src/java/org/apache/lucene/util/CodecUtil.java Tue May 22 02:50:22 2012 @@ -130,7 +130,7 @@ public final class CodecUtil { } /** Like {@link - * checkHeader(DataInput,String,int,int)} except this + * #checkHeader(DataInput,String,int,int)} except this * version assumes the first int has already been read * and validated from the input. */ public static int checkHeaderNoMagic(DataInput in, String codec, int minVersion, int maxVersion) throws IOException { Modified: lucene/dev/branches/lucene4055/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4055/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java?rev=1341291&r1=1341290&r2=1341291&view=diff ============================================================================== --- lucene/dev/branches/lucene4055/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java (original) +++ lucene/dev/branches/lucene4055/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java Tue May 22 02:50:22 2012 @@ -30,7 +30,7 @@ import org.apache.lucene.codecs.FieldInf import org.apache.lucene.codecs.LiveDocsFormat; import org.apache.lucene.codecs.NormsFormat; import org.apache.lucene.codecs.PostingsFormat; -import org.apache.lucene.codecs.SegmentInfosFormat; +import org.apache.lucene.codecs.SegmentInfoFormat; import org.apache.lucene.codecs.StoredFieldsFormat; import org.apache.lucene.codecs.TermVectorsFormat; import org.apache.lucene.codecs.lucene40.Lucene40Codec; @@ -38,7 +38,7 @@ import org.apache.lucene.codecs.lucene40 import org.apache.lucene.codecs.lucene40.Lucene40FieldInfosFormat; import org.apache.lucene.codecs.lucene40.Lucene40LiveDocsFormat; import org.apache.lucene.codecs.lucene40.Lucene40NormsFormat; -import org.apache.lucene.codecs.lucene40.Lucene40SegmentInfosFormat; +import org.apache.lucene.codecs.lucene40.Lucene40SegmentInfoFormat; import org.apache.lucene.codecs.lucene40.Lucene40StoredFieldsFormat; import org.apache.lucene.codecs.lucene40.Lucene40TermVectorsFormat; import org.apache.lucene.codecs.pulsing.Pulsing40PostingsFormat; @@ -1150,8 +1150,8 @@ public class TestAddIndexes extends Luce } @Override - public SegmentInfosFormat segmentInfosFormat() { - return new Lucene40SegmentInfosFormat(); + public SegmentInfoFormat segmentInfosFormat() { + return new Lucene40SegmentInfoFormat(); } @Override Modified: lucene/dev/branches/lucene4055/lucene/test-framework/src/java/org/apache/lucene/codecs/lucene3x/PreFlexRWCodec.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4055/lucene/test-framework/src/java/org/apache/lucene/codecs/lucene3x/PreFlexRWCodec.java?rev=1341291&r1=1341290&r2=1341291&view=diff ============================================================================== --- lucene/dev/branches/lucene4055/lucene/test-framework/src/java/org/apache/lucene/codecs/lucene3x/PreFlexRWCodec.java (original) +++ lucene/dev/branches/lucene4055/lucene/test-framework/src/java/org/apache/lucene/codecs/lucene3x/PreFlexRWCodec.java Tue May 22 02:50:22 2012 @@ -24,7 +24,7 @@ import org.apache.lucene.codecs.FieldInf import org.apache.lucene.codecs.LiveDocsFormat; import org.apache.lucene.codecs.NormsFormat; import org.apache.lucene.codecs.PostingsFormat; -import org.apache.lucene.codecs.SegmentInfosFormat; +import org.apache.lucene.codecs.SegmentInfoFormat; import org.apache.lucene.codecs.StoredFieldsFormat; import org.apache.lucene.codecs.TermVectorsFormat; import org.apache.lucene.codecs.lucene40.Lucene40LiveDocsFormat; @@ -42,7 +42,7 @@ public class PreFlexRWCodec extends Luce private final Lucene3xNormsFormat norms = new PreFlexRWNormsFormat(); private final FieldInfosFormat fieldInfos = new PreFlexRWFieldInfosFormat(); private final TermVectorsFormat termVectors = new PreFlexRWTermVectorsFormat(); - private final SegmentInfosFormat segmentInfos = new PreFlexRWSegmentInfosFormat(); + private final SegmentInfoFormat segmentInfos = new PreFlexRWSegmentInfosFormat(); private final StoredFieldsFormat storedFields = new PreFlexRWStoredFieldsFormat(); // TODO: this should really be a different impl private final LiveDocsFormat liveDocs = new Lucene40LiveDocsFormat(); @@ -66,7 +66,7 @@ public class PreFlexRWCodec extends Luce } @Override - public SegmentInfosFormat segmentInfosFormat() { + public SegmentInfoFormat segmentInfosFormat() { if (LuceneTestCase.PREFLEX_IMPERSONATION_IS_ACTIVE) { return segmentInfos ; } else { Modified: lucene/dev/branches/lucene4055/lucene/test-framework/src/java/org/apache/lucene/codecs/lucene3x/PreFlexRWSegmentInfosFormat.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4055/lucene/test-framework/src/java/org/apache/lucene/codecs/lucene3x/PreFlexRWSegmentInfosFormat.java?rev=1341291&r1=1341290&r2=1341291&view=diff ============================================================================== --- lucene/dev/branches/lucene4055/lucene/test-framework/src/java/org/apache/lucene/codecs/lucene3x/PreFlexRWSegmentInfosFormat.java (original) +++ lucene/dev/branches/lucene4055/lucene/test-framework/src/java/org/apache/lucene/codecs/lucene3x/PreFlexRWSegmentInfosFormat.java Tue May 22 02:50:22 2012 @@ -1,6 +1,6 @@ package org.apache.lucene.codecs.lucene3x; -import org.apache.lucene.codecs.SegmentInfosWriter; +import org.apache.lucene.codecs.SegmentInfoWriter; /** * Licensed to the Apache Software Foundation (ASF) under one or more @@ -22,11 +22,11 @@ import org.apache.lucene.codecs.SegmentI /** * @lucene.experimental */ -class PreFlexRWSegmentInfosFormat extends Lucene3xSegmentInfosFormat { - private final SegmentInfosWriter writer = new PreFlexRWSegmentInfosWriter(); +class PreFlexRWSegmentInfosFormat extends Lucene3xSegmentInfoFormat { + private final SegmentInfoWriter writer = new PreFlexRWSegmentInfosWriter(); @Override - public SegmentInfosWriter getSegmentInfosWriter() { + public SegmentInfoWriter getSegmentInfosWriter() { return writer; } } Modified: lucene/dev/branches/lucene4055/lucene/test-framework/src/java/org/apache/lucene/codecs/lucene3x/PreFlexRWSegmentInfosWriter.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4055/lucene/test-framework/src/java/org/apache/lucene/codecs/lucene3x/PreFlexRWSegmentInfosWriter.java?rev=1341291&r1=1341290&r2=1341291&view=diff ============================================================================== --- lucene/dev/branches/lucene4055/lucene/test-framework/src/java/org/apache/lucene/codecs/lucene3x/PreFlexRWSegmentInfosWriter.java (original) +++ lucene/dev/branches/lucene4055/lucene/test-framework/src/java/org/apache/lucene/codecs/lucene3x/PreFlexRWSegmentInfosWriter.java Tue May 22 02:50:22 2012 @@ -21,7 +21,7 @@ import java.io.IOException; import java.util.Map.Entry; import java.util.Map; -import org.apache.lucene.codecs.SegmentInfosWriter; +import org.apache.lucene.codecs.SegmentInfoWriter; import org.apache.lucene.index.FieldInfos; import org.apache.lucene.index.IndexFileNames; import org.apache.lucene.index.SegmentInfo; @@ -34,10 +34,10 @@ import org.apache.lucene.store.IndexOutp import org.apache.lucene.util.IOUtils; /** - * PreFlex implementation of {@link SegmentInfosWriter}. + * PreFlex implementation of {@link SegmentInfoWriter}. * @lucene.experimental */ -class PreFlexRWSegmentInfosWriter extends SegmentInfosWriter { +class PreFlexRWSegmentInfosWriter extends SegmentInfoWriter { // NOTE: this is not "really" 3.x format, because we are // writing each SI to its own file, vs 3.x where the list