Module org.apache.lucene.codecs
Class SimpleTextStoredFieldsReader
java.lang.Object
org.apache.lucene.index.StoredFields
org.apache.lucene.codecs.StoredFieldsReader
org.apache.lucene.codecs.simpletext.SimpleTextStoredFieldsReader
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Cloneable
reads plaintext stored fields
FOR RECREATIONAL USE ONLY
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final FieldInfos
private IndexInput
private long[]
private BytesRefBuilder
private CharsRefBuilder
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleTextStoredFieldsReader
(long[] offsets, IndexInput in, FieldInfos fieldInfos) SimpleTextStoredFieldsReader
(Directory directory, SegmentInfo si, FieldInfos fn, IOContext context) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Checks consistency of this reader.clone()
void
close()
void
document
(int n, StoredFieldVisitor visitor) Expert: visits the fields of a stored document, for custom processing/loading of each field.private boolean
private int
parseIntAt
(int offset) private void
readField
(BytesRef type, FieldInfo fieldInfo, StoredFieldVisitor visitor) private void
readIndex
(int size) private void
readLine()
toString()
Methods inherited from class org.apache.lucene.codecs.StoredFieldsReader
getMergeInstance
Methods inherited from class org.apache.lucene.index.StoredFields
document, document
-
Field Details
-
offsets
private long[] offsets -
in
-
scratch
-
scratchUTF16
-
fieldInfos
-
-
Constructor Details
-
SimpleTextStoredFieldsReader
public SimpleTextStoredFieldsReader(Directory directory, SegmentInfo si, FieldInfos fn, IOContext context) throws IOException - Throws:
IOException
-
SimpleTextStoredFieldsReader
SimpleTextStoredFieldsReader(long[] offsets, IndexInput in, FieldInfos fieldInfos)
-
-
Method Details
-
readIndex
- Throws:
IOException
-
document
Description copied from class:StoredFields
Expert: visits the fields of a stored document, for custom processing/loading of each field. If you simply want to load all fields, useStoredFields.document(int)
. If you want to load a subset, useDocumentStoredFieldVisitor
.- Specified by:
document
in classStoredFields
- Throws:
IOException
-
readField
private void readField(BytesRef type, FieldInfo fieldInfo, StoredFieldVisitor visitor) throws IOException - Throws:
IOException
-
clone
- Specified by:
clone
in classStoredFieldsReader
-
close
- Throws:
IOException
-
readLine
- Throws:
IOException
-
parseIntAt
private int parseIntAt(int offset) -
equalsAt
-
toString
-
checkIntegrity
Description copied from class:StoredFieldsReader
Checks consistency of this reader.Note that this may be costly in terms of I/O, e.g. may involve computing a checksum value against large data files.
- Specified by:
checkIntegrity
in classStoredFieldsReader
- Throws:
IOException
-