Class CompressingStoredFieldsWriter
- java.lang.Object
-
- org.apache.lucene.codecs.StoredFieldsWriter
-
- org.apache.lucene.codecs.compressing.CompressingStoredFieldsWriter
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public final class CompressingStoredFieldsWriter extends StoredFieldsWriter
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.codecs.StoredFieldsWriter
StoredFieldsWriter.MergeVisitor
-
-
Field Summary
Fields Modifier and Type Field Description static StringFIELDS_EXTENSIONExtension of stored fields filestatic StringINDEX_CODEC_NAMECodec name for the index.static StringINDEX_EXTENSION_PREFIXExtension of stored fields index
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidfinish(FieldInfos fis, int numDocs)Called beforeStoredFieldsWriter.close(), passing in the number of documents that were written.voidfinishDocument()Called when a document and all its fields have been added.intmerge(MergeState mergeState)Merges in the stored fields from the readers inmergeState.voidstartDocument()Called before writing the stored fields of the document.voidwriteField(FieldInfo info, IndexableField field)Writes a single stored field.
-
-
-
Field Detail
-
FIELDS_EXTENSION
public static final String FIELDS_EXTENSION
Extension of stored fields file- See Also:
- Constant Field Values
-
INDEX_EXTENSION_PREFIX
public static final String INDEX_EXTENSION_PREFIX
Extension of stored fields index- See Also:
- Constant Field Values
-
INDEX_CODEC_NAME
public static final String INDEX_CODEC_NAME
Codec name for the index.- See Also:
- Constant Field Values
-
-
Method Detail
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classStoredFieldsWriter- Throws:
IOException
-
startDocument
public void startDocument() throws IOExceptionDescription copied from class:StoredFieldsWriterCalled before writing the stored fields of the document.StoredFieldsWriter.writeField(FieldInfo, IndexableField)will be called for each stored field. Note that this is called even if the document has no stored fields.- Specified by:
startDocumentin classStoredFieldsWriter- Throws:
IOException
-
finishDocument
public void finishDocument() throws IOExceptionDescription copied from class:StoredFieldsWriterCalled when a document and all its fields have been added.- Overrides:
finishDocumentin classStoredFieldsWriter- Throws:
IOException
-
writeField
public void writeField(FieldInfo info, IndexableField field) throws IOException
Description copied from class:StoredFieldsWriterWrites a single stored field.- Specified by:
writeFieldin classStoredFieldsWriter- Throws:
IOException
-
finish
public void finish(FieldInfos fis, int numDocs) throws IOException
Description copied from class:StoredFieldsWriterCalled beforeStoredFieldsWriter.close(), passing in the number of documents that were written. Note that this is intentionally redundant (equivalent to the number of calls toStoredFieldsWriter.startDocument(), but a Codec should check that this is the case to detect the JRE bug described in LUCENE-1282.- Specified by:
finishin classStoredFieldsWriter- Throws:
IOException
-
merge
public int merge(MergeState mergeState) throws IOException
Description copied from class:StoredFieldsWriterMerges in the stored fields from the readers inmergeState. The default implementation skips over deleted documents, and usesStoredFieldsWriter.startDocument(),StoredFieldsWriter.writeField(FieldInfo, IndexableField), andStoredFieldsWriter.finish(FieldInfos, int), returning the number of documents that were written. Implementations can override this method for more sophisticated merging (bulk-byte copying, etc).- Overrides:
mergein classStoredFieldsWriter- Throws:
IOException
-
-