You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by s1monw <gi...@git.apache.org> on 2018/12/05 21:05:33 UTC
[GitHub] lucene-solr pull request #515: LUCENE-8593?: Specialize single value numeric...
GitHub user s1monw opened a pull request:
https://github.com/apache/lucene-solr/pull/515
LUCENE-8593?: Specialize single value numeric DV updates
The case when all values are the the same on a numeric field update
is common for soft_deletes. With the new infrastucture for buffering
DV updates we can gain an easy win by specializing the applied updates
if all values are the same.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/s1monw/lucene-solr optimize_single_value_numerics
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/lucene-solr/pull/515.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #515
----
commit 6c5538b0392d91177accbe31a6aaf31e8e1297f4
Author: Simon Willnauer <si...@...>
Date: 2018-12-05T20:58:30Z
LUCENE-8593?: Specialize single value numeric DV updates
The case when all values are the the same on a numeric field update
is common for soft_deletes. With the new infrastucture for buffering
DV updates we can gain an easy win by specializing the applied updates
if all values are the same.
----
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[GitHub] lucene-solr pull request #515: LUCENE-8593: Specialize single value numeric ...
Posted by dnhatn <gi...@git.apache.org>.
Github user dnhatn commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/515#discussion_r239323491
--- Diff: lucene/core/src/java/org/apache/lucene/index/DocValuesFieldUpdates.java ---
@@ -425,4 +425,51 @@ final boolean hasValue() {
return hasValue;
}
}
+
+ static abstract class SingleValueDocValuesFieldUpdates extends DocValuesFieldUpdates {
+
+ protected SingleValueDocValuesFieldUpdates(int maxDoc, long delGen, String field, DocValuesType type) {
+ super(maxDoc, delGen, field, type);
+ }
+
+ @Override
+ void add(int doc, long value) {
+ super.add(doc);
+ assert longValue() == value;
+ }
+
+ @Override
+ void add(int doc, BytesRef value) {
+ super.add(doc);
+ assert binaryValue().equals(value);
--- End diff --
I think this assert should be moved up.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[GitHub] lucene-solr pull request #515: LUCENE-8593: Specialize single value numeric ...
Posted by dnhatn <gi...@git.apache.org>.
Github user dnhatn commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/515#discussion_r239323699
--- Diff: lucene/core/src/java/org/apache/lucene/index/DocValuesFieldUpdates.java ---
@@ -425,4 +425,51 @@ final boolean hasValue() {
return hasValue;
}
}
+
+ static abstract class SingleValueDocValuesFieldUpdates extends DocValuesFieldUpdates {
+
+ protected SingleValueDocValuesFieldUpdates(int maxDoc, long delGen, String field, DocValuesType type) {
+ super(maxDoc, delGen, field, type);
+ }
+
+ @Override
+ void add(int doc, long value) {
+ super.add(doc);
+ assert longValue() == value;
+ }
+
+ @Override
+ void add(int doc, BytesRef value) {
+ super.add(doc);
+ assert binaryValue().equals(value);
+ }
+
+ @Override
+ void add(int docId, Iterator iterator) {
+ throw new UnsupportedOperationException();
+ }
+
+ protected abstract BytesRef binaryValue();
+ protected abstract long longValue();
--- End diff --
nit: extra line.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[GitHub] lucene-solr pull request #515: LUCENE-8593: Specialize single value numeric ...
Posted by dnhatn <gi...@git.apache.org>.
Github user dnhatn commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/515#discussion_r239323513
--- Diff: lucene/core/src/java/org/apache/lucene/index/DocValuesFieldUpdates.java ---
@@ -425,4 +425,51 @@ final boolean hasValue() {
return hasValue;
}
}
+
+ static abstract class SingleValueDocValuesFieldUpdates extends DocValuesFieldUpdates {
+
+ protected SingleValueDocValuesFieldUpdates(int maxDoc, long delGen, String field, DocValuesType type) {
+ super(maxDoc, delGen, field, type);
+ }
+
+ @Override
+ void add(int doc, long value) {
+ super.add(doc);
+ assert longValue() == value;
--- End diff --
I think this assert should be moved up.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[GitHub] lucene-solr pull request #515: LUCENE-8593: Specialize single value numeric ...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/lucene-solr/pull/515
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org