|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.lucene.codecs.DocValuesConsumer
public abstract class DocValuesConsumer
Abstract API that consumes IndexableFields.
DocValuesConsumer are always associated with a specific field and
segments. Concrete implementations of this API write the given
IndexableField into a implementation specific format depending on
the fields meta-data.
| Field Summary | |
|---|---|
protected BytesRef |
spare
Spare BytesRef that subclasses can reuse. |
| Constructor Summary | |
|---|---|
protected |
DocValuesConsumer()
Sole constructor. |
| Method Summary | |
|---|---|
abstract void |
add(int docID,
IndexableField value)
Adds the given IndexableField instance to this
DocValuesConsumer |
abstract void |
finish(int docCount)
Called when the consumer of this API is done adding values. |
protected abstract DocValues.Type |
getType()
Returns the DocValues.Type of this consumer. |
abstract int |
getValueSize()
Returns the value size this consumer accepts or -1 iff this consumer is value size agnostic ie. |
protected void |
merge(DocValues reader,
int docBase,
int docCount,
Bits liveDocs)
Merges the given DocValues into this DocValuesConsumer. |
void |
merge(MergeState mergeState,
DocValues[] docValues)
Merges the given MergeState into
this DocValuesConsumer. |
protected void |
mergeDoc(Field scratchField,
DocValues.Source source,
int docID,
int sourceDoc)
Merges a document with the given docID. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final BytesRef spare
BytesRef that subclasses can reuse.
| Constructor Detail |
|---|
protected DocValuesConsumer()
| Method Detail |
|---|
protected abstract DocValues.Type getType()
DocValues.Type of this consumer.
public abstract void add(int docID,
IndexableField value)
throws IOException
IndexableField instance to this
DocValuesConsumer
docID - the document ID to add the value for. The docID must always
increase or be 0 if it is the first call to this method.value - the value to add
IOException - if an IOException occurs
public abstract void finish(int docCount)
throws IOException
docCount - the total number of documents in this DocValuesConsumer.
Must be greater than or equal the last given docID to
add(int, IndexableField).
IOException - If an I/O error occurspublic abstract int getValueSize()
NOTE: the return value is undefined until the consumer has successfully consumed at least one value.
public void merge(MergeState mergeState,
DocValues[] docValues)
throws IOException
MergeState into
this DocValuesConsumer.
mergeState - the state to mergedocValues - docValues array containing one instance per reader (
MergeState.readers) or null if the reader has
no DocValues instance.
IOException - if an IOException occurs
protected void merge(DocValues reader,
int docBase,
int docCount,
Bits liveDocs)
throws IOException
DocValues into this DocValuesConsumer.
IOException - if an IOException occurs
protected void mergeDoc(Field scratchField,
DocValues.Source source,
int docID,
int sourceDoc)
throws IOException
docID. The methods
implementation obtains the value for the sourceDoc id from the
current DocValues.Source.
This method is used during merging to provide implementation agnostic default merge implementation.
All documents IDs between the given ID and the previously given ID or 0 if the method is call the first time are filled with default values depending on the implementation. The given document ID must always be greater than the previous ID or 0 if called the first time.
IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||