mirror of
https://github.com/apache/lucene.git
synced 2025-03-04 15:29:28 +00:00
remove dead code
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/pforcodec_3892@1357024 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5b4e1aea06
commit
1616749915
@ -87,14 +87,12 @@ public abstract class FixedIntBlockIndexInput extends IntIndexInput {
|
|||||||
private long lastBlockFP;
|
private long lastBlockFP;
|
||||||
private final BlockReader blockReader;
|
private final BlockReader blockReader;
|
||||||
private final int blockSize;
|
private final int blockSize;
|
||||||
private final IntsRef bulkResult = new IntsRef();
|
|
||||||
|
|
||||||
public Reader(final IndexInput in, final int[] pending, final BlockReader blockReader)
|
public Reader(final IndexInput in, final int[] pending, final BlockReader blockReader)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
this.in = in;
|
this.in = in;
|
||||||
this.pending = pending;
|
this.pending = pending;
|
||||||
this.blockSize = pending.length;
|
this.blockSize = pending.length;
|
||||||
bulkResult.ints = pending;
|
|
||||||
this.blockReader = blockReader;
|
this.blockReader = blockReader;
|
||||||
upto = blockSize;
|
upto = blockSize;
|
||||||
}
|
}
|
||||||
@ -129,25 +127,6 @@ public abstract class FixedIntBlockIndexInput extends IntIndexInput {
|
|||||||
|
|
||||||
return pending[upto++];
|
return pending[upto++];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IntsRef read(final int count) throws IOException {
|
|
||||||
this.maybeSeek();
|
|
||||||
if (upto == blockSize) {
|
|
||||||
blockReader.readBlock();
|
|
||||||
upto = 0;
|
|
||||||
}
|
|
||||||
bulkResult.offset = upto;
|
|
||||||
if (upto + count < blockSize) {
|
|
||||||
bulkResult.length = count;
|
|
||||||
upto += count;
|
|
||||||
} else {
|
|
||||||
bulkResult.length = blockSize - upto;
|
|
||||||
upto = blockSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
return bulkResult;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class Index extends IntIndexInput.Index {
|
private class Index extends IntIndexInput.Index {
|
||||||
|
@ -90,13 +90,11 @@ public abstract class VariableIntBlockIndexInput extends IntIndexInput {
|
|||||||
private long lastBlockFP;
|
private long lastBlockFP;
|
||||||
private int blockSize;
|
private int blockSize;
|
||||||
private final BlockReader blockReader;
|
private final BlockReader blockReader;
|
||||||
private final IntsRef bulkResult = new IntsRef();
|
|
||||||
|
|
||||||
public Reader(final IndexInput in, final int[] pending, final BlockReader blockReader)
|
public Reader(final IndexInput in, final int[] pending, final BlockReader blockReader)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
this.in = in;
|
this.in = in;
|
||||||
this.pending = pending;
|
this.pending = pending;
|
||||||
bulkResult.ints = pending;
|
|
||||||
this.blockReader = blockReader;
|
this.blockReader = blockReader;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,26 +145,6 @@ public abstract class VariableIntBlockIndexInput extends IntIndexInput {
|
|||||||
|
|
||||||
return pending[upto++];
|
return pending[upto++];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IntsRef read(final int count) throws IOException {
|
|
||||||
this.maybeSeek();
|
|
||||||
if (upto == blockSize) {
|
|
||||||
lastBlockFP = in.getFilePointer();
|
|
||||||
blockSize = blockReader.readBlock();
|
|
||||||
upto = 0;
|
|
||||||
}
|
|
||||||
bulkResult.offset = upto;
|
|
||||||
if (upto + count < blockSize) {
|
|
||||||
bulkResult.length = count;
|
|
||||||
upto += count;
|
|
||||||
} else {
|
|
||||||
bulkResult.length = blockSize - upto;
|
|
||||||
upto = blockSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
return bulkResult;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class Index extends IntIndexInput.Index {
|
private class Index extends IntIndexInput.Index {
|
||||||
|
@ -54,23 +54,5 @@ public abstract class IntIndexInput implements Closeable {
|
|||||||
|
|
||||||
/** Reads next single int */
|
/** Reads next single int */
|
||||||
public abstract int next() throws IOException;
|
public abstract int next() throws IOException;
|
||||||
|
|
||||||
/** Reads next chunk of ints */
|
|
||||||
private IntsRef bulkResult;
|
|
||||||
|
|
||||||
/** Read up to count ints. */
|
|
||||||
public IntsRef read(int count) throws IOException {
|
|
||||||
if (bulkResult == null) {
|
|
||||||
bulkResult = new IntsRef();
|
|
||||||
bulkResult.ints = new int[count];
|
|
||||||
} else {
|
|
||||||
bulkResult.grow(count);
|
|
||||||
}
|
|
||||||
for(int i=0;i<count;i++) {
|
|
||||||
bulkResult.ints[i] = next();
|
|
||||||
}
|
|
||||||
bulkResult.length = count;
|
|
||||||
return bulkResult;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user