Module org.apache.lucene.core
Class Lucene90CompressingStoredFieldsReader
java.lang.Object
org.apache.lucene.index.StoredFields
org.apache.lucene.codecs.StoredFieldsReader
org.apache.lucene.codecs.lucene90.compressing.Lucene90CompressingStoredFieldsReader
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Cloneable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
Keeps state about the current block of documents.(package private) static class
A serialized document, you need to decode its input in order to get an actualDocument
. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private boolean
private final CompressionMode
private final Decompressor
private final FieldInfos
private final IndexInput
private final FieldsIndex
private final long
private final boolean
private final long
private final long
private final long
private final int
private static final int
private static final int
private final long[]
private int
private final Lucene90CompressingStoredFieldsReader.BlockState
private final int
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Lucene90CompressingStoredFieldsReader
(Lucene90CompressingStoredFieldsReader reader, boolean merging) Lucene90CompressingStoredFieldsReader
(Directory d, SegmentInfo si, String segmentSuffix, FieldInfos fn, IOContext context, String formatName, CompressionMode compressionMode) Sole constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Checks consistency of this reader.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
(package private) int
(package private) CompressionMode
(package private) IndexInput
(package private) FieldsIndex
(package private) long
Returns an instance optimized for merging.(package private) long
(package private) long
(package private) long
(package private) int
(package private) int
(package private) boolean
isLoaded
(int docID) Checks if a given docID was loaded in the current block state.void
prefetch
(int docID) Optional method: Give a hint to thisStoredFields
instance that the given document will be read in the near future.private static void
readField
(DataInput in, StoredFieldVisitor visitor, FieldInfo info, int bits) (package private) static long
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) Lucene90CompressingStoredFieldsReader.SerializedDocument
serializedDocument
(int docID) private static void
toString()
Methods inherited from class org.apache.lucene.index.StoredFields
document, document
-
Field Details
-
PREFETCH_CACHE_SIZE
private static final int PREFETCH_CACHE_SIZE- See Also:
-
PREFETCH_CACHE_MASK
private static final int PREFETCH_CACHE_MASK- See Also:
-
version
private final int version -
fieldInfos
-
indexReader
-
maxPointer
private final long maxPointer -
fieldsStream
-
chunkSize
private final int chunkSize -
compressionMode
-
decompressor
-
numDocs
private final int numDocs -
merging
private final boolean merging -
state
-
numChunks
private final long numChunks -
numDirtyChunks
private final long numDirtyChunks -
numDirtyDocs
private final long numDirtyDocs -
prefetchedBlockIDCache
private final long[] prefetchedBlockIDCache -
prefetchedBlockIDCacheIndex
private int prefetchedBlockIDCacheIndex -
closed
private boolean closed
-
-
Constructor Details
-
Lucene90CompressingStoredFieldsReader
private Lucene90CompressingStoredFieldsReader(Lucene90CompressingStoredFieldsReader reader, boolean merging) -
Lucene90CompressingStoredFieldsReader
public Lucene90CompressingStoredFieldsReader(Directory d, SegmentInfo si, String segmentSuffix, FieldInfos fn, IOContext context, String formatName, CompressionMode compressionMode) throws IOException Sole constructor.- Throws:
IOException
-
-
Method Details
-
ensureOpen
- Throws:
AlreadyClosedException
- if this FieldsReader is closed
-
close
Close the underlyingIndexInput
s.- Throws:
IOException
-
readField
private static void readField(DataInput in, StoredFieldVisitor visitor, FieldInfo info, int bits) throws IOException - Throws:
IOException
-
skipField
- Throws:
IOException
-
readZFloat
Reads a float in a variable-length format. Reads between one and five bytes. Small integral values typically take fewer bytes.- Throws:
IOException
-
readZDouble
Reads a double in a variable-length format. Reads between one and nine bytes. Small integral values typically take fewer bytes.- Throws:
IOException
-
readTLong
Reads a long in a variable-length format. Reads between one andCorePropLo nine bytes. Small values typically take fewer bytes.- Throws:
IOException
-
prefetch
Description copied from class:StoredFields
Optional method: Give a hint to thisStoredFields
instance that the given document will be read in the near future. This typically delegates toIndexInput.prefetch(long, long)
and is useful to parallelize I/O across multiple documents.NOTE: This API is expected to be called on a small enough set of doc IDs that they could all fit in the page cache. If you plan on retrieving a very large number of documents, it may be a good idea to perform calls to
StoredFields.prefetch(int)
andStoredFields.document(int)
in batches instead of prefetching all documents up-front.- Overrides:
prefetch
in classStoredFields
- Throws:
IOException
-
serializedDocument
Lucene90CompressingStoredFieldsReader.SerializedDocument serializedDocument(int docID) throws IOException - Throws:
IOException
-
isLoaded
boolean isLoaded(int docID) Checks if a given docID was loaded in the current block state. -
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
-
clone
- Specified by:
clone
in classStoredFieldsReader
-
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() -
getNumDirtyDocs
long getNumDirtyDocs() -
getNumDirtyChunks
long getNumDirtyChunks() -
getNumChunks
long getNumChunks() -
getNumDocs
int getNumDocs() -
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
-
toString
-