public final class CompressingStoredFieldsWriter extends StoredFieldsWriter
| Constructor and Description |
|---|
CompressingStoredFieldsWriter(Directory directory,
SegmentInfo si,
java.lang.String segmentSuffix,
IOContext context,
java.lang.String formatName,
CompressionMode compressionMode,
int chunkSize)
Sole constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abort()
Aborts writing entirely, implementation should remove
any partially-written files, etc.
|
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(int numStoredFields)
Called before writing the stored fields of the document.
|
void |
writeField(FieldInfo info,
IndexableField field)
Writes a single stored field.
|
public CompressingStoredFieldsWriter(Directory directory, SegmentInfo si, java.lang.String segmentSuffix, IOContext context, java.lang.String formatName, CompressionMode compressionMode, int chunkSize) throws java.io.IOException
java.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class StoredFieldsWriterjava.io.IOExceptionpublic void startDocument(int numStoredFields)
throws java.io.IOException
StoredFieldsWriterStoredFieldsWriter.writeField(FieldInfo, IndexableField) will be called
numStoredFields times. Note that this is
called even if the document has no stored fields, in
this case numStoredFields will be zero.startDocument in class StoredFieldsWriterjava.io.IOExceptionpublic void finishDocument()
throws java.io.IOException
StoredFieldsWriterfinishDocument in class StoredFieldsWriterjava.io.IOExceptionpublic void writeField(FieldInfo info, IndexableField field) throws java.io.IOException
StoredFieldsWriterwriteField in class StoredFieldsWriterjava.io.IOExceptionpublic void abort()
StoredFieldsWriterabort in class StoredFieldsWriterpublic void finish(FieldInfos fis, int numDocs) throws java.io.IOException
StoredFieldsWriterStoredFieldsWriter.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(int), but a Codec should
check that this is the case to detect the JRE bug described
in LUCENE-1282.finish in class StoredFieldsWriterjava.io.IOExceptionpublic int merge(MergeState mergeState) throws java.io.IOException
StoredFieldsWritermergeState. The default implementation skips
over deleted documents, and uses StoredFieldsWriter.startDocument(int),
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 StoredFieldsWriterjava.io.IOExceptionCopyright © 2010 - 2024 Adobe. All Rights Reserved