lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject svn commit: r1519542 - in /lucene/dev/branches/lucene3069/lucene: codecs/src/java/org/apache/lucene/codecs/blockterms/ codecs/src/java/org/apache/lucene/codecs/pulsing/ codecs/src/java/org/apache/lucene/codecs/temp/ core/src/java/org/apache/lucene/code...
Date Tue, 03 Sep 2013 02:36:54 GMT
Author: han
Date: Tue Sep  3 02:36:54 2013
New Revision: 1519542

URL: http://svn.apache.org/r1519542
Log:
LUCENE-3069: update javadocs, fix impersonator bug

Modified:
    lucene/dev/branches/lucene3069/lucene/codecs/src/java/org/apache/lucene/codecs/blockterms/BlockTermsWriter.java
    lucene/dev/branches/lucene3069/lucene/codecs/src/java/org/apache/lucene/codecs/pulsing/PulsingPostingsWriter.java
    lucene/dev/branches/lucene3069/lucene/codecs/src/java/org/apache/lucene/codecs/temp/TempTermOutputs.java
    lucene/dev/branches/lucene3069/lucene/core/src/java/org/apache/lucene/codecs/BlockTreeTermsWriter.java
    lucene/dev/branches/lucene3069/lucene/core/src/java/org/apache/lucene/codecs/PostingsReaderBase.java
    lucene/dev/branches/lucene3069/lucene/core/src/java/org/apache/lucene/codecs/PostingsWriterBase.java
    lucene/dev/branches/lucene3069/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41PostingsWriter.java

Modified: lucene/dev/branches/lucene3069/lucene/codecs/src/java/org/apache/lucene/codecs/blockterms/BlockTermsWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3069/lucene/codecs/src/java/org/apache/lucene/codecs/blockterms/BlockTermsWriter.java?rev=1519542&r1=1519541&r2=1519542&view=diff
==============================================================================
--- lucene/dev/branches/lucene3069/lucene/codecs/src/java/org/apache/lucene/codecs/blockterms/BlockTermsWriter.java
(original)
+++ lucene/dev/branches/lucene3069/lucene/codecs/src/java/org/apache/lucene/codecs/blockterms/BlockTermsWriter.java
Tue Sep  3 02:36:54 2013
@@ -61,8 +61,7 @@ public class BlockTermsWriter extends Fi
   public static final int VERSION_START = 0;
   public static final int VERSION_APPEND_ONLY = 1;
   public static final int VERSION_META_ARRAY = 2;
-  public static final int VERSION_CURRENT = VERSION_APPEND_ONLY;
-  //public static final int VERSION_CURRENT = VERSION_META_ARRAY;
+  public static final int VERSION_CURRENT = VERSION_META_ARRAY;
 
   /** Extension of terms file */
   static final String TERMS_EXTENSION = "tib";

Modified: lucene/dev/branches/lucene3069/lucene/codecs/src/java/org/apache/lucene/codecs/pulsing/PulsingPostingsWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3069/lucene/codecs/src/java/org/apache/lucene/codecs/pulsing/PulsingPostingsWriter.java?rev=1519542&r1=1519541&r2=1519542&view=diff
==============================================================================
--- lucene/dev/branches/lucene3069/lucene/codecs/src/java/org/apache/lucene/codecs/pulsing/PulsingPostingsWriter.java
(original)
+++ lucene/dev/branches/lucene3069/lucene/codecs/src/java/org/apache/lucene/codecs/pulsing/PulsingPostingsWriter.java
Tue Sep  3 02:36:54 2013
@@ -63,8 +63,7 @@ public final class PulsingPostingsWriter
 
   final static int VERSION_META_ARRAY = 1;
 
-  //final static int VERSION_CURRENT = VERSION_META_ARRAY;
-  final static int VERSION_CURRENT = VERSION_START;
+  final static int VERSION_CURRENT = VERSION_META_ARRAY;
 
   private SegmentWriteState segmentState;
   private IndexOutput termsOut;

Modified: lucene/dev/branches/lucene3069/lucene/codecs/src/java/org/apache/lucene/codecs/temp/TempTermOutputs.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3069/lucene/codecs/src/java/org/apache/lucene/codecs/temp/TempTermOutputs.java?rev=1519542&r1=1519541&r2=1519542&view=diff
==============================================================================
--- lucene/dev/branches/lucene3069/lucene/codecs/src/java/org/apache/lucene/codecs/temp/TempTermOutputs.java
(original)
+++ lucene/dev/branches/lucene3069/lucene/codecs/src/java/org/apache/lucene/codecs/temp/TempTermOutputs.java
Tue Sep  3 02:36:54 2013
@@ -187,8 +187,8 @@ public class TempTermOutputs extends Out
   }
 
   // TODO: if we refactor a 'addSelf(TempMetaDat other)',
-  // we can gain about 5~7% for fuzzy queries, however on the other hand
-  // we seem to put much stress on FST Outputs decoding?
+  // we can gain about 5~7% for fuzzy queries, however this also 
+  // means we are putting too much stress on FST Outputs decoding?
   @Override
   public TempMetaData add(TempMetaData t1, TempMetaData t2) {
     //if (TEST) System.out.print("add("+t1+", "+t2+") = ");

Modified: lucene/dev/branches/lucene3069/lucene/core/src/java/org/apache/lucene/codecs/BlockTreeTermsWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3069/lucene/core/src/java/org/apache/lucene/codecs/BlockTreeTermsWriter.java?rev=1519542&r1=1519541&r2=1519542&view=diff
==============================================================================
--- lucene/dev/branches/lucene3069/lucene/core/src/java/org/apache/lucene/codecs/BlockTreeTermsWriter.java
(original)
+++ lucene/dev/branches/lucene3069/lucene/core/src/java/org/apache/lucene/codecs/BlockTreeTermsWriter.java
Tue Sep  3 02:36:54 2013
@@ -209,7 +209,7 @@ public class BlockTreeTermsWriter extend
   public static final int TERMS_VERSION_META_ARRAY = 2;
 
   /** Current terms format. */
-  public static final int TERMS_VERSION_CURRENT = TERMS_VERSION_APPEND_ONLY;
+  public static final int TERMS_VERSION_CURRENT = TERMS_VERSION_META_ARRAY;
 
   /** Extension of terms index file */
   static final String TERMS_INDEX_EXTENSION = "tip";
@@ -225,7 +225,7 @@ public class BlockTreeTermsWriter extend
   public static final int TERMS_INDEX_VERSION_META_ARRAY = 2;
 
   /** Current index format. */
-  public static final int TERMS_INDEX_VERSION_CURRENT = TERMS_INDEX_VERSION_APPEND_ONLY;
+  public static final int TERMS_INDEX_VERSION_CURRENT = TERMS_INDEX_VERSION_META_ARRAY;
 
   private final IndexOutput out;
   private final IndexOutput indexOut;

Modified: lucene/dev/branches/lucene3069/lucene/core/src/java/org/apache/lucene/codecs/PostingsReaderBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3069/lucene/core/src/java/org/apache/lucene/codecs/PostingsReaderBase.java?rev=1519542&r1=1519541&r2=1519542&view=diff
==============================================================================
--- lucene/dev/branches/lucene3069/lucene/core/src/java/org/apache/lucene/codecs/PostingsReaderBase.java
(original)
+++ lucene/dev/branches/lucene3069/lucene/core/src/java/org/apache/lucene/codecs/PostingsReaderBase.java
Tue Sep  3 02:36:54 2013
@@ -55,7 +55,9 @@ public abstract class PostingsReaderBase
   /** Return a newly created empty TermState */
   public abstract BlockTermState newTermState() throws IOException;
 
-  /** Actually decode metadata for next term */
+  /** Actually decode metadata for next term 
+   *  @see PostingsWriterBase#encodeTerm 
+   */
   public abstract void decodeTerm(long[] longs, DataInput in, FieldInfo fieldInfo, BlockTermState
state, boolean absolute) throws IOException;
 
   /** Must fully consume state, since after this call that

Modified: lucene/dev/branches/lucene3069/lucene/core/src/java/org/apache/lucene/codecs/PostingsWriterBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3069/lucene/core/src/java/org/apache/lucene/codecs/PostingsWriterBase.java?rev=1519542&r1=1519541&r2=1519542&view=diff
==============================================================================
--- lucene/dev/branches/lucene3069/lucene/core/src/java/org/apache/lucene/codecs/PostingsWriterBase.java
(original)
+++ lucene/dev/branches/lucene3069/lucene/core/src/java/org/apache/lucene/codecs/PostingsWriterBase.java
Tue Sep  3 02:36:54 2013
@@ -65,13 +65,17 @@ public abstract class PostingsWriterBase
   public abstract void finishTerm(BlockTermState state) throws IOException;
 
   /**
-   * Encode metadata as long[] and byte[]. {@code absolute} controls 
-   * whether current term is delta encoded according to latest term.
+   * Encode metadata as long[] and byte[]. {@code absolute} controls whether 
+   * current term is delta encoded according to latest term. 
+   * Usually elements in {@code longs} are file pointers, so each one always 
+   * increases when a new term is consumed. {@code out} is used to write generic
+   * bytes, which are not monotonical.
    *
-   * NOTE: sometimes long[] might contain values that doesn't make sense,
-   * e.g. for Lucene41PostingsFormat, when singletonDocID != -1, docStartFP is not defined.
-   * Here postings side should always use the last docStartFP, to keep each element in 
-   * metadata long[] monotonic.
+   * NOTE: sometimes long[] might contain values that doesn't make sense, e.g. 
+   * the pointer to postings list may not be defined, if it is designed to inline 
+   * some postings data in term dictionary.  For this the postings side should 
+   * always use the last file pointer, so that each element in metadata long[] is 
+   * still monotonic.
    */
   public abstract void encodeTerm(long[] longs, DataOutput out, FieldInfo fieldInfo, BlockTermState
state, boolean absolute) throws IOException;
 

Modified: lucene/dev/branches/lucene3069/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41PostingsWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3069/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41PostingsWriter.java?rev=1519542&r1=1519541&r2=1519542&view=diff
==============================================================================
--- lucene/dev/branches/lucene3069/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41PostingsWriter.java
(original)
+++ lucene/dev/branches/lucene3069/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41PostingsWriter.java
Tue Sep  3 02:36:54 2013
@@ -67,8 +67,8 @@ public final class Lucene41PostingsWrite
   // Increment version to change it
   final static int VERSION_START = 0;
   final static int VERSION_META_ARRAY = 1;
-  final static int VERSION_CURRENT = VERSION_START;
-  //final static int VERSION_CURRENT = VERSION_META_ARRAY;
+  //final static int VERSION_CURRENT = VERSION_START;
+  final static int VERSION_CURRENT = VERSION_META_ARRAY;
 
   final IndexOutput docOut;
   final IndexOutput posOut;
@@ -519,7 +519,7 @@ public final class Lucene41PostingsWrite
       //   System.out.println("  no skip: docCount=" + docCount);
       // }
     }
-    if (state.totalTermFreq >= BLOCK_SIZE) {
+    if (VERSION_CURRENT >= VERSION_META_ARRAY || state.totalTermFreq >= BLOCK_SIZE)
{
       state.payTermStartFP = payTermStartFP;
     } else {
       state.payTermStartFP = -1;
@@ -552,11 +552,7 @@ public final class Lucene41PostingsWrite
     if (fieldHasPositions) {
       longs[1] = state.posTermStartFP - lastState.posTermStartFP;
       if (fieldHasPayloads || fieldHasOffsets) {
-        if (state.payTermStartFP == -1) {
-          longs[2] = 0;
-        } else {
-          longs[2] = state.payTermStartFP - lastState.payTermStartFP;
-        }
+        longs[2] = state.payTermStartFP - lastState.payTermStartFP;
       }
     }
     if (state.singletonDocID != -1) {



Mime
View raw message