nuke more nocommits

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene4547@1436681 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2013-01-21 23:03:40 +00:00
parent 078e0a1265
commit 36ebc71124
5 changed files with 10 additions and 40 deletions

View File

@ -676,7 +676,7 @@ public class CheckIndex {
} }
for (FieldInfo info : reader.getFieldInfos()) { for (FieldInfo info : reader.getFieldInfos()) {
if (info.hasNorms()) { if (info.hasNorms()) {
checkSimpleNorms(info, reader, infoStream); checkNorms(info, reader, infoStream);
++status.totFields; ++status.totFields;
} else { } else {
if (reader.getNormValues(info.name) != null) { if (reader.getNormValues(info.name) != null) {
@ -1262,7 +1262,7 @@ public class CheckIndex {
for (FieldInfo fieldInfo : reader.getFieldInfos()) { for (FieldInfo fieldInfo : reader.getFieldInfos()) {
if (fieldInfo.hasDocValues()) { if (fieldInfo.hasDocValues()) {
status.totalValueFields++; status.totalValueFields++;
checkSimpleDocValues(fieldInfo, reader, infoStream); checkDocValues(fieldInfo, reader, infoStream);
} else { } else {
if (reader.getBinaryDocValues(fieldInfo.name) != null || if (reader.getBinaryDocValues(fieldInfo.name) != null ||
reader.getNumericDocValues(fieldInfo.name) != null || reader.getNumericDocValues(fieldInfo.name) != null ||
@ -1284,10 +1284,6 @@ public class CheckIndex {
} }
private static void checkBinaryDocValues(String fieldName, AtomicReader reader, BinaryDocValues dv) { private static void checkBinaryDocValues(String fieldName, AtomicReader reader, BinaryDocValues dv) {
// nocommit remove this:
if (dv == null) {
return;
}
// nocommit what else to check ... // nocommit what else to check ...
BytesRef scratch = new BytesRef(); BytesRef scratch = new BytesRef();
for (int i = 0; i < reader.maxDoc(); i++) { for (int i = 0; i < reader.maxDoc(); i++) {
@ -1296,10 +1292,6 @@ public class CheckIndex {
} }
private static void checkSortedDocValues(String fieldName, AtomicReader reader, SortedDocValues dv) { private static void checkSortedDocValues(String fieldName, AtomicReader reader, SortedDocValues dv) {
// nocommit remove this:
if (dv == null) {
return;
}
checkBinaryDocValues(fieldName, reader, dv); checkBinaryDocValues(fieldName, reader, dv);
final int maxOrd = dv.getValueCount()-1; final int maxOrd = dv.getValueCount()-1;
FixedBitSet seenOrds = new FixedBitSet(dv.getValueCount()); FixedBitSet seenOrds = new FixedBitSet(dv.getValueCount());
@ -1332,23 +1324,13 @@ public class CheckIndex {
} }
private static void checkNumericDocValues(String fieldName, AtomicReader reader, NumericDocValues ndv) { private static void checkNumericDocValues(String fieldName, AtomicReader reader, NumericDocValues ndv) {
// nocommit remove this:
if (ndv == null) {
return;
}
// nocommit what else to check! // nocommit what else to check!
for (int i = 0; i < reader.maxDoc(); i++) { for (int i = 0; i < reader.maxDoc(); i++) {
ndv.get(i); ndv.get(i);
} }
} }
// nocommit private static void checkDocValues(FieldInfo fi, AtomicReader reader, PrintStream infoStream) throws Exception {
public static void checkSimpleDocValues(FieldInfo fi, AtomicReader reader, PrintStream infoStream) throws Exception {
// nocommit: just for debugging
Map<String,String> atts = fi.attributes();
if (atts != null) {
msg(infoStream, " field: " + fi.name + ": " + atts);
}
switch(fi.getDocValuesType()) { switch(fi.getDocValuesType()) {
case SORTED: case SORTED:
checkSortedDocValues(fi.name, reader, reader.getSortedDocValues(fi.name)); checkSortedDocValues(fi.name, reader, reader.getSortedDocValues(fi.name));
@ -1364,8 +1346,7 @@ public class CheckIndex {
} }
} }
// nocommit private static void checkNorms(FieldInfo fi, AtomicReader reader, PrintStream infoStream) throws IOException {
public static void checkSimpleNorms(FieldInfo fi, AtomicReader reader, PrintStream infoStream) throws IOException {
switch(fi.getNormType()) { switch(fi.getNormType()) {
case NUMERIC: case NUMERIC:
checkNumericDocValues(fi.name, reader, reader.getNormValues(fi.name)); checkNumericDocValues(fi.name, reader, reader.getNormValues(fi.name));

View File

@ -53,7 +53,7 @@ public class MultiDocValues {
} }
} }
// assert anyReal; // nocommit: unsafe until 4.0 is done assert anyReal;
return new NumericDocValues() { return new NumericDocValues() {
@Override @Override
@ -65,7 +65,7 @@ public class MultiDocValues {
} catch (IOException ioe) { } catch (IOException ioe) {
throw new RuntimeException(ioe); throw new RuntimeException(ioe);
} }
if (norms == null) { // WTF? should be EMPTY? if (norms == null) {
return 0; return 0;
} else { } else {
return norms.get(docID - leaves.get(subIndex).docBase); return norms.get(docID - leaves.get(subIndex).docBase);

View File

@ -17,10 +17,6 @@ package org.apache.lucene.index;
* limitations under the License. * limitations under the License.
*/ */
import java.io.IOException;
import java.util.Comparator;
import org.apache.lucene.util.Bits;
import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRef;
public abstract class SortedDocValues extends BinaryDocValues { public abstract class SortedDocValues extends BinaryDocValues {
@ -41,14 +37,6 @@ public abstract class SortedDocValues extends BinaryDocValues {
} }
} }
// nocommit make this final, and impl seekExact(term) to
// fwd to lookupTerm
// nocommit should we nuke this? the iterator can be
// efficiently built "on top" since ord is part of the
// API? why must it be impl'd here...?
// SortedDocValuesTermsEnum.
public static final SortedDocValues EMPTY = new SortedDocValues() { public static final SortedDocValues EMPTY = new SortedDocValues() {
@Override @Override
public int getOrd(int docID) { public int getOrd(int docID) {

View File

@ -84,7 +84,6 @@ import org.apache.lucene.util.BytesRef;
* @lucene.experimental * @lucene.experimental
*/ */
public abstract class FieldComparator<T> { public abstract class FieldComparator<T> {
// nocommit remove the doc values comparators
/** /**
* Compare hit at slot1 with hit at slot2. * Compare hit at slot1 with hit at slot2.

View File

@ -113,8 +113,10 @@ public final class Util {
return getByOutput(fst, targetOutput, in, arc, scratchArc, result); return getByOutput(fst, targetOutput, in, arc, scratchArc, result);
} }
/** Expert: like {@link Util#getByOutput(FST, long)} except reusing */ /**
// nocommit * Expert: like {@link Util#getByOutput(FST, long)} except reusing
* BytesReader, initial and scratch Arc, and result.
*/
public static IntsRef getByOutput(FST<Long> fst, long targetOutput, BytesReader in, Arc<Long> arc, Arc<Long> scratchArc, IntsRef result) throws IOException { public static IntsRef getByOutput(FST<Long> fst, long targetOutput, BytesReader in, Arc<Long> arc, Arc<Long> scratchArc, IntsRef result) throws IOException {
long output = arc.output; long output = arc.output;
int upto = 0; int upto = 0;