LUCENE-6890: update TODOs; remove dead code from test case; improve javadocs

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1713684 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2015-11-10 16:26:20 +00:00
parent 148b453949
commit f25c890709
4 changed files with 5 additions and 22 deletions

View File

@ -382,8 +382,8 @@ public abstract class StringHelper {
} }
/** Compares a fixed length slice of two byte arrays interpreted as /** Compares a fixed length slice of two byte arrays interpreted as
* unsigned values. Returns positive int if a > b, negative * big-endian unsigned values. Returns positive int if a > b,
* int if a < b and 0 if a == b */ * negative int if a < b and 0 if a == b */
public static int compare(int count, byte[] a, int aOffset, byte[] b, int bOffset) { public static int compare(int count, byte[] a, int aOffset, byte[] b, int bOffset) {
for(int i=0;i<count;i++) { for(int i=0;i<count;i++) {
int cmp = (a[aOffset+i]&0xff) - (b[bOffset+i]&0xff); int cmp = (a[aOffset+i]&0xff) - (b[bOffset+i]&0xff);

View File

@ -129,8 +129,6 @@ public class BKDReader implements Accountable {
int count = in.readVInt(); int count = in.readVInt();
visitor.grow(count); visitor.grow(count);
// TODO: especially for the 1D case, this was a decent speedup, because caller could know it should budget for around XXX docs:
//state.docs.grow(count);
for(int i=0;i<count;i++) { for(int i=0;i<count;i++) {
visitor.visit(in.readInt()); visitor.visit(in.readInt());
} }
@ -142,9 +140,6 @@ public class BKDReader implements Accountable {
// How many points are stored in this leaf cell: // How many points are stored in this leaf cell:
int count = in.readVInt(); int count = in.readVInt();
// TODO: we could maybe pollute the IntersectVisitor API with a "grow" method if this maybe helps perf
// enough (it did before, esp. for the 1D case):
//state.docs.grow(count);
for(int i=0;i<count;i++) { for(int i=0;i<count;i++) {
docIDs[i] = in.readInt(); docIDs[i] = in.readInt();
} }

View File

@ -474,6 +474,8 @@ public class BKDWriter implements Closeable {
out.writeVInt(leafBlockFPs.length); out.writeVInt(leafBlockFPs.length);
// TODO: for 1D case, don't waste the first byte of each split value (it's always 0)
// NOTE: splitPackedValues[0] is unused, because nodeID is 1-based: // NOTE: splitPackedValues[0] is unused, because nodeID is 1-based:
out.writeBytes(splitPackedValues, 0, splitPackedValues.length); out.writeBytes(splitPackedValues, 0, splitPackedValues.length);

View File

@ -50,7 +50,6 @@ import org.apache.lucene.index.Term;
import org.apache.lucene.store.Directory; import org.apache.lucene.store.Directory;
import org.apache.lucene.store.MockDirectoryWrapper; import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.FixedBitSet;
import org.apache.lucene.util.IOUtils; import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.TestUtil;
@ -90,24 +89,11 @@ public class TestDimensionalRangeQuery extends LuceneTestCase {
int numValues = atLeast(10000); int numValues = atLeast(10000);
long value = randomValue(false); long value = randomValue(false);
long[] values = new long[numValues]; long[] values = new long[numValues];
FixedBitSet missing = new FixedBitSet(numValues);
if (VERBOSE) { if (VERBOSE) {
System.out.println("TEST: use same value=" + value); System.out.println("TEST: use same value=" + value);
} }
Arrays.fill(values, value);
for(int docID=0;docID<numValues;docID++) {
int x = random().nextInt(20);
if (x == 17) {
// Some docs don't have a point:
missing.set(docID);
if (VERBOSE) {
System.out.println(" doc=" + docID + " is missing");
}
continue;
}
values[docID] = value;
}
verifyLongs(values, null); verifyLongs(values, null);
} }