Module org.apache.lucene.codecs
Class SimpleTextStoredFieldsWriter
java.lang.Object
org.apache.lucene.codecs.StoredFieldsWriter
org.apache.lucene.codecs.simpletext.SimpleTextStoredFieldsWriter
- All Implemented Interfaces:
Closeable,AutoCloseable,Accountable
Writes plain-text stored fields.
FOR RECREATIONAL USE ONLY
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.codecs.StoredFieldsWriter
StoredFieldsWriter.MergeVisitor -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final BytesRef(package private) static final BytesRef(package private) static final BytesRef(package private) static final String(package private) static final BytesRefprivate intprivate IndexOutputprivate final BytesRefBuilder(package private) static final BytesRef(package private) static final BytesRef(package private) static final BytesRef(package private) static final BytesRef(package private) static final BytesRef(package private) static final BytesRef(package private) static final BytesRef(package private) static final BytesRefFields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Constructor Summary
ConstructorsConstructorDescriptionSimpleTextStoredFieldsWriter(Directory directory, String segment, IOContext context) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidfinish(int numDocs) Called beforeStoredFieldsWriter.close(), passing in the number of documents that were written.private voidnewLine()longReturn the memory usage of this object in bytes.voidCalled before writing the stored fields of the document.private voidprivate voidvoidwriteField(FieldInfo info, IndexableField field) Writes a single stored field.Methods inherited from class org.apache.lucene.codecs.StoredFieldsWriter
finishDocument, mergeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
Field Details
-
numDocsWritten
private int numDocsWritten -
out
-
FIELDS_EXTENSION
- See Also:
-
TYPE_STRING
-
TYPE_BINARY
-
TYPE_INT
-
TYPE_LONG
-
TYPE_FLOAT
-
TYPE_DOUBLE
-
END
-
DOC
-
FIELD
-
NAME
-
TYPE
-
VALUE
-
scratch
-
-
Constructor Details
-
SimpleTextStoredFieldsWriter
public SimpleTextStoredFieldsWriter(Directory directory, String segment, IOContext context) throws IOException - Throws:
IOException
-
-
Method Details
-
startDocument
Description 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
-
writeField
Description copied from class:StoredFieldsWriterWrites a single stored field.- Specified by:
writeFieldin classStoredFieldsWriter- Throws:
IOException
-
finish
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
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classStoredFieldsWriter- Throws:
IOException
-
write
- Throws:
IOException
-
write
- Throws:
IOException
-
newLine
- Throws:
IOException
-
ramBytesUsed
public long ramBytesUsed()Description copied from interface:AccountableReturn the memory usage of this object in bytes. Negative values are illegal.
-