LUCENE-5799: optimize numeric docvalues merging

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1607065 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2014-07-01 13:06:23 +00:00
parent b8067fa423
commit b0b4c711e8
2 changed files with 9 additions and 5 deletions

View File

@ -115,6 +115,8 @@ Optimizations
* LUCENE-5798: Optimize MultiDocsEnum reuse. (Robert Muir)
* LUCENE-5799: Optimize numeric docvalues merging. (Robert Muir)
Test Framework
* LUCENE-5786: Unflushed/ truncated events file (hung testing subprocess).

View File

@ -133,7 +133,8 @@ public abstract class DocValuesConsumer implements Closeable {
return new Iterator<Number>() {
int readerUpto = -1;
int docIDUpto;
Long nextValue;
long nextValue;
boolean nextHasValue;
AtomicReader currentReader;
NumericDocValues currentValues;
Bits currentLiveDocs;
@ -157,7 +158,7 @@ public abstract class DocValuesConsumer implements Closeable {
}
assert nextIsSet;
nextIsSet = false;
return nextValue;
return nextHasValue ? nextValue : null;
}
private boolean setNext() {
@ -180,10 +181,11 @@ public abstract class DocValuesConsumer implements Closeable {
if (currentLiveDocs == null || currentLiveDocs.get(docIDUpto)) {
nextIsSet = true;
if (currentDocsWithField.get(docIDUpto)) {
nextValue = currentValues.get(docIDUpto);
nextValue = currentValues.get(docIDUpto);
if (nextValue == 0 && currentDocsWithField.get(docIDUpto) == false) {
nextHasValue = false;
} else {
nextValue = null;
nextHasValue = true;
}
docIDUpto++;
return true;