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 2014/07/01 15:14:22 UTC
svn commit: r1607067 - in /lucene/dev/branches/branch_4x: ./ lucene/
lucene/CHANGES.txt lucene/core/
lucene/core/src/java/org/apache/lucene/codecs/DocValuesConsumer.java
Author: rmuir
Date: Tue Jul 1 13:14:21 2014
New Revision: 1607067
URL: http://svn.apache.org/r1607067
Log:
LUCENE-5799: optimize numeric docvalues merging
Modified:
lucene/dev/branches/branch_4x/ (props changed)
lucene/dev/branches/branch_4x/lucene/ (props changed)
lucene/dev/branches/branch_4x/lucene/CHANGES.txt (contents, props changed)
lucene/dev/branches/branch_4x/lucene/core/ (props changed)
lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/codecs/DocValuesConsumer.java
Modified: lucene/dev/branches/branch_4x/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/CHANGES.txt?rev=1607067&r1=1607066&r2=1607067&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/CHANGES.txt (original)
+++ lucene/dev/branches/branch_4x/lucene/CHANGES.txt Tue Jul 1 13:14:21 2014
@@ -24,6 +24,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).
Modified: lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/codecs/DocValuesConsumer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/codecs/DocValuesConsumer.java?rev=1607067&r1=1607066&r2=1607067&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/codecs/DocValuesConsumer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/codecs/DocValuesConsumer.java Tue Jul 1 13:14:21 2014
@@ -133,7 +133,8 @@ public abstract class DocValuesConsumer
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
}
assert nextIsSet;
nextIsSet = false;
- return nextValue;
+ return nextHasValue ? nextValue : null;
}
private boolean setNext() {
@@ -180,10 +181,11 @@ public abstract class DocValuesConsumer
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;