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 voidprivate voidwriteField(FieldInfo info) voidwriteField(FieldInfo info, double value) Writes a stored double value.voidwriteField(FieldInfo info, float value) Writes a stored float value.voidwriteField(FieldInfo info, int value) Writes a stored int value.voidwriteField(FieldInfo info, long value) Writes a stored long value.voidwriteField(FieldInfo info, String value) Writes a stored String value.voidwriteField(FieldInfo info, BytesRef value) Writes a stored binary value.Methods inherited from class org.apache.lucene.codecs.StoredFieldsWriter
finishDocument, merge, writeFieldMethods 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.writeFieldwill 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 stored int value.- Specified by:
writeFieldin classStoredFieldsWriter- Throws:
IOException
-
writeField
Description copied from class:StoredFieldsWriterWrites a stored long value.- Specified by:
writeFieldin classStoredFieldsWriter- Throws:
IOException
-
writeField
Description copied from class:StoredFieldsWriterWrites a stored float value.- Specified by:
writeFieldin classStoredFieldsWriter- Throws:
IOException
-
writeField
Description copied from class:StoredFieldsWriterWrites a stored double value.- Specified by:
writeFieldin classStoredFieldsWriter- Throws:
IOException
-
writeField
Description copied from class:StoredFieldsWriterWrites a stored binary value.- Specified by:
writeFieldin classStoredFieldsWriter- Throws:
IOException
-
writeField
Description copied from class:StoredFieldsWriterWrites a stored String value.- Specified by:
writeFieldin classStoredFieldsWriter- Throws:
IOException
-
writeField
- 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.
-