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:
java.io.Closeable
,java.lang.AutoCloseable
,java.lang.Cloneable
public class SimpleTextStoredFieldsReader extends StoredFieldsReader
reads plaintext stored fieldsFOR RECREATIONAL USE ONLY
-
-
Field Summary
Fields Modifier and Type Field Description private FieldInfos
fieldInfos
private IndexInput
in
private long[]
offsets
private BytesRefBuilder
scratch
private CharsRefBuilder
scratchUTF16
-
Constructor Summary
Constructors Constructor Description SimpleTextStoredFieldsReader(long[] offsets, IndexInput in, FieldInfos fieldInfos)
SimpleTextStoredFieldsReader(Directory directory, SegmentInfo si, FieldInfos fn, IOContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkIntegrity()
Checks consistency of this reader.StoredFieldsReader
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
equalsAt(BytesRef a, BytesRef b, int bOffset)
private int
parseIntAt(int offset)
private void
readField(BytesRef type, FieldInfo fieldInfo, StoredFieldVisitor visitor)
private void
readIndex(int size)
private void
readLine()
java.lang.String
toString()
-
Methods inherited from class org.apache.lucene.codecs.StoredFieldsReader
getMergeInstance
-
Methods inherited from class org.apache.lucene.index.StoredFields
document, document
-
-
-
-
Field Detail
-
offsets
private long[] offsets
-
in
private IndexInput in
-
scratch
private BytesRefBuilder scratch
-
scratchUTF16
private CharsRefBuilder scratchUTF16
-
fieldInfos
private final FieldInfos fieldInfos
-
-
Constructor Detail
-
SimpleTextStoredFieldsReader
public SimpleTextStoredFieldsReader(Directory directory, SegmentInfo si, FieldInfos fn, IOContext context) throws java.io.IOException
- Throws:
java.io.IOException
-
SimpleTextStoredFieldsReader
SimpleTextStoredFieldsReader(long[] offsets, IndexInput in, FieldInfos fieldInfos)
-
-
Method Detail
-
readIndex
private void readIndex(int size) throws java.io.IOException
- Throws:
java.io.IOException
-
document
public void document(int n, StoredFieldVisitor visitor) throws java.io.IOException
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:
java.io.IOException
-
readField
private void readField(BytesRef type, FieldInfo fieldInfo, StoredFieldVisitor visitor) throws java.io.IOException
- Throws:
java.io.IOException
-
clone
public StoredFieldsReader clone()
- Specified by:
clone
in classStoredFieldsReader
-
close
public void close() throws java.io.IOException
- Throws:
java.io.IOException
-
readLine
private void readLine() throws java.io.IOException
- Throws:
java.io.IOException
-
parseIntAt
private int parseIntAt(int offset)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
checkIntegrity
public void checkIntegrity() throws java.io.IOException
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:
java.io.IOException
-
-