Class DocValuesConsumer

java.lang.Object
org.apache.lucene.codecs.DocValuesConsumer
All Implemented Interfaces:
Closeable, AutoCloseable
Direct Known Subclasses:
Lucene45DocValuesConsumer

public abstract class DocValuesConsumer extends Object implements Closeable
Abstract API that consumes numeric, binary and sorted docvalues. Concrete implementations of this actually do "something" with the docvalues (write it into the index in a specific format).

The lifecycle is:

  1. DocValuesConsumer is created by DocValuesFormat.fieldsConsumer(SegmentWriteState) or NormsFormat.normsConsumer(SegmentWriteState).
  2. addNumericField(org.apache.lucene.index.FieldInfo, java.lang.Iterable<java.lang.Number>), addBinaryField(org.apache.lucene.index.FieldInfo, java.lang.Iterable<org.apache.lucene.util.BytesRef>), or addSortedField(org.apache.lucene.index.FieldInfo, java.lang.Iterable<org.apache.lucene.util.BytesRef>, java.lang.Iterable<java.lang.Number>) are called for each Numeric, Binary, or Sorted docvalues field. The API is a "pull" rather than "push", and the implementation is free to iterate over the values multiple times (Iterable.iterator()).
  3. After all fields are added, the consumer is Closeable.close()d.