Class Lucene50CompressingTermVectorsReader
- java.lang.Object
-
- org.apache.lucene.index.TermVectors
-
- org.apache.lucene.codecs.TermVectorsReader
-
- org.apache.lucene.backward_codecs.lucene50.compressing.Lucene50CompressingTermVectorsReader
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.lang.Cloneable
public final class Lucene50CompressingTermVectorsReader extends TermVectorsReader
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
Lucene50CompressingTermVectorsReader.TVFields
private static class
Lucene50CompressingTermVectorsReader.TVPostingsEnum
private static class
Lucene50CompressingTermVectorsReader.TVTerms
private static class
Lucene50CompressingTermVectorsReader.TVTermsEnum
-
Field Summary
Fields Modifier and Type Field Description private int
chunkSize
private boolean
closed
private CompressionMode
compressionMode
private Decompressor
decompressor
private FieldInfos
fieldInfos
(package private) static int
FLAGS_BITS
(package private) FieldsIndex
indexReader
private long
maxPointer
(package private) static int
META_VERSION_START
private int
numDocs
(package private) static int
OFFSETS
(package private) static int
PACKED_BLOCK_SIZE
private int
packedIntsVersion
(package private) static int
PAYLOADS
(package private) static int
POSITIONS
private BlockPackedReaderIterator
reader
(package private) static java.lang.String
VECTORS_EXTENSION
(package private) static java.lang.String
VECTORS_INDEX_CODEC_NAME
(package private) static java.lang.String
VECTORS_INDEX_EXTENSION
(package private) static java.lang.String
VECTORS_META_EXTENSION
(package private) IndexInput
vectorsStream
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(package private) static int
VERSION_OFFHEAP_INDEX
(package private) static int
VERSION_START
-
Fields inherited from class org.apache.lucene.index.TermVectors
EMPTY
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Lucene50CompressingTermVectorsReader(Lucene50CompressingTermVectorsReader reader)
Lucene50CompressingTermVectorsReader(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.TermVectorsReader
clone()
Create a clone that one caller at a time may use to read term vectors.void
close()
private void
ensureOpen()
Fields
get(int doc)
Returns term vectors for this document, or null if term vectors were not indexed.private int[][]
positionIndex(int skip, int numFields, PackedInts.Reader numTerms, int[] termFreqs)
private int[][]
readPositions(int skip, int numFields, PackedInts.Reader flags, PackedInts.Reader numTerms, int[] termFreqs, int flag, int totalPositions, int[][] positionIndex)
private static int
sum(int[] arr)
java.lang.String
toString()
-
Methods inherited from class org.apache.lucene.codecs.TermVectorsReader
getMergeInstance
-
Methods inherited from class org.apache.lucene.index.TermVectors
get
-
-
-
-
Field Detail
-
VECTORS_EXTENSION
static final java.lang.String VECTORS_EXTENSION
- See Also:
- Constant Field Values
-
VECTORS_INDEX_EXTENSION
static final java.lang.String VECTORS_INDEX_EXTENSION
- See Also:
- Constant Field Values
-
VECTORS_META_EXTENSION
static final java.lang.String VECTORS_META_EXTENSION
- See Also:
- Constant Field Values
-
VECTORS_INDEX_CODEC_NAME
static final java.lang.String VECTORS_INDEX_CODEC_NAME
- See Also:
- Constant Field Values
-
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- 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
-
PACKED_BLOCK_SIZE
static final int PACKED_BLOCK_SIZE
- See Also:
- Constant Field Values
-
POSITIONS
static final int POSITIONS
- See Also:
- Constant Field Values
-
OFFSETS
static final int OFFSETS
- See Also:
- Constant Field Values
-
PAYLOADS
static final int PAYLOADS
- See Also:
- Constant Field Values
-
FLAGS_BITS
static final int FLAGS_BITS
-
fieldInfos
private final FieldInfos fieldInfos
-
indexReader
final FieldsIndex indexReader
-
vectorsStream
final IndexInput vectorsStream
-
version
private final int version
-
packedIntsVersion
private final int packedIntsVersion
-
compressionMode
private final CompressionMode compressionMode
-
decompressor
private final Decompressor decompressor
-
chunkSize
private final int chunkSize
-
numDocs
private final int numDocs
-
closed
private boolean closed
-
reader
private final BlockPackedReaderIterator reader
-
maxPointer
private final long maxPointer
-
-
Constructor Detail
-
Lucene50CompressingTermVectorsReader
private Lucene50CompressingTermVectorsReader(Lucene50CompressingTermVectorsReader reader)
-
Lucene50CompressingTermVectorsReader
public Lucene50CompressingTermVectorsReader(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 TermVectorsReader is closed
-
close
public void close() throws java.io.IOException
- Throws:
java.io.IOException
-
clone
public TermVectorsReader clone()
Description copied from class:TermVectorsReader
Create a clone that one caller at a time may use to read term vectors.- Specified by:
clone
in classTermVectorsReader
-
get
public Fields get(int doc) throws java.io.IOException
Description copied from class:TermVectors
Returns term vectors for this document, or null if term vectors were not indexed.The returned Fields instance acts like a single-document inverted index (the docID will be 0). If offsets are available they are in an
OffsetAttribute
available from thePostingsEnum
.- Specified by:
get
in classTermVectors
- Throws:
java.io.IOException
-
positionIndex
private int[][] positionIndex(int skip, int numFields, PackedInts.Reader numTerms, int[] termFreqs)
-
readPositions
private int[][] readPositions(int skip, int numFields, PackedInts.Reader flags, PackedInts.Reader numTerms, int[] termFreqs, int flag, int totalPositions, int[][] positionIndex) throws java.io.IOException
- Throws:
java.io.IOException
-
sum
private static int sum(int[] arr)
-
checkIntegrity
public void checkIntegrity() throws java.io.IOException
Description copied from class:TermVectorsReader
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 classTermVectorsReader
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-