Class CompressingStoredFieldsReader
- java.lang.Object
-
- org.apache.lucene.codecs.StoredFieldsReader
-
- org.apache.lucene.codecs.compressing.CompressingStoredFieldsReader
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.lang.Cloneable
,Accountable
public final class CompressingStoredFieldsReader extends StoredFieldsReader
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
CompressingStoredFieldsReader.BlockState
Keeps state about the current block of documents.(package private) static class
CompressingStoredFieldsReader.SerializedDocument
A serialized document, you need to decode its input in order to get an actualDocument
.
-
Field Summary
Fields Modifier and Type Field Description private int
chunkSize
private boolean
closed
private CompressionMode
compressionMode
private Decompressor
decompressor
private FieldInfos
fieldInfos
private IndexInput
fieldsStream
private FieldsIndex
indexReader
private long
maxPointer
private boolean
merging
private long
numChunks
private long
numDirtyChunks
private int
numDocs
private int
packedIntsVersion
private CompressingStoredFieldsReader.BlockState
state
private int
version
-
Constructor Summary
Constructors Modifier Constructor Description private
CompressingStoredFieldsReader(CompressingStoredFieldsReader reader, boolean merging)
CompressingStoredFieldsReader(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.(package private) CompressingStoredFieldsReader.SerializedDocument
document(int docID)
private void
ensureOpen()
java.util.Collection<Accountable>
getChildResources()
Returns nested resources of this class.(package private) int
getChunkSize()
(package private) CompressionMode
getCompressionMode()
(package private) IndexInput
getFieldsStream()
(package private) FieldsIndex
getIndexReader()
(package private) long
getMaxPointer()
StoredFieldsReader
getMergeInstance()
Returns an instance optimized for merging.(package private) long
getNumChunks()
(package private) long
getNumDirtyChunks()
(package private) int
getPackedIntsVersion()
(package private) int
getVersion()
long
ramBytesUsed()
Return the memory usage of this object in bytes.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.private static void
skipField(DataInput in, int bits)
java.lang.String
toString()
void
visitDocument(int docID, StoredFieldVisitor visitor)
Visit the stored fields for documentdocID
-
-
-
Field Detail
-
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 CompressingStoredFieldsReader.BlockState state
-
numChunks
private final long numChunks
-
numDirtyChunks
private final long numDirtyChunks
-
closed
private boolean closed
-
-
Constructor Detail
-
CompressingStoredFieldsReader
private CompressingStoredFieldsReader(CompressingStoredFieldsReader reader, boolean merging)
-
CompressingStoredFieldsReader
public CompressingStoredFieldsReader(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
-
document
CompressingStoredFieldsReader.SerializedDocument document(int docID) throws java.io.IOException
- Throws:
java.io.IOException
-
visitDocument
public void visitDocument(int docID, StoredFieldVisitor visitor) throws java.io.IOException
Description copied from class:StoredFieldsReader
Visit the stored fields for documentdocID
- Specified by:
visitDocument
in classStoredFieldsReader
- 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
-
getVersion
int getVersion()
-
getCompressionMode
CompressionMode getCompressionMode()
-
getIndexReader
FieldsIndex getIndexReader()
-
getMaxPointer
long getMaxPointer()
-
getFieldsStream
IndexInput getFieldsStream()
-
getChunkSize
int getChunkSize()
-
getNumChunks
long getNumChunks()
-
getNumDirtyChunks
long getNumDirtyChunks()
-
getPackedIntsVersion
int getPackedIntsVersion()
-
ramBytesUsed
public long ramBytesUsed()
Description copied from interface:Accountable
Return the memory usage of this object in bytes. Negative values are illegal.
-
getChildResources
public java.util.Collection<Accountable> getChildResources()
Description copied from interface:Accountable
Returns nested resources of this class. The result should be a point-in-time snapshot (to avoid race conditions).- See Also:
Accountables
-
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
-
-