Class Lucene50CompressingStoredFieldsReader
- java.lang.Object
-
- org.apache.lucene.index.StoredFields
-
- org.apache.lucene.codecs.StoredFieldsReader
-
- org.apache.lucene.backward_codecs.lucene50.compressing.Lucene50CompressingStoredFieldsReader
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.lang.Cloneable
public final class Lucene50CompressingStoredFieldsReader extends StoredFieldsReader
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
Lucene50CompressingStoredFieldsReader.BlockState
Keeps state about the current block of documents.(package private) static class
Lucene50CompressingStoredFieldsReader.SerializedDocument
A serialized document, you need to decode its input in order to get an actualDocument
.
-
Field Summary
Fields Modifier and Type Field Description (package private) static int
BYTE_ARR
private int
chunkSize
private boolean
closed
private CompressionMode
compressionMode
(package private) static long
DAY
(package private) static int
DAY_ENCODING
private Decompressor
decompressor
private FieldInfos
fieldInfos
static java.lang.String
FIELDS_EXTENSION
Extension of stored fields fileprivate IndexInput
fieldsStream
(package private) static long
HOUR
(package private) static int
HOUR_ENCODING
static java.lang.String
INDEX_CODEC_NAME
Codec name for the index.static java.lang.String
INDEX_EXTENSION
Extension of stored fields indexprivate FieldsIndex
indexReader
private long
maxPointer
private boolean
merging
static java.lang.String
META_EXTENSION
Extension of stored fields meta(package private) static int
META_VERSION_START
private int
numDocs
(package private) static int
NUMERIC_DOUBLE
(package private) static int
NUMERIC_FLOAT
(package private) static int
NUMERIC_INT
(package private) static int
NUMERIC_LONG
private int
packedIntsVersion
(package private) static long
SECOND
(package private) static int
SECOND_ENCODING
private Lucene50CompressingStoredFieldsReader.BlockState
state
(package private) static int
STRING
(package private) static int
TYPE_BITS
(package private) static int
TYPE_MASK
private int
version
(package private) static int
VERSION_CURRENT
(package private) static int
VERSION_META
Version where all metadata were moved to the meta file.(package private) static int
VERSION_NUM_CHUNKS
Version where numChunks is explicitly recorded in meta file and a dirty chunk bit is recorded in each chunk(package private) static int
VERSION_OFFHEAP_INDEX
(package private) static int
VERSION_START
-
Constructor Summary
Constructors Modifier Constructor Description private
Lucene50CompressingStoredFieldsReader(Lucene50CompressingStoredFieldsReader reader, boolean merging)
Lucene50CompressingStoredFieldsReader(Directory d, SegmentInfo si, java.lang.String segmentSuffix, FieldInfos fn, IOContext context, java.lang.String formatName, CompressionMode compressionMode)
Sole constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkIntegrity()
Checks consistency of this reader.StoredFieldsReader
clone()
void
close()
Close the underlyingIndexInput
s.void
document(int docID, StoredFieldVisitor visitor)
Expert: visits the fields of a stored document, for custom processing/loading of each field.private void
ensureOpen()
StoredFieldsReader
getMergeInstance()
Returns an instance optimized for merging.private static void
readField(DataInput in, StoredFieldVisitor visitor, FieldInfo info, int bits)
(package private) static long
readTLong(DataInput in)
Reads a long in a variable-length format.(package private) static double
readZDouble(DataInput in)
Reads a double in a variable-length format.(package private) static float
readZFloat(DataInput in)
Reads a float in a variable-length format.(package private) Lucene50CompressingStoredFieldsReader.SerializedDocument
serializedDocument(int docID)
private static void
skipField(DataInput in, int bits)
java.lang.String
toString()
-
Methods inherited from class org.apache.lucene.index.StoredFields
document, document
-
-
-
-
Field Detail
-
FIELDS_EXTENSION
public static final java.lang.String FIELDS_EXTENSION
Extension of stored fields file- See Also:
- Constant Field Values
-
INDEX_EXTENSION
public static final java.lang.String INDEX_EXTENSION
Extension of stored fields index- See Also:
- Constant Field Values
-
META_EXTENSION
public static final java.lang.String META_EXTENSION
Extension of stored fields meta- See Also:
- Constant Field Values
-
INDEX_CODEC_NAME
public static final java.lang.String INDEX_CODEC_NAME
Codec name for the index.- See Also:
- Constant Field Values
-
STRING
static final int STRING
- See Also:
- Constant Field Values
-
BYTE_ARR
static final int BYTE_ARR
- See Also:
- Constant Field Values
-
NUMERIC_INT
static final int NUMERIC_INT
- See Also:
- Constant Field Values
-
NUMERIC_FLOAT
static final int NUMERIC_FLOAT
- See Also:
- Constant Field Values
-
NUMERIC_LONG
static final int NUMERIC_LONG
- See Also:
- Constant Field Values
-
NUMERIC_DOUBLE
static final int NUMERIC_DOUBLE
- See Also:
- Constant Field Values
-
TYPE_BITS
static final int TYPE_BITS
-
TYPE_MASK
static final int TYPE_MASK
-
VERSION_START
static final int VERSION_START
- See Also:
- Constant Field Values
-
VERSION_OFFHEAP_INDEX
static final int VERSION_OFFHEAP_INDEX
- See Also:
- Constant Field Values
-
VERSION_META
static final int VERSION_META
Version where all metadata were moved to the meta file.- See Also:
- Constant Field Values
-
VERSION_NUM_CHUNKS
static final int VERSION_NUM_CHUNKS
Version where numChunks is explicitly recorded in meta file and a dirty chunk bit is recorded in each chunk- See Also:
- Constant Field Values
-
VERSION_CURRENT
static final int VERSION_CURRENT
- See Also:
- Constant Field Values
-
META_VERSION_START
static final int META_VERSION_START
- See Also:
- Constant Field Values
-
SECOND
static final long SECOND
- See Also:
- Constant Field Values
-
HOUR
static final long HOUR
- See Also:
- Constant Field Values
-
DAY
static final long DAY
- See Also:
- Constant Field Values
-
SECOND_ENCODING
static final int SECOND_ENCODING
- See Also:
- Constant Field Values
-
HOUR_ENCODING
static final int HOUR_ENCODING
- See Also:
- Constant Field Values
-
DAY_ENCODING
static final int DAY_ENCODING
- See Also:
- Constant Field Values
-
version
private final int version
-
fieldInfos
private final FieldInfos fieldInfos
-
indexReader
private final FieldsIndex indexReader
-
maxPointer
private final long maxPointer
-
fieldsStream
private final IndexInput fieldsStream
-
chunkSize
private final int chunkSize
-
packedIntsVersion
private final int packedIntsVersion
-
compressionMode
private final CompressionMode compressionMode
-
decompressor
private final Decompressor decompressor
-
numDocs
private final int numDocs
-
merging
private final boolean merging
-
state
private final Lucene50CompressingStoredFieldsReader.BlockState state
-
closed
private boolean closed
-
-
Constructor Detail
-
Lucene50CompressingStoredFieldsReader
private Lucene50CompressingStoredFieldsReader(Lucene50CompressingStoredFieldsReader reader, boolean merging)
-
Lucene50CompressingStoredFieldsReader
public Lucene50CompressingStoredFieldsReader(Directory d, SegmentInfo si, java.lang.String segmentSuffix, FieldInfos fn, IOContext context, java.lang.String formatName, CompressionMode compressionMode) throws java.io.IOException
Sole constructor.- Throws:
java.io.IOException
-
-
Method Detail
-
ensureOpen
private void ensureOpen() throws AlreadyClosedException
- Throws:
AlreadyClosedException
- if this FieldsReader is closed
-
close
public void close() throws java.io.IOException
Close the underlyingIndexInput
s.- Throws:
java.io.IOException
-
readField
private static void readField(DataInput in, StoredFieldVisitor visitor, FieldInfo info, int bits) throws java.io.IOException
- Throws:
java.io.IOException
-
skipField
private static void skipField(DataInput in, int bits) throws java.io.IOException
- Throws:
java.io.IOException
-
readZFloat
static float readZFloat(DataInput in) throws java.io.IOException
Reads a float in a variable-length format. Reads between one and five bytes. Small integral values typically take fewer bytes.- Throws:
java.io.IOException
-
readZDouble
static double readZDouble(DataInput in) throws java.io.IOException
Reads a double in a variable-length format. Reads between one and nine bytes. Small integral values typically take fewer bytes.- Throws:
java.io.IOException
-
readTLong
static long readTLong(DataInput in) throws java.io.IOException
Reads a long in a variable-length format. Reads between one andCorePropLo nine bytes. Small values typically take fewer bytes.- Throws:
java.io.IOException
-
serializedDocument
Lucene50CompressingStoredFieldsReader.SerializedDocument serializedDocument(int docID) throws java.io.IOException
- Throws:
java.io.IOException
-
document
public void document(int docID, 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
-
clone
public StoredFieldsReader clone()
- Specified by:
clone
in classStoredFieldsReader
-
getMergeInstance
public StoredFieldsReader getMergeInstance()
Description copied from class:StoredFieldsReader
Returns an instance optimized for merging. This instance may not be cloned.The default implementation returns
this
- Overrides:
getMergeInstance
in classStoredFieldsReader
-
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
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-