public abstract class StoredFieldsWriter extends implements , Accountable
startDocument()
is called,
informing the Codec that a new document has started.
writeField(FieldInfo, IndexableField)
is called for
each field in the document.
finish(FieldInfos, int)
is called for verification/sanity-checks.
close()
)
Modifier and Type | Class and Description |
---|---|
protected class |
StoredFieldsWriter.MergeVisitor
A visitor that adds every field it sees.
|
NULL_ACCOUNTABLE
Modifier | Constructor and Description |
---|---|
protected |
StoredFieldsWriter()
Sole constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
close() |
abstract void |
finish(FieldInfos fis,
int numDocs)
Called before
close() , passing in the number
of documents that were written. |
void |
finishDocument()
Called when a document and all its fields have been added.
|
int |
merge(MergeState mergeState)
Merges in the stored fields from the readers in
mergeState . |
abstract void |
startDocument()
Called before writing the stored fields of the document.
|
abstract void |
writeField(FieldInfo info,
IndexableField field)
Writes a single stored field.
|
getChildResources, ramBytesUsed
protected StoredFieldsWriter()
public abstract void startDocument() throws
writeField(FieldInfo, IndexableField)
will be called
for each stored field. Note that this is
called even if the document has no stored fields.
public void finishDocument() throws
public abstract void writeField(FieldInfo info, IndexableField field) throws
public abstract void finish(FieldInfos fis, int numDocs) throws
close()
, passing in the number
of documents that were written. Note that this is
intentionally redundant (equivalent to the number of
calls to startDocument()
, but a Codec should
check that this is the case to detect the JRE bug described
in LUCENE-1282.
public int merge(MergeState mergeState) throws
mergeState
. The default implementation skips
over deleted documents, and uses startDocument()
,
writeField(FieldInfo, IndexableField)
, and finish(FieldInfos, int)
,
returning the number of documents that were written.
Implementations can override this method for more sophisticated
merging (bulk-byte copying, etc).
public abstract void close() throws
in interface
in interface
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.