Class DocValuesConsumer

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

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 NormsFormat.normsConsumer(SegmentWriteState).
  2. addNumericField(org.apache.lucene.index.FieldInfo, org.apache.lucene.codecs.DocValuesProducer), addBinaryField(org.apache.lucene.index.FieldInfo, org.apache.lucene.codecs.DocValuesProducer), addSortedField(org.apache.lucene.index.FieldInfo, org.apache.lucene.codecs.DocValuesProducer), addSortedSetField(org.apache.lucene.index.FieldInfo, org.apache.lucene.codecs.DocValuesProducer), or addSortedNumericField(org.apache.lucene.index.FieldInfo, org.apache.lucene.codecs.DocValuesProducer) are called for each Numeric, Binary, Sorted, SortedSet, or SortedNumeric 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.
WARNING: This API is experimental and might change in incompatible ways in the next release.