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 classCompressingStoredFieldsReader.BlockStateKeeps state about the current block of documents.(package private) static classCompressingStoredFieldsReader.SerializedDocumentA serialized document, you need to decode its input in order to get an actualDocument.
-
Field Summary
Fields Modifier and Type Field Description private intchunkSizeprivate booleanclosedprivate CompressionModecompressionModeprivate Decompressordecompressorprivate FieldInfosfieldInfosprivate IndexInputfieldsStreamprivate FieldsIndexindexReaderprivate longmaxPointerprivate booleanmergingprivate longnumDirtyChunksprivate longnumDirtyDocsprivate intnumDocsprivate intpackedIntsVersionprivate CompressingStoredFieldsReader.BlockStatestateprivate intversion-
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
-
-
Constructor Summary
Constructors Modifier Constructor Description privateCompressingStoredFieldsReader(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 voidcheckIntegrity()Checks consistency of this reader.StoredFieldsReaderclone()voidclose()Close the underlyingIndexInputs.(package private) CompressingStoredFieldsReader.SerializedDocumentdocument(int docID)private voidensureOpen()java.util.Collection<Accountable>getChildResources()Returns nested resources of this class.(package private) intgetChunkSize()(package private) CompressionModegetCompressionMode()(package private) IndexInputgetFieldsStream()(package private) FieldsIndexgetIndexReader()(package private) longgetMaxPointer()StoredFieldsReadergetMergeInstance()Returns an instance optimized for merging.(package private) longgetNumDirtyChunks()(package private) longgetNumDirtyDocs()(package private) intgetNumDocs()(package private) intgetPackedIntsVersion()(package private) intgetVersion()longramBytesUsed()Return the memory usage of this object in bytes.private static voidreadField(DataInput in, StoredFieldVisitor visitor, FieldInfo info, int bits)(package private) static longreadTLong(DataInput in)Reads a long in a variable-length format.(package private) static doublereadZDouble(DataInput in)Reads a double in a variable-length format.(package private) static floatreadZFloat(DataInput in)Reads a float in a variable-length format.private static voidskipField(DataInput in, int bits)java.lang.StringtoString()voidvisitDocument(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
-
numDirtyChunks
private final long numDirtyChunks
-
numDirtyDocs
private final long numDirtyDocs
-
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.IOExceptionClose the underlyingIndexInputs.- 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.IOExceptionDescription copied from class:StoredFieldsReaderVisit the stored fields for documentdocID- Specified by:
visitDocumentin classStoredFieldsReader- Throws:
java.io.IOException
-
clone
public StoredFieldsReader clone()
- Specified by:
clonein classStoredFieldsReader
-
getMergeInstance
public StoredFieldsReader getMergeInstance()
Description copied from class:StoredFieldsReaderReturns an instance optimized for merging. This instance may not be cloned.The default implementation returns
this- Overrides:
getMergeInstancein classStoredFieldsReader
-
getVersion
int getVersion()
-
getCompressionMode
CompressionMode getCompressionMode()
-
getIndexReader
FieldsIndex getIndexReader()
-
getMaxPointer
long getMaxPointer()
-
getFieldsStream
IndexInput getFieldsStream()
-
getChunkSize
int getChunkSize()
-
getNumDirtyDocs
long getNumDirtyDocs()
-
getNumDirtyChunks
long getNumDirtyChunks()
-
getNumDocs
int getNumDocs()
-
getPackedIntsVersion
int getPackedIntsVersion()
-
ramBytesUsed
public long ramBytesUsed()
Description copied from interface:AccountableReturn the memory usage of this object in bytes. Negative values are illegal.
-
getChildResources
public java.util.Collection<Accountable> getChildResources()
Description copied from interface:AccountableReturns 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.IOExceptionDescription copied from class:StoredFieldsReaderChecks 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:
checkIntegrityin classStoredFieldsReader- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-