public final class CompressingStoredFieldsWriter extends StoredFieldsWriter
StoredFieldsWriter.MergeVisitor
Modifier and Type | Field and Description |
---|---|
static String |
FIELDS_EXTENSION
Extension of stored fields file
|
static String |
INDEX_CODEC_NAME
Codec name for the index.
|
static String |
INDEX_EXTENSION_PREFIX
Extension of stored fields index
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
finish(FieldInfos fis,
int numDocs)
Called before
StoredFieldsWriter.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 . |
void |
startDocument()
Called before writing the stored fields of the document.
|
void |
writeField(FieldInfo info,
IndexableField field)
Writes a single stored field.
|
public static final String FIELDS_EXTENSION
public static final String INDEX_EXTENSION_PREFIX
public static final String INDEX_CODEC_NAME
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class StoredFieldsWriter
IOException
public void startDocument() throws IOException
StoredFieldsWriter
StoredFieldsWriter.writeField(FieldInfo, IndexableField)
will be called
for each stored field. Note that this is
called even if the document has no stored fields.startDocument
in class StoredFieldsWriter
IOException
public void finishDocument() throws IOException
StoredFieldsWriter
finishDocument
in class StoredFieldsWriter
IOException
public void writeField(FieldInfo info, IndexableField field) throws IOException
StoredFieldsWriter
writeField
in class StoredFieldsWriter
IOException
public void finish(FieldInfos fis, int numDocs) throws IOException
StoredFieldsWriter
StoredFieldsWriter.close()
, passing in the number
of documents that were written. Note that this is
intentionally redundant (equivalent to the number of
calls to StoredFieldsWriter.startDocument()
, but a Codec should
check that this is the case to detect the JRE bug described
in LUCENE-1282.finish
in class StoredFieldsWriter
IOException
public int merge(MergeState mergeState) throws IOException
StoredFieldsWriter
mergeState
. The default implementation skips
over deleted documents, and uses StoredFieldsWriter.startDocument()
,
StoredFieldsWriter.writeField(FieldInfo, IndexableField)
, and StoredFieldsWriter.finish(FieldInfos, int)
,
returning the number of documents that were written.
Implementations can override this method for more sophisticated
merging (bulk-byte copying, etc).merge
in class StoredFieldsWriter
IOException
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.