public class SimpleTextStoredFieldsWriter extends StoredFieldsWriter
FOR RECREATIONAL USE ONLY
StoredFieldsWriter.MergeVisitor
Modifier and Type | Field and Description |
---|---|
private Directory |
directory |
(package private) static BytesRef |
DOC |
(package private) static BytesRef |
END |
(package private) static BytesRef |
FIELD |
(package private) static java.lang.String |
FIELDS_EXTENSION |
(package private) static BytesRef |
NAME |
private int |
numDocsWritten |
private IndexOutput |
out |
private BytesRefBuilder |
scratch |
private java.lang.String |
segment |
(package private) static BytesRef |
TYPE |
(package private) static BytesRef |
TYPE_BINARY |
(package private) static BytesRef |
TYPE_DOUBLE |
(package private) static BytesRef |
TYPE_FLOAT |
(package private) static BytesRef |
TYPE_INT |
(package private) static BytesRef |
TYPE_LONG |
(package private) static BytesRef |
TYPE_STRING |
(package private) static BytesRef |
VALUE |
Constructor and Description |
---|
SimpleTextStoredFieldsWriter(Directory directory,
java.lang.String segment,
IOContext context) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
finish(FieldInfos fis,
int numDocs)
Called before
StoredFieldsWriter.close() , passing in the number
of documents that were written. |
private void |
newLine() |
void |
startDocument()
Called before writing the stored fields of the document.
|
private void |
write(BytesRef bytes) |
private void |
write(java.lang.String s) |
void |
writeField(FieldInfo info,
IndexableField field)
Writes a single stored field.
|
finishDocument, merge
private int numDocsWritten
private final Directory directory
private final java.lang.String segment
private IndexOutput out
static final java.lang.String FIELDS_EXTENSION
static final BytesRef TYPE_STRING
static final BytesRef TYPE_BINARY
static final BytesRef TYPE_INT
static final BytesRef TYPE_LONG
static final BytesRef TYPE_FLOAT
static final BytesRef TYPE_DOUBLE
static final BytesRef END
static final BytesRef DOC
static final BytesRef FIELD
static final BytesRef NAME
static final BytesRef TYPE
static final BytesRef VALUE
private final BytesRefBuilder scratch
public void startDocument() throws java.io.IOException
StoredFieldsWriter
StoredFieldsWriter.writeField(FieldInfo, IndexableField)
will be called
for each stored field. Note that this is
called even if the document has no stored fields.startDocument
in class StoredFieldsWriter
java.io.IOException
public void writeField(FieldInfo info, IndexableField field) throws java.io.IOException
StoredFieldsWriter
writeField
in class StoredFieldsWriter
java.io.IOException
public void finish(FieldInfos fis, int numDocs) throws java.io.IOException
StoredFieldsWriter
StoredFieldsWriter.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()
, but a Codec should
check that this is the case to detect the JRE bug described
in LUCENE-1282.finish
in class StoredFieldsWriter
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class StoredFieldsWriter
java.io.IOException
private void write(java.lang.String s) throws java.io.IOException
java.io.IOException
private void write(BytesRef bytes) throws java.io.IOException
java.io.IOException
private void newLine() throws java.io.IOException
java.io.IOException