You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2011/05/10 16:35:57 UTC

svn commit: r1101478 - in /lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene: index/DocTermOrds.java index/IndexReader.java index/TermsEnum.java search/FuzzyTermsEnum.java search/cache/DocTermsIndexCreator.java

Author: rmuir
Date: Tue May 10 14:35:56 2011
New Revision: 1101478

URL: http://svn.apache.org/viewvc?rev=1101478&view=rev
Log:
make TE.bulkPostingsEnum() abstract, add boilerplate javadoc

Modified:
    lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/DocTermOrds.java
    lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/IndexReader.java
    lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/TermsEnum.java
    lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/FuzzyTermsEnum.java
    lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/cache/DocTermsIndexCreator.java

Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/DocTermOrds.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/DocTermOrds.java?rev=1101478&r1=1101477&r2=1101478&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/DocTermOrds.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/DocTermOrds.java Tue May 10 14:35:56 2011
@@ -673,6 +673,12 @@ public class DocTermOrds {
     }
 
     @Override
+    public BulkPostingsEnum bulkPostings(BulkPostingsEnum reuse,
+        boolean doFreqs, boolean doPositions) throws IOException {
+      return termsEnum.bulkPostings(reuse, doFreqs, doPositions);
+    }
+
+    @Override
     public BytesRef term() {
       return term;
     }

Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/IndexReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/IndexReader.java?rev=1101478&r1=1101477&r2=1101478&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/IndexReader.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/IndexReader.java Tue May 10 14:35:56 2011
@@ -1129,7 +1129,10 @@ public abstract class IndexReader implem
     }
   }
 
-  // nocommit jdocs
+  /** Get {@link BulkPostingsEnum} for the specified field
+   *  & term. This may return null, if either the field or
+   *  term does not exist.
+   */
   public BulkPostingsEnum bulkTermPostingsEnum(String field, BytesRef term, boolean doFreqs, boolean doPositions) throws IOException {
     assert field != null;
     assert term != null;
@@ -1145,6 +1148,11 @@ public abstract class IndexReader implem
     }
   }
   
+  /** Get {@link BulkPostingsEnum} for the specified field
+   *  & term. This may return null, if either the field or
+   *  term does not exist or the {@link TermState} is invalid
+   *  for the underlying implementation.
+   */
   public BulkPostingsEnum bulkTermPostingsEnum(String field, BytesRef term, TermState termState, boolean doFreqs, boolean doPositions) throws IOException {
     assert field != null;
     assert term != null;

Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/TermsEnum.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/TermsEnum.java?rev=1101478&r1=1101477&r2=1101478&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/TermsEnum.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/TermsEnum.java Tue May 10 14:35:56 2011
@@ -144,10 +144,12 @@ public abstract class TermsEnum {
    * @param reuse pass a prior DocsEnum for possible reuse */
   public abstract DocsEnum docs(Bits skipDocs, DocsEnum reuse) throws IOException;
 
-  // nocommit -- make abstract
-  public BulkPostingsEnum bulkPostings(BulkPostingsEnum reuse, boolean doFreqs, boolean doPositions) throws IOException {
-    throw new UnsupportedOperationException();
-  }
+  /** Get {@link BulkPostingsEnum} for the current term. Do not
+   *  call this before calling {@link #next} or {@link
+   *  #seek} for the first time. This method will not
+   *  return null.
+   */
+  public abstract BulkPostingsEnum bulkPostings(BulkPostingsEnum reuse, boolean doFreqs, boolean doPositions) throws IOException;
 
   /** Get {@link DocsAndPositionsEnum} for the current term.
    *  Do not call this before calling {@link #next} or
@@ -232,6 +234,11 @@ public abstract class TermsEnum {
     }
       
     @Override
+    public BulkPostingsEnum bulkPostings(BulkPostingsEnum reuse, boolean doFreqs, boolean doPositions) throws IOException {
+      throw new IllegalStateException("this method should never be called");
+    }
+
+    @Override
     public BytesRef next() {
       return null;
     }

Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/FuzzyTermsEnum.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/FuzzyTermsEnum.java?rev=1101478&r1=1101477&r2=1101478&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/FuzzyTermsEnum.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/FuzzyTermsEnum.java Tue May 10 14:35:56 2011
@@ -17,6 +17,7 @@ package org.apache.lucene.search;
  * limitations under the License.
  */
 
+import org.apache.lucene.index.BulkPostingsEnum;
 import org.apache.lucene.index.DocsAndPositionsEnum;
 import org.apache.lucene.index.DocsEnum;
 import org.apache.lucene.index.Term;
@@ -263,6 +264,12 @@ public final class FuzzyTermsEnum extend
   }
   
   @Override
+  public BulkPostingsEnum bulkPostings(BulkPostingsEnum reuse, boolean doFreqs,
+      boolean doPositions) throws IOException {
+    return actualEnum.bulkPostings(reuse, doFreqs, doPositions);
+  }
+
+  @Override
   public void seek(BytesRef term, TermState state) throws IOException {
     actualEnum.seek(term, state);
   }

Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/cache/DocTermsIndexCreator.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/cache/DocTermsIndexCreator.java?rev=1101478&r1=1101477&r2=1101478&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/cache/DocTermsIndexCreator.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/cache/DocTermsIndexCreator.java Tue May 10 14:35:56 2011
@@ -20,6 +20,7 @@ package org.apache.lucene.search.cache;
 import java.io.IOException;
 import java.util.Comparator;
 
+import org.apache.lucene.index.BulkPostingsEnum;
 import org.apache.lucene.index.DocsAndPositionsEnum;
 import org.apache.lucene.index.DocsEnum;
 import org.apache.lucene.index.IndexReader;
@@ -336,6 +337,11 @@ public class DocTermsIndexCreator extend
       }
 
       @Override
+      public BulkPostingsEnum bulkPostings(BulkPostingsEnum reuse, boolean doFreqs, boolean doPositions) throws IOException {
+        throw new UnsupportedOperationException();
+      }
+
+      @Override
       public Comparator<BytesRef> getComparator() throws IOException {
         return BytesRef.getUTF8SortedAsUnicodeComparator();
       }