lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1138331 - in /lucene/dev/trunk/lucene/src: java/org/apache/lucene/index/ java/org/apache/lucene/index/codecs/ test/org/apache/lucene/index/
Date Wed, 22 Jun 2011 08:11:44 GMT
Author: rmuir
Date: Wed Jun 22 08:11:44 2011
New Revision: 1138331

URL: http://svn.apache.org/viewvc?rev=1138331&view=rev
Log:
LUCENE-3226: revert

Modified:
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/CheckIndex.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/SegmentInfo.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/SegmentInfos.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/test/org/apache/lucene/index/TestGlobalFieldNumbers.java

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=1138331&r1=1138330&r2=1138331&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 Wed Jun 22 08:11:44
2011
@@ -371,10 +371,10 @@ public class CheckIndex {
       sFormat = "FORMAT_DIAGNOSTICS [Lucene 2.9]";
     } else if (format == DefaultSegmentInfosWriter.FORMAT_HAS_VECTORS) {
       sFormat = "FORMAT_HAS_VECTORS [Lucene 3.1]";
-    } else if (format == DefaultSegmentInfosWriter.FORMAT_SEGMENT_RECORDS_VERSION) {
-      sFormat = "FORMAT_SEGMENT_RECORDS_VERSION [Lucene 3.1+]";
-    } else if (format == DefaultSegmentInfosWriter.FORMAT_FLEX) {
-      sFormat = "FORMAT_FLEX [Lucene 4.0+]";
+    } else if (format == DefaultSegmentInfosWriter.FORMAT_3_1) {
+      sFormat = "FORMAT_3_1 [Lucene 3.1]";
+    } else if (format == DefaultSegmentInfosWriter.FORMAT_4_0) {
+      sFormat = "FORMAT_4_0 [Lucene 4.0]";
     } else if (format == DefaultSegmentInfosWriter.FORMAT_CURRENT) {
       throw new RuntimeException("BUG: You should update this tool!");
     } else if (format < DefaultSegmentInfosWriter.FORMAT_CURRENT) {

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/SegmentInfo.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/SegmentInfo.java?rev=1138331&r1=1138330&r2=1138331&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/SegmentInfo.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/SegmentInfo.java Wed Jun 22 08:11:44
2011
@@ -178,7 +178,7 @@ public final class SegmentInfo implement
    */
   public SegmentInfo(Directory dir, int format, IndexInput input, CodecProvider codecs) throws
IOException {
     this.dir = dir;
-    if (format <= DefaultSegmentInfosWriter.FORMAT_SEGMENT_RECORDS_VERSION) {
+    if (format <= DefaultSegmentInfosWriter.FORMAT_3_1) {
       version = input.readString();
     }
     name = input.readString();
@@ -193,7 +193,7 @@ public final class SegmentInfo implement
       docStoreIsCompoundFile = false;
     }
 
-    if (format > DefaultSegmentInfosWriter.FORMAT_FLEX) {
+    if (format > DefaultSegmentInfosWriter.FORMAT_4_0) {
       // pre-4.0 indexes write a byte if there is a single norms file
       byte b = input.readByte();
       assert 1 == b;
@@ -206,7 +206,7 @@ public final class SegmentInfo implement
       normGen = new HashMap<Integer, Long>();
       for(int j=0;j<numNormGen;j++) {
         int fieldNumber = j;
-        if (format <= DefaultSegmentInfosWriter.FORMAT_FLEX) {
+        if (format <= DefaultSegmentInfosWriter.FORMAT_4_0) {
           fieldNumber = input.readInt();
         }
 
@@ -221,7 +221,7 @@ public final class SegmentInfo implement
     hasProx = input.readByte();
 
     // System.out.println(Thread.currentThread().getName() + ": si.read hasProx=" + hasProx
+ " seg=" + name);
-    if (format <= DefaultSegmentInfosWriter.FORMAT_FLEX) {
+    if (format <= DefaultSegmentInfosWriter.FORMAT_4_0) {
       segmentCodecs = new SegmentCodecs(codecs, input);
     } else {
       // codec ID on FieldInfo is 0 so it will simply use the first codec available

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=1138331&r1=1138330&r2=1138331&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 Wed Jun 22
08:11:44 2011
@@ -289,7 +289,7 @@ public final class SegmentInfos implemen
       }
     }.run();
     // either we are on 4.0 or we don't have a lastGlobalFieldMapVersion i.e. its still set
to 0
-    assert DefaultSegmentInfosWriter.FORMAT_FLEX <= format || (DefaultSegmentInfosWriter.FORMAT_FLEX
> format && lastGlobalFieldMapVersion == 0); 
+    assert DefaultSegmentInfosWriter.FORMAT_4_0 <= format || (DefaultSegmentInfosWriter.FORMAT_4_0
> format && lastGlobalFieldMapVersion == 0); 
   }
 
   // Only non-null after prepareCommit has been called and
@@ -1030,7 +1030,7 @@ public final class SegmentInfos implemen
       readGlobalFieldMap(map, dir);
     }
     if (size() > 0) {
-      if (format > DefaultSegmentInfosWriter.FORMAT_FLEX) {
+      if (format > DefaultSegmentInfosWriter.FORMAT_4_0) {
         assert lastGlobalFieldMapVersion == 0;
         // build the map up if we open a pre 4.0 index
         for (SegmentInfo info : this) {

Modified: 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/DefaultSegmentInfosReader.java?rev=1138331&r1=1138330&r2=1138331&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/DefaultSegmentInfosReader.java
Wed Jun 22 08:11:44 2011
@@ -55,7 +55,7 @@ public class DefaultSegmentInfosReader e
   
       infos.version = input.readLong(); // read version
       infos.counter = input.readInt(); // read counter
-      if (infos.getFormat() <= DefaultSegmentInfosWriter.FORMAT_FLEX) {
+      if (infos.getFormat() <= DefaultSegmentInfosWriter.FORMAT_4_0) {
         infos.setGlobalFieldMapVersion(input.readLong());
       }
       for (int i = input.readInt(); i > 0; i--) { // read segmentInfos

Modified: 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/DefaultSegmentInfosWriter.java?rev=1138331&r1=1138330&r2=1138331&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/DefaultSegmentInfosWriter.java
Wed Jun 22 08:11:44 2011
@@ -40,15 +40,15 @@ public class DefaultSegmentInfosWriter e
   public static final int FORMAT_HAS_VECTORS = -10;
 
   /** Each segment records the Lucene version that created it. */
-  public static final int FORMAT_SEGMENT_RECORDS_VERSION = -11;
+  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_FLEX = -12;
+  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)! */
-  public static final int FORMAT_CURRENT = FORMAT_FLEX;
+  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;

Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestGlobalFieldNumbers.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestGlobalFieldNumbers.java?rev=1138331&r1=1138330&r2=1138331&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestGlobalFieldNumbers.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestGlobalFieldNumbers.java Wed
Jun 22 08:11:44 2011
@@ -465,14 +465,14 @@ public class TestGlobalFieldNumbers exte
       IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(
           TEST_VERSION_CURRENT, new MockAnalyzer(random)).setMergePolicy(policy));
       SegmentInfos segmentInfos = writer.segmentInfos;
-      assertTrue(DefaultSegmentInfosWriter.FORMAT_FLEX < segmentInfos.getFormat());
+      assertTrue(DefaultSegmentInfosWriter.FORMAT_4_0 < segmentInfos.getFormat());
       assertEquals(0, segmentInfos.getGlobalFieldMapVersion());
       for (String string : writer.getIndexFileNames()) {
         assertFalse(string.endsWith(".fnx"));
       }
       writer.commit();
       
-      assertTrue(DefaultSegmentInfosWriter.FORMAT_FLEX < segmentInfos.getFormat());
+      assertTrue(DefaultSegmentInfosWriter.FORMAT_4_0 < segmentInfos.getFormat());
       assertEquals(0, segmentInfos.getGlobalFieldMapVersion());
       Collection<String> files = writer.getIndexFileNames();
       for (String string : files) {
@@ -485,7 +485,7 @@ public class TestGlobalFieldNumbers exte
       writer.addDocument(d);
       writer.prepareCommit();
       // the fnx file should still be under control of the SIS
-      assertTrue(DefaultSegmentInfosWriter.FORMAT_FLEX < segmentInfos.getFormat());
+      assertTrue(DefaultSegmentInfosWriter.FORMAT_4_0 < segmentInfos.getFormat());
       assertEquals(0, segmentInfos.getLastGlobalFieldMapVersion());
       assertEquals(1, segmentInfos.getGlobalFieldMapVersion());
       files = writer.getIndexFileNames();
@@ -496,7 +496,7 @@ public class TestGlobalFieldNumbers exte
       writer.commit();
       
       // now we should see the fnx file even if this is a 3.x segment
-      assertTrue(DefaultSegmentInfosWriter.FORMAT_FLEX < segmentInfos.getFormat());
+      assertTrue(DefaultSegmentInfosWriter.FORMAT_4_0 < segmentInfos.getFormat());
       assertEquals(1, segmentInfos.getGlobalFieldMapVersion());
       assertEquals(1, segmentInfos.getLastGlobalFieldMapVersion());
       files = writer.getIndexFileNames();



Mime
View raw message