You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2011/02/11 01:51:36 UTC

svn commit: r1069647 - in /lucene/dev/branches/bulkpostings/lucene/src: java/org/apache/lucene/index/codecs/intblock/ java/org/apache/lucene/index/codecs/sep/ test-framework/org/apache/lucene/index/codecs/mocksep/

Author: rmuir
Date: Fri Feb 11 00:51:35 2011
New Revision: 1069647

URL: http://svn.apache.org/viewvc?rev=1069647&view=rev
Log:
remove dead code

Modified:
    lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/intblock/FixedIntBlockIndexInput.java
    lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/intblock/FixedIntBlockIndexOutput.java
    lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/intblock/VariableIntBlockIndexInput.java
    lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/intblock/VariableIntBlockIndexOutput.java
    lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/sep/IntIndexInput.java
    lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/sep/IntIndexOutput.java
    lucene/dev/branches/bulkpostings/lucene/src/test-framework/org/apache/lucene/index/codecs/mocksep/MockSingleIntIndexInput.java
    lucene/dev/branches/bulkpostings/lucene/src/test-framework/org/apache/lucene/index/codecs/mocksep/MockSingleIntIndexOutput.java

Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/intblock/FixedIntBlockIndexInput.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/intblock/FixedIntBlockIndexInput.java?rev=1069647&r1=1069646&r2=1069647&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/intblock/FixedIntBlockIndexInput.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/intblock/FixedIntBlockIndexInput.java Fri Feb 11 00:51:35 2011
@@ -167,26 +167,6 @@ public abstract class FixedIntBlockIndex
       assert upto < blockSize;
     }
 
-    // This is used on index stored in terms dict
-    @Override
-    public void read(final BulkPostingsEnum.BlockReader indexIn, final boolean absolute) throws IOException {
-      if (absolute) {
-        fp = readVLong(indexIn);
-        upto = next(indexIn);
-      } else {
-        final long delta = readVLong(indexIn);
-        if (delta == 0) {
-          // same block
-          upto += next(indexIn);
-        } else {
-          // new block
-          fp += delta;
-          upto = next(indexIn);
-        }
-      }
-      assert upto < blockSize;
-    }
-
     @Override
     public void seek(final BulkPostingsEnum.BlockReader other) throws IOException {
       ((Reader) other).seek(fp, upto);

Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/intblock/FixedIntBlockIndexOutput.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/intblock/FixedIntBlockIndexOutput.java?rev=1069647&r1=1069646&r2=1069647&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/intblock/FixedIntBlockIndexOutput.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/intblock/FixedIntBlockIndexOutput.java Fri Feb 11 00:51:35 2011
@@ -94,25 +94,6 @@ public abstract class FixedIntBlockIndex
     }
 
     @Override
-    public void write(IntIndexOutput indexOut, boolean absolute) throws IOException {
-      if (absolute) {
-        indexOut.writeVLong(fp);
-        indexOut.write(upto);
-      } else if (fp == lastFP) {
-        // same block
-        indexOut.writeVLong(0);
-        assert upto >= lastUpto;
-        indexOut.write(upto - lastUpto);
-      } else {      
-        // new block
-        indexOut.writeVLong(fp - lastFP);
-        indexOut.write(upto);
-      }
-      lastUpto = upto;
-      lastFP = fp;
-    }
-
-    @Override
     public String toString() {
       return "fp=" + fp + " idx=" + upto;
     }

Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/intblock/VariableIntBlockIndexInput.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/intblock/VariableIntBlockIndexInput.java?rev=1069647&r1=1069646&r2=1069647&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/intblock/VariableIntBlockIndexInput.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/intblock/VariableIntBlockIndexInput.java Fri Feb 11 00:51:35 2011
@@ -180,25 +180,6 @@ public abstract class VariableIntBlockIn
       //assert upto < maxBlockSize: "upto=" + upto + " max=" + maxBlockSize;
     }
 
-    // This is used on index stored in terms dict
-    @Override
-    public void read(final BulkPostingsEnum.BlockReader indexIn, final boolean absolute) throws IOException {
-      if (absolute) {
-        fp = readVLong(indexIn);
-        upto = next(indexIn)&0xFF;
-      } else {
-        final long delta = readVLong(indexIn);
-        if (delta == 0) {
-          // same block
-          upto = next(indexIn)&0xFF;
-        } else {
-          // new block
-          fp += delta;
-          upto = next(indexIn)&0xFF;
-        }
-      }
-    }
-
     @Override
     public String toString() {
       return "VarIntBlock.Index fp=" + fp + " upto=" + upto + " maxBlock=" + maxBlockSize;

Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/intblock/VariableIntBlockIndexOutput.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/intblock/VariableIntBlockIndexOutput.java?rev=1069647&r1=1069646&r2=1069647&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/intblock/VariableIntBlockIndexOutput.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/intblock/VariableIntBlockIndexOutput.java Fri Feb 11 00:51:35 2011
@@ -105,26 +105,6 @@ public abstract class VariableIntBlockIn
     }
 
     @Override
-    public void write(IntIndexOutput indexOut, boolean absolute) throws IOException {
-      assert upto >= 0;
-      if (absolute) {
-        indexOut.writeVLong(fp);
-        indexOut.write(upto);
-      } else if (fp == lastFP) {
-        // same block
-        indexOut.writeVLong(0);
-        assert upto >= lastUpto;
-        indexOut.write(upto);
-      } else {      
-        // new block
-        indexOut.writeVLong(fp - lastFP);
-        indexOut.write(upto);
-      }
-      lastUpto = upto;
-      lastFP = fp;
-    }
-
-    @Override
     public String toString() {
       return "VarIntBlock.Output fp=" + fp + " upto=" + upto;
     }

Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/sep/IntIndexInput.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/sep/IntIndexInput.java?rev=1069647&r1=1069646&r2=1069647&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/sep/IntIndexInput.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/sep/IntIndexInput.java Fri Feb 11 00:51:35 2011
@@ -41,8 +41,6 @@ public abstract class IntIndexInput impl
 
     public abstract void read(DataInput indexIn, boolean absolute) throws IOException;
 
-    public abstract void read(BulkPostingsEnum.BlockReader indexIn, boolean absolute) throws IOException;
-
     /** Seeks primary stream to the last read offset.
      *  Returns true if the seek was "within block", ie
      *  within the last read block, at which point you
@@ -58,30 +56,4 @@ public abstract class IntIndexInput impl
     @Override
     public abstract Object clone();
   }
-
-
-  public static int next(BulkPostingsEnum.BlockReader reader) throws IOException {
-    final int[] buffer = reader.getBuffer();
-    int offset = reader.offset();
-    int end = reader.end();
-    if (offset >= end) {
-      offset = 0;
-      end = reader.fill();
-      assert offset < end;
-    }
-    reader.setOffset(1+offset);
-    return buffer[offset];
-  }
-
-  /** Reads long as 1 or 2 ints, and can only use 61 of
-   *  the 64 long bits. */
-  public static long readVLong(BulkPostingsEnum.BlockReader reader) throws IOException {
-    final int v = next(reader);
-    if ((v & 1) == 0) {
-      return v >> 1;
-    } else {
-      final long v2 = next(reader);
-      return (v2 << 30) | (v >> 1);
-    }
-  }
 }

Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/sep/IntIndexOutput.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/sep/IntIndexOutput.java?rev=1069647&r1=1069646&r2=1069647&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/sep/IntIndexOutput.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/sep/IntIndexOutput.java Fri Feb 11 00:51:35 2011
@@ -40,23 +40,6 @@ public abstract class IntIndexOutput imp
    * >= 0.  */
   public abstract void write(int v) throws IOException;
 
-  public static final long MAX_SINGLE_INT_VLONG = Integer.MAX_VALUE - (1<<30);
-  public static final long MAX_VLONG = Long.MAX_VALUE - (1L<<62) - (1L<<61);
-
-  /** Encodes as 1 or 2 ints, and can only use 61 of the 64
-   *  long bits. */
-  public void writeVLong(long v) throws IOException {
-    assert v >= 0: "v=" + v;
-    assert v < MAX_VLONG: "v=" + v;
-    // we cannot pass a negative int 
-    if (v <= MAX_SINGLE_INT_VLONG) {
-      write(((int) v)<<1);
-    } else {
-      write(((int) ((v & MAX_SINGLE_INT_VLONG))<<1) | 1);
-      write(((int) (v >> 30)));
-    }
-  }
-
   public abstract static class Index {
 
     /** Internally records the current location */
@@ -68,8 +51,6 @@ public abstract class IntIndexOutput imp
     /** Writes "location" of current output pointer of primary
      *  output to different output (out) */
     public abstract void write(IndexOutput indexOut, boolean absolute) throws IOException;
-
-    public abstract void write(IntIndexOutput indexOut, boolean absolute) throws IOException;
   }
 
   /** If you are indexing the primary output file, call

Modified: lucene/dev/branches/bulkpostings/lucene/src/test-framework/org/apache/lucene/index/codecs/mocksep/MockSingleIntIndexInput.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test-framework/org/apache/lucene/index/codecs/mocksep/MockSingleIntIndexInput.java?rev=1069647&r1=1069646&r2=1069647&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test-framework/org/apache/lucene/index/codecs/mocksep/MockSingleIntIndexInput.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test-framework/org/apache/lucene/index/codecs/mocksep/MockSingleIntIndexInput.java Fri Feb 11 00:51:35 2011
@@ -106,16 +106,6 @@ public class MockSingleIntIndexInput ext
     }
 
     @Override
-    public void read(BulkPostingsEnum.BlockReader indexIn, boolean absolute)
-      throws IOException {
-      if (absolute) {
-        fp = readVLong(indexIn);
-      } else {
-        fp += readVLong(indexIn);
-      }
-    }
-
-    @Override
     public void set(IntIndexInput.Index other) {
       fp = ((Index) other).fp;
     }

Modified: lucene/dev/branches/bulkpostings/lucene/src/test-framework/org/apache/lucene/index/codecs/mocksep/MockSingleIntIndexOutput.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test-framework/org/apache/lucene/index/codecs/mocksep/MockSingleIntIndexOutput.java?rev=1069647&r1=1069646&r2=1069647&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test-framework/org/apache/lucene/index/codecs/mocksep/MockSingleIntIndexOutput.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test-framework/org/apache/lucene/index/codecs/mocksep/MockSingleIntIndexOutput.java Fri Feb 11 00:51:35 2011
@@ -77,17 +77,6 @@ public class MockSingleIntIndexOutput ex
       }
       lastFP = fp;
     }
-
-    @Override
-    public void write(IntIndexOutput indexOut, boolean absolute) 
-      throws IOException {
-      if (absolute) {
-        indexOut.writeVLong(fp);
-      } else {
-        indexOut.writeVLong(fp - lastFP);
-      }
-      lastFP = fp;
-    }
       
     @Override
     public String toString() {