lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r927241 [1/2] - in /lucene/java/branches/flex_1458/src: java/org/apache/lucene/index/ java/org/apache/lucene/index/codecs/ java/org/apache/lucene/index/codecs/intblock/ java/org/apache/lucene/index/codecs/preflex/ java/org/apache/lucene/ind...
Date Thu, 25 Mar 2010 00:35:29 GMT
Author: mikemccand
Date: Thu Mar 25 00:35:28 2010
New Revision: 927241

URL: http://svn.apache.org/viewvc?rev=927241&view=rev
Log:
LUCENE-2111: remove all debugging prints

Modified:
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocsEnum.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocumentsWriter.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/FieldInfos.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentInfo.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentReader.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermsHashPerField.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/Codec.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/PostingsConsumer.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/intblock/FixedIntBlockIndexInput.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/intblock/FixedIntBlockIndexOutput.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/preflex/PreFlexFields.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/pulsing/PulsingPostingsReaderImpl.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/pulsing/PulsingPostingsWriterImpl.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/IntIndexInput.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/IntIndexOutput.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepPostingsReaderImpl.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepPostingsWriterImpl.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepSkipListReader.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepSkipListWriter.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SingleIntIndexInput.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SingleIntIndexOutput.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/DefaultSkipListWriter.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/DeltaBytesReader.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/DeltaBytesWriter.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/SimpleStandardTermsIndexReader.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/SimpleStandardTermsIndexWriter.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPostingsReaderImpl.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPostingsWriterImpl.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/index/TestCodecs.java

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocsEnum.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocsEnum.java?rev=927241&r1=927240&r2=927241&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocsEnum.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocsEnum.java Thu Mar 25 00:35:28 2010
@@ -31,9 +31,6 @@ public abstract class DocsEnum extends D
 
   private AttributeSource atts = null;
 
-  // nocommit -- debugging
-  public String desc;
-
   /** Returns term frequency in the current document.  Do
    *  not call this before {@link #next} is first called,
    *  nor after {@link #next} returns NO_MORE_DOCS. */

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocumentsWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocumentsWriter.java?rev=927241&r1=927240&r2=927241&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocumentsWriter.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocumentsWriter.java Thu Mar 25 00:35:28 2010
@@ -671,9 +671,6 @@ final class DocumentsWriter {
     CompoundFileWriter cfsWriter = new CompoundFileWriter(directory, 
         IndexFileNames.segmentFileName(segment, IndexFileNames.COMPOUND_FILE_EXTENSION));
     for(String fileName : flushState.flushedFiles) {
-      if (Codec.DEBUG) {
-        System.out.println("make cfs " + fileName);
-      }
       cfsWriter.addFile(fileName);
     }
       

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/FieldInfos.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/FieldInfos.java?rev=927241&r1=927240&r2=927241&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/FieldInfos.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/FieldInfos.java Thu Mar 25 00:35:28 2010
@@ -126,13 +126,9 @@ public final class FieldInfos {
     for(int i=0;i<numFields;i++) {
       final FieldInfo fi = fieldInfo(i);
       if (fi.isIndexed && !fi.omitTermFreqAndPositions) {
-        // mxx
-        //        System.out.println(Thread.currentThread().getName() + ": fieldInfos: hasProx=true");
         return true;
       }
     }
-    // mxx
-    //System.out.println(Thread.currentThread().getName() + ": fieldInfos: hasProx=false");
     return false;
   }
   

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentInfo.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentInfo.java?rev=927241&r1=927240&r2=927241&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentInfo.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentInfo.java Thu Mar 25 00:35:28 2010
@@ -566,8 +566,6 @@ public final class SegmentInfo {
     output.writeByte(isCompoundFile);
     output.writeInt(delCount);
     output.writeByte((byte) (hasProx ? 1:0));
-    // mxx
-    //System.out.println(Thread.currentThread().getName() + ": si.write hasProx=" + hasProx + " seg=" + name);
     output.writeString(codec.name);
     output.writeStringStringMap(diagnostics);
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentReader.java?rev=927241&r1=927240&r2=927241&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentReader.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentReader.java Thu Mar 25 00:35:28 2010
@@ -41,7 +41,6 @@ import org.apache.lucene.util.Bits;
 import org.apache.lucene.util.CloseableThreadLocal;
 import org.apache.lucene.util.UnicodeUtil;
 import org.apache.lucene.index.codecs.CodecProvider;
-import org.apache.lucene.index.codecs.Codec;
 import org.apache.lucene.index.codecs.preflex.PreFlexFields;
 import org.apache.lucene.index.codecs.preflex.SegmentTermDocs;
 import org.apache.lucene.index.codecs.preflex.SegmentTermPositions;
@@ -116,9 +115,6 @@ public class SegmentReader extends Index
       }
 
       segment = si.name;
-      if (Codec.DEBUG) {
-        System.out.println("sr: init core for segment=" + segment);
-      }
       if (codecs == null) {
         codecs = CodecProvider.getDefault();
       }
@@ -141,9 +137,6 @@ public class SegmentReader extends Index
         this.termsIndexDivisor = termsIndexDivisor;
 
         // Ask codec for its Fields
-        if (Codec.DEBUG) {
-          System.out.println("sr.core.init: seg=" + si.name + " codec=" + si.getCodec());
-        }
         fields = si.getCodec().fieldsProducer(new SegmentReadState(cfsDir, si, fieldInfos, readBufferSize, termsIndexDivisor));
         assert fields != null;
 
@@ -1406,10 +1399,6 @@ public class SegmentReader extends Index
     @Override
     public boolean next() throws IOException {
 
-      if (Codec.DEBUG) {
-        System.out.println("tdte.next done=" + done + " seg=" + core.segment);
-      }
-
       if (done) {
         return false;
       }
@@ -1419,9 +1408,6 @@ public class SegmentReader extends Index
           // Advance to the next field
           currentField = fields.next();
           if (currentField == null) {
-            if (Codec.DEBUG) {
-              System.out.println("  fields.next returned false");
-            }
             done = true;
             return false;
           }
@@ -1486,17 +1472,10 @@ public class SegmentReader extends Index
 
     public void seek(Term term) throws IOException {
 
-      if (Codec.DEBUG) {
-        System.out.println("\nwrapper termdocs.seek term=" + term);
-      }
-
       any = false;
 
       if (terms != null && !term.field.equals(currentField)) {
         // new field
-        if (Codec.DEBUG) {
-          System.out.println("  switch field");
-        }
         terms = null;
       }
 
@@ -1516,13 +1495,6 @@ public class SegmentReader extends Index
         any = true;
         pendingBulkResult = null;
         docsEnum = terms.docs(deletedDocs, docsEnum);
-        if (Codec.DEBUG) {
-          System.out.println("  init docs enum");
-        }
-      } else {
-        if (Codec.DEBUG) {
-          System.out.println("  clear docs enum");
-        }
       }
     }
 
@@ -1623,17 +1595,10 @@ public class SegmentReader extends Index
 
     public void seek(Term term) throws IOException {
 
-      if (Codec.DEBUG) {
-        System.out.println("\nwrapper termdocs.seek term=" + term);
-      }
-
       any = false;
 
       if (terms != null && !term.field.equals(currentField)) {
         // new field
-        if (Codec.DEBUG) {
-          System.out.println("  switch field");
-        }
         terms = null;
       }
 
@@ -1657,13 +1622,6 @@ public class SegmentReader extends Index
         } else {
           docsEnum = postingsEnum;
         }
-        if (Codec.DEBUG) {
-          System.out.println("  init docs enum");
-        }
-      } else {
-        if (Codec.DEBUG) {
-          System.out.println("  clear docs enum");
-        }
       }
     }
 

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermsHashPerField.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermsHashPerField.java?rev=927241&r1=927240&r2=927241&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermsHashPerField.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermsHashPerField.java Thu Mar 25 00:35:28 2010
@@ -24,7 +24,6 @@ import java.util.Comparator;
 import org.apache.lucene.analysis.tokenattributes.TermAttribute;
 import org.apache.lucene.analysis.tokenattributes.TermToBytesRefAttribute;
 import org.apache.lucene.document.Fieldable;
-import org.apache.lucene.util.UnicodeUtil;
 import org.apache.lucene.util.BytesRef;
 
 final class TermsHashPerField extends InvertedDocConsumerPerField {
@@ -387,8 +386,6 @@ final class TermsHashPerField extends In
 
     if (p == null) {
 
-      //System.out.println("  not seen yet");
-
       // First time we are seeing this token since we last
       // flushed the hash.
       final int textLen2 = 2+utf8.length;
@@ -538,7 +535,6 @@ final class TermsHashPerField extends In
 
     final int newMask = newSize-1;
 
-    //System.out.println("  rehash");
     RawPostingList[] newHash = new RawPostingList[newSize];
     for(int i=0;i<postingsHashSize;i++) {
       RawPostingList p0 = postingsHash[i];
@@ -559,7 +555,6 @@ final class TermsHashPerField extends In
             len = (text[start]&0x7f) + ((text[start+1]&0xff)<<7);
             pos = start+2;
           }
-          //System.out.println("    term=" + bytePool.setBytesRef(new BytesRef(), p0.textStart).toBytesString());
 
           final int endPos = pos+len;
           while(pos < endPos) {

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/Codec.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/Codec.java?rev=927241&r1=927240&r2=927241&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/Codec.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/Codec.java Thu Mar 25 00:35:28 2010
@@ -28,8 +28,6 @@ import org.apache.lucene.store.Directory
 /** @lucene.experimental */
 public abstract class Codec {
 
-  public static boolean DEBUG = false;
-
   /** Unique name that's used to retrieve this codec when
    *  reading the index */
   public String name;

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/PostingsConsumer.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/PostingsConsumer.java?rev=927241&r1=927240&r2=927241&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/PostingsConsumer.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/PostingsConsumer.java Thu Mar 25 00:35:28 2010
@@ -30,9 +30,6 @@ import org.apache.lucene.util.BytesRef;
 
 public abstract class PostingsConsumer {
 
-  // nocommit -- debugging
-  public String desc;
-
   /** Adds a new doc in this term.  Return null if this
    *  consumer doesn't need to see the positions for this
    *  doc. */

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/intblock/FixedIntBlockIndexInput.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/intblock/FixedIntBlockIndexInput.java?rev=927241&r1=927240&r2=927241&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/intblock/FixedIntBlockIndexInput.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/intblock/FixedIntBlockIndexInput.java Thu Mar 25 00:35:28 2010
@@ -142,11 +142,6 @@ public abstract class FixedIntBlockIndex
 
       return bulkResult;
     }
-
-    @Override
-    public String descFilePointer() {
-      return in.getFilePointer() + ":" + upto;
-    }
   }
 
   private class Index extends IntIndexInput.Index {

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/intblock/FixedIntBlockIndexOutput.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/intblock/FixedIntBlockIndexOutput.java?rev=927241&r1=927240&r2=927241&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/intblock/FixedIntBlockIndexOutput.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/intblock/FixedIntBlockIndexOutput.java Thu Mar 25 00:35:28 2010
@@ -55,11 +55,6 @@ public abstract class FixedIntBlockIndex
     return new Index();
   }
 
-  @Override
-  public String descFilePointer() {
-    return out.getFilePointer() + ":" + upto;
-  }
-
   private class Index extends IntIndexOutput.Index {
     long fp;
     int upto;

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/preflex/PreFlexFields.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/preflex/PreFlexFields.java?rev=927241&r1=927240&r2=927241&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/preflex/PreFlexFields.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/preflex/PreFlexFields.java Thu Mar 25 00:35:28 2010
@@ -34,7 +34,6 @@ import org.apache.lucene.index.Term;
 import org.apache.lucene.index.Terms;
 import org.apache.lucene.index.TermsEnum;
 import org.apache.lucene.index.CompoundFileReader;
-import org.apache.lucene.index.codecs.Codec;
 import org.apache.lucene.index.codecs.FieldsProducer;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.IndexInput;
@@ -99,7 +98,6 @@ public class PreFlexFields extends Field
     files.add(IndexFileNames.segmentFileName(info.name, PreFlexCodec.TERMS_EXTENSION));
     files.add(IndexFileNames.segmentFileName(info.name, PreFlexCodec.TERMS_INDEX_EXTENSION));
     files.add(IndexFileNames.segmentFileName(info.name, PreFlexCodec.FREQ_EXTENSION));
-    //System.out.println("seg=" + info.name + " hasProx?=" + info.getHasProx());
     if (info.getHasProx()) {
       // LUCENE-1739: for certain versions of 2.9-dev,
       // hasProx would be incorrectly computed during
@@ -274,9 +272,6 @@ public class PreFlexFields extends Field
 
     @Override
     public SeekStatus seek(BytesRef term) throws IOException {
-      if (Codec.DEBUG) {
-        System.out.println("pff.seek term=" + term);
-      }
       skipNext = false;
       final TermInfosReader tis = getTermsDict();
       final Term t0 = new Term(fieldInfo.name, term.utf8ToString());
@@ -320,22 +315,13 @@ public class PreFlexFields extends Field
       }
       if (termEnum.next()) {
         final Term t = termEnum.term();
-        if (Codec.DEBUG) {
-          System.out.println("pff.next term=" + t);
-        }
         if (t.field() == fieldInfo.name) {
-          if (Codec.DEBUG) {
-            System.out.println("  ok");
-          }
           scratchBytesRef.copy(t.text());
           current = scratchBytesRef;
           return current;
         } else {
           assert !t.field().equals(fieldInfo.name);  // make sure field name is interned
           // Crossed into new field
-          if (Codec.DEBUG) {
-            System.out.println("  stop (new field " + t.field());
-          }
           return null;
         }
       } else {
@@ -387,9 +373,6 @@ public class PreFlexFields extends Field
 
     @Override
     public int nextDoc() throws IOException {
-      if (Codec.DEBUG) {
-        System.out.println("pff.docs.next");
-      }
       if (docs.next()) {
         return docs.doc();
       } else {
@@ -442,9 +425,6 @@ public class PreFlexFields extends Field
 
     @Override
     public int nextDoc() throws IOException {
-      if (Codec.DEBUG) {
-        System.out.println("pff.docs.next");
-      }
       if (pos.next()) {
         return pos.doc();
       } else {

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/pulsing/PulsingPostingsReaderImpl.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/pulsing/PulsingPostingsReaderImpl.java?rev=927241&r1=927240&r2=927241&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/pulsing/PulsingPostingsReaderImpl.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/pulsing/PulsingPostingsReaderImpl.java Thu Mar 25 00:35:28 2010
@@ -22,7 +22,6 @@ import java.io.IOException;
 import org.apache.lucene.index.DocsEnum;
 import org.apache.lucene.index.FieldInfo;
 import org.apache.lucene.index.DocsAndPositionsEnum;
-import org.apache.lucene.index.codecs.Codec;
 import org.apache.lucene.index.codecs.standard.TermState;
 import org.apache.lucene.index.codecs.standard.StandardPostingsReader;
 import org.apache.lucene.index.codecs.pulsing.PulsingPostingsWriterImpl.Document;
@@ -102,18 +101,10 @@ public class PulsingPostingsReaderImpl e
 
     PulsingTermState termState = (PulsingTermState) _termState;
 
-    if (Codec.DEBUG) {
-      System.out.println("pulsr.readTerm docFreq=" + termState.docFreq + " indexTerm=" + isIndexTerm);
-    }
-
     termState.pendingIndexTerm |= isIndexTerm;
 
     if (termState.docFreq <= maxPulsingDocFreq) {
 
-      if (Codec.DEBUG) {
-        System.out.println("  pulsed");
-      }
-
       // Inlined into terms dict -- read everything in
 
       // TODO: maybe only read everything in lazily?  But
@@ -136,9 +127,6 @@ public class PulsingPostingsReaderImpl e
         if (fieldInfo.omitTermFreqAndPositions) {
           docID += code;
           doc.numPositions = 1;
-          if (Codec.DEBUG) {
-            System.out.println("  doc=" + docID);
-          }
         } else {
           docID += code>>>1;
           if ((code & 1) != 0) {
@@ -147,10 +135,6 @@ public class PulsingPostingsReaderImpl e
             doc.numPositions = termsIn.readVInt();
           }
             
-          if (Codec.DEBUG) {
-            System.out.println("  doc=" + docID + " numPos=" + doc.numPositions);
-          }
-
           if (doc.numPositions > doc.positions.length) {
             doc.reallocPositions(doc.numPositions);
           }
@@ -188,9 +172,6 @@ public class PulsingPostingsReaderImpl e
         doc.docID = docID;
       }
     } else {
-      if (Codec.DEBUG) {
-        System.out.println("  not pulsed pass isIndex=" + termState.pendingIndexTerm);
-      }
       termState.wrappedTermState.docFreq = termState.docFreq;
       wrappedPostingsReader.readTerm(termsIn, fieldInfo, termState.wrappedTermState, termState.pendingIndexTerm);
       termState.pendingIndexTerm = false;

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/pulsing/PulsingPostingsWriterImpl.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/pulsing/PulsingPostingsWriterImpl.java?rev=927241&r1=927240&r2=927241&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/pulsing/PulsingPostingsWriterImpl.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/pulsing/PulsingPostingsWriterImpl.java Thu Mar 25 00:35:28 2010
@@ -21,7 +21,6 @@ import java.io.IOException;
 
 import org.apache.lucene.index.FieldInfo;
 import org.apache.lucene.util.CodecUtil;
-import org.apache.lucene.index.codecs.Codec;
 import org.apache.lucene.index.codecs.standard.StandardPostingsWriter;
 import org.apache.lucene.store.IndexOutput;
 import org.apache.lucene.util.ArrayUtil;
@@ -53,9 +52,6 @@ public final class PulsingPostingsWriter
   // Starts a new term
   FieldInfo fieldInfo;
 
-  // nocommit -- debugging
-  String desc;
-
   /** @lucene.experimental */
   public static class Document {
     int docID;
@@ -163,25 +159,15 @@ public final class PulsingPostingsWriter
 
     assert docID >= 0: "got docID=" + docID;
         
-    if (Codec.DEBUG) {
-      System.out.println("PW.addDoc: docID=" + docID + " pendingDocCount=" + pendingDocCount + " vs " + pendingDocs.length + " pulsed=" + pulsed);
-    }
-
     if (!pulsed && pendingDocCount == pendingDocs.length) {
       
       // OK we just crossed the threshold, this term should
       // now be written with our wrapped codec:
       wrappedPostingsWriter.startTerm();
       
-      if (Codec.DEBUG) {
-        System.out.println("  now flush buffer");
-      }
-
       // Flush all buffered docs
       for(int i=0;i<pendingDocCount;i++) {
         final Document doc = pendingDocs[i];
-        if (Codec.DEBUG)
-          System.out.println("  docID=" + doc.docID);
 
         wrappedPostingsWriter.startDoc(doc.docID, doc.termDocFreq);
 
@@ -257,10 +243,6 @@ public final class PulsingPostingsWriter
 
     assert docCount > 0;
 
-    if (Codec.DEBUG) {
-      System.out.println("PW: finishTerm pendingDocCount=" + pendingDocCount);
-    }
-
     pendingIsIndexTerm |= isIndexTerm;
 
     if (pulsed) {

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/IntIndexInput.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/IntIndexInput.java?rev=927241&r1=927240&r2=927241&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/IntIndexInput.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/IntIndexInput.java Thu Mar 25 00:35:28 2010
@@ -39,9 +39,6 @@ public abstract class IntIndexInput impl
   // TODO: -- can we simplify this?
   public abstract static class Index {
 
-    // nocommit -- debugging
-    public String desc;
-
     public abstract void read(IndexInput indexIn, boolean absolute) throws IOException;
 
     /** Seeks primary stream to the last read offset */
@@ -74,8 +71,5 @@ public abstract class IntIndexInput impl
       bulkResult.length = count;
       return bulkResult;
     }
-
-    // nocommit -- debugging
-    public abstract String descFilePointer() throws IOException;
   }
 }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/IntIndexOutput.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/IntIndexOutput.java?rev=927241&r1=927240&r2=927241&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/IntIndexOutput.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/IntIndexOutput.java Thu Mar 25 00:35:28 2010
@@ -39,9 +39,6 @@ public abstract class IntIndexOutput imp
 
   public abstract static class Index {
 
-    // nocommit -- debugging
-    public String desc;
-
     /** Internally records the current location */
     public abstract void mark() throws IOException;
 
@@ -58,7 +55,4 @@ public abstract class IntIndexOutput imp
   public abstract Index index() throws IOException;
 
   public abstract void close() throws IOException;
-
-  // nocommit -- debugging
-  public abstract String descFilePointer() throws IOException;
 }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepPostingsReaderImpl.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepPostingsReaderImpl.java?rev=927241&r1=927240&r2=927241&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepPostingsReaderImpl.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepPostingsReaderImpl.java Thu Mar 25 00:35:28 2010
@@ -25,7 +25,6 @@ import org.apache.lucene.index.DocsAndPo
 import org.apache.lucene.index.FieldInfo;
 import org.apache.lucene.index.IndexFileNames;
 import org.apache.lucene.index.SegmentInfo;
-import org.apache.lucene.index.codecs.Codec;
 import org.apache.lucene.index.codecs.standard.StandardPostingsReader;
 import org.apache.lucene.index.codecs.standard.TermState;
 import org.apache.lucene.store.Directory;
@@ -182,11 +181,6 @@ public class SepPostingsReaderImpl exten
   public void readTerm(IndexInput termsIn, FieldInfo fieldInfo, TermState _termState, boolean isIndexTerm) throws IOException {
     final SepTermState termState = (SepTermState) _termState;
 
-    if (Codec.DEBUG) {
-      System.out.println("  dr.readTerm termsFP=" + termsIn.getFilePointer() + " df=" + termState.docFreq + " isIndex=" + isIndexTerm);
-      System.out.println("    start freqFP=" + termState.freqIndex + " docFP=" + termState.docIndex + " skipFP=" + termState.skipOffset);
-    }
-
     // read freq index
     if (!fieldInfo.omitTermFreqAndPositions) {
       if (termState.freqIndex == null) {
@@ -217,10 +211,6 @@ public class SepPostingsReaderImpl exten
         termState.payloadOffset += v;
       }
     }
-
-    if (Codec.DEBUG) {
-      System.out.println("    freqFP=" + termState.freqIndex + " docFP=" + termState.docIndex + " skipFP=" + termState.skipOffset);
-    }
   }
 
   @Override
@@ -269,9 +259,6 @@ public class SepPostingsReaderImpl exten
     SepSkipListReader skipper;
 
     SepDocsEnum() throws IOException {
-      if (Codec.DEBUG) {
-        Codec.debug("sep: new DocsEnum");
-      }
       docReader = docIn.reader();
       docIndex = docIn.index();
       if (freqIn != null) {
@@ -289,9 +276,6 @@ public class SepPostingsReaderImpl exten
     }
 
     SepDocsEnum init(FieldInfo fieldInfo, SepTermState termState, Bits skipDocs) throws IOException {
-      if (Codec.DEBUG) {
-        System.out.println("[" + desc + "] dr.init freqIn seek " + freqIndex + " this=" + this + " (in=" + freqIn + "; this=" + this + ")");
-      }
       this.skipDocs = skipDocs;
       omitTF = fieldInfo.omitTermFreqAndPositions;
       storePayloads = fieldInfo.storePayloads;
@@ -320,14 +304,6 @@ public class SepPostingsReaderImpl exten
     @Override
     public int nextDoc() throws IOException {
 
-      if (Codec.DEBUG) {
-        if (!omitTF) {
-          Codec.debug("sep.reader.docs.nextDoc count=" + count + " vs df=" + docFreq + " freqFP=" + freqReader.descFilePointer() + " docFP=" + docReader.descFilePointer() + " skipDocs?=" + (skipDocs != null), desc);
-        } else {
-          Codec.debug("sep.reader.docs.nextDoc count=" + count + " vs df=" + docFreq + " docFP=" + docReader.descFilePointer() + " skipDocs?=" + (skipDocs != null), desc);
-        }
-      }
-
       while(true) {
         if (count == docFreq) {
           return doc = NO_MORE_DOCS;
@@ -342,21 +318,11 @@ public class SepPostingsReaderImpl exten
           freq = freqReader.next();
         }
 
-        if (Codec.DEBUG) {
-          System.out.println("  decode doc=" + doc + " freq=" + freq);
-        }
-
         if (skipDocs == null || !skipDocs.get(doc)) {
           break;
-        } else if (Codec.DEBUG) {
-          System.out.println("  doc=" + doc + " is skipped");
         }
       }
 
-      // nocommit -- debugging
-      if (Codec.DEBUG) {
-        System.out.println("  return doc=" + doc);
-      }
       return doc;
     }
 
@@ -400,10 +366,6 @@ public class SepPostingsReaderImpl exten
       // TODO: jump right to next() if target is < X away
       // from where we are now?
 
-      if (Codec.DEBUG) {
-        Codec.debug("sep.reader.docs: advance target=" + target + " omitTF=" + omitTF, desc);
-      }
-
       if (docFreq >= skipInterval) {
 
         // There are enough docs in the posting to have
@@ -411,10 +373,6 @@ public class SepPostingsReaderImpl exten
 
         if (skipper == null) {
           // This DocsEnum has never done any skipping
-          if (Codec.DEBUG) {
-            System.out.println("  create skipper");
-          }
-
           skipper = new SepSkipListReader((IndexInput) skipIn.clone(),
                                           freqIn,
                                           docIn,
@@ -434,10 +392,6 @@ public class SepPostingsReaderImpl exten
                        storePayloads);
           skipper.setOmitTF(omitTF);
 
-          if (Codec.DEBUG) {
-            System.out.println("    init skipper: base skipFP=" + skipOffset + " docFP=" + docIndex + " freqFP=" + freqIndex);
-          }
-
           skipped = true;
         }
 
@@ -446,21 +400,12 @@ public class SepPostingsReaderImpl exten
         if (newCount > count) {
 
           // Skipper did move
-          if (Codec.DEBUG) {
-            System.out.println("sdr [" + desc + "]: skipper moved to newCount=" + newCount +
-                               " docFP=" + skipper.getDocIndex() +
-                               " freqFP=" + skipper.getFreqIndex() +
-                               " doc=" + skipper.getDoc());
-          }
-            
           if (!omitTF) {
             skipper.getFreqIndex().seek(freqReader);
           }
           skipper.getDocIndex().seek(docReader);
           count = newCount;
           doc = skipper.getDoc();
-        } else if (Codec.DEBUG) {
-          System.out.println("  no skipping to be done");
         }
       }
         
@@ -471,10 +416,6 @@ public class SepPostingsReaderImpl exten
         }
       } while (target > doc);
 
-      if (Codec.DEBUG) {
-        Codec.debug("  skip return doc=" + doc);
-      }
-
       return doc;
     }
   }
@@ -486,8 +427,6 @@ public class SepPostingsReaderImpl exten
     int freq;
     long freqStart;
 
-    // TODO: -- should we do omitTF with 2 different enum classes?
-    private boolean omitTF;
     private boolean storePayloads;
     private Bits skipDocs;
     private final IntIndexInput.Reader docReader;
@@ -512,9 +451,6 @@ public class SepPostingsReaderImpl exten
     private boolean posSeekPending;
 
     SepDocsAndPositionsEnum() throws IOException {
-      if (Codec.DEBUG) {
-        Codec.debug("sep: new DocsAndPositionsEnum");
-      }
       docReader = docIn.reader();
       docIndex = docIn.index();
       freqReader = freqIn.reader();
@@ -525,9 +461,6 @@ public class SepPostingsReaderImpl exten
     }
 
     SepDocsAndPositionsEnum init(FieldInfo fieldInfo, SepTermState termState, Bits skipDocs) throws IOException {
-      if (Codec.DEBUG) {
-        Codec.debug("sep.reader.init freqIn seek " + termState.freqIndex);
-      }
       this.skipDocs = skipDocs;
       storePayloads = fieldInfo.storePayloads;
 
@@ -560,14 +493,6 @@ public class SepPostingsReaderImpl exten
     @Override
     public int nextDoc() throws IOException {
 
-      if (Codec.DEBUG) {
-        if (!omitTF) {
-          Codec.debug("sep.reader.nextDoc next count=" + count + " vs df=" + docFreq + " freqFP=" + freqReader.descFilePointer() + " docFP=" + docReader.descFilePointer() + " skipDocs?=" + (skipDocs != null), desc);
-        } else {
-          Codec.debug("sep.reader.nextDoc next count=" + count + " vs df=" + docFreq + " docFP=" + docReader.descFilePointer() + " skipDocs?=" + (skipDocs != null), desc);
-        }
-      }
-
       while(true) {
         if (count == docFreq) {
           return doc = NO_MORE_DOCS;
@@ -585,21 +510,11 @@ public class SepPostingsReaderImpl exten
 
         pendingPosCount += freq;
 
-        if (Codec.DEBUG) {
-          System.out.println("  decode doc=" + doc + " freq=" + freq);
-        }
-
         if (skipDocs == null || !skipDocs.get(doc)) {
           break;
-        } else if (Codec.DEBUG) {
-          System.out.println("  doc=" + doc + " is skipped");
         }
       }
 
-      // nocommit -- debugging
-      if (Codec.DEBUG) {
-        System.out.println("  return doc=" + doc);
-      }
       position = 0;
       return doc;
     }
@@ -620,10 +535,6 @@ public class SepPostingsReaderImpl exten
       // TODO: jump right to next() if target is < X away
       // from where we are now?
 
-      if (Codec.DEBUG) {
-        Codec.debug("sep.reader.advance current doc=" + doc + " target=" + target, desc);
-      }
-
       if (docFreq >= skipInterval) {
 
         // There are enough docs in the posting to have
@@ -631,10 +542,6 @@ public class SepPostingsReaderImpl exten
 
         if (skipper == null) {
           // This DocsEnum has never done any skipping
-          if (Codec.DEBUG) {
-            System.out.println("  create skipper");
-          }
-
           skipper = new SepSkipListReader((IndexInput) skipIn.clone(),
                                           freqIn,
                                           docIn,
@@ -652,11 +559,6 @@ public class SepPostingsReaderImpl exten
                        docFreq,
                        storePayloads);
 
-          if (Codec.DEBUG) {
-            System.out.println("    init skipper: base skipFP=" + skipOffset + " docFP=" + docIndex + " freqFP=" + freqIndex + " proxFP=" +
-                               posIndex + " payloadFP=" + payloadOffset);
-          }
-
           skipped = true;
         }
 
@@ -665,13 +567,6 @@ public class SepPostingsReaderImpl exten
         if (newCount > count) {
 
           // Skipper did move
-          if (Codec.DEBUG) {
-            Codec.debug("  skipper moved to newCount=" + newCount +
-                        " docFP=" + skipper.getDocIndex() +
-                        " freqFP=" + skipper.getFreqIndex() +
-                        " doc=" + skipper.getDoc());
-          }
-            
           skipper.getFreqIndex().seek(freqReader);
           skipper.getDocIndex().seek(docReader);
           //skipper.getPosIndex().seek(posReader);
@@ -685,14 +580,6 @@ public class SepPostingsReaderImpl exten
           pendingPayloadBytes = 0;
           payloadPending = false;
           payloadLength = skipper.getPayloadLength();
-
-        } else if (Codec.DEBUG) {
-          System.out.println("  no skipping to be done");
-        }
-
-      } else {
-        if (Codec.DEBUG) {
-          Codec.debug("[" + desc + "]: no skip data");
         }
       }
         
@@ -703,18 +590,11 @@ public class SepPostingsReaderImpl exten
         }
       } while (target > doc);
 
-      if (Codec.DEBUG) {
-        Codec.debug("advance done return doc=" + doc, desc);
-      }
       return doc;
     }
 
     @Override
     public int nextPosition() throws IOException {
-      if (Codec.DEBUG) {
-        Codec.debug("sep.reader.nextPos pendingPosCount=" + pendingPosCount + " freq=" + freq, desc);
-      }
-
       if (posSeekPending) {
         posIndex.seek(posReader);
         payloadIn.seek(payloadOffset);
@@ -724,18 +604,12 @@ public class SepPostingsReaderImpl exten
       // scan over any docs that were iterated without their
       // positions
       while (pendingPosCount > freq) {
-        if (Codec.DEBUG) {
-          System.out.println("      skip position payloadBytesPending=" + pendingPayloadBytes);
-        }
         final int code = posReader.next();
         if (storePayloads) {
           if ((code & 1) != 0) {
             // Payload length has changed
             payloadLength = posReader.next();
             assert payloadLength >= 0;
-            if (Codec.DEBUG) {
-              System.out.println("  new payloadLen=" + payloadLength);
-            }
           }
         }
         pendingPosCount--;
@@ -750,9 +624,6 @@ public class SepPostingsReaderImpl exten
           // Payload length has changed
           payloadLength = posReader.next();
           assert payloadLength >= 0;
-          if (Codec.DEBUG) {
-            System.out.println("  new payloadLen=" + payloadLength);
-          }
         }
         position += code >> 1;
       } else {
@@ -764,10 +635,6 @@ public class SepPostingsReaderImpl exten
       pendingPosCount--;
       payloadPending = true;
       assert pendingPosCount >= 0;
-
-      if (Codec.DEBUG) {
-        System.out.println("      return pos=" + position);
-      }
       return position;
     }
 
@@ -784,10 +651,6 @@ public class SepPostingsReaderImpl exten
         throw new IOException("Either no payload exists at this term position or an attempt was made to load it more than once.");
       }
 
-      if (Codec.DEBUG) {
-        Codec.debug(" getPayload payloadFP=" + payloadIn.getFilePointer() + " len=" + payloadLength + " pendingPayloadBytes=" + pendingPayloadBytes, desc);
-      }
-
       assert pendingPayloadBytes >= payloadLength;
 
       if (pendingPayloadBytes > payloadLength) {

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepPostingsWriterImpl.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepPostingsWriterImpl.java?rev=927241&r1=927240&r2=927241&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepPostingsWriterImpl.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepPostingsWriterImpl.java Thu Mar 25 00:35:28 2010
@@ -23,7 +23,6 @@ import org.apache.lucene.index.CorruptIn
 import org.apache.lucene.index.FieldInfo;
 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.standard.StandardPostingsWriter;
 import org.apache.lucene.store.IndexOutput;
 import org.apache.lucene.util.BytesRef;
@@ -73,7 +72,6 @@ public final class SepPostingsWriterImpl
   long lastPayloadStart;
   int lastDocID;
   int df;
-  int count;
 
   public SepPostingsWriterImpl(SegmentWriteState state, IntStreamFactory factory) throws IOException {
     super();
@@ -135,9 +133,6 @@ public final class SepPostingsWriterImpl
 
   @Override
   public void startTerm() throws IOException {
-    if (Codec.DEBUG) {
-      Codec.debug("sep.writer.startTerm");
-    }
     docIndex.mark();
     if (!omitTF) {
       freqIndex.mark();
@@ -169,10 +164,6 @@ public final class SepPostingsWriterImpl
 
     final int delta = docID - lastDocID;
 
-    if (Codec.DEBUG) {
-      System.out.println("  dw.addDoc [" + desc + "] count=" + (count++) + " docID=" + docID + " lastDocID=" + lastDocID + " delta=" + delta + " omitTF=" + omitTF + " freq=" + termDocFreq);
-    }
-
     if (docID < 0 || (df > 0 && delta <= 0)) {
       throw new CorruptIndexException("docs out of order (" + docID + " <= " + lastDocID + " )");
     }
@@ -182,16 +173,6 @@ public final class SepPostingsWriterImpl
       // separate calls to skipper
       skipListWriter.setSkipData(lastDocID, storePayloads, lastPayloadLength);
       skipListWriter.bufferSkip(df);
-
-      if (Codec.DEBUG) {
-        System.out.println("    bufferSkip lastDocID=" + lastDocID +
-                           " df=" + df +
-                           " docFP=" + docOut.descFilePointer() + 
-                           " freqFP=" + freqOut.descFilePointer() + 
-                           " posFP=" + posOut.descFilePointer() + 
-                           " payloadFP=" + payloadOut.getFilePointer() + 
-                           " payloadLen=" + lastPayloadLength);
-      }
     }
 
     lastDocID = docID;
@@ -206,26 +187,12 @@ public final class SepPostingsWriterImpl
   public void addPosition(int position, BytesRef payload) throws IOException {
     assert !omitTF;
 
-    if (Codec.DEBUG) {
-      if (payload != null && payload.length > 0) {
-        System.out.println("pw.addPos [" + desc + "]: pos=" + position + " posFP=" + posOut.descFilePointer() + " payloadFP=" + payloadOut.getFilePointer() + " payload=" + payload.length + " bytes");
-      } else {
-        System.out.println("pw.addPos [" + desc + "]: pos=" + position + " posFP=" + posOut.descFilePointer() + " payloadFP=" + payloadOut.getFilePointer());
-      }
-    }
-
     final int delta = position - lastPosition;
     lastPosition = position;
 
     if (storePayloads) {
       final int payloadLength = payload == null ? 0 : payload.length;
-      if (Codec.DEBUG) {
-        System.out.println("  store payload len=" + payloadLength);
-      }
       if (payloadLength != lastPayloadLength) {
-        if (Codec.DEBUG) {
-          System.out.println("  payload len change old=" + lastPayloadLength + " new=" + payloadLength);
-        }
         lastPayloadLength = payloadLength;
         // TODO: explore whether we get better compression
         // by not storing payloadLength into prox stream?
@@ -236,9 +203,6 @@ public final class SepPostingsWriterImpl
       }
 
       if (payloadLength > 0) {
-        if (Codec.DEBUG) {
-          System.out.println("  write @ payloadFP=" + payloadOut.getFilePointer());
-        }
         payloadOut.writeBytes(payload.bytes, payload.offset, payloadLength);
       }
     } else {
@@ -263,9 +227,6 @@ public final class SepPostingsWriterImpl
     // TODO: -- wasteful we are counting this in two places?
     assert docCount > 0;
     assert docCount == df;
-    if (Codec.DEBUG) {
-      System.out.println("dw.finishTerm termsFP=" + termsOut.getFilePointer() + " df=" + df + " skipPos=" + skipPos);
-    }
 
     // TODO: -- only do this if once (consolidate the
     // conditional things that are written)
@@ -275,10 +236,6 @@ public final class SepPostingsWriterImpl
     docIndex.write(termsOut, isIndexTerm);
 
     if (df >= skipInterval) {
-      if (Codec.DEBUG) {
-        System.out.println("  writeSkip skipPos=" + skipPos + " lastSkipPos=" + lastSkipStart);
-      }
-      
       skipListWriter.writeSkip(skipOut);
     }
 
@@ -303,16 +260,10 @@ public final class SepPostingsWriterImpl
 
     lastDocID = 0;
     df = 0;
-
-    // nocommit -- debugging
-    count = 0;
   }
 
   @Override
   public void close() throws IOException {
-    if (Codec.DEBUG) {
-      System.out.println("sep.writer.close skipFP=" + skipOut.getFilePointer());
-    }
     try {
       docOut.close();
     } finally {

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepSkipListReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepSkipListReader.java?rev=927241&r1=927240&r2=927241&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepSkipListReader.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepSkipListReader.java Thu Mar 25 00:35:28 2010
@@ -21,7 +21,6 @@ import java.io.IOException;
 import java.util.Arrays;
 
 import org.apache.lucene.store.IndexInput;
-import org.apache.lucene.index.codecs.Codec;
 import org.apache.lucene.index.codecs.MultiLevelSkipListReader;
 
 /**
@@ -66,19 +65,10 @@ class SepSkipListReader extends MultiLev
     for(int i=0;i<maxSkipLevels;i++) {
       if (freqIn != null) {
         freqIndex[i] = freqIn.index();
-        if (Codec.DEBUG) {
-          freqIndex[i].desc = "sslr.freq.level" + i;
-        }
       }
       docIndex[i] = docIn.index();
-      if (Codec.DEBUG) {
-        docIndex[i].desc = "sslr.doc.level" + i;
-      }
       if (posIn != null) {
         posIndex[i] = posIn.index();
-        if (Codec.DEBUG) {
-          posIndex[i].desc = "sslr.pos.level" + i;
-        }
       }
     }
     payloadPointer = new long[maxSkipLevels];
@@ -114,10 +104,6 @@ class SepSkipListReader extends MultiLev
     super.init(skipPointer, df);
     this.currentFieldStoresPayloads = storesPayloads;
 
-    if (Codec.DEBUG) {
-      System.out.println("ssr.init docBase=" + docBaseIndex + " freqBase=" + freqBaseIndex + " posBase=" + posBaseIndex + " payloadBase=" + payloadBasePointer + " df=" + df);
-    }
-
     lastPayloadPointer = payloadBasePointer;
 
     for(int i=0;i<maxNumberOfSkipLevels;i++) {
@@ -214,9 +200,6 @@ class SepSkipListReader extends MultiLev
       payloadPointer[level] += skipStream.readVInt();
     }
     
-    if (Codec.DEBUG) {
-      System.out.println("ssr.readSkipData docDelta=" + delta + " curStoresPayloads=" + currentFieldStoresPayloads + " level=" + level + " freqIndex=" + (freqIndex==null?null:freqIndex[level]) + " docIndex=" + docIndex[level] + " posIndex=" + (posIndex==null? "null" : ""+posIndex[level]) + " payloadPointer=" + payloadPointer[level]);
-    }
     return delta;
   }
 }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepSkipListWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepSkipListWriter.java?rev=927241&r1=927240&r2=927241&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepSkipListWriter.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SepSkipListWriter.java Thu Mar 25 00:35:28 2010
@@ -21,7 +21,6 @@ import java.io.IOException;
 import java.util.Arrays;
 
 import org.apache.lucene.store.IndexOutput;
-import org.apache.lucene.index.codecs.Codec;
 import org.apache.lucene.index.codecs.MultiLevelSkipListWriter;
 
 // TODO: -- skip data should somehow be more local to the
@@ -43,7 +42,6 @@ class SepSkipListWriter extends MultiLev
   private IntIndexOutput.Index[] posIndex;
   
   private IntIndexOutput freqOutput;
-  private IntIndexOutput docOutput;
   // TODO: -- private again
   IntIndexOutput posOutput;
   // TODO: -- private again
@@ -63,7 +61,6 @@ class SepSkipListWriter extends MultiLev
     super(skipInterval, numberOfSkipLevels, docCount);
 
     this.freqOutput = freqOutput;
-    this.docOutput = docOutput;
     this.posOutput = posOutput;
     this.payloadOutput = payloadOutput;
     
@@ -79,19 +76,10 @@ class SepSkipListWriter extends MultiLev
     for(int i=0;i<numberOfSkipLevels;i++) {
       if (freqOutput != null) {
         freqIndex[i] = freqOutput.index();
-        if (Codec.DEBUG) {
-          freqIndex[i].desc = "sslw.freq.level" + i;
-        }
       }
       docIndex[i] = docOutput.index();
-      if (Codec.DEBUG) {
-        docIndex[i].desc = "sslw.doc.level" + i;
-      }
       if (posOutput != null) {
         posIndex[i] = posOutput.index();
-        if (Codec.DEBUG) {
-          posIndex[i].desc = "sslw.pos.level" + i;
-        }
       }
     }
   }
@@ -106,9 +94,6 @@ class SepSkipListWriter extends MultiLev
     this.posOutput = posOutput;
     for(int i=0;i<numberOfSkipLevels;i++) {
       posIndex[i] = posOutput.index();
-      if (Codec.DEBUG) {
-        posIndex[i].desc = "sslw.pos.level" + i;
-      }
     }
   }
 
@@ -134,11 +119,6 @@ class SepSkipListWriter extends MultiLev
   protected void resetSkip(IntIndexOutput.Index topDocIndex, IntIndexOutput.Index topFreqIndex, IntIndexOutput.Index topPosIndex)
     throws IOException {
     super.resetSkip();
-    if (Codec.DEBUG) {
-      System.out.println("sslw.reset docIndexBase=" + topDocIndex +
-                         " freqIndexBase=" + topFreqIndex +
-                         " topPosIndex=" + (topPosIndex == null? "null" : (""+topPosIndex)));
-    }
 
     Arrays.fill(lastSkipDoc, 0);
     Arrays.fill(lastSkipPayloadLength, -1);  // we don't have to write the first length in the skip list
@@ -178,9 +158,6 @@ class SepSkipListWriter extends MultiLev
     //         if DocSkip is even, then it is assumed that the
     //         current payload length equals the length at the previous
     //         skip point
-    if (Codec.DEBUG) {
-      System.out.println("ssw level=" + level + " curDoc=" + curDoc + " lastDoc=" + lastSkipDoc[level] + " delta=" + (curDoc - lastSkipDoc[level]) + " storePayloads=" + curStorePayloads + " skipBufferFP=" + skipBuffer.getFilePointer() + " curPayloadLen=" + curPayloadLength + " freqIndex=" + freqOutput.descFilePointer() + " docIndex=" + docOutput.descFilePointer() + " posIndex=" + posOutput.descFilePointer() + " curPayloadPointer=" + curPayloadPointer);
-    }
 
     assert !omitTF || !curStorePayloads;
 

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SingleIntIndexInput.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SingleIntIndexInput.java?rev=927241&r1=927240&r2=927241&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SingleIntIndexInput.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SingleIntIndexInput.java Thu Mar 25 00:35:28 2010
@@ -19,7 +19,6 @@ package org.apache.lucene.index.codecs.s
 
 import java.io.IOException;
 
-import org.apache.lucene.index.codecs.Codec;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.IndexInput;
 import org.apache.lucene.util.CodecUtil;
@@ -63,11 +62,6 @@ public class SingleIntIndexInput extends
     public int next() throws IOException {
       return in.readVInt();
     }
-
-    @Override
-    public String descFilePointer() {
-      return Long.toString(in.getFilePointer());
-    }
   }
   
   class Index extends IntIndexInput.Index {
@@ -78,7 +72,6 @@ public class SingleIntIndexInput extends
     @Override
     public void read(IndexInput indexIn, boolean absolute)
       throws IOException {
-      long cur = fp;
       if (absolute) {
         fp = indexIn.readVLong();
         first = false;
@@ -86,9 +79,6 @@ public class SingleIntIndexInput extends
         assert !first;
         fp += indexIn.readVLong();
       }
-      if (Codec.DEBUG) {
-        System.out.println("siii.idx.read: id=" + desc + " abs=" + absolute + " now=" + fp + " delta=" + (fp-cur));
-      }
     }
 
     @Override

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SingleIntIndexOutput.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SingleIntIndexOutput.java?rev=927241&r1=927240&r2=927241&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SingleIntIndexOutput.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SingleIntIndexOutput.java Thu Mar 25 00:35:28 2010
@@ -19,7 +19,6 @@ package org.apache.lucene.index.codecs.s
 
 import org.apache.lucene.store.IndexOutput;
 import org.apache.lucene.store.Directory;
-import org.apache.lucene.index.codecs.Codec;
 import org.apache.lucene.util.CodecUtil;
 
 import java.io.IOException;
@@ -56,20 +55,12 @@ public class SingleIntIndexOutput extend
     out.close();
   }
 
-  @Override
-  public String descFilePointer() {
-    return Long.toString(out.getFilePointer());
-  }
-
   private class Index extends IntIndexOutput.Index {
     long fp;
     long lastFP;
     @Override
     public void mark() {
       fp = out.getFilePointer();
-      if (Codec.DEBUG) {
-        System.out.println("siio.idx.mark id=" + desc + " fp=" + fp);
-      }
     }
     @Override
     public void set(IntIndexOutput.Index other) {
@@ -78,9 +69,6 @@ public class SingleIntIndexOutput extend
     @Override
     public void write(IndexOutput indexOut, boolean absolute)
       throws IOException {
-      if (Codec.DEBUG) {
-        System.out.println("siio.idx.write id=" + desc + " fp=" + fp + " abs=" + absolute + " delta=" + (fp-lastFP));
-      }
       if (absolute) {
         indexOut.writeVLong(fp);
       } else {

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/DefaultSkipListWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/DefaultSkipListWriter.java?rev=927241&r1=927240&r2=927241&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/DefaultSkipListWriter.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/DefaultSkipListWriter.java Thu Mar 25 00:35:28 2010
@@ -21,7 +21,6 @@ import java.io.IOException;
 import java.util.Arrays;
 
 import org.apache.lucene.store.IndexOutput;
-import org.apache.lucene.index.codecs.Codec;
 import org.apache.lucene.index.codecs.MultiLevelSkipListWriter;
 
 
@@ -76,12 +75,6 @@ public class DefaultSkipListWriter exten
     Arrays.fill(lastSkipFreqPointer, freqOutput.getFilePointer());
     if (proxOutput != null)
       Arrays.fill(lastSkipProxPointer, proxOutput.getFilePointer());
-    if (Codec.DEBUG) {
-      if (proxOutput != null)
-        System.out.println("    skip writer base freqFP=" + freqOutput.getFilePointer() + " proxFP=" + proxOutput.getFilePointer());
-      else
-        System.out.println("    skip writer base freqFP=" + freqOutput.getFilePointer());
-    }
   }
   
   @Override
@@ -127,7 +120,6 @@ public class DefaultSkipListWriter exten
     skipBuffer.writeVInt((int) (curProxPointer - lastSkipProxPointer[level]));
 
     lastSkipDoc[level] = curDoc;
-    //System.out.println("write doc at level " + level + ": " + curDoc);
     
     lastSkipFreqPointer[level] = curFreqPointer;
     lastSkipProxPointer[level] = curProxPointer;

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/DeltaBytesReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/DeltaBytesReader.java?rev=927241&r1=927240&r2=927241&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/DeltaBytesReader.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/DeltaBytesReader.java Thu Mar 25 00:35:28 2010
@@ -37,12 +37,8 @@ final class DeltaBytesReader {
   }
 
   void read() throws IOException {
-    // mxx
-    //System.out.println(Thread.currentThread().getName() + ":  dbr termFP=" + in.getFilePointer());
     final int start = in.readVInt();
     final int suffix = in.readVInt();
-    // mxx
-    //System.out.println(Thread.currentThread().getName() + ":  start=" + start + " suffix=" + suffix);
     assert start <= term.length: "start=" + start + " length=" + term.length;
     final int newLength = start+suffix;
     term.grow(newLength);

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/DeltaBytesWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/DeltaBytesWriter.java?rev=927241&r1=927240&r2=927241&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/DeltaBytesWriter.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/DeltaBytesWriter.java Thu Mar 25 00:35:28 2010
@@ -52,9 +52,6 @@ final class DeltaBytesWriter {
     }
 
     final int suffix = length - start;
-    // mxx
-    //System.out.println(Thread.currentThread().getName() + ":  dbw start=" + start + " suffix=" + suffix + " outFP=" + out.getFilePointer());
-
     out.writeVInt(start);                       // prefix
     out.writeVInt(suffix);                      // suffix
     out.writeBytes(bytes, upto, suffix);

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/SimpleStandardTermsIndexReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/SimpleStandardTermsIndexReader.java?rev=927241&r1=927240&r2=927241&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/SimpleStandardTermsIndexReader.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/SimpleStandardTermsIndexReader.java Thu Mar 25 00:35:28 2010
@@ -23,10 +23,6 @@ import org.apache.lucene.index.FieldInfo
 import org.apache.lucene.index.FieldInfo;
 import org.apache.lucene.index.SegmentInfo;
 import org.apache.lucene.util.BytesRef;
-import org.apache.lucene.util.RamUsageEstimator;
-import org.apache.lucene.index.codecs.Codec;
-import org.apache.lucene.index.IndexWriter;
-import org.apache.lucene.util.ArrayUtil;
 import org.apache.lucene.util.CodecUtil;
 import org.apache.lucene.util.packed.PackedInts;
 
@@ -73,7 +69,6 @@ public class SimpleStandardTermsIndexRea
   private volatile boolean indexLoaded;
 
   private final Comparator<BytesRef> termComp;
-  private final String segment;
 
   private final static int PAGED_BYTES_BITS = 15;
 
@@ -87,8 +82,6 @@ public class SimpleStandardTermsIndexRea
 
     this.termComp = termComp;
 
-    this.segment = segment;
-
     IndexInput in = dir.openInput(IndexFileNames.segmentFileName(segment, StandardCodec.TERMS_INDEX_EXTENSION));
     
     boolean success = false;
@@ -96,10 +89,6 @@ public class SimpleStandardTermsIndexRea
     try {
       CodecUtil.checkHeader(in, SimpleStandardTermsIndexWriter.CODEC_NAME, SimpleStandardTermsIndexWriter.VERSION_START);
 
-      if (Codec.DEBUG) {
-        Codec.debug("  sstir init: header tii.fp=" + in.getFilePointer());
-      }
-
       final long dirOffset = in.readLong();
 
       indexInterval = in.readInt();
@@ -117,15 +106,8 @@ public class SimpleStandardTermsIndexRea
 
       final int numFields = in.readInt();
 
-      if (Codec.DEBUG) {
-        System.out.println("sstir create seg=" + segment + " numFields=" + numFields + " dirStart=" + dirOffset);
-      }
-
       for(int i=0;i<numFields;i++) {
         final int field = in.readInt();
-        if (Codec.DEBUG) {
-          System.out.println("  read field number=" + field);
-        }
         final int numIndexTerms = in.readInt();
         final long termsStart = in.readLong();
         final long indexStart = in.readLong();
@@ -182,21 +164,12 @@ public class SimpleStandardTermsIndexRea
       // is -1, so that StandardTermsDictReader can call
       // isIndexTerm for each field:
       if (indexDivisor != -1) {
-
-        if (Codec.DEBUG) {
-          System.out.println("read index for field=" + fieldInfo.name + " numIndexTerms=" + numIndexTerms + " indexDivisor=" + indexDivisor + " indexFP=" + indexStart);
-        }
-
         coreIndex = new CoreFieldIndex(indexStart,
                                        termsStart,
                                        packedIndexStart,
                                        packedOffsetsStart,
                                        numIndexTerms);
       
-      } else {
-        if (Codec.DEBUG) {
-          System.out.println("skip read index for field=" + fieldInfo.name + " numIndexTerms=" + numIndexTerms + " indexDivisor=" + indexDivisor);
-        }
       }
     }
 
@@ -316,7 +289,6 @@ public class SimpleStandardTermsIndexRea
 
             int upto = 0;
 
-            long lastTermOffset = 0;
             long termOffsetUpto = 0;
 
             while(upto < this.numIndexTerms) {
@@ -352,10 +324,6 @@ public class SimpleStandardTermsIndexRea
             clone.close();
           }
         }
-
-        if (Codec.DEBUG) {
-          System.out.println("  done read");
-        }
       }
 
       public final boolean nextIndexTerm(long ord, TermsIndexResult result) throws IOException {
@@ -377,11 +345,6 @@ public class SimpleStandardTermsIndexRea
       }
 
       public final void getIndexOffset(BytesRef term, TermsIndexResult result) throws IOException {
-
-        if (Codec.DEBUG) {
-          System.out.println("getIndexOffset field=" + fieldInfo.name + " term=" + term.utf8ToString());
-        }
-
         int lo = 0;					  // binary search
         int hi = numIndexTerms - 1;
 
@@ -433,11 +396,6 @@ public class SimpleStandardTermsIndexRea
       this.indexDivisor = indexDivisor;
       this.totalIndexInterval = indexInterval * indexDivisor;
 
-      // mxx
-      if (Codec.DEBUG) {
-        System.out.println(Thread.currentThread().getName() + ": sstir: load coreIndex on demand");
-      }
-
       Iterator<FieldIndexReader> it = fields.values().iterator();
       while(it.hasNext()) {
         it.next().loadTermsIndex();

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/SimpleStandardTermsIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/SimpleStandardTermsIndexWriter.java?rev=927241&r1=927240&r2=927241&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/SimpleStandardTermsIndexWriter.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/SimpleStandardTermsIndexWriter.java Thu Mar 25 00:35:28 2010
@@ -23,7 +23,6 @@ import org.apache.lucene.index.FieldInfo
 import org.apache.lucene.index.IndexFileNames;
 import org.apache.lucene.index.SegmentWriteState;
 import org.apache.lucene.util.BytesRef;
-import org.apache.lucene.index.codecs.Codec;
 import org.apache.lucene.util.CodecUtil;
 import org.apache.lucene.util.ArrayUtil;
 import org.apache.lucene.util.packed.PackedInts;
@@ -46,12 +45,9 @@ public class SimpleStandardTermsIndexWri
   private final FieldInfos fieldInfos; // unread
   private IndexOutput termsOut;
 
-  final private String segment;
-
   public SimpleStandardTermsIndexWriter(SegmentWriteState state) throws IOException {
     final String indexFileName = IndexFileNames.segmentFileName(state.segmentName, StandardCodec.TERMS_INDEX_EXTENSION);
     state.flushedFiles.add(indexFileName);
-    this.segment = state.segmentName;
     termIndexInterval = state.termIndexInterval;
     out = state.directory.createOutput(indexFileName);
     CodecUtil.writeHeader(out, CODEC_NAME, VERSION_CURRENT);
@@ -104,10 +100,6 @@ public class SimpleStandardTermsIndexWri
       // First term is first indexed term:
       if (0 == (numTerms++ % termIndexInterval)) {
 
-        if (Codec.DEBUG) {
-          Codec.debug("sstiw.checkIndexTerm write index field=" + fieldInfo.name + " term=" + text.utf8ToString() + " numIndexTerms=" + numIndexTerms + " outFP=" + out.getFilePointer());
-        }
-
         // write full bytes
         out.writeBytes(text.bytes, text.offset, text.length);
 
@@ -175,17 +167,11 @@ public class SimpleStandardTermsIndexWri
   @Override
   public void close() throws IOException {
     final long dirStart = out.getFilePointer();
-    if (Codec.DEBUG) {
-      System.out.println("sstiw.close seg=" + segment + " dirStart=" + dirStart);
-    }
     final int fieldCount = fields.size();
 
     out.writeInt(fieldCount);
     for(int i=0;i<fieldCount;i++) {
       SimpleFieldWriter field = fields.get(i);
-      if (Codec.DEBUG) {
-        System.out.println("sstiw.close save field=" + field.fieldInfo.name + " numIndexTerms=" + field.numIndexTerms);
-      }
       out.writeInt(field.fieldInfo.number);
       out.writeInt(field.numIndexTerms);
       out.writeLong(field.termsStart);
@@ -195,9 +181,6 @@ public class SimpleStandardTermsIndexWri
     }
     out.seek(CodecUtil.headerLength(CODEC_NAME));
     out.writeLong(dirStart);
-    if (Codec.DEBUG) {
-      System.out.println(" writeDirStart " + dirStart + " @ " + CodecUtil.headerLength(CODEC_NAME));
-    }
     out.close();
   }
 }
\ No newline at end of file

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPostingsReaderImpl.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPostingsReaderImpl.java?rev=927241&r1=927240&r2=927241&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPostingsReaderImpl.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPostingsReaderImpl.java Thu Mar 25 00:35:28 2010
@@ -25,7 +25,6 @@ import org.apache.lucene.index.SegmentIn
 import org.apache.lucene.index.FieldInfo;
 import org.apache.lucene.index.DocsEnum;
 import org.apache.lucene.index.DocsAndPositionsEnum;
-import org.apache.lucene.index.codecs.Codec;
 import org.apache.lucene.index.IndexFileNames;
 import org.apache.lucene.store.IndexInput;
 import org.apache.lucene.util.Bits;
@@ -130,20 +129,12 @@ public class StandardPostingsReaderImpl 
 
     final DocTermState docTermState = (DocTermState) termState;
 
-    if (Codec.DEBUG) {
-      Codec.debug("  sdr.readTerm tis.fp=" + termsIn.getFilePointer() + " df=" + termState.docFreq + " isIndex?=" + isIndexTerm + " tis=" + termsIn);
-    }
-
     if (isIndexTerm) {
       docTermState.freqOffset = termsIn.readVLong();
     } else {
       docTermState.freqOffset += termsIn.readVLong();
     }
 
-    if (Codec.DEBUG) {
-      Codec.debug("    frq.fp=" + docTermState.freqOffset + " vs len=" + freqIn.length());
-    }
-
     if (docTermState.docFreq >= skipInterval) {
       docTermState.skipOffset = termsIn.readVInt();
     } else {
@@ -205,16 +196,10 @@ public class StandardPostingsReaderImpl 
     DefaultSkipListReader skipper;
 
     public SegmentDocsEnum(IndexInput freqIn) throws IOException {
-      if (Codec.DEBUG) {
-        System.out.println("new docs enum");
-      }
       this.freqIn = (IndexInput) freqIn.clone();
     }
 
     public SegmentDocsEnum reset(FieldInfo fieldInfo, DocTermState termState, Bits skipDocs) throws IOException {
-      if (Codec.DEBUG) {
-        System.out.println("[" + desc + "] dr.reset freqIn seek " + termState.freqOffset + " docCount=" + termState.docFreq);
-      }
       omitTF = fieldInfo.omitTermFreqAndPositions;
       if (omitTF) {
         freq = 1;
@@ -239,10 +224,6 @@ public class StandardPostingsReaderImpl 
 
     @Override
     public int nextDoc() throws IOException {
-      if (Codec.DEBUG) {
-        Codec.debug("sdr.next [" + desc + "] ord=" + ord + " vs df=" + limit + " freq.fp=" + freqIn.getFilePointer() + " + has skip docs=" + (skipDocs != null));
-      }
-
       while(true) {
         if (ord == limit) {
           return doc = NO_MORE_DOCS;
@@ -252,9 +233,6 @@ public class StandardPostingsReaderImpl 
 
         // Decode next doc/freq pair
         final int code = freqIn.readVInt();
-        if (Codec.DEBUG) {
-          System.out.println("  read code=" + code);
-        }
         if (omitTF) {
           doc += code;
         } else {
@@ -268,23 +246,15 @@ public class StandardPostingsReaderImpl 
 
         if (skipDocs == null || !skipDocs.get(doc)) {
           break;
-        } else if (Codec.DEBUG) {
-          System.out.println("  doc=" + doc + " is skipped");
         }
       }
 
-      if (Codec.DEBUG) {
-        System.out.println("  result doc=" + doc + " freq=" + freq);
-      }
-
       return doc;
     }
 
     @Override
     public int read() throws IOException {
-      if (Codec.DEBUG) {
-        Codec.debug("sdr.bulk read: ord=" + ord + " df=" + limit + " omitTF=" + omitTF + " ord=" + ord + " of " + limit + " freq.fp=" + freqIn.getFilePointer(), desc);
-      }
+
       final int[] docs = bulkResult.docs.ints;
       final int[] freqs = bulkResult.freqs.ints;
       int i = 0;
@@ -305,19 +275,12 @@ public class StandardPostingsReaderImpl 
         }
 
         if (skipDocs == null || !skipDocs.get(doc)) {
-          if (Codec.DEBUG) {
-            Codec.debug("  " + i + ": doc=" + doc + " freq=" + freq, desc);
-          }
           docs[i] = doc;
           freqs[i] = freq;
           ++i;
         }
       }
       
-      if (Codec.DEBUG) {
-        System.out.println("  return " + i);
-      }
-
       return i;
     }
 
@@ -337,10 +300,6 @@ public class StandardPostingsReaderImpl 
       // TODO: jump right to next() if target is < X away
       // from where we are now?
 
-      if (Codec.DEBUG) {
-        System.out.println("dr [" + desc + "]: skip to target=" + target);
-      }
-
       if (skipOffset > 0) {
 
         // There are enough docs in the posting to have
@@ -361,10 +320,6 @@ public class StandardPostingsReaderImpl 
                        freqOffset, 0,
                        limit, storePayloads);
 
-          if (Codec.DEBUG) {
-            System.out.println("    skipper init  skipFP=" + (freqOffset+skipOffset) + " freqFP=" + freqOffset);
-          }
-
           skipped = true;
         }
 
@@ -376,16 +331,7 @@ public class StandardPostingsReaderImpl 
           ord = newOrd;
           doc = skipper.getDoc();
           freqIn.seek(skipper.getFreqPointer());
-
-          if (Codec.DEBUG) {
-            System.out.println("dr [" + desc + "]: skipper moved to newOrd=" + newOrd + " freqFP=" + skipper.getFreqPointer() + " doc=" + doc + "; now scan...");
-          }
-
-        } else if (Codec.DEBUG) {
-          System.out.println("  no skipping to be done");
         }
-      } else if (Codec.DEBUG) {
-        System.out.println("  no skip data (#docs is too low)");
       }
         
       // scan for the rest:
@@ -426,17 +372,11 @@ public class StandardPostingsReaderImpl 
     private long lazyProxPointer;
 
     public SegmentDocsAndPositionsEnum(IndexInput freqIn, IndexInput proxIn) throws IOException {
-      if (Codec.DEBUG) {
-        System.out.println("new docs enum");
-      }
       this.freqIn = (IndexInput) freqIn.clone();
       this.proxIn = (IndexInput) proxIn.clone();
     }
 
     public SegmentDocsAndPositionsEnum reset(FieldInfo fieldInfo, DocTermState termState, Bits skipDocs) throws IOException {
-      if (Codec.DEBUG) {
-        System.out.println("[" + desc + "] dr.init freqIn seek freq.fp=" + termState.freqOffset + " prox.fp=" + termState.proxOffset + " docCount=" + termState.docFreq);
-      }
       assert !fieldInfo.omitTermFreqAndPositions;
       storePayloads = fieldInfo.storePayloads;
       if (storePayloads && payload == null) {
@@ -470,10 +410,6 @@ public class StandardPostingsReaderImpl 
 
     @Override
     public int nextDoc() throws IOException {
-      if (Codec.DEBUG) {
-        Codec.debug("sdr.next [" + desc + "] ord=" + ord + " vs df=" + limit + " freq.fp=" + freqIn.getFilePointer() + " + has skip docs=" + (skipDocs != null));
-      }
-
       while(true) {
         if (ord == limit) {
           return doc = NO_MORE_DOCS;
@@ -483,9 +419,7 @@ public class StandardPostingsReaderImpl 
 
         // Decode next doc/freq pair
         final int code = freqIn.readVInt();
-        if (Codec.DEBUG) {
-          System.out.println("  read code=" + code);
-        }
+
         doc += code >>> 1;              // shift off low bit
         if ((code & 1) != 0) {          // if low bit is set
           freq = 1;                     // freq is one
@@ -496,14 +430,9 @@ public class StandardPostingsReaderImpl 
 
         if (skipDocs == null || !skipDocs.get(doc)) {
           break;
-        } else if (Codec.DEBUG) {
-          System.out.println("  doc=" + doc + " is skipped");
         }
       }
 
-      if (Codec.DEBUG) {
-        System.out.println("  result doc=" + doc + " freq=" + freq);
-      }
       position = 0;
 
       return doc;
@@ -525,10 +454,6 @@ public class StandardPostingsReaderImpl 
       // TODO: jump right to next() if target is < X away
       // from where we are now?
 
-      if (Codec.DEBUG) {
-        System.out.println("dr [" + desc + "]: skip to target=" + target);
-      }
-
       if (skipOffset > 0) {
 
         // There are enough docs in the posting to have
@@ -549,10 +474,6 @@ public class StandardPostingsReaderImpl 
                        freqOffset, proxOffset,
                        limit, storePayloads);
 
-          if (Codec.DEBUG) {
-            Codec.debug("    skip reader base freqFP=" + (freqOffset+skipOffset) + " freqFP=" + freqOffset + " prox.fp=" + proxOffset);
-          }
-
           skipped = true;
         }
 
@@ -568,16 +489,7 @@ public class StandardPostingsReaderImpl 
           position = 0;
           payloadPending = false;
           payloadLength = skipper.getPayloadLength();
-
-          if (Codec.DEBUG) {
-            Codec.debug("dr [" + desc + "]: skipper moved to newOrd=" + newOrd + " freq.fp=" + skipper.getFreqPointer() + " prox.fp=" + skipper.getProxPointer() + " doc=" + doc);
-          }
-
-        } else if (Codec.DEBUG) {
-          System.out.println("  no skipping to be done");
         }
-      } else if (Codec.DEBUG) {
-        System.out.println("  no skip data (#docs is too low)");
       }
         
       // Now, linear scan for the rest:
@@ -595,15 +507,8 @@ public class StandardPostingsReaderImpl 
         lazyProxPointer = -1;
       }
       
-      if (Codec.DEBUG) {
-        System.out.println("nextPos [" + desc + "] payloadPending=" + payloadPending + " payloadLen=" + payloadLength + " posPendingCount=" + posPendingCount + " freq=" + freq);
-      }
-
       if (payloadPending && payloadLength > 0) {
         // payload of last position as never retrieved -- skip it
-        if (Codec.DEBUG) {
-          System.out.println("      skip payload len=" + payloadLength);
-        }
         proxIn.seek(proxIn.getFilePointer() + payloadLength);
         payloadPending = false;
       }
@@ -611,10 +516,6 @@ public class StandardPostingsReaderImpl 
       // scan over any docs that were iterated without their positions
       while(posPendingCount > freq) {
 
-        if (Codec.DEBUG) {
-          System.out.println("      skip position");
-        }
-
         final int code = proxIn.readVInt();
 
         if (storePayloads) {
@@ -622,15 +523,9 @@ public class StandardPostingsReaderImpl 
             // new payload length
             payloadLength = proxIn.readVInt();
             assert payloadLength >= 0;
-            if (Codec.DEBUG) {
-              System.out.println("        new payloadLen=" + payloadLength);
-            }
           }
           assert payloadLength != -1;
           proxIn.seek(proxIn.getFilePointer() + payloadLength);
-          if (Codec.DEBUG) {
-            System.out.println("        skip payloadLen=" + payloadLength + " bytes");
-          }
         }
 
         posPendingCount--;
@@ -643,9 +538,6 @@ public class StandardPostingsReaderImpl 
 
         if (payloadPending && payloadLength > 0) {
           // payload wasn't retrieved for last position
-          if (Codec.DEBUG) {
-            System.out.println("      payload pending: skip " + payloadLength + " bytes");
-          }
           proxIn.seek(proxIn.getFilePointer()+payloadLength);
         }
 
@@ -654,9 +546,6 @@ public class StandardPostingsReaderImpl 
           // new payload length
           payloadLength = proxIn.readVInt();
           assert payloadLength >= 0;
-          if (Codec.DEBUG) {
-            System.out.println("      new payloadLen=" + payloadLength);
-          }
         }
         assert payloadLength != -1;
           
@@ -670,9 +559,6 @@ public class StandardPostingsReaderImpl 
 
       assert posPendingCount >= 0: "nextPosition() was called too many times (more than freq() times) posPendingCount=" + posPendingCount;
 
-      if (Codec.DEBUG) {
-        System.out.println("   proxFP=" + proxIn.getFilePointer() + " return pos=" + position);
-      }
       return position;
     }
 
@@ -688,9 +574,6 @@ public class StandardPostingsReaderImpl 
     public BytesRef getPayload() throws IOException {
       assert lazyProxPointer == -1;
       assert posPendingCount < freq;
-      if (Codec.DEBUG) {
-        System.out.println("      read payload: " + payloadLength);
-      }
       if (!payloadPending) {
         throw new IOException("Either no payload exists at this term position or an attempt was made to load it more than once.");
       }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPostingsWriterImpl.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPostingsWriterImpl.java?rev=927241&r1=927240&r2=927241&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPostingsWriterImpl.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/StandardPostingsWriterImpl.java Thu Mar 25 00:35:28 2010
@@ -27,7 +27,6 @@ import org.apache.lucene.index.FieldInfo
 import org.apache.lucene.index.SegmentWriteState;
 import org.apache.lucene.index.IndexFileNames;
 import org.apache.lucene.index.CorruptIndexException;
-import org.apache.lucene.index.codecs.Codec;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.CodecUtil;
 
@@ -118,8 +117,6 @@ public final class StandardPostingsWrite
   int lastDocID;
   int df;
   
-  int count;
-
   /** Adds a new doc in this term.  If this returns null
    *  then we just skip consuming positions/payloads. */
   @Override
@@ -127,10 +124,6 @@ public final class StandardPostingsWrite
 
     final int delta = docID - lastDocID;
     
-    if (Codec.DEBUG) {
-      Codec.debug("  addDoc [" + desc + "] count=" + (count++) + " docID=" + docID + " lastDocID=" + lastDocID + " delta=" + delta + " omitTF=" + omitTermFreqAndPositions + " freq=" + termDocFreq + " freq.fp=" + freqOut.getFilePointer());
-    }
-
     if (docID < 0 || (df > 0 && delta <= 0)) {
       throw new CorruptIndexException("docs out of order (" + docID + " <= " + lastDocID + " )");
     }
@@ -161,14 +154,6 @@ public final class StandardPostingsWrite
     assert !omitTermFreqAndPositions: "omitTermFreqAndPositions is true";
     assert proxOut != null;
 
-    if (Codec.DEBUG) {
-      if (payload != null) {
-        Codec.debug("    addPos [" + desc + "]: pos=" + position + " prox.fp=" + proxOut.getFilePointer() + " payload=" + payload.length + " bytes");
-      } else {
-        Codec.debug("    addPos [" + desc + "]: pos=" + position + " prox.fp=" + proxOut.getFilePointer());
-      }
-    }
-    
     final int delta = position - lastPosition;
     
     assert delta > 0 || position == 0 || position == -1: "position=" + position + " lastPosition=" + lastPosition;            // not quite right (if pos=0 is repeated twice we don't catch it)
@@ -176,15 +161,9 @@ public final class StandardPostingsWrite
     lastPosition = position;
 
     if (storePayloads) {
-      if (Codec.DEBUG) {
-        System.out.println("  store payloads");
-      }
       final int payloadLength = payload == null ? 0 : payload.length;
 
       if (payloadLength != lastPayloadLength) {
-        if (Codec.DEBUG) {
-          System.out.println("  payload len change old=" + lastPayloadLength + " new=" + payloadLength);
-        }
         lastPayloadLength = payloadLength;
         proxOut.writeVInt((delta<<1)|1);
         proxOut.writeVInt(payloadLength);
@@ -213,11 +192,6 @@ public final class StandardPostingsWrite
     // for this term) in two places?
     assert docCount == df;
 
-    // mxx
-    if (Codec.DEBUG) {
-      Codec.debug("dw.finishTerm termsOut.fp=" + termsOut.getFilePointer() + " freqStart=" + freqStart + " df=" + df + " isIndex?=" + isIndexTerm);
-    }
-
     if (isIndexTerm) {
       // Write absolute at seek points
       termsOut.writeVLong(freqStart);
@@ -229,10 +203,6 @@ public final class StandardPostingsWrite
     lastFreqStart = freqStart;
 
     if (df >= skipInterval) {
-      // mxx
-      if (Codec.DEBUG) {
-        System.out.println(Thread.currentThread().getName() + ":  writeSkip @ freqFP=" + freqOut.getFilePointer() + " freqStartFP=" + freqStart);
-      }
       termsOut.writeVInt((int) (skipListWriter.writeSkip(freqOut)-freqStart));
     }
      
@@ -249,9 +219,6 @@ public final class StandardPostingsWrite
 
     lastDocID = 0;
     df = 0;
-    
-    // nocommit -- debugging
-    count = 0;
   }
 
   @Override



Mime
View raw message