Class CompressingTermVectorsReader
- java.lang.Object
-
- org.apache.lucene.codecs.TermVectorsReader
-
- org.apache.lucene.codecs.compressing.CompressingTermVectorsReader
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.lang.Cloneable
,Accountable
public final class CompressingTermVectorsReader extends TermVectorsReader implements java.io.Closeable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
CompressingTermVectorsReader.TVFields
private static class
CompressingTermVectorsReader.TVPostingsEnum
private static class
CompressingTermVectorsReader.TVTerms
private static class
CompressingTermVectorsReader.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) CompressingStoredFieldsIndexReader
indexReader
private long
maxPointer
private long
numChunks
private long
numDirtyChunks
private int
numDocs
private int
packedIntsVersion
private BlockPackedReaderIterator
reader
(package private) IndexInput
vectorsStream
private int
version
-
Constructor Summary
Constructors Modifier Constructor Description private
CompressingTermVectorsReader(CompressingTermVectorsReader reader)
CompressingTermVectorsReader(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.java.util.Collection<Accountable>
getChildResources()
Returns nested resources of this class.(package private) int
getChunkSize()
(package private) CompressionMode
getCompressionMode()
(package private) CompressingStoredFieldsIndexReader
getIndexReader()
(package private) long
getMaxPointer()
(package private) long
getNumChunks()
(package private) long
getNumDirtyChunks()
(package private) int
getPackedIntsVersion()
(package private) IndexInput
getVectorsStream()
(package private) int
getVersion()
private int[][]
positionIndex(int skip, int numFields, PackedInts.Reader numTerms, int[] termFreqs)
long
ramBytesUsed()
Return the memory usage of this object in bytes.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
-
-
-
-
Field Detail
-
fieldInfos
private final FieldInfos fieldInfos
-
indexReader
final CompressingStoredFieldsIndexReader 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
-
numChunks
private final long numChunks
-
numDirtyChunks
private final long numDirtyChunks
-
maxPointer
private final long maxPointer
-
-
Constructor Detail
-
CompressingTermVectorsReader
private CompressingTermVectorsReader(CompressingTermVectorsReader reader)
-
CompressingTermVectorsReader
public CompressingTermVectorsReader(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
-
getCompressionMode
CompressionMode getCompressionMode()
-
getChunkSize
int getChunkSize()
-
getPackedIntsVersion
int getPackedIntsVersion()
-
getVersion
int getVersion()
-
getIndexReader
CompressingStoredFieldsIndexReader getIndexReader()
-
getVectorsStream
IndexInput getVectorsStream()
-
getMaxPointer
long getMaxPointer()
-
getNumChunks
long getNumChunks()
-
getNumDirtyChunks
long getNumDirtyChunks()
-
ensureOpen
private void ensureOpen() throws AlreadyClosedException
- Throws:
AlreadyClosedException
- if this TermVectorsReader is closed
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- 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:TermVectorsReader
Returns term vectors for this document, or null if term vectors were not indexed. If offsets are available they are in anOffsetAttribute
available from thePostingsEnum
.- Specified by:
get
in classTermVectorsReader
- 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)
-
ramBytesUsed
public long ramBytesUsed()
Description copied from interface:Accountable
Return the memory usage of this object in bytes. Negative values are illegal.- Specified by:
ramBytesUsed
in interfaceAccountable
-
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).- Specified by:
getChildResources
in interfaceAccountable
- See Also:
Accountables
-
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
-
-