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

Reply via email to