public final class Lucene40StoredFieldsWriter extends StoredFieldsWriter
Lucene40StoredFieldsFormat| Modifier and Type | Field and Description |
|---|---|
static String |
FIELDS_EXTENSION
Extension of stored fields file
|
static String |
FIELDS_INDEX_EXTENSION
Extension of stored fields index file
|
| Constructor and Description |
|---|
Lucene40StoredFieldsWriter(Directory directory,
String segment,
IOContext context)
Sole constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abort()
Aborts writing entirely, implementation should remove
any partially-written files, etc.
|
void |
addRawDocuments(IndexInput stream,
int[] lengths,
int numDocs)
Bulk write a contiguous series of documents.
|
void |
close() |
void |
finish(FieldInfos fis,
int numDocs)
Called before
StoredFieldsWriter.close(), passing in the number
of documents that were written. |
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.
|
addDocumentpublic static final String FIELDS_EXTENSION
public static final String FIELDS_INDEX_EXTENSION
public Lucene40StoredFieldsWriter(Directory directory, String segment, IOContext context) throws IOException
IOExceptionpublic void startDocument(int numStoredFields)
throws 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 StoredFieldsWriterIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in class StoredFieldsWriterIOExceptionpublic void abort()
StoredFieldsWriterabort in class StoredFieldsWriterpublic void writeField(FieldInfo info, IndexableField field) throws IOException
StoredFieldsWriterwriteField in class StoredFieldsWriterIOExceptionpublic void addRawDocuments(IndexInput stream, int[] lengths, int numDocs) throws IOException
IOExceptionpublic void finish(FieldInfos fis, int numDocs)
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 StoredFieldsWriterpublic int merge(MergeState mergeState) throws 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 StoredFieldsWriterIOExceptionCopyright © 2000-2012 Apache Software Foundation. All Rights Reserved.