lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1209625 [1/2] - in /lucene/dev/trunk/lucene: contrib/misc/src/java/org/apache/lucene/index/codecs/appending/ src/java/org/apache/lucene/index/ src/java/org/apache/lucene/index/codecs/ src/java/org/apache/lucene/index/codecs/lucene3x/ src/j...
Date Fri, 02 Dec 2011 18:29:27 GMT
Author: rmuir
Date: Fri Dec  2 18:29:25 2011
New Revision: 1209625

URL: http://svn.apache.org/viewvc?rev=1209625&view=rev
Log:
LUCENE-3613: move codecs.DefaultXXXX into lucene40, TODO: split out 3.x stuff

Added:
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40DocValuesConsumer.java
      - copied, changed from r1209572, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultDocValuesConsumer.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40DocValuesFormat.java
      - copied, changed from r1209572, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultDocValuesFormat.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40DocValuesProducer.java
      - copied, changed from r1209572, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultDocValuesProducer.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40FieldInfosFormat.java
      - copied, changed from r1209174, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultFieldInfosFormat.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40FieldInfosReader.java
      - copied, changed from r1209174, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultFieldInfosReader.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40FieldInfosWriter.java
      - copied, changed from r1209174, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultFieldInfosWriter.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40SegmentInfosFormat.java
      - copied, changed from r1209174, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultSegmentInfosFormat.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40SegmentInfosReader.java
      - copied, changed from r1209174, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultSegmentInfosReader.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40SegmentInfosWriter.java
      - copied, changed from r1209174, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultSegmentInfosWriter.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40SkipListReader.java
      - copied, changed from r1209174, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/DefaultSkipListReader.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40SkipListWriter.java
      - copied, changed from r1209174, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/DefaultSkipListWriter.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40StoredFieldsFormat.java
      - copied, changed from r1209174, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultStoredFieldsFormat.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40StoredFieldsReader.java
      - copied, changed from r1209174, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultStoredFieldsReader.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40StoredFieldsWriter.java
      - copied, changed from r1209174, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultStoredFieldsWriter.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40TermVectorsFormat.java
      - copied, changed from r1209174, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultTermVectorsFormat.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40TermVectorsReader.java
      - copied, changed from r1209174, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultTermVectorsReader.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40TermVectorsWriter.java
      - copied, changed from r1209174, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultTermVectorsWriter.java
Removed:
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultDocValuesConsumer.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultDocValuesFormat.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultDocValuesProducer.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultFieldInfosFormat.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultFieldInfosReader.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultFieldInfosWriter.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultSegmentInfosFormat.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultSegmentInfosReader.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultSegmentInfosWriter.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultStoredFieldsFormat.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultStoredFieldsReader.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultStoredFieldsWriter.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultTermVectorsFormat.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultTermVectorsReader.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultTermVectorsWriter.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/DefaultSkipListReader.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/DefaultSkipListWriter.java
Modified:
    lucene/dev/trunk/lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingCodec.java
    lucene/dev/trunk/lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingSegmentInfosFormat.java
    lucene/dev/trunk/lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingSegmentInfosWriter.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/CheckIndex.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/SegmentInfos.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DocValuesReaderBase.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene3x/Lucene3xCodec.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene3x/SegmentTermDocs.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40Codec.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40PostingsReader.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40PostingsWriter.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/simpletext/SimpleTextCodec.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/simpletext/SimpleTextSegmentInfosWriter.java
    lucene/dev/trunk/lucene/src/test-framework/java/org/apache/lucene/index/codecs/preflexrw/PreFlexFieldsWriter.java
    lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestAddIndexes.java
    lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestTermVectorsReader.java
    lucene/dev/trunk/lucene/src/test/org/apache/lucene/store/TestFileSwitchDirectory.java

Modified: lucene/dev/trunk/lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingCodec.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingCodec.java?rev=1209625&r1=1209624&r2=1209625&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingCodec.java (original)
+++ lucene/dev/trunk/lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingCodec.java Fri Dec  2 18:29:25 2011
@@ -18,10 +18,6 @@ package org.apache.lucene.index.codecs.a
  */
 
 import org.apache.lucene.index.codecs.Codec;
-import org.apache.lucene.index.codecs.DefaultDocValuesFormat;
-import org.apache.lucene.index.codecs.DefaultFieldInfosFormat;
-import org.apache.lucene.index.codecs.DefaultStoredFieldsFormat;
-import org.apache.lucene.index.codecs.DefaultTermVectorsFormat;
 import org.apache.lucene.index.codecs.DocValuesFormat;
 import org.apache.lucene.index.codecs.FieldInfosFormat;
 import org.apache.lucene.index.codecs.StoredFieldsFormat;
@@ -29,6 +25,10 @@ import org.apache.lucene.index.codecs.Po
 import org.apache.lucene.index.codecs.SegmentInfosFormat;
 import org.apache.lucene.index.codecs.TermVectorsFormat;
 import org.apache.lucene.index.codecs.lucene40.Lucene40Codec;
+import org.apache.lucene.index.codecs.lucene40.Lucene40FieldInfosFormat;
+import org.apache.lucene.index.codecs.lucene40.Lucene40DocValuesFormat;
+import org.apache.lucene.index.codecs.lucene40.Lucene40StoredFieldsFormat;
+import org.apache.lucene.index.codecs.lucene40.Lucene40TermVectorsFormat;
 
 /**
  * This codec extends {@link Lucene40Codec} to work on append-only outputs, such
@@ -43,10 +43,10 @@ public class AppendingCodec extends Code
 
   private final PostingsFormat postings = new AppendingPostingsFormat();
   private final SegmentInfosFormat infos = new AppendingSegmentInfosFormat();
-  private final StoredFieldsFormat fields = new DefaultStoredFieldsFormat();
-  private final FieldInfosFormat fieldInfos = new DefaultFieldInfosFormat();
-  private final TermVectorsFormat vectors = new DefaultTermVectorsFormat();
-  private final DocValuesFormat docValues = new DefaultDocValuesFormat();
+  private final StoredFieldsFormat fields = new Lucene40StoredFieldsFormat();
+  private final FieldInfosFormat fieldInfos = new Lucene40FieldInfosFormat();
+  private final TermVectorsFormat vectors = new Lucene40TermVectorsFormat();
+  private final DocValuesFormat docValues = new Lucene40DocValuesFormat();
   
   @Override
   public PostingsFormat postingsFormat() {

Modified: lucene/dev/trunk/lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingSegmentInfosFormat.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingSegmentInfosFormat.java?rev=1209625&r1=1209624&r2=1209625&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingSegmentInfosFormat.java (original)
+++ lucene/dev/trunk/lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingSegmentInfosFormat.java Fri Dec  2 18:29:25 2011
@@ -17,10 +17,10 @@ package org.apache.lucene.index.codecs.a
  * limitations under the License.
  */
 
-import org.apache.lucene.index.codecs.DefaultSegmentInfosFormat;
 import org.apache.lucene.index.codecs.SegmentInfosWriter;
+import org.apache.lucene.index.codecs.lucene40.Lucene40SegmentInfosFormat;
 
-public class AppendingSegmentInfosFormat extends DefaultSegmentInfosFormat {
+public class AppendingSegmentInfosFormat extends Lucene40SegmentInfosFormat {
   private final SegmentInfosWriter writer = new AppendingSegmentInfosWriter();
 
   @Override

Modified: lucene/dev/trunk/lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingSegmentInfosWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingSegmentInfosWriter.java?rev=1209625&r1=1209624&r2=1209625&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingSegmentInfosWriter.java (original)
+++ lucene/dev/trunk/lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingSegmentInfosWriter.java Fri Dec  2 18:29:25 2011
@@ -19,10 +19,10 @@ package org.apache.lucene.index.codecs.a
 
 import java.io.IOException;
 
-import org.apache.lucene.index.codecs.DefaultSegmentInfosWriter;
+import org.apache.lucene.index.codecs.lucene40.Lucene40SegmentInfosWriter;
 import org.apache.lucene.store.IndexOutput;
 
-public class AppendingSegmentInfosWriter extends DefaultSegmentInfosWriter {
+public class AppendingSegmentInfosWriter extends Lucene40SegmentInfosWriter {
 
   @Override
   public void prepareCommit(IndexOutput segmentOutput) throws IOException {

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/CheckIndex.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/CheckIndex.java?rev=1209625&r1=1209624&r2=1209625&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/CheckIndex.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/CheckIndex.java Fri Dec  2 18:29:25 2011
@@ -26,7 +26,6 @@ import org.apache.lucene.store.IOContext
 import org.apache.lucene.store.IndexInput;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.index.codecs.Codec;
-import org.apache.lucene.index.codecs.DefaultSegmentInfosWriter;
 import java.io.File;
 import java.io.IOException;
 import java.io.PrintStream;
@@ -401,20 +400,20 @@ public class CheckIndex {
     String sFormat = "";
     boolean skip = false;
 
-    if (format == DefaultSegmentInfosWriter.FORMAT_DIAGNOSTICS) {
+    if (format == SegmentInfos.FORMAT_DIAGNOSTICS) {
       sFormat = "FORMAT_DIAGNOSTICS [Lucene 2.9]";
-    } else if (format == DefaultSegmentInfosWriter.FORMAT_HAS_VECTORS) {
+    } else if (format == SegmentInfos.FORMAT_HAS_VECTORS) {
       sFormat = "FORMAT_HAS_VECTORS [Lucene 3.1]";
-    } else if (format == DefaultSegmentInfosWriter.FORMAT_3_1) {
+    } else if (format == SegmentInfos.FORMAT_3_1) {
       sFormat = "FORMAT_3_1 [Lucene 3.1+]";
-    } else if (format == DefaultSegmentInfosWriter.FORMAT_4_0) {
+    } else if (format == SegmentInfos.FORMAT_4_0) {
       sFormat = "FORMAT_4_0 [Lucene 4.0]";
-    } else if (format == DefaultSegmentInfosWriter.FORMAT_CURRENT) {
+    } else if (format == SegmentInfos.FORMAT_CURRENT) {
       throw new RuntimeException("BUG: You should update this tool!");
-    } else if (format < DefaultSegmentInfosWriter.FORMAT_CURRENT) {
+    } else if (format < SegmentInfos.FORMAT_CURRENT) {
       sFormat = "int=" + format + " [newer version of Lucene than this tool supports]";
       skip = true;
-    } else if (format > DefaultSegmentInfosWriter.FORMAT_MINIMUM) {
+    } else if (format > SegmentInfos.FORMAT_MINIMUM) {
       sFormat = "int=" + format + " [older version of Lucene than this tool supports]";
       skip = true;
     }

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/SegmentInfos.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/SegmentInfos.java?rev=1209625&r1=1209624&r2=1209625&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/SegmentInfos.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/SegmentInfos.java Fri Dec  2 18:29:25 2011
@@ -33,7 +33,6 @@ import java.util.Set;
 
 import org.apache.lucene.index.FieldInfos.FieldNumberBiMap;
 import org.apache.lucene.index.codecs.Codec;
-import org.apache.lucene.index.codecs.DefaultSegmentInfosWriter;
 import org.apache.lucene.index.codecs.SegmentInfosReader;
 import org.apache.lucene.index.codecs.SegmentInfosWriter;
 import org.apache.lucene.store.ChecksumIndexInput;
@@ -61,6 +60,36 @@ public final class SegmentInfos implemen
    * be removed, however the numbers should continue to decrease. 
    */
 
+  // 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)
+
+  /** This format adds optional per-segment String
+   *  diagnostics storage, and switches userData to Map */
+  public static final int FORMAT_DIAGNOSTICS = -9;
+
+  /** Each segment records whether it has term vectors */
+  public static final int FORMAT_HAS_VECTORS = -10;
+
+  /** Each segment records the Lucene version that created it. */
+  public static final int FORMAT_3_1 = -11;
+
+  /** Each segment records whether its postings are written
+   *  in the new flex format */
+  public static final int FORMAT_4_0 = -12;
+
+  /** This must always point to the most recent file format.
+   * whenever you add a new format, make it 1 smaller (negative version logic)! */
+  // TODO: move this, as its currently part of required preamble
+  public static final int FORMAT_CURRENT = FORMAT_4_0;
+  
+  /** This must always point to the first supported file format. */
+  public static final int FORMAT_MINIMUM = FORMAT_DIAGNOSTICS;
+  
   /** Used for the segments.gen file only!
    * Whenever you add a new format, make it 1 smaller (negative version logic)! */
   public static final int FORMAT_SEGMENTS_GEN_CURRENT = -2;
@@ -240,14 +269,14 @@ public final class SegmentInfos implemen
       setFormat(format);
     
       // check that it is a format we can understand
-      if (format > DefaultSegmentInfosWriter.FORMAT_MINIMUM)
+      if (format > FORMAT_MINIMUM)
         throw new IndexFormatTooOldException(input, format,
-          DefaultSegmentInfosWriter.FORMAT_MINIMUM, DefaultSegmentInfosWriter.FORMAT_CURRENT);
-      if (format < DefaultSegmentInfosWriter.FORMAT_CURRENT)
+          FORMAT_MINIMUM, FORMAT_CURRENT);
+      if (format < FORMAT_CURRENT)
         throw new IndexFormatTooNewException(input, format,
-          DefaultSegmentInfosWriter.FORMAT_MINIMUM, DefaultSegmentInfosWriter.FORMAT_CURRENT);
+          FORMAT_MINIMUM, FORMAT_CURRENT);
 
-      if (format <= DefaultSegmentInfosWriter.FORMAT_4_0) {
+      if (format <= FORMAT_4_0) {
         codecFormat = Codec.forName(input.readString());
       } else {
         codecFormat = Codec.forName("Lucene3x");

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DocValuesReaderBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DocValuesReaderBase.java?rev=1209625&r1=1209624&r2=1209625&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DocValuesReaderBase.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DocValuesReaderBase.java Fri Dec  2 18:29:25 2011
@@ -76,7 +76,7 @@ public abstract class DocValuesReaderBas
           final String field = fieldInfo.name;
           // TODO can we have a compound file per segment and codec for
           // docvalues?
-          final String id = DefaultDocValuesConsumer.docValuesId(segment,
+          final String id = DocValuesWriterBase.docValuesId(segment,
               fieldInfo.number);
           values.put(field,
               loadDocValues(docCount, dir, id, fieldInfo.getDocValues(), context));

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene3x/Lucene3xCodec.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene3x/Lucene3xCodec.java?rev=1209625&r1=1209624&r2=1209625&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene3x/Lucene3xCodec.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene3x/Lucene3xCodec.java Fri Dec  2 18:29:25 2011
@@ -24,10 +24,6 @@ import org.apache.lucene.index.PerDocWri
 import org.apache.lucene.index.SegmentInfo;
 import org.apache.lucene.index.SegmentReadState;
 import org.apache.lucene.index.codecs.Codec;
-import org.apache.lucene.index.codecs.DefaultFieldInfosFormat;
-import org.apache.lucene.index.codecs.DefaultStoredFieldsFormat;
-import org.apache.lucene.index.codecs.DefaultSegmentInfosFormat;
-import org.apache.lucene.index.codecs.DefaultTermVectorsFormat;
 import org.apache.lucene.index.codecs.DocValuesFormat;
 import org.apache.lucene.index.codecs.FieldInfosFormat;
 import org.apache.lucene.index.codecs.StoredFieldsFormat;
@@ -36,6 +32,10 @@ import org.apache.lucene.index.codecs.Pe
 import org.apache.lucene.index.codecs.PostingsFormat;
 import org.apache.lucene.index.codecs.SegmentInfosFormat;
 import org.apache.lucene.index.codecs.TermVectorsFormat;
+import org.apache.lucene.index.codecs.lucene40.Lucene40FieldInfosFormat;
+import org.apache.lucene.index.codecs.lucene40.Lucene40SegmentInfosFormat;
+import org.apache.lucene.index.codecs.lucene40.Lucene40StoredFieldsFormat;
+import org.apache.lucene.index.codecs.lucene40.Lucene40TermVectorsFormat;
 import org.apache.lucene.store.Directory;
 
 /**
@@ -49,18 +49,18 @@ public class Lucene3xCodec extends Codec
   private final PostingsFormat postingsFormat = new Lucene3xPostingsFormat();
   
   // TODO: this should really be a different impl
-  private final StoredFieldsFormat fieldsFormat = new DefaultStoredFieldsFormat();
+  private final StoredFieldsFormat fieldsFormat = new Lucene40StoredFieldsFormat();
   
   // TODO: this should really be a different impl
-  private final TermVectorsFormat vectorsFormat = new DefaultTermVectorsFormat();
+  private final TermVectorsFormat vectorsFormat = new Lucene40TermVectorsFormat();
   
   // TODO: this should really be a different impl
-  private final FieldInfosFormat fieldInfosFormat = new DefaultFieldInfosFormat();
+  private final FieldInfosFormat fieldInfosFormat = new Lucene40FieldInfosFormat();
 
   // TODO: this should really be a different impl
   // also if we want preflex to *really* be read-only it should throw exception for the writer?
   // this way IR.commit fails on delete/undelete/setNorm/etc ?
-  private final SegmentInfosFormat infosFormat = new DefaultSegmentInfosFormat();
+  private final SegmentInfosFormat infosFormat = new Lucene40SegmentInfosFormat();
   
   // 3.x doesn't support docvalues
   private final DocValuesFormat docValuesFormat = new DocValuesFormat() {

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene3x/SegmentTermDocs.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene3x/SegmentTermDocs.java?rev=1209625&r1=1209624&r2=1209625&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene3x/SegmentTermDocs.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene3x/SegmentTermDocs.java Fri Dec  2 18:29:25 2011
@@ -23,7 +23,7 @@ import org.apache.lucene.index.FieldInfo
 import org.apache.lucene.index.FieldInfo.IndexOptions;
 import org.apache.lucene.index.FieldInfos;
 import org.apache.lucene.index.Term;
-import org.apache.lucene.index.codecs.lucene40.DefaultSkipListReader;
+import org.apache.lucene.index.codecs.lucene40.Lucene40SkipListReader;
 import org.apache.lucene.store.IndexInput;
 import org.apache.lucene.util.Bits;
 
@@ -43,7 +43,7 @@ public class SegmentTermDocs {
 
   private int skipInterval;
   private int maxSkipLevels;
-  private DefaultSkipListReader skipListReader;
+  private Lucene40SkipListReader skipListReader;
   
   private long freqBasePointer;
   private long proxBasePointer;
@@ -201,7 +201,7 @@ public class SegmentTermDocs {
     // don't skip if the target is close (within skipInterval docs away)
     if ((target - skipInterval) >= doc && df >= skipInterval) {                      // optimized case
       if (skipListReader == null)
-        skipListReader = new DefaultSkipListReader((IndexInput) freqStream.clone(), maxSkipLevels, skipInterval); // lazily clone
+        skipListReader = new Lucene40SkipListReader((IndexInput) freqStream.clone(), maxSkipLevels, skipInterval); // lazily clone
 
       if (!haveSkipped) {                          // lazily initialize skip stream
         skipListReader.init(skipPointer, freqBasePointer, proxBasePointer, df, currentFieldStoresPayloads);

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40Codec.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40Codec.java?rev=1209625&r1=1209624&r2=1209625&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40Codec.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40Codec.java Fri Dec  2 18:29:25 2011
@@ -18,11 +18,6 @@ package org.apache.lucene.index.codecs.l
  */
 
 import org.apache.lucene.index.codecs.Codec;
-import org.apache.lucene.index.codecs.DefaultDocValuesFormat;
-import org.apache.lucene.index.codecs.DefaultFieldInfosFormat;
-import org.apache.lucene.index.codecs.DefaultStoredFieldsFormat;
-import org.apache.lucene.index.codecs.DefaultSegmentInfosFormat;
-import org.apache.lucene.index.codecs.DefaultTermVectorsFormat;
 import org.apache.lucene.index.codecs.DocValuesFormat;
 import org.apache.lucene.index.codecs.FieldInfosFormat;
 import org.apache.lucene.index.codecs.StoredFieldsFormat;
@@ -42,11 +37,11 @@ import org.apache.lucene.index.codecs.pe
 // if they are backwards compatible or smallish we can probably do the backwards in the postingsreader
 // (it writes a minor version, etc).
 public class Lucene40Codec extends Codec {
-  private final StoredFieldsFormat fieldsFormat = new DefaultStoredFieldsFormat();
-  private final TermVectorsFormat vectorsFormat = new DefaultTermVectorsFormat();
-  private final DocValuesFormat docValuesFormat = new DefaultDocValuesFormat();
-  private final FieldInfosFormat fieldInfosFormat = new DefaultFieldInfosFormat();
-  private final SegmentInfosFormat infosFormat = new DefaultSegmentInfosFormat();
+  private final StoredFieldsFormat fieldsFormat = new Lucene40StoredFieldsFormat();
+  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 PostingsFormat postingsFormat = new PerFieldPostingsFormat() {
     @Override
     public PostingsFormat getPostingsFormatForField(String field) {

Copied: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40DocValuesConsumer.java (from r1209572, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultDocValuesConsumer.java)
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40DocValuesConsumer.java?p2=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40DocValuesConsumer.java&p1=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultDocValuesConsumer.java&r1=1209572&r2=1209625&rev=1209625&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultDocValuesConsumer.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40DocValuesConsumer.java Fri Dec  2 18:29:25 2011
@@ -1,4 +1,4 @@
-package org.apache.lucene.index.codecs;
+package org.apache.lucene.index.codecs.lucene40;
 
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -25,6 +25,7 @@ import org.apache.lucene.index.FieldInfo
 import org.apache.lucene.index.IndexFileNames;
 import org.apache.lucene.index.PerDocWriteState;
 import org.apache.lucene.index.SegmentInfo;
+import org.apache.lucene.index.codecs.DocValuesWriterBase;
 import org.apache.lucene.store.CompoundFileDirectory;
 import org.apache.lucene.store.Directory;
 
@@ -32,13 +33,13 @@ import org.apache.lucene.store.Directory
  * Default PerDocConsumer implementation that uses compound file.
  * @lucene.experimental
  */
-public class DefaultDocValuesConsumer extends DocValuesWriterBase {
+public class Lucene40DocValuesConsumer extends DocValuesWriterBase {
   private final Directory mainDirectory;
   private Directory directory;
 
   final static String DOC_VALUES_SEGMENT_SUFFIX = "dv";
   
-  public DefaultDocValuesConsumer(PerDocWriteState state) throws IOException {
+  public Lucene40DocValuesConsumer(PerDocWriteState state) throws IOException {
     super(state);
     mainDirectory = state.directory;
     //TODO maybe we should enable a global CFS that all codecs can pull on demand to further reduce the number of files?

Copied: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40DocValuesFormat.java (from r1209572, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultDocValuesFormat.java)
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40DocValuesFormat.java?p2=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40DocValuesFormat.java&p1=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultDocValuesFormat.java&r1=1209572&r2=1209625&rev=1209625&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultDocValuesFormat.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40DocValuesFormat.java Fri Dec  2 18:29:25 2011
@@ -1,4 +1,4 @@
-package org.apache.lucene.index.codecs;
+package org.apache.lucene.index.codecs.lucene40;
 
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -23,22 +23,25 @@ import java.util.Set;
 import org.apache.lucene.index.PerDocWriteState;
 import org.apache.lucene.index.SegmentInfo;
 import org.apache.lucene.index.SegmentReadState;
+import org.apache.lucene.index.codecs.DocValuesFormat;
+import org.apache.lucene.index.codecs.PerDocConsumer;
+import org.apache.lucene.index.codecs.PerDocValues;
 import org.apache.lucene.store.Directory;
 
-public class DefaultDocValuesFormat extends DocValuesFormat {
+public class Lucene40DocValuesFormat extends DocValuesFormat {
 
   @Override
   public PerDocConsumer docsConsumer(PerDocWriteState state) throws IOException {
-    return new DefaultDocValuesConsumer(state);
+    return new Lucene40DocValuesConsumer(state);
   }
 
   @Override
   public PerDocValues docsProducer(SegmentReadState state) throws IOException {
-    return new DefaultDocValuesProducer(state);
+    return new Lucene40DocValuesProducer(state);
   }
 
   @Override
   public void files(Directory dir, SegmentInfo info, Set<String> files) throws IOException {
-    DefaultDocValuesConsumer.files(dir, info, files);
+    Lucene40DocValuesConsumer.files(dir, info, files);
   }
 }

Copied: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40DocValuesProducer.java (from r1209572, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultDocValuesProducer.java)
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40DocValuesProducer.java?p2=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40DocValuesProducer.java&p1=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultDocValuesProducer.java&r1=1209572&r2=1209625&rev=1209625&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultDocValuesProducer.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40DocValuesProducer.java Fri Dec  2 18:29:25 2011
@@ -1,4 +1,4 @@
-package org.apache.lucene.index.codecs;
+package org.apache.lucene.index.codecs.lucene40;
 
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -26,6 +26,7 @@ import java.util.TreeMap;
 
 import org.apache.lucene.index.IndexFileNames;
 import org.apache.lucene.index.SegmentReadState;
+import org.apache.lucene.index.codecs.DocValuesReaderBase;
 import org.apache.lucene.index.values.IndexDocValues;
 import org.apache.lucene.store.CompoundFileDirectory;
 import org.apache.lucene.store.Directory;
@@ -35,19 +36,19 @@ import org.apache.lucene.util.IOUtils;
  * Default PerDocValues implementation that uses compound file.
  * @lucene.experimental
  */
-public class DefaultDocValuesProducer extends DocValuesReaderBase {
+public class Lucene40DocValuesProducer extends DocValuesReaderBase {
   protected final TreeMap<String,IndexDocValues> docValues;
   private final Directory cfs;
 
   /**
-   * Creates a new {@link DefaultDocValuesProducer} instance and loads all
+   * Creates a new {@link Lucene40DocValuesProducer} instance and loads all
    * {@link IndexDocValues} instances for this segment and codec.
    */
-  public DefaultDocValuesProducer(SegmentReadState state) throws IOException {
+  public Lucene40DocValuesProducer(SegmentReadState state) throws IOException {
     if (state.fieldInfos.anyDocValuesFields()) {
       cfs = new CompoundFileDirectory(state.dir, 
                                       IndexFileNames.segmentFileName(state.segmentInfo.name,
-                                                                     DefaultDocValuesConsumer.DOC_VALUES_SEGMENT_SUFFIX, IndexFileNames.COMPOUND_FILE_EXTENSION), 
+                                                                     Lucene40DocValuesConsumer.DOC_VALUES_SEGMENT_SUFFIX, IndexFileNames.COMPOUND_FILE_EXTENSION), 
                                       state.context, false);
       docValues = load(state.fieldInfos, state.segmentInfo.name, state.segmentInfo.docCount, cfs, state.context);
     } else {

Copied: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40FieldInfosFormat.java (from r1209174, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultFieldInfosFormat.java)
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40FieldInfosFormat.java?p2=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40FieldInfosFormat.java&p1=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultFieldInfosFormat.java&r1=1209174&r2=1209625&rev=1209625&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultFieldInfosFormat.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40FieldInfosFormat.java Fri Dec  2 18:29:25 2011
@@ -1,4 +1,4 @@
-package org.apache.lucene.index.codecs;
+package org.apache.lucene.index.codecs.lucene40;
 
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -21,14 +21,17 @@ import java.io.IOException;
 import java.util.Set;
 
 import org.apache.lucene.index.SegmentInfo;
+import org.apache.lucene.index.codecs.FieldInfosFormat;
+import org.apache.lucene.index.codecs.FieldInfosReader;
+import org.apache.lucene.index.codecs.FieldInfosWriter;
 import org.apache.lucene.store.Directory;
 
 /**
  * @lucene.experimental
  */
-public class DefaultFieldInfosFormat extends FieldInfosFormat {
-  private final FieldInfosReader reader = new DefaultFieldInfosReader();
-  private final FieldInfosWriter writer = new DefaultFieldInfosWriter();
+public class Lucene40FieldInfosFormat extends FieldInfosFormat {
+  private final FieldInfosReader reader = new Lucene40FieldInfosReader();
+  private final FieldInfosWriter writer = new Lucene40FieldInfosWriter();
   
   @Override
   public FieldInfosReader getFieldInfosReader() throws IOException {
@@ -42,6 +45,6 @@ public class DefaultFieldInfosFormat ext
 
   @Override
   public void files(Directory dir, SegmentInfo info, Set<String> files) throws IOException {
-    DefaultFieldInfosReader.files(dir, info, files);
+    Lucene40FieldInfosReader.files(dir, info, files);
   }
 }

Copied: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40FieldInfosReader.java (from r1209174, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultFieldInfosReader.java)
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40FieldInfosReader.java?p2=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40FieldInfosReader.java&p1=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultFieldInfosReader.java&r1=1209174&r2=1209625&rev=1209625&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultFieldInfosReader.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40FieldInfosReader.java Fri Dec  2 18:29:25 2011
@@ -1,4 +1,4 @@
-package org.apache.lucene.index.codecs;
+package org.apache.lucene.index.codecs.lucene40;
 
 import java.io.IOException;
 import java.util.Set;
@@ -11,6 +11,7 @@ import org.apache.lucene.index.IndexForm
 import org.apache.lucene.index.IndexFormatTooOldException;
 import org.apache.lucene.index.SegmentInfo;
 import org.apache.lucene.index.FieldInfo.IndexOptions;
+import org.apache.lucene.index.codecs.FieldInfosReader;
 import org.apache.lucene.index.values.ValueType;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.IOContext;
@@ -36,13 +37,13 @@ import org.apache.lucene.store.IndexInpu
 /**
  * @lucene.experimental
  */
-public class DefaultFieldInfosReader extends FieldInfosReader {
+public class Lucene40FieldInfosReader extends FieldInfosReader {
 
-  static final int FORMAT_MINIMUM = DefaultFieldInfosWriter.FORMAT_START;
+  static final int FORMAT_MINIMUM = Lucene40FieldInfosWriter.FORMAT_START;
 
   @Override
   public FieldInfos read(Directory directory, String segmentName, IOContext iocontext) throws IOException {
-    final String fileName = IndexFileNames.segmentFileName(segmentName, "", DefaultFieldInfosWriter.FIELD_INFOS_EXTENSION);
+    final String fileName = IndexFileNames.segmentFileName(segmentName, "", Lucene40FieldInfosWriter.FIELD_INFOS_EXTENSION);
     IndexInput input = directory.openInput(fileName, iocontext);
 
     boolean hasVectors = false;
@@ -53,10 +54,10 @@ public class DefaultFieldInfosReader ext
       final int format = input.readVInt();
 
       if (format > FORMAT_MINIMUM) {
-        throw new IndexFormatTooOldException(input, format, FORMAT_MINIMUM, DefaultFieldInfosWriter.FORMAT_CURRENT);
+        throw new IndexFormatTooOldException(input, format, FORMAT_MINIMUM, Lucene40FieldInfosWriter.FORMAT_CURRENT);
       }
-      if (format < DefaultFieldInfosWriter.FORMAT_CURRENT) {
-        throw new IndexFormatTooNewException(input, format, FORMAT_MINIMUM, DefaultFieldInfosWriter.FORMAT_CURRENT);
+      if (format < Lucene40FieldInfosWriter.FORMAT_CURRENT) {
+        throw new IndexFormatTooNewException(input, format, FORMAT_MINIMUM, Lucene40FieldInfosWriter.FORMAT_CURRENT);
       }
 
       final int size = input.readVInt(); //read in the size
@@ -64,19 +65,19 @@ public class DefaultFieldInfosReader ext
 
       for (int i = 0; i < size; i++) {
         String name = input.readString();
-        final int fieldNumber = format <= DefaultFieldInfosWriter.FORMAT_FLEX? input.readInt():i;
+        final int fieldNumber = format <= Lucene40FieldInfosWriter.FORMAT_FLEX? input.readInt():i;
         byte bits = input.readByte();
-        boolean isIndexed = (bits & DefaultFieldInfosWriter.IS_INDEXED) != 0;
-        boolean storeTermVector = (bits & DefaultFieldInfosWriter.STORE_TERMVECTOR) != 0;
-        boolean storePositionsWithTermVector = (bits & DefaultFieldInfosWriter.STORE_POSITIONS_WITH_TERMVECTOR) != 0;
-        boolean storeOffsetWithTermVector = (bits & DefaultFieldInfosWriter.STORE_OFFSET_WITH_TERMVECTOR) != 0;
-        boolean omitNorms = (bits & DefaultFieldInfosWriter.OMIT_NORMS) != 0;
-        boolean storePayloads = (bits & DefaultFieldInfosWriter.STORE_PAYLOADS) != 0;
+        boolean isIndexed = (bits & Lucene40FieldInfosWriter.IS_INDEXED) != 0;
+        boolean storeTermVector = (bits & Lucene40FieldInfosWriter.STORE_TERMVECTOR) != 0;
+        boolean storePositionsWithTermVector = (bits & Lucene40FieldInfosWriter.STORE_POSITIONS_WITH_TERMVECTOR) != 0;
+        boolean storeOffsetWithTermVector = (bits & Lucene40FieldInfosWriter.STORE_OFFSET_WITH_TERMVECTOR) != 0;
+        boolean omitNorms = (bits & Lucene40FieldInfosWriter.OMIT_NORMS) != 0;
+        boolean storePayloads = (bits & Lucene40FieldInfosWriter.STORE_PAYLOADS) != 0;
         final IndexOptions indexOptions;
-        if ((bits & DefaultFieldInfosWriter.OMIT_TERM_FREQ_AND_POSITIONS) != 0) {
+        if ((bits & Lucene40FieldInfosWriter.OMIT_TERM_FREQ_AND_POSITIONS) != 0) {
           indexOptions = IndexOptions.DOCS_ONLY;
-        } else if ((bits & DefaultFieldInfosWriter.OMIT_POSITIONS) != 0) {
-          if (format <= DefaultFieldInfosWriter.FORMAT_OMIT_POSITIONS) {
+        } else if ((bits & Lucene40FieldInfosWriter.OMIT_POSITIONS) != 0) {
+          if (format <= Lucene40FieldInfosWriter.FORMAT_OMIT_POSITIONS) {
             indexOptions = IndexOptions.DOCS_AND_FREQS;
           } else {
             throw new CorruptIndexException("Corrupt fieldinfos, OMIT_POSITIONS set but format=" + format + " (resource: " + input + ")");
@@ -95,7 +96,7 @@ public class DefaultFieldInfosReader ext
         hasProx |= isIndexed && indexOptions == IndexOptions.DOCS_AND_FREQS_AND_POSITIONS;
         hasFreq |= isIndexed && indexOptions != IndexOptions.DOCS_ONLY;
         ValueType docValuesType = null;
-        if (format <= DefaultFieldInfosWriter.FORMAT_FLEX) {
+        if (format <= Lucene40FieldInfosWriter.FORMAT_FLEX) {
           final byte b = input.readByte();
           switch(b) {
             case 0:
@@ -161,6 +162,6 @@ public class DefaultFieldInfosReader ext
   }
   
   public static void files(Directory dir, SegmentInfo info, Set<String> files) throws IOException {
-    files.add(IndexFileNames.segmentFileName(info.name, "", DefaultFieldInfosWriter.FIELD_INFOS_EXTENSION));
+    files.add(IndexFileNames.segmentFileName(info.name, "", Lucene40FieldInfosWriter.FIELD_INFOS_EXTENSION));
   }
 }

Copied: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40FieldInfosWriter.java (from r1209174, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultFieldInfosWriter.java)
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40FieldInfosWriter.java?p2=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40FieldInfosWriter.java&p1=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultFieldInfosWriter.java&r1=1209174&r2=1209625&rev=1209625&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultFieldInfosWriter.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40FieldInfosWriter.java Fri Dec  2 18:29:25 2011
@@ -1,4 +1,4 @@
-package org.apache.lucene.index.codecs;
+package org.apache.lucene.index.codecs.lucene40;
 
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -22,6 +22,7 @@ import org.apache.lucene.index.FieldInfo
 import org.apache.lucene.index.FieldInfos;
 import org.apache.lucene.index.IndexFileNames;
 import org.apache.lucene.index.FieldInfo.IndexOptions;
+import org.apache.lucene.index.codecs.FieldInfosWriter;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.IOContext;
 import org.apache.lucene.store.IndexOutput;
@@ -29,7 +30,7 @@ import org.apache.lucene.store.IndexOutp
 /**
  * @lucene.experimental
  */
-public class DefaultFieldInfosWriter extends FieldInfosWriter {
+public class Lucene40FieldInfosWriter extends FieldInfosWriter {
   
   /** Extension of field infos */
   static final String FIELD_INFOS_EXTENSION = "fnm";

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40PostingsReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40PostingsReader.java?rev=1209625&r1=1209624&r2=1209625&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40PostingsReader.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40PostingsReader.java Fri Dec  2 18:29:25 2011
@@ -292,7 +292,7 @@ public class Lucene40PostingsReader exte
     int skipOffset;
 
     boolean skipped;
-    DefaultSkipListReader skipper;
+    Lucene40SkipListReader skipper;
 
     public SegmentDocsEnum(IndexInput freqIn) throws IOException {
       startFreqIn = freqIn;
@@ -450,7 +450,7 @@ public class Lucene40PostingsReader exte
 
         if (skipper == null) {
           // This is the first time this enum has ever been used for skipping -- do lazy init
-          skipper = new DefaultSkipListReader((IndexInput) freqIn.clone(), maxSkipLevels, skipInterval);
+          skipper = new Lucene40SkipListReader((IndexInput) freqIn.clone(), maxSkipLevels, skipInterval);
         }
 
         if (!skipped) {
@@ -502,7 +502,7 @@ public class Lucene40PostingsReader exte
     int posPendingCount;
 
     boolean skipped;
-    DefaultSkipListReader skipper;
+    Lucene40SkipListReader skipper;
     private long lazyProxPointer;
 
     public SegmentDocsAndPositionsEnum(IndexInput freqIn, IndexInput proxIn) throws IOException {
@@ -597,7 +597,7 @@ public class Lucene40PostingsReader exte
 
         if (skipper == null) {
           // This is the first time this enum has ever been used for skipping -- do lazy init
-          skipper = new DefaultSkipListReader((IndexInput) freqIn.clone(), maxSkipLevels, skipInterval);
+          skipper = new Lucene40SkipListReader((IndexInput) freqIn.clone(), maxSkipLevels, skipInterval);
         }
 
         if (!skipped) {
@@ -698,7 +698,7 @@ public class Lucene40PostingsReader exte
     boolean payloadPending;
 
     boolean skipped;
-    DefaultSkipListReader skipper;
+    Lucene40SkipListReader skipper;
     private BytesRef payload;
     private long lazyProxPointer;
 
@@ -796,7 +796,7 @@ public class Lucene40PostingsReader exte
 
         if (skipper == null) {
           // This is the first time this enum has ever been used for skipping -- do lazy init
-          skipper = new DefaultSkipListReader((IndexInput) freqIn.clone(), maxSkipLevels, skipInterval);
+          skipper = new Lucene40SkipListReader((IndexInput) freqIn.clone(), maxSkipLevels, skipInterval);
         }
 
         if (!skipped) {

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40PostingsWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40PostingsWriter.java?rev=1209625&r1=1209624&r2=1209625&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40PostingsWriter.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40PostingsWriter.java Fri Dec  2 18:29:25 2011
@@ -50,7 +50,7 @@ public final class Lucene40PostingsWrite
 
   final IndexOutput freqOut;
   final IndexOutput proxOut;
-  final DefaultSkipListWriter skipListWriter;
+  final Lucene40SkipListWriter skipListWriter;
   /** Expert: The fraction of TermDocs entries stored in skip tables,
    * used to accelerate {@link DocsEnum#advance(int)}.  Larger values result in
    * smaller indexes, greater acceleration, but fewer accelerable cases, while
@@ -113,7 +113,7 @@ public final class Lucene40PostingsWrite
 
     totalNumDocs = state.numDocs;
 
-    skipListWriter = new DefaultSkipListWriter(skipInterval,
+    skipListWriter = new Lucene40SkipListWriter(skipInterval,
                                                maxSkipLevels,
                                                state.numDocs,
                                                freqOut,

Copied: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40SegmentInfosFormat.java (from r1209174, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultSegmentInfosFormat.java)
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40SegmentInfosFormat.java?p2=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40SegmentInfosFormat.java&p1=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultSegmentInfosFormat.java&r1=1209174&r2=1209625&rev=1209625&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultSegmentInfosFormat.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40SegmentInfosFormat.java Fri Dec  2 18:29:25 2011
@@ -1,4 +1,8 @@
-package org.apache.lucene.index.codecs;
+package org.apache.lucene.index.codecs.lucene40;
+
+import org.apache.lucene.index.codecs.SegmentInfosFormat;
+import org.apache.lucene.index.codecs.SegmentInfosReader;
+import org.apache.lucene.index.codecs.SegmentInfosWriter;
 
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -20,9 +24,9 @@ package org.apache.lucene.index.codecs;
 /**
  * @lucene.experimental
  */
-public class DefaultSegmentInfosFormat extends SegmentInfosFormat {
-  private final SegmentInfosReader reader = new DefaultSegmentInfosReader();
-  private final SegmentInfosWriter writer = new DefaultSegmentInfosWriter();
+public class Lucene40SegmentInfosFormat extends SegmentInfosFormat {
+  private final SegmentInfosReader reader = new Lucene40SegmentInfosReader();
+  private final SegmentInfosWriter writer = new Lucene40SegmentInfosWriter();
   
   @Override
   public SegmentInfosReader getSegmentInfosReader() {

Copied: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40SegmentInfosReader.java (from r1209174, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultSegmentInfosReader.java)
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40SegmentInfosReader.java?p2=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40SegmentInfosReader.java&p1=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultSegmentInfosReader.java&r1=1209174&r2=1209625&rev=1209625&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultSegmentInfosReader.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40SegmentInfosReader.java Fri Dec  2 18:29:25 2011
@@ -1,4 +1,4 @@
-package org.apache.lucene.index.codecs;
+package org.apache.lucene.index.codecs.lucene40;
 
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -25,6 +25,9 @@ import org.apache.lucene.index.IndexFile
 import org.apache.lucene.index.IndexFormatTooOldException;
 import org.apache.lucene.index.SegmentInfo;
 import org.apache.lucene.index.SegmentInfos;
+import org.apache.lucene.index.codecs.Codec;
+import org.apache.lucene.index.codecs.SegmentInfosReader;
+import org.apache.lucene.index.codecs.lucene40.Lucene40TermVectorsReader;
 import org.apache.lucene.store.ChecksumIndexInput;
 import org.apache.lucene.store.CompoundFileDirectory;
 import org.apache.lucene.store.Directory;
@@ -34,7 +37,7 @@ import org.apache.lucene.store.IOContext
  * Default implementation of {@link SegmentInfosReader}.
  * @lucene.experimental
  */
-public class DefaultSegmentInfosReader extends SegmentInfosReader {
+public class Lucene40SegmentInfosReader extends SegmentInfosReader {
 
   // TODO: shove all backwards code to preflex!
   // this is a little tricky, because of IR.commit(), two options:
@@ -68,7 +71,7 @@ public class DefaultSegmentInfosReader e
         }
 
         try {
-          DefaultStoredFieldsReader.checkCodeVersion(dir, si.getDocStoreSegment());
+          Lucene40StoredFieldsReader.checkCodeVersion(dir, si.getDocStoreSegment());
         } finally {
           // If we opened the directory, close it
           if (dir != directory) dir.close();
@@ -93,7 +96,7 @@ public class DefaultSegmentInfosReader e
   // if we make a preflex impl we can remove a lot of this hair...
   public SegmentInfo readSegmentInfo(Directory dir, int format, ChecksumIndexInput input) throws IOException {
     final String version;
-    if (format <= DefaultSegmentInfosWriter.FORMAT_3_1) {
+    if (format <= SegmentInfos.FORMAT_3_1) {
       version = input.readString();
     } else {
       version = null;
@@ -112,7 +115,7 @@ public class DefaultSegmentInfosReader e
       docStoreIsCompoundFile = false;
     }
 
-    if (format > DefaultSegmentInfosWriter.FORMAT_4_0) {
+    if (format > SegmentInfos.FORMAT_4_0) {
       // pre-4.0 indexes write a byte if there is a single norms file
       byte b = input.readByte();
       assert 1 == b;
@@ -126,7 +129,7 @@ public class DefaultSegmentInfosReader e
       normGen = new HashMap<Integer, Long>();
       for(int j=0;j<numNormGen;j++) {
         int fieldNumber = j;
-        if (format <= DefaultSegmentInfosWriter.FORMAT_4_0) {
+        if (format <= SegmentInfos.FORMAT_4_0) {
           fieldNumber = input.readInt();
         }
 
@@ -142,7 +145,7 @@ public class DefaultSegmentInfosReader e
 
     final Codec codec;
     // note: if the codec is not available: Codec.forName will throw an exception.
-    if (format <= DefaultSegmentInfosWriter.FORMAT_4_0) {
+    if (format <= SegmentInfos.FORMAT_4_0) {
       codec = Codec.forName(input.readString());
     } else {
       codec = Codec.forName("Lucene3x");
@@ -150,7 +153,7 @@ public class DefaultSegmentInfosReader e
     final Map<String,String> diagnostics = input.readStringStringMap();
 
     final int hasVectors;
-    if (format <= DefaultSegmentInfosWriter.FORMAT_HAS_VECTORS) {
+    if (format <= SegmentInfos.FORMAT_HAS_VECTORS) {
       hasVectors = input.readByte();
     } else {
       final String storesSegment;
@@ -173,7 +176,7 @@ public class DefaultSegmentInfosReader e
       }
       try {
         // TODO: remove this manual file check or push to preflex codec
-        hasVectors = dirToTest.fileExists(IndexFileNames.segmentFileName(storesSegment, "", DefaultTermVectorsReader.VECTORS_INDEX_EXTENSION)) ? SegmentInfo.YES : SegmentInfo.NO;
+        hasVectors = dirToTest.fileExists(IndexFileNames.segmentFileName(storesSegment, "", Lucene40TermVectorsReader.VECTORS_INDEX_EXTENSION)) ? SegmentInfo.YES : SegmentInfo.NO;
       } finally {
         if (isCompoundFile) {
           dirToTest.close();

Copied: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40SegmentInfosWriter.java (from r1209174, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultSegmentInfosWriter.java)
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40SegmentInfosWriter.java?p2=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40SegmentInfosWriter.java&p1=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultSegmentInfosWriter.java&r1=1209174&r2=1209625&rev=1209625&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultSegmentInfosWriter.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40SegmentInfosWriter.java Fri Dec  2 18:29:25 2011
@@ -1,4 +1,4 @@
-package org.apache.lucene.index.codecs;
+package org.apache.lucene.index.codecs.lucene40;
 
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -23,6 +23,7 @@ import java.util.Map.Entry;
 
 import org.apache.lucene.index.SegmentInfo;
 import org.apache.lucene.index.SegmentInfos;
+import org.apache.lucene.index.codecs.SegmentInfosWriter;
 import org.apache.lucene.store.ChecksumIndexOutput;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.FlushInfo;
@@ -34,29 +35,7 @@ import org.apache.lucene.util.IOUtils;
  * Default implementation of {@link SegmentInfosWriter}.
  * @lucene.experimental
  */
-public class DefaultSegmentInfosWriter extends SegmentInfosWriter {
-
-  /** This format adds optional per-segment String
-   *  diagnostics storage, and switches userData to Map */
-  public static final int FORMAT_DIAGNOSTICS = -9;
-
-  /** Each segment records whether it has term vectors */
-  public static final int FORMAT_HAS_VECTORS = -10;
-
-  /** Each segment records the Lucene version that created it. */
-  public static final int FORMAT_3_1 = -11;
-
-  /** Each segment records whether its postings are written
-   *  in the new flex format */
-  public static final int FORMAT_4_0 = -12;
-
-  /** This must always point to the most recent file format.
-   * whenever you add a new format, make it 1 smaller (negative version logic)! */
-  // TODO: move this, as its currently part of required preamble
-  public static final int FORMAT_CURRENT = FORMAT_4_0;
-  
-  /** This must always point to the first supported file format. */
-  public static final int FORMAT_MINIMUM = FORMAT_DIAGNOSTICS;
+public class Lucene40SegmentInfosWriter extends SegmentInfosWriter {
 
   @Override
   public IndexOutput writeInfos(Directory dir, String segmentFileName, String codecID, SegmentInfos infos, IOContext context)
@@ -64,7 +43,7 @@ public class DefaultSegmentInfosWriter e
     IndexOutput out = createOutput(dir, segmentFileName, new IOContext(new FlushInfo(infos.size(), infos.totalDocCount())));
     boolean success = false;
     try {
-      out.writeInt(FORMAT_CURRENT); // write FORMAT
+      out.writeInt(SegmentInfos.FORMAT_CURRENT); // write FORMAT
       out.writeString(codecID); // write codecID
       out.writeLong(infos.version);
       out.writeInt(infos.counter); // write counter

Copied: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40SkipListReader.java (from r1209174, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/DefaultSkipListReader.java)
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40SkipListReader.java?p2=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40SkipListReader.java&p1=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/DefaultSkipListReader.java&r1=1209174&r2=1209625&rev=1209625&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/DefaultSkipListReader.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40SkipListReader.java Fri Dec  2 18:29:25 2011
@@ -28,7 +28,7 @@ import org.apache.lucene.store.IndexInpu
  * that stores positions and payloads.
  * @lucene.experimental
  */
-public class DefaultSkipListReader extends MultiLevelSkipListReader {
+public class Lucene40SkipListReader extends MultiLevelSkipListReader {
   private boolean currentFieldStoresPayloads;
   private long freqPointer[];
   private long proxPointer[];
@@ -39,7 +39,7 @@ public class DefaultSkipListReader exten
   private int lastPayloadLength;
                            
 
-  public DefaultSkipListReader(IndexInput skipStream, int maxSkipLevels, int skipInterval) {
+  public Lucene40SkipListReader(IndexInput skipStream, int maxSkipLevels, int skipInterval) {
     super(skipStream, maxSkipLevels, skipInterval);
     freqPointer = new long[maxSkipLevels];
     proxPointer = new long[maxSkipLevels];

Copied: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40SkipListWriter.java (from r1209174, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/DefaultSkipListWriter.java)
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40SkipListWriter.java?p2=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40SkipListWriter.java&p1=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/DefaultSkipListWriter.java&r1=1209174&r2=1209625&rev=1209625&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/DefaultSkipListWriter.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40SkipListWriter.java Fri Dec  2 18:29:25 2011
@@ -29,7 +29,7 @@ import org.apache.lucene.index.codecs.Mu
  * that stores positions and payloads.
  * @lucene.experimental
  */
-public class DefaultSkipListWriter extends MultiLevelSkipListWriter {
+public class Lucene40SkipListWriter extends MultiLevelSkipListWriter {
   private int[] lastSkipDoc;
   private int[] lastSkipPayloadLength;
   private long[] lastSkipFreqPointer;
@@ -44,7 +44,7 @@ public class DefaultSkipListWriter exten
   private long curFreqPointer;
   private long curProxPointer;
 
-  public DefaultSkipListWriter(int skipInterval, int numberOfSkipLevels, int docCount, IndexOutput freqOutput, IndexOutput proxOutput) {
+  public Lucene40SkipListWriter(int skipInterval, int numberOfSkipLevels, int docCount, IndexOutput freqOutput, IndexOutput proxOutput) {
     super(skipInterval, numberOfSkipLevels, docCount);
     this.freqOutput = freqOutput;
     this.proxOutput = proxOutput;

Copied: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40StoredFieldsFormat.java (from r1209174, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultStoredFieldsFormat.java)
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40StoredFieldsFormat.java?p2=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40StoredFieldsFormat.java&p1=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultStoredFieldsFormat.java&r1=1209174&r2=1209625&rev=1209625&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultStoredFieldsFormat.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40StoredFieldsFormat.java Fri Dec  2 18:29:25 2011
@@ -1,4 +1,4 @@
-package org.apache.lucene.index.codecs;
+package org.apache.lucene.index.codecs.lucene40;
 
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -22,26 +22,29 @@ import java.util.Set;
 
 import org.apache.lucene.index.FieldInfos;
 import org.apache.lucene.index.SegmentInfo;
+import org.apache.lucene.index.codecs.StoredFieldsFormat;
+import org.apache.lucene.index.codecs.StoredFieldsReader;
+import org.apache.lucene.index.codecs.StoredFieldsWriter;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.IOContext;
 
 /** @lucene.experimental */
-public class DefaultStoredFieldsFormat extends StoredFieldsFormat {
+public class Lucene40StoredFieldsFormat extends StoredFieldsFormat {
 
   @Override
   public StoredFieldsReader fieldsReader(Directory directory, SegmentInfo si,
       FieldInfos fn, IOContext context) throws IOException {
-    return new DefaultStoredFieldsReader(directory, si, fn, context);
+    return new Lucene40StoredFieldsReader(directory, si, fn, context);
   }
 
   @Override
   public StoredFieldsWriter fieldsWriter(Directory directory, String segment,
       IOContext context) throws IOException {
-    return new DefaultStoredFieldsWriter(directory, segment, context);
+    return new Lucene40StoredFieldsWriter(directory, segment, context);
   }
 
   @Override
   public void files(Directory dir, SegmentInfo info, Set<String> files) throws IOException {
-    DefaultStoredFieldsReader.files(dir, info, files);
+    Lucene40StoredFieldsReader.files(dir, info, files);
   }
 }

Copied: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40StoredFieldsReader.java (from r1209174, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultStoredFieldsReader.java)
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40StoredFieldsReader.java?p2=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40StoredFieldsReader.java&p1=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultStoredFieldsReader.java&r1=1209174&r2=1209625&rev=1209625&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultStoredFieldsReader.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40StoredFieldsReader.java Fri Dec  2 18:29:25 2011
@@ -1,4 +1,4 @@
-package org.apache.lucene.index.codecs;
+package org.apache.lucene.index.codecs.lucene40;
 
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -28,6 +28,7 @@ import org.apache.lucene.index.IndexForm
 import org.apache.lucene.index.IndexFormatTooOldException;
 import org.apache.lucene.index.SegmentInfo;
 import org.apache.lucene.index.StoredFieldVisitor;
+import org.apache.lucene.index.codecs.StoredFieldsReader;
 import org.apache.lucene.store.AlreadyClosedException;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.IOContext;
@@ -45,7 +46,7 @@ import java.util.Set;
  * 
  * @lucene.internal
  */
-public final class DefaultStoredFieldsReader extends StoredFieldsReader implements Cloneable, Closeable {
+public final class Lucene40StoredFieldsReader extends StoredFieldsReader implements Cloneable, Closeable {
   private final static int FORMAT_SIZE = 4;
 
   private final FieldInfos fieldInfos;
@@ -66,22 +67,22 @@ public final class DefaultStoredFieldsRe
    *  clones are called (eg, currently SegmentReader manages
    *  this logic). */
   @Override
-  public DefaultStoredFieldsReader clone() {
+  public Lucene40StoredFieldsReader clone() {
     ensureOpen();
-    return new DefaultStoredFieldsReader(fieldInfos, numTotalDocs, size, format, docStoreOffset, (IndexInput)fieldsStream.clone(), (IndexInput)indexStream.clone());
+    return new Lucene40StoredFieldsReader(fieldInfos, numTotalDocs, size, format, docStoreOffset, (IndexInput)fieldsStream.clone(), (IndexInput)indexStream.clone());
   }
 
   /** Verifies that the code version which wrote the segment is supported. */
   public static void checkCodeVersion(Directory dir, String segment) throws IOException {
-    final String indexStreamFN = IndexFileNames.segmentFileName(segment, "", DefaultStoredFieldsWriter.FIELDS_INDEX_EXTENSION);
+    final String indexStreamFN = IndexFileNames.segmentFileName(segment, "", Lucene40StoredFieldsWriter.FIELDS_INDEX_EXTENSION);
     IndexInput idxStream = dir.openInput(indexStreamFN, IOContext.DEFAULT);
     
     try {
       int format = idxStream.readInt();
-      if (format < DefaultStoredFieldsWriter.FORMAT_MINIMUM)
-        throw new IndexFormatTooOldException(idxStream, format, DefaultStoredFieldsWriter.FORMAT_MINIMUM, DefaultStoredFieldsWriter.FORMAT_CURRENT);
-      if (format > DefaultStoredFieldsWriter.FORMAT_CURRENT)
-        throw new IndexFormatTooNewException(idxStream, format, DefaultStoredFieldsWriter.FORMAT_MINIMUM, DefaultStoredFieldsWriter.FORMAT_CURRENT);
+      if (format < Lucene40StoredFieldsWriter.FORMAT_MINIMUM)
+        throw new IndexFormatTooOldException(idxStream, format, Lucene40StoredFieldsWriter.FORMAT_MINIMUM, Lucene40StoredFieldsWriter.FORMAT_CURRENT);
+      if (format > Lucene40StoredFieldsWriter.FORMAT_CURRENT)
+        throw new IndexFormatTooNewException(idxStream, format, Lucene40StoredFieldsWriter.FORMAT_MINIMUM, Lucene40StoredFieldsWriter.FORMAT_CURRENT);
     } finally {
       idxStream.close();
     }
@@ -89,7 +90,7 @@ public final class DefaultStoredFieldsRe
   }
   
   // Used only by clone
-  private DefaultStoredFieldsReader(FieldInfos fieldInfos, int numTotalDocs, int size, int format, int docStoreOffset,
+  private Lucene40StoredFieldsReader(FieldInfos fieldInfos, int numTotalDocs, int size, int format, int docStoreOffset,
                        IndexInput fieldsStream, IndexInput indexStream) {
     this.fieldInfos = fieldInfos;
     this.numTotalDocs = numTotalDocs;
@@ -100,23 +101,23 @@ public final class DefaultStoredFieldsRe
     this.indexStream = indexStream;
   }
 
-  public DefaultStoredFieldsReader(Directory d, SegmentInfo si, FieldInfos fn, IOContext context) throws IOException {
+  public Lucene40StoredFieldsReader(Directory d, SegmentInfo si, FieldInfos fn, IOContext context) throws IOException {
     final String segment = si.getDocStoreSegment();
     final int docStoreOffset = si.getDocStoreOffset();
     final int size = si.docCount;
     boolean success = false;
     fieldInfos = fn;
     try {
-      fieldsStream = d.openInput(IndexFileNames.segmentFileName(segment, "", DefaultStoredFieldsWriter.FIELDS_EXTENSION), context);
-      final String indexStreamFN = IndexFileNames.segmentFileName(segment, "", DefaultStoredFieldsWriter.FIELDS_INDEX_EXTENSION);
+      fieldsStream = d.openInput(IndexFileNames.segmentFileName(segment, "", Lucene40StoredFieldsWriter.FIELDS_EXTENSION), context);
+      final String indexStreamFN = IndexFileNames.segmentFileName(segment, "", Lucene40StoredFieldsWriter.FIELDS_INDEX_EXTENSION);
       indexStream = d.openInput(indexStreamFN, context);
       
       format = indexStream.readInt();
 
-      if (format < DefaultStoredFieldsWriter.FORMAT_MINIMUM)
-        throw new IndexFormatTooOldException(indexStream, format, DefaultStoredFieldsWriter.FORMAT_MINIMUM, DefaultStoredFieldsWriter.FORMAT_CURRENT);
-      if (format > DefaultStoredFieldsWriter.FORMAT_CURRENT)
-        throw new IndexFormatTooNewException(indexStream, format, DefaultStoredFieldsWriter.FORMAT_MINIMUM, DefaultStoredFieldsWriter.FORMAT_CURRENT);
+      if (format < Lucene40StoredFieldsWriter.FORMAT_MINIMUM)
+        throw new IndexFormatTooOldException(indexStream, format, Lucene40StoredFieldsWriter.FORMAT_MINIMUM, Lucene40StoredFieldsWriter.FORMAT_CURRENT);
+      if (format > Lucene40StoredFieldsWriter.FORMAT_CURRENT)
+        throw new IndexFormatTooNewException(indexStream, format, Lucene40StoredFieldsWriter.FORMAT_MINIMUM, Lucene40StoredFieldsWriter.FORMAT_CURRENT);
 
       final long indexSize = indexStream.length() - FORMAT_SIZE;
       
@@ -190,7 +191,7 @@ public final class DefaultStoredFieldsRe
       FieldInfo fieldInfo = fieldInfos.fieldInfo(fieldNumber);
       
       int bits = fieldsStream.readByte() & 0xFF;
-      assert bits <= (DefaultStoredFieldsWriter.FIELD_IS_NUMERIC_MASK | DefaultStoredFieldsWriter.FIELD_IS_BINARY): "bits=" + Integer.toHexString(bits);
+      assert bits <= (Lucene40StoredFieldsWriter.FIELD_IS_NUMERIC_MASK | Lucene40StoredFieldsWriter.FIELD_IS_BINARY): "bits=" + Integer.toHexString(bits);
 
       switch(visitor.needsField(fieldInfo)) {
         case YES:
@@ -208,19 +209,19 @@ public final class DefaultStoredFieldsRe
   static final Charset UTF8 = Charset.forName("UTF-8");
 
   private void readField(StoredFieldVisitor visitor, FieldInfo info, int bits) throws IOException {
-    final int numeric = bits & DefaultStoredFieldsWriter.FIELD_IS_NUMERIC_MASK;
+    final int numeric = bits & Lucene40StoredFieldsWriter.FIELD_IS_NUMERIC_MASK;
     if (numeric != 0) {
       switch(numeric) {
-        case DefaultStoredFieldsWriter.FIELD_IS_NUMERIC_INT:
+        case Lucene40StoredFieldsWriter.FIELD_IS_NUMERIC_INT:
           visitor.intField(info, fieldsStream.readInt());
           return;
-        case DefaultStoredFieldsWriter.FIELD_IS_NUMERIC_LONG:
+        case Lucene40StoredFieldsWriter.FIELD_IS_NUMERIC_LONG:
           visitor.longField(info, fieldsStream.readLong());
           return;
-        case DefaultStoredFieldsWriter.FIELD_IS_NUMERIC_FLOAT:
+        case Lucene40StoredFieldsWriter.FIELD_IS_NUMERIC_FLOAT:
           visitor.floatField(info, Float.intBitsToFloat(fieldsStream.readInt()));
           return;
-        case DefaultStoredFieldsWriter.FIELD_IS_NUMERIC_DOUBLE:
+        case Lucene40StoredFieldsWriter.FIELD_IS_NUMERIC_DOUBLE:
           visitor.doubleField(info, Double.longBitsToDouble(fieldsStream.readLong()));
           return;
         default:
@@ -230,7 +231,7 @@ public final class DefaultStoredFieldsRe
       final int length = fieldsStream.readVInt();
       byte bytes[] = new byte[length];
       fieldsStream.readBytes(bytes, 0, length);
-      if ((bits & DefaultStoredFieldsWriter.FIELD_IS_BINARY) != 0) {
+      if ((bits & Lucene40StoredFieldsWriter.FIELD_IS_BINARY) != 0) {
         visitor.binaryField(info, bytes, 0, bytes.length);
       } else {
         visitor.stringField(info, new String(bytes, 0, bytes.length, UTF8));
@@ -239,15 +240,15 @@ public final class DefaultStoredFieldsRe
   }
   
   private void skipField(int bits) throws IOException {
-    final int numeric = bits & DefaultStoredFieldsWriter.FIELD_IS_NUMERIC_MASK;
+    final int numeric = bits & Lucene40StoredFieldsWriter.FIELD_IS_NUMERIC_MASK;
     if (numeric != 0) {
       switch(numeric) {
-        case DefaultStoredFieldsWriter.FIELD_IS_NUMERIC_INT:
-        case DefaultStoredFieldsWriter.FIELD_IS_NUMERIC_FLOAT:
+        case Lucene40StoredFieldsWriter.FIELD_IS_NUMERIC_INT:
+        case Lucene40StoredFieldsWriter.FIELD_IS_NUMERIC_FLOAT:
           fieldsStream.readInt();
           return;
-        case DefaultStoredFieldsWriter.FIELD_IS_NUMERIC_LONG:
-        case DefaultStoredFieldsWriter.FIELD_IS_NUMERIC_DOUBLE:
+        case Lucene40StoredFieldsWriter.FIELD_IS_NUMERIC_LONG:
+        case Lucene40StoredFieldsWriter.FIELD_IS_NUMERIC_DOUBLE:
           fieldsStream.readLong();
           return;
         default: 
@@ -291,12 +292,12 @@ public final class DefaultStoredFieldsRe
     if (info.getDocStoreOffset() != -1) {
       assert info.getDocStoreSegment() != null;
       if (!info.getDocStoreIsCompoundFile()) {
-        files.add(IndexFileNames.segmentFileName(info.getDocStoreSegment(), "", DefaultStoredFieldsWriter.FIELDS_INDEX_EXTENSION));
-        files.add(IndexFileNames.segmentFileName(info.getDocStoreSegment(), "", DefaultStoredFieldsWriter.FIELDS_EXTENSION));
+        files.add(IndexFileNames.segmentFileName(info.getDocStoreSegment(), "", Lucene40StoredFieldsWriter.FIELDS_INDEX_EXTENSION));
+        files.add(IndexFileNames.segmentFileName(info.getDocStoreSegment(), "", Lucene40StoredFieldsWriter.FIELDS_EXTENSION));
       }
     } else {
-      files.add(IndexFileNames.segmentFileName(info.name, "", DefaultStoredFieldsWriter.FIELDS_INDEX_EXTENSION));
-      files.add(IndexFileNames.segmentFileName(info.name, "", DefaultStoredFieldsWriter.FIELDS_EXTENSION));
+      files.add(IndexFileNames.segmentFileName(info.name, "", Lucene40StoredFieldsWriter.FIELDS_INDEX_EXTENSION));
+      files.add(IndexFileNames.segmentFileName(info.name, "", Lucene40StoredFieldsWriter.FIELDS_EXTENSION));
     }
   }
 }

Copied: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40StoredFieldsWriter.java (from r1209174, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultStoredFieldsWriter.java)
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40StoredFieldsWriter.java?p2=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40StoredFieldsWriter.java&p1=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultStoredFieldsWriter.java&r1=1209174&r2=1209625&rev=1209625&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultStoredFieldsWriter.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40StoredFieldsWriter.java Fri Dec  2 18:29:25 2011
@@ -1,4 +1,4 @@
-package org.apache.lucene.index.codecs;
+package org.apache.lucene.index.codecs.lucene40;
 
 /**
  * Copyright 2004 The Apache Software Foundation
@@ -26,6 +26,8 @@ import org.apache.lucene.index.Indexable
 import org.apache.lucene.index.MergeState;
 import org.apache.lucene.index.SegmentReader;
 import org.apache.lucene.index.MergePolicy.MergeAbortedException;
+import org.apache.lucene.index.codecs.StoredFieldsReader;
+import org.apache.lucene.index.codecs.StoredFieldsWriter;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.IOContext;
 import org.apache.lucene.store.IndexInput;
@@ -35,7 +37,7 @@ import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.IOUtils;
 
 /** @lucene.experimental */
-public final class DefaultStoredFieldsWriter extends StoredFieldsWriter {
+public final class Lucene40StoredFieldsWriter extends StoredFieldsWriter {
   // NOTE: bit 0 is free here!  You can steal it!
   static final int FIELD_IS_BINARY = 1 << 1;
 
@@ -78,7 +80,7 @@ public final class DefaultStoredFieldsWr
   private IndexOutput fieldsStream;
   private IndexOutput indexStream;
 
-  public DefaultStoredFieldsWriter(Directory directory, String segment, IOContext context) throws IOException {
+  public Lucene40StoredFieldsWriter(Directory directory, String segment, IOContext context) throws IOException {
     assert directory != null;
     this.directory = directory;
     this.segment = segment;
@@ -227,12 +229,12 @@ public final class DefaultStoredFieldsWr
     
     for (MergeState.IndexReaderAndLiveDocs reader : mergeState.readers) {
       final SegmentReader matchingSegmentReader = mergeState.matchingSegmentReaders[idx++];
-      DefaultStoredFieldsReader matchingFieldsReader = null;
+      Lucene40StoredFieldsReader matchingFieldsReader = null;
       if (matchingSegmentReader != null) {
         final StoredFieldsReader fieldsReader = matchingSegmentReader.getFieldsReader();
-        // we can only bulk-copy if the matching reader is also a DefaultFieldsReader
-        if (fieldsReader != null && fieldsReader instanceof DefaultStoredFieldsReader) {
-          matchingFieldsReader = (DefaultStoredFieldsReader) fieldsReader;
+        // we can only bulk-copy if the matching reader is also a Lucene40FieldsReader
+        if (fieldsReader != null && fieldsReader instanceof Lucene40StoredFieldsReader) {
+          matchingFieldsReader = (Lucene40StoredFieldsReader) fieldsReader;
         }
       }
     
@@ -253,7 +255,7 @@ public final class DefaultStoredFieldsWr
   private final static int MAX_RAW_MERGE_DOCS = 4192;
 
   private int copyFieldsWithDeletions(MergeState mergeState, final MergeState.IndexReaderAndLiveDocs reader,
-                                      final DefaultStoredFieldsReader matchingFieldsReader, int rawDocLengths[])
+                                      final Lucene40StoredFieldsReader matchingFieldsReader, int rawDocLengths[])
     throws IOException, MergeAbortedException, CorruptIndexException {
     int docCount = 0;
     final int maxDoc = reader.reader.maxDoc();
@@ -307,7 +309,7 @@ public final class DefaultStoredFieldsWr
   }
 
   private int copyFieldsNoDeletions(MergeState mergeState, final MergeState.IndexReaderAndLiveDocs reader,
-                                    final DefaultStoredFieldsReader matchingFieldsReader, int rawDocLengths[])
+                                    final Lucene40StoredFieldsReader matchingFieldsReader, int rawDocLengths[])
     throws IOException, MergeAbortedException, CorruptIndexException {
     final int maxDoc = reader.reader.maxDoc();
     int docCount = 0;

Copied: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40TermVectorsFormat.java (from r1209174, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultTermVectorsFormat.java)
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40TermVectorsFormat.java?p2=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40TermVectorsFormat.java&p1=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultTermVectorsFormat.java&r1=1209174&r2=1209625&rev=1209625&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultTermVectorsFormat.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40TermVectorsFormat.java Fri Dec  2 18:29:25 2011
@@ -1,4 +1,4 @@
-package org.apache.lucene.index.codecs;
+package org.apache.lucene.index.codecs.lucene40;
 
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -22,23 +22,26 @@ import java.util.Set;
 
 import org.apache.lucene.index.FieldInfos;
 import org.apache.lucene.index.SegmentInfo;
+import org.apache.lucene.index.codecs.TermVectorsFormat;
+import org.apache.lucene.index.codecs.TermVectorsReader;
+import org.apache.lucene.index.codecs.TermVectorsWriter;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.IOContext;
 
-public class DefaultTermVectorsFormat extends TermVectorsFormat {
+public class Lucene40TermVectorsFormat extends TermVectorsFormat {
 
   @Override
   public TermVectorsReader vectorsReader(Directory directory, SegmentInfo segmentInfo, FieldInfos fieldInfos, IOContext context) throws IOException {
-    return new DefaultTermVectorsReader(directory, segmentInfo, fieldInfos, context);
+    return new Lucene40TermVectorsReader(directory, segmentInfo, fieldInfos, context);
   }
 
   @Override
   public TermVectorsWriter vectorsWriter(Directory directory, String segment, IOContext context) throws IOException {
-    return new DefaultTermVectorsWriter(directory, segment, context);
+    return new Lucene40TermVectorsWriter(directory, segment, context);
   }
 
   @Override
   public void files(Directory dir, SegmentInfo info, Set<String> files) throws IOException {
-    DefaultTermVectorsReader.files(dir, info, files);
+    Lucene40TermVectorsReader.files(dir, info, files);
   }
 }

Copied: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40TermVectorsReader.java (from r1209174, lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultTermVectorsReader.java)
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40TermVectorsReader.java?p2=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40TermVectorsReader.java&p1=lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultTermVectorsReader.java&r1=1209174&r2=1209625&rev=1209625&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/DefaultTermVectorsReader.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/lucene40/Lucene40TermVectorsReader.java Fri Dec  2 18:29:25 2011
@@ -1,4 +1,4 @@
-package org.apache.lucene.index.codecs;
+package org.apache.lucene.index.codecs.lucene40;
 
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -38,6 +38,7 @@ import org.apache.lucene.index.IndexForm
 import org.apache.lucene.index.SegmentInfo;
 import org.apache.lucene.index.Terms;
 import org.apache.lucene.index.TermsEnum;
+import org.apache.lucene.index.codecs.TermVectorsReader;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.IOContext;
 import org.apache.lucene.store.IndexInput;
@@ -45,7 +46,7 @@ import org.apache.lucene.util.Bits;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.IOUtils;
 
-public class DefaultTermVectorsReader extends TermVectorsReader {
+public class Lucene40TermVectorsReader extends TermVectorsReader {
 
   // NOTE: if you make a new format, it must be larger than
   // the current format
@@ -74,7 +75,8 @@ public class DefaultTermVectorsReader ex
   static final String VECTORS_DOCUMENTS_EXTENSION = "tvd";
 
   /** Extension of vectors index file */
-  static final String VECTORS_INDEX_EXTENSION = "tvx";
+  // TODO: shouldnt be visible to segments reader, preflex should do this itself somehow
+  public static final String VECTORS_INDEX_EXTENSION = "tvx";
 
   private FieldInfos fieldInfos;
 
@@ -91,7 +93,7 @@ public class DefaultTermVectorsReader ex
   private final int format;
 
   // used by clone
-  DefaultTermVectorsReader(FieldInfos fieldInfos, IndexInput tvx, IndexInput tvd, IndexInput tvf, int size, int numTotalDocs, int docStoreOffset, int format) {
+  Lucene40TermVectorsReader(FieldInfos fieldInfos, IndexInput tvx, IndexInput tvd, IndexInput tvf, int size, int numTotalDocs, int docStoreOffset, int format) {
     this.fieldInfos = fieldInfos;
     this.tvx = tvx;
     this.tvd = tvd;
@@ -102,7 +104,7 @@ public class DefaultTermVectorsReader ex
     this.format = format;
   }
     
-  public DefaultTermVectorsReader(Directory d, SegmentInfo si, FieldInfos fieldInfos, IOContext context)
+  public Lucene40TermVectorsReader(Directory d, SegmentInfo si, FieldInfos fieldInfos, IOContext context)
     throws CorruptIndexException, IOException {
     final String segment = si.getDocStoreSegment();
     final int docStoreOffset = si.getDocStoreOffset();
@@ -395,7 +397,7 @@ public class DefaultTermVectorsReader ex
 
     // NOTE: tvf is pre-positioned by caller
     public TVTermsEnum() throws IOException {
-      this.origTVF = DefaultTermVectorsReader.this.tvf;
+      this.origTVF = Lucene40TermVectorsReader.this.tvf;
       tvf = (IndexInput) origTVF.clone();
     }
 
@@ -717,7 +719,7 @@ public class DefaultTermVectorsReader ex
       cloneTvf = (IndexInput) tvf.clone();
     }
     
-    return new DefaultTermVectorsReader(fieldInfos, cloneTvx, cloneTvd, cloneTvf, size, numTotalDocs, docStoreOffset, format);
+    return new Lucene40TermVectorsReader(fieldInfos, cloneTvx, cloneTvd, cloneTvf, size, numTotalDocs, docStoreOffset, format);
   }
   
   public static void files(Directory dir, SegmentInfo info, Set<String> files) throws IOException {



Mime
View raw message