[GitHub] lucene-solr pull request #515: LUCENE-8593?: Specialize single value numeric...

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr pull request #515: LUCENE-8593?: Specialize single value numeric...

barrotsteindev
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 <simonw@...>
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr pull request #515: LUCENE-8593: Specialize single value numeric ...

barrotsteindev
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr pull request #515: LUCENE-8593: Specialize single value numeric ...

barrotsteindev
In reply to this post by barrotsteindev
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr pull request #515: LUCENE-8593: Specialize single value numeric ...

barrotsteindev
In reply to this post by barrotsteindev
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr pull request #515: LUCENE-8593: Specialize single value numeric ...

barrotsteindev
In reply to this post by barrotsteindev
Github user asfgit closed the pull request at:

    https://github.com/apache/lucene-solr/pull/515


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]