Class CompressingStoredFieldsWriter
StoredFieldsWriter impl for CompressingStoredFieldsFormat.
Note
This API is experimental and might change in incompatible ways in the next release.
Implements
Inherited Members
Namespace: Lucene.Net.Codecs.Compressing
Assembly: Lucene.Net.dll
Syntax
public sealed class CompressingStoredFieldsWriter : StoredFieldsWriter, IDisposable
Constructors
CompressingStoredFieldsWriter(Directory, SegmentInfo, string, IOContext, string, CompressionMode, int)
Sole constructor.
Declaration
public CompressingStoredFieldsWriter(Directory directory, SegmentInfo si, string segmentSuffix, IOContext context, string formatName, CompressionMode compressionMode, int chunkSize)
Parameters
Type | Name | Description |
---|---|---|
Directory | directory | |
SegmentInfo | si | |
string | segmentSuffix | |
IOContext | context | |
string | formatName | |
CompressionMode | compressionMode | |
int | chunkSize |
Methods
Abort()
Aborts writing entirely, implementation should remove any partially-written files, etc.
Declaration
public override void Abort()
Overrides
Dispose(bool)
Implementations must override and should dispose all resources used by this instance.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing |
Overrides
Finish(FieldInfos, int)
Called before Dispose(), passing in the number of documents that were written. Note that this is intentionally redundant (equivalent to the number of calls to StartDocument(int), but a Codec should check that this is the case to detect the bug described in LUCENE-1282.
Declaration
public override void Finish(FieldInfos fis, int numDocs)
Parameters
Type | Name | Description |
---|---|---|
FieldInfos | fis | |
int | numDocs |
Overrides
FinishDocument()
Called when a document and all its fields have been added.
Declaration
public override void FinishDocument()
Overrides
Merge(MergeState)
Merges in the stored fields from the readers in
mergeState
. The default implementation skips
over deleted documents, and uses StartDocument(int),
WriteField(FieldInfo, IIndexableField), 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).
Declaration
public override int Merge(MergeState mergeState)
Parameters
Type | Name | Description |
---|---|---|
MergeState | mergeState |
Returns
Type | Description |
---|---|
int |
Overrides
StartDocument(int)
Called before writing the stored fields of the document.
WriteField(FieldInfo, IIndexableField) 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.
Declaration
public override void StartDocument(int numStoredFields)
Parameters
Type | Name | Description |
---|---|---|
int | numStoredFields |
Overrides
WriteField(FieldInfo, IIndexableField)
Writes a single stored field.
Declaration
public override void WriteField(FieldInfo info, IIndexableField field)
Parameters
Type | Name | Description |
---|---|---|
FieldInfo | info | |
IIndexableField | field |