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 BytesRef
private int
private IndexOutput
private 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 BytesRef
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleTextStoredFieldsWriter
(Directory directory, String segment, IOContext context) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
finish
(int numDocs) Called beforeStoredFieldsWriter.close()
, passing in the number of documents that were written.private void
newLine()
long
Return the memory usage of this object in bytes.void
Called before writing the stored fields of the document.private void
private void
void
writeField
(FieldInfo info, IndexableField field) Writes a single stored field.Methods inherited from class org.apache.lucene.codecs.StoredFieldsWriter
finishDocument, merge
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:StoredFieldsWriter
Called 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:
startDocument
in classStoredFieldsWriter
- Throws:
IOException
-
writeField
Description copied from class:StoredFieldsWriter
Writes a single stored field.- Specified by:
writeField
in classStoredFieldsWriter
- Throws:
IOException
-
finish
Description copied from class:StoredFieldsWriter
Called 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:
finish
in classStoredFieldsWriter
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classStoredFieldsWriter
- Throws:
IOException
-
write
- Throws:
IOException
-
write
- Throws:
IOException
-
newLine
- Throws:
IOException
-
ramBytesUsed
public long ramBytesUsed()Description copied from interface:Accountable
Return the memory usage of this object in bytes. Negative values are illegal.
-