lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r829334 - in /lucene/java/branches/flex_1458/src: java/org/apache/lucene/index/codecs/ java/org/apache/lucene/index/codecs/intblock/ java/org/apache/lucene/index/codecs/pulsing/ java/org/apache/lucene/index/codecs/sep/ java/org/apache/lucen...
Date Sat, 24 Oct 2009 09:50:45 GMT
Author: mikemccand
Date: Sat Oct 24 09:50:44 2009
New Revision: 829334

URL: http://svn.apache.org/viewvc?rev=829334&view=rev
Log:
LUCENE-1458: better separate StandarDocsConsumer/Producer from their generic counterparts

Added:
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardDocsConsumer.java
  (with props)
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardDocsProducer.java
      - copied, changed from r829330, lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/DocsProducer.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPositionsConsumer.java
  (with props)
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPositionsProducer.java
      - copied, changed from r829330, lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/PositionsProducer.java
Removed:
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/DocsProducer.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/PositionsProducer.java
Modified:
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/DocsConsumer.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/PositionsConsumer.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/intblock/IntBlockCodec.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/pulsing/PulsingCodec.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/pulsing/PulsingDocsReader.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/pulsing/PulsingDocsWriter.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepCodec.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepDocsReader.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepDocsWriter.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepPositionsReader.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardCodec.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardDocsReader.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardDocsWriter.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPositionsReader.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPositionsWriter.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardTermsDictReader.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardTermsDictWriter.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/TestExternalCodecs.java

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/DocsConsumer.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/DocsConsumer.java?rev=829334&r1=829333&r2=829334&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/DocsConsumer.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/DocsConsumer.java
Sat Oct 24 09:50:44 2009
@@ -39,19 +39,8 @@
   }
   */
 
-  public abstract void start(IndexOutput termsOut) throws IOException;
-
-  public abstract void startTerm() throws IOException;
-
   /** Adds a new doc in this term.  Return null if this
    *  consumer doesn't need to see the positions for this
    *  doc. */
   public abstract PositionsConsumer addDoc(int docID, int termDocFreq) throws IOException;
-
-  /** Finishes the current term */
-  public abstract void finishTerm(int numDocs, boolean isIndexTerm) throws IOException;
-
-  public abstract void setField(FieldInfo fieldInfo);
-
-  public abstract void close() throws IOException;
 }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/PositionsConsumer.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/PositionsConsumer.java?rev=829334&r1=829333&r2=829334&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/PositionsConsumer.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/PositionsConsumer.java
Sat Oct 24 09:50:44 2009
@@ -21,13 +21,8 @@
 
 import org.apache.lucene.store.IndexOutput;
 
-// nocommit -- split into generic vs standardtermsdict
 public abstract class PositionsConsumer {
 
-  public abstract void start(IndexOutput termsOut) throws IOException;
-
-  public abstract void startTerm() throws IOException;
-
   /** Add a new position & payload.  If payloadLength > 0
    *  you must read those bytes from the IndexInput.  NOTE:
    *  you must fully consume the byte[] payload, since
@@ -37,8 +32,4 @@
   /** Called when we are done adding positions & payloads
    * for each doc */
   public abstract void finishDoc() throws IOException;
-
-  public abstract void finishTerm(boolean isIndexTerm) throws IOException;
-  
-  public abstract void close() throws IOException;
 }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/intblock/IntBlockCodec.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/intblock/IntBlockCodec.java?rev=829334&r1=829333&r2=829334&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/intblock/IntBlockCodec.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/intblock/IntBlockCodec.java
Sat Oct 24 09:50:44 2009
@@ -25,7 +25,7 @@
 import org.apache.lucene.index.SegmentWriteState;
 import org.apache.lucene.index.codecs.Codec;
 import org.apache.lucene.index.codecs.DocsConsumer;
-import org.apache.lucene.index.codecs.DocsProducer;
+import org.apache.lucene.index.codecs.standard.StandardDocsProducer;
 import org.apache.lucene.index.codecs.FieldsConsumer;
 import org.apache.lucene.index.codecs.FieldsProducer;
 import org.apache.lucene.index.codecs.sep.SepCodec;
@@ -37,6 +37,7 @@
 import org.apache.lucene.index.codecs.standard.StandardTermsDictWriter;
 import org.apache.lucene.index.codecs.standard.StandardTermsIndexReader;
 import org.apache.lucene.index.codecs.standard.StandardTermsIndexWriter;
+import org.apache.lucene.index.codecs.standard.StandardDocsConsumer;
 import org.apache.lucene.store.Directory;
 
 public class IntBlockCodec extends Codec {
@@ -46,7 +47,7 @@
   }
 
   public FieldsConsumer fieldsConsumer(SegmentWriteState state) throws IOException {
-    DocsConsumer docsWriter = new SepDocsWriter(state, new SimpleIntBlockFactory(1024));
+    StandardDocsConsumer docsWriter = new SepDocsWriter(state, new SimpleIntBlockFactory(1024));
 
     boolean success = false;
     StandardTermsIndexWriter indexWriter;
@@ -84,7 +85,7 @@
   */
 
   public FieldsProducer fieldsProducer(Directory dir, FieldInfos fieldInfos, SegmentInfo
si, int readBufferSize, int indexDivisor) throws IOException {
-    DocsProducer docsReader = new SepDocsReader(dir, si, readBufferSize, new SimpleIntBlockFactory(1024));
+    StandardDocsProducer docsReader = new SepDocsReader(dir, si, readBufferSize, new SimpleIntBlockFactory(1024));
 
     StandardTermsIndexReader indexReader;
     boolean success = false;

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/pulsing/PulsingCodec.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/pulsing/PulsingCodec.java?rev=829334&r1=829333&r2=829334&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/pulsing/PulsingCodec.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/pulsing/PulsingCodec.java
Sat Oct 24 09:50:44 2009
@@ -25,7 +25,8 @@
 import org.apache.lucene.index.SegmentWriteState;
 import org.apache.lucene.index.codecs.Codec;
 import org.apache.lucene.index.codecs.DocsConsumer;
-import org.apache.lucene.index.codecs.DocsProducer;
+import org.apache.lucene.index.codecs.standard.StandardDocsConsumer;
+import org.apache.lucene.index.codecs.standard.StandardDocsProducer;
 import org.apache.lucene.index.codecs.FieldsConsumer;
 import org.apache.lucene.index.codecs.FieldsProducer;
 import org.apache.lucene.index.codecs.standard.SimpleStandardTermsIndexReader;
@@ -33,6 +34,7 @@
 import org.apache.lucene.index.codecs.standard.StandardCodec;
 import org.apache.lucene.index.codecs.standard.StandardDocsReader;
 import org.apache.lucene.index.codecs.standard.StandardDocsWriter;
+import org.apache.lucene.index.codecs.standard.StandardDocsConsumer;
 import org.apache.lucene.index.codecs.standard.StandardTermsDictReader;
 import org.apache.lucene.index.codecs.standard.StandardTermsDictWriter;
 import org.apache.lucene.index.codecs.standard.StandardTermsIndexReader;
@@ -55,12 +57,12 @@
   public FieldsConsumer fieldsConsumer(SegmentWriteState state) throws IOException {
     // We wrap StandardDocsWriter, but any DocsConsumer
     // will work:
-    DocsConsumer docsWriter = new StandardDocsWriter(state);
+    StandardDocsConsumer docsWriter = new StandardDocsWriter(state);
 
     // Terms that have <= freqCutoff number of docs are
     // "pulsed" (inlined):
     final int freqCutoff = 1;
-    DocsConsumer pulsingWriter = new PulsingDocsWriter(state, freqCutoff, docsWriter);
+    StandardDocsConsumer pulsingWriter = new PulsingDocsWriter(state, freqCutoff, docsWriter);
 
     // Terms dict index
     StandardTermsIndexWriter indexWriter;
@@ -95,8 +97,8 @@
 
     // We wrap StandardDocsReader, but any DocsProducer
     // will work:
-    DocsProducer docs = new StandardDocsReader(dir, si, readBufferSize);
-    DocsProducer docsReader = new PulsingDocsReader(dir, si, readBufferSize, docs);
+    StandardDocsProducer docs = new StandardDocsReader(dir, si, readBufferSize);
+    StandardDocsProducer docsReader = new PulsingDocsReader(dir, si, readBufferSize, docs);
 
     // Terms dict index reader
     StandardTermsIndexReader indexReader;

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/pulsing/PulsingDocsReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/pulsing/PulsingDocsReader.java?rev=829334&r1=829333&r2=829334&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/pulsing/PulsingDocsReader.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/pulsing/PulsingDocsReader.java
Sat Oct 24 09:50:44 2009
@@ -24,7 +24,7 @@
 import org.apache.lucene.index.PositionsEnum;
 import org.apache.lucene.index.SegmentInfo;
 import org.apache.lucene.index.codecs.Codec;
-import org.apache.lucene.index.codecs.DocsProducer;
+import org.apache.lucene.index.codecs.standard.StandardDocsProducer;
 import org.apache.lucene.index.codecs.pulsing.PulsingDocsWriter.Document;
 import org.apache.lucene.index.codecs.standard.StandardTermsDictReader.CacheEntry;
 import org.apache.lucene.store.Directory;
@@ -39,14 +39,14 @@
 // create two separate docs readers, one that also reads
 // prox and one that doesn't?
 
-class PulsingDocsReader extends DocsProducer {
+class PulsingDocsReader extends StandardDocsProducer {
 
   // Fallback reader for non-pulsed terms:
-  final DocsProducer wrappedDocsReader;
+  final StandardDocsProducer wrappedDocsReader;
   IndexInput termsIn;
   int maxPulsingDocFreq;
 
-  PulsingDocsReader(Directory dir, SegmentInfo segmentInfo, int readBufferSize, DocsProducer
wrappedDocsReader) throws IOException {
+  PulsingDocsReader(Directory dir, SegmentInfo segmentInfo, int readBufferSize, StandardDocsProducer
wrappedDocsReader) throws IOException {
     this.wrappedDocsReader = wrappedDocsReader;
   }
 

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/pulsing/PulsingDocsWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/pulsing/PulsingDocsWriter.java?rev=829334&r1=829333&r2=829334&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/pulsing/PulsingDocsWriter.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/pulsing/PulsingDocsWriter.java
Sat Oct 24 09:50:44 2009
@@ -24,6 +24,8 @@
 
 import org.apache.lucene.index.codecs.DocsConsumer;
 import org.apache.lucene.index.codecs.PositionsConsumer;
+import org.apache.lucene.index.codecs.standard.StandardDocsConsumer;
+import org.apache.lucene.index.codecs.standard.StandardPositionsConsumer;
 import org.apache.lucene.index.FieldInfo;
 import org.apache.lucene.index.SegmentWriteState;
 import org.apache.lucene.index.codecs.Codec;
@@ -35,7 +37,7 @@
 // presumably rare in practice...
 
 //nocommit: public 
-public final class PulsingDocsWriter extends DocsConsumer {
+public final class PulsingDocsWriter extends StandardDocsConsumer {
 
   final static String CODEC = "PulsedPostings";
 
@@ -114,11 +116,11 @@
   // nocommit -- lazy init this?  ie, if every single term
   // was pulsed then we never need to use this fallback?
   // Fallback writer for non-pulsed terms:
-  final DocsConsumer wrappedDocsWriter;
+  final StandardDocsConsumer wrappedDocsWriter;
 
   /** If docFreq <= maxPulsingDocFreq, its postings are
    *  inlined into terms dict */
-  PulsingDocsWriter(SegmentWriteState state, int maxPulsingDocFreq, DocsConsumer wrappedDocsWriter)
throws IOException {
+  PulsingDocsWriter(SegmentWriteState state, int maxPulsingDocFreq, StandardDocsConsumer
wrappedDocsWriter) throws IOException {
     super();
 
     pendingDocs = new Document[maxPulsingDocFreq];
@@ -156,7 +158,7 @@
   }
 
   /** Simply buffers up positions */
-  class PositionsWriter extends PositionsConsumer {
+  class PositionsWriter extends StandardPositionsConsumer {
     public void start(IndexOutput termsOut) {}
     public void startTerm() {}
     public void addPosition(int position, byte[] payload, int payloadOffset, int payloadLength)
{

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepCodec.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepCodec.java?rev=829334&r1=829333&r2=829334&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepCodec.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepCodec.java
Sat Oct 24 09:50:44 2009
@@ -25,7 +25,8 @@
 import org.apache.lucene.index.SegmentWriteState;
 import org.apache.lucene.index.codecs.Codec;
 import org.apache.lucene.index.codecs.DocsConsumer;
-import org.apache.lucene.index.codecs.DocsProducer;
+import org.apache.lucene.index.codecs.standard.StandardDocsConsumer;
+import org.apache.lucene.index.codecs.standard.StandardDocsProducer;
 import org.apache.lucene.index.codecs.FieldsConsumer;
 import org.apache.lucene.index.codecs.FieldsProducer;
 import org.apache.lucene.index.codecs.standard.SimpleStandardTermsIndexReader;
@@ -44,7 +45,7 @@
 
   public FieldsConsumer fieldsConsumer(SegmentWriteState state) throws IOException {
 
-    DocsConsumer docsWriter = new SepDocsWriter(state, new SingleIntFactory());
+    StandardDocsConsumer docsWriter = new SepDocsWriter(state, new SingleIntFactory());
 
     boolean success = false;
     StandardTermsIndexWriter indexWriter;
@@ -81,7 +82,7 @@
 
   public FieldsProducer fieldsProducer(Directory dir, FieldInfos fieldInfos, SegmentInfo
si, int readBufferSize, int indexDivisor) throws IOException {
 
-    DocsProducer docsReader = new SepDocsReader(dir, si, readBufferSize, new SingleIntFactory());
+    StandardDocsProducer docsReader = new SepDocsReader(dir, si, readBufferSize, new SingleIntFactory());
 
     StandardTermsIndexReader indexReader;
     boolean success = false;

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepDocsReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepDocsReader.java?rev=829334&r1=829333&r2=829334&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepDocsReader.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepDocsReader.java
Sat Oct 24 09:50:44 2009
@@ -26,15 +26,13 @@
 import org.apache.lucene.index.PositionsEnum;
 import org.apache.lucene.index.SegmentInfo;
 import org.apache.lucene.index.codecs.Codec;
-import org.apache.lucene.index.codecs.DocsProducer;
+import org.apache.lucene.index.codecs.standard.StandardDocsProducer;
 import org.apache.lucene.index.codecs.sep.IntIndexInput.IndexState;
 import org.apache.lucene.index.codecs.standard.StandardTermsDictReader.CacheEntry;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.IndexInput;
 import org.apache.lucene.util.Bits;
 
-import sun.security.util.PendingException;
-
 /** Concrete class that reads the current doc/freq/skip
  *  postings format */
 
@@ -42,7 +40,7 @@
 // create two separate docs readers, one that also reads
 // prox and one that doesn't?
 
-public class SepDocsReader extends DocsProducer {
+public class SepDocsReader extends StandardDocsProducer {
 
   final IntIndexInput freqIn;
   final IntIndexInput docIn;
@@ -545,7 +543,7 @@
 
     // nocommit: rought start
     @Override
-    public CacheEntry captureState(CacheEntry reusableState) throws IOException {
+      public CacheEntry captureState(CacheEntry reusableState) throws IOException {
       TermDictsReaderState state;
       if (reusableState == null) {
         state = new TermDictsReaderState();

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepDocsWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepDocsWriter.java?rev=829334&r1=829333&r2=829334&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepDocsWriter.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepDocsWriter.java
Sat Oct 24 09:50:44 2009
@@ -21,7 +21,9 @@
 
 import org.apache.lucene.store.IndexOutput;
 import org.apache.lucene.index.codecs.DocsConsumer;
+import org.apache.lucene.index.codecs.standard.StandardDocsConsumer;
 import org.apache.lucene.index.codecs.PositionsConsumer;
+import org.apache.lucene.index.codecs.standard.StandardPositionsConsumer;
 import org.apache.lucene.index.FieldInfo;
 import org.apache.lucene.index.SegmentWriteState;
 import org.apache.lucene.index.IndexFileNames;
@@ -31,7 +33,7 @@
 /** Writes frq to .frq, docs to .doc, pos to .pos, payloads
  *  to .pyl, skip data to .skp */
 
-public final class SepDocsWriter extends DocsConsumer {
+public final class SepDocsWriter extends StandardDocsConsumer {
   final static String CODEC = "SepDocFreqSkip";
 
   // Increment version to change it:

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepPositionsReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepPositionsReader.java?rev=829334&r1=829333&r2=829334&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepPositionsReader.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepPositionsReader.java
Sat Oct 24 09:50:44 2009
@@ -25,11 +25,11 @@
 import org.apache.lucene.index.PositionsEnum;
 import org.apache.lucene.index.SegmentInfo;
 import org.apache.lucene.index.codecs.Codec;
-import org.apache.lucene.index.codecs.PositionsProducer;
+import org.apache.lucene.index.codecs.standard.StandardPositionsProducer;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.IndexInput;
 
-public class SepPositionsReader extends PositionsProducer {
+public class SepPositionsReader extends StandardPositionsProducer {
   
   final IntIndexInput posIn;
 

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardCodec.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardCodec.java?rev=829334&r1=829333&r2=829334&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardCodec.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardCodec.java
Sat Oct 24 09:50:44 2009
@@ -37,7 +37,7 @@
   }
 
   public FieldsConsumer fieldsConsumer(SegmentWriteState state) throws IOException {
-    DocsConsumer docs = new StandardDocsWriter(state);
+    StandardDocsConsumer docs = new StandardDocsWriter(state);
 
     StandardTermsIndexWriter indexWriter;
     boolean success = false;

Added: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardDocsConsumer.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardDocsConsumer.java?rev=829334&view=auto
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardDocsConsumer.java
(added)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardDocsConsumer.java
Sat Oct 24 09:50:44 2009
@@ -0,0 +1,42 @@
+package org.apache.lucene.index.codecs.standard;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.IOException;
+
+import org.apache.lucene.store.IndexOutput;
+import org.apache.lucene.index.FieldInfo;
+import org.apache.lucene.index.codecs.DocsConsumer;
+
+/**
+ * NOTE: this API is experimental and will likely change
+ */
+
+public abstract class StandardDocsConsumer extends DocsConsumer {
+
+  public abstract void start(IndexOutput termsOut) throws IOException;
+
+  public abstract void startTerm() throws IOException;
+
+  /** Finishes the current term */
+  public abstract void finishTerm(int numDocs, boolean isIndexTerm) throws IOException;
+
+  public abstract void setField(FieldInfo fieldInfo);
+
+  public abstract void close() throws IOException;
+}

Propchange: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardDocsConsumer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardDocsProducer.java
(from r829330, lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/DocsProducer.java)
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardDocsProducer.java?p2=lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardDocsProducer.java&p1=lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/DocsProducer.java&r1=829330&r2=829334&rev=829334&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/DocsProducer.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardDocsProducer.java
Sat Oct 24 09:50:44 2009
@@ -1,4 +1,4 @@
-package org.apache.lucene.index.codecs;
+package org.apache.lucene.index.codecs.standard;
 
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -27,18 +27,13 @@
 // nocommit -- circular, not clean
 import org.apache.lucene.index.codecs.standard.StandardTermsDictReader.CacheEntry;
 
-
-// nocommit -- this is tied to StandarTermsDictWriter;
-// shouldn't it be named StandardDocsProducer?  hmm, though,
-// it's API is fairly generic in that any other terms dict
-// codec could re-use it
-
 /** StandardTermsDictReader interacts with a single instance
  *  of this to manage creation of multiple docs enum
  *  instances.  It provides an IndexInput (termsIn) where
  *  this class may read any previously stored data that it
- *  had written in its corresponding DocsConsumer. */
-public abstract class DocsProducer {
+ *  had written in its corresponding StandarDocsConsumer at
+ *  indexing time. */
+public abstract class StandardDocsProducer {
   
   public abstract class Reader {
     

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardDocsReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardDocsReader.java?rev=829334&r1=829333&r2=829334&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardDocsReader.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardDocsReader.java
Sat Oct 24 09:50:44 2009
@@ -29,7 +29,6 @@
 import org.apache.lucene.index.IndexFileNames;
 import org.apache.lucene.store.IndexInput;
 import org.apache.lucene.util.Bits;
-import org.apache.lucene.index.codecs.DocsProducer;
 import org.apache.lucene.index.codecs.standard.StandardTermsDictReader.CacheEntry;
 
 /** Concrete class that reads the current doc/freq/skip
@@ -39,7 +38,7 @@
 // create two separate docs readers, one that also reads
 // prox and one that doesn't?
 
-public class StandardDocsReader extends DocsProducer {
+public class StandardDocsReader extends StandardDocsProducer {
 
   final IndexInput freqIn;
   IndexInput termsIn;

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardDocsWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardDocsWriter.java?rev=829334&r1=829333&r2=829334&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardDocsWriter.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardDocsWriter.java
Sat Oct 24 09:50:44 2009
@@ -23,7 +23,6 @@
 import java.io.IOException;
 
 import org.apache.lucene.store.IndexOutput;
-import org.apache.lucene.index.codecs.DocsConsumer;
 import org.apache.lucene.index.codecs.PositionsConsumer;
 import org.apache.lucene.index.FieldInfo;
 import org.apache.lucene.index.SegmentWriteState;
@@ -31,7 +30,7 @@
 import org.apache.lucene.index.CorruptIndexException;
 import org.apache.lucene.index.codecs.Codec;
 
-public final class StandardDocsWriter extends DocsConsumer {
+public final class StandardDocsWriter extends StandardDocsConsumer {
   final static String CODEC = "SingleFileDocFreqSkip";
   
   // Increment version to change it:

Added: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPositionsConsumer.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPositionsConsumer.java?rev=829334&view=auto
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPositionsConsumer.java
(added)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPositionsConsumer.java
Sat Oct 24 09:50:44 2009
@@ -0,0 +1,34 @@
+package org.apache.lucene.index.codecs.standard;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.IOException;
+
+import org.apache.lucene.store.IndexOutput;
+import org.apache.lucene.index.codecs.PositionsConsumer;
+
+public abstract class StandardPositionsConsumer extends PositionsConsumer{
+
+  public abstract void start(IndexOutput termsOut) throws IOException;
+
+  public abstract void startTerm() throws IOException;
+
+  public abstract void finishTerm(boolean isIndexTerm) throws IOException;
+  
+  public abstract void close() throws IOException;
+}

Propchange: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPositionsConsumer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPositionsProducer.java
(from r829330, lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/PositionsProducer.java)
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPositionsProducer.java?p2=lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPositionsProducer.java&p1=lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/PositionsProducer.java&r1=829330&r2=829334&rev=829334&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/PositionsProducer.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPositionsProducer.java
Sat Oct 24 09:50:44 2009
@@ -1,4 +1,4 @@
-package org.apache.lucene.index.codecs;
+package org.apache.lucene.index.codecs.standard;
 
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -23,7 +23,7 @@
 import org.apache.lucene.index.FieldInfo;
 import org.apache.lucene.index.PositionsEnum;
 
-public abstract class PositionsProducer {
+public abstract class StandardPositionsProducer {
 
   public abstract class Reader {
     public abstract void readTerm(int docFreq, boolean isIndexTerm) throws IOException;

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPositionsReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPositionsReader.java?rev=829334&r1=829333&r2=829334&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPositionsReader.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPositionsReader.java
Sat Oct 24 09:50:44 2009
@@ -25,13 +25,13 @@
 import org.apache.lucene.index.PositionsEnum;
 import org.apache.lucene.index.SegmentInfo;
 import org.apache.lucene.index.codecs.Codec;
-import org.apache.lucene.index.codecs.PositionsProducer;
+import org.apache.lucene.index.codecs.standard.StandardPositionsProducer;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.IndexInput;
 
 // nocommit -- base class should not be named terms dict:
 // this class interacts w/ a docsreader
-public class StandardPositionsReader extends PositionsProducer {
+public class StandardPositionsReader extends StandardPositionsProducer {
   
   final IndexInput proxIn;
   IndexInput termsIn;

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPositionsWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPositionsWriter.java?rev=829334&r1=829333&r2=829334&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPositionsWriter.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPositionsWriter.java
Sat Oct 24 09:50:44 2009
@@ -23,10 +23,9 @@
 import org.apache.lucene.index.IndexFileNames;
 import org.apache.lucene.index.SegmentWriteState;
 import org.apache.lucene.index.codecs.Codec;
-import org.apache.lucene.index.codecs.PositionsConsumer;
 import org.apache.lucene.store.IndexOutput;
 
-final class StandardPositionsWriter extends PositionsConsumer {
+final class StandardPositionsWriter extends StandardPositionsConsumer {
   final static String CODEC = "SingleFilePositionsPayloads";
 
   // Increment version to change it:

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardTermsDictReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardTermsDictReader.java?rev=829334&r1=829333&r2=829334&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardTermsDictReader.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardTermsDictReader.java
Sat Oct 24 09:50:44 2009
@@ -34,7 +34,6 @@
 import org.apache.lucene.index.Terms;
 import org.apache.lucene.index.TermsEnum;
 import org.apache.lucene.index.codecs.Codec;
-import org.apache.lucene.index.codecs.DocsProducer;
 import org.apache.lucene.index.codecs.FieldsProducer;
 import org.apache.lucene.index.codecs.pulsing.PulsingDocsWriter.Document;
 import org.apache.lucene.store.Directory;
@@ -51,7 +50,7 @@
 public class StandardTermsDictReader extends FieldsProducer {
   private final IndexInput in;
 
-  private final DocsProducer docs;
+  private final StandardDocsProducer docs;
 
   final TreeMap<String,FieldReader> fields = new TreeMap<String,FieldReader>();
 
@@ -59,7 +58,7 @@
   private StandardTermsIndexReader indexReader;
 
 
-  public StandardTermsDictReader(StandardTermsIndexReader indexReader, Directory dir, FieldInfos
fieldInfos, String segment, DocsProducer docs, int readBufferSize)
+  public StandardTermsDictReader(StandardTermsIndexReader indexReader, Directory dir, FieldInfos
fieldInfos, String segment, StandardDocsProducer docs, int readBufferSize)
     throws IOException {
 
     in = dir.openInput(IndexFileNames.segmentFileName(segment, StandardCodec.TERMS_EXTENSION),
readBufferSize);
@@ -239,7 +238,7 @@
       private final DeltaBytesReader bytesReader;
       // nocommit: long?
       private int termUpto;
-      private final DocsProducer.Reader docs;
+      private final StandardDocsProducer.Reader docs;
       private int docFreq;
       private final StandardTermsIndexReader.TermsIndexResult indexResult = new StandardTermsIndexReader.TermsIndexResult();
       

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardTermsDictWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardTermsDictWriter.java?rev=829334&r1=829333&r2=829334&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardTermsDictWriter.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardTermsDictWriter.java
Sat Oct 24 09:50:44 2009
@@ -27,8 +27,8 @@
 import org.apache.lucene.index.SegmentWriteState;
 import org.apache.lucene.index.TermRef;
 import org.apache.lucene.index.codecs.Codec;
-import org.apache.lucene.index.codecs.DocsConsumer;
 import org.apache.lucene.index.codecs.FieldsConsumer;
+import org.apache.lucene.index.codecs.DocsConsumer;
 import org.apache.lucene.index.codecs.TermsConsumer;
 import org.apache.lucene.store.IndexOutput;
 import org.apache.lucene.util.UnicodeUtil;
@@ -55,7 +55,7 @@
   private final DeltaBytesWriter termWriter;
 
   final IndexOutput out;
-  final DocsConsumer consumer;
+  final StandardDocsConsumer consumer;
   final FieldInfos fieldInfos;
   FieldInfo currentField;
   private final StandardTermsIndexWriter indexWriter;
@@ -64,7 +64,7 @@
   // nocommit
   private String segment;
 
-  public StandardTermsDictWriter(StandardTermsIndexWriter indexWriter, SegmentWriteState
state, DocsConsumer consumer) throws IOException {
+  public StandardTermsDictWriter(StandardTermsIndexWriter indexWriter, SegmentWriteState
state, StandardDocsConsumer consumer) throws IOException {
     final String termsFileName = IndexFileNames.segmentFileName(state.segmentName, StandardCodec.TERMS_EXTENSION);
     this.indexWriter = indexWriter;
     out = state.directory.createOutput(termsFileName);
@@ -146,12 +146,12 @@
 
   class TermsWriter extends TermsConsumer {
     final FieldInfo fieldInfo;
-    final DocsConsumer consumer;
+    final StandardDocsConsumer consumer;
     final long termsStartPointer;
     int numTerms;
     final StandardTermsIndexWriter.FieldWriter fieldIndexWriter;
 
-    TermsWriter(StandardTermsIndexWriter.FieldWriter fieldIndexWriter, FieldInfo fieldInfo,
DocsConsumer consumer) {
+    TermsWriter(StandardTermsIndexWriter.FieldWriter fieldIndexWriter, FieldInfo fieldInfo,
StandardDocsConsumer consumer) {
       this.fieldInfo = fieldInfo;
       this.consumer = consumer;
       this.fieldIndexWriter = fieldIndexWriter;

Modified: lucene/java/branches/flex_1458/src/test/org/apache/lucene/TestExternalCodecs.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/test/org/apache/lucene/TestExternalCodecs.java?rev=829334&r1=829333&r2=829334&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/test/org/apache/lucene/TestExternalCodecs.java (original)
+++ lucene/java/branches/flex_1458/src/test/org/apache/lucene/TestExternalCodecs.java Sat
Oct 24 09:50:44 2009
@@ -153,22 +153,12 @@
       public void reset(RAMTerm term) {
         this.term = term;
       }
-      public void start(IndexOutput termsOut) {
-      }
-      public void startTerm() {
-      }
       public PositionsConsumer addDoc(int docID, int freq) {
         current = new RAMDoc(docID, freq);
         term.docs.add(current);
         positions.reset(current);
         return positions;
       }
-      public void finishTerm(int numDocs, boolean isIndexTerm) {
-      }
-      public void setField(FieldInfo fieldInfo) {
-      }
-      public void close() {
-      }
     }
 
     public static class RAMPositionsConsumer extends PositionsConsumer {
@@ -179,12 +169,6 @@
         upto = 0;
       }
 
-      public void start(IndexOutput termsOut) {
-      }
-
-      public void startTerm() {
-      }
-
       public void addPosition(int position, byte[] payload, int payloadOffset, int payloadLength)
{
         if (payload != null) {
           throw new UnsupportedOperationException("can't handle payloads");
@@ -195,12 +179,6 @@
       public void finishDoc() {
         assert upto == current.positions.length;
       }
-
-      public void finishTerm(boolean isIndexTerm) {
-      }
-  
-      public void close() {
-      }
     }
 
 



Mime
View raw message