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 classCompressingTermVectorsReader.TVFieldsprivate static classCompressingTermVectorsReader.TVPostingsEnumprivate static classCompressingTermVectorsReader.TVTermsprivate static classCompressingTermVectorsReader.TVTermsEnum
-
Field Summary
Fields Modifier and Type Field Description private intchunkSizeprivate booleanclosedprivate CompressionModecompressionModeprivate Decompressordecompressorprivate FieldInfosfieldInfos(package private) FieldsIndexindexReaderprivate longmaxPointerprivate longnumDirtyChunksprivate longnumDirtyDocsprivate intnumDocsprivate intpackedIntsVersionprivate BlockPackedReaderIteratorreader(package private) IndexInputvectorsStreamprivate intversion-
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
-
-
Constructor Summary
Constructors Modifier Constructor Description privateCompressingTermVectorsReader(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 voidcheckIntegrity()Checks consistency of this reader.TermVectorsReaderclone()Create a clone that one caller at a time may use to read term vectors.voidclose()private voidensureOpen()Fieldsget(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) intgetChunkSize()(package private) CompressionModegetCompressionMode()(package private) FieldsIndexgetIndexReader()(package private) longgetMaxPointer()(package private) longgetNumDirtyChunks()(package private) longgetNumDirtyDocs()(package private) intgetNumDocs()(package private) intgetPackedIntsVersion()(package private) IndexInputgetVectorsStream()(package private) intgetVersion()private int[][]positionIndex(int skip, int numFields, PackedInts.Reader numTerms, int[] termFreqs)longramBytesUsed()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 intsum(int[] arr)java.lang.StringtoString()-
Methods inherited from class org.apache.lucene.codecs.TermVectorsReader
getMergeInstance
-
-
-
-
Field Detail
-
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
-
numDirtyChunks
private final long numDirtyChunks
-
numDirtyDocs
private final long numDirtyDocs
-
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
FieldsIndex getIndexReader()
-
getVectorsStream
IndexInput getVectorsStream()
-
getMaxPointer
long getMaxPointer()
-
getNumDirtyDocs
long getNumDirtyDocs()
-
getNumDirtyChunks
long getNumDirtyChunks()
-
getNumDocs
int getNumDocs()
-
ensureOpen
private void ensureOpen() throws AlreadyClosedException- Throws:
AlreadyClosedException- if this TermVectorsReader is closed
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
clone
public TermVectorsReader clone()
Description copied from class:TermVectorsReaderCreate a clone that one caller at a time may use to read term vectors.- Specified by:
clonein classTermVectorsReader
-
get
public Fields get(int doc) throws java.io.IOException
Description copied from class:TermVectorsReaderReturns term vectors for this document, or null if term vectors were not indexed. If offsets are available they are in anOffsetAttributeavailable from thePostingsEnum.- Specified by:
getin 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:AccountableReturn the memory usage of this object in bytes. Negative values are illegal.- Specified by:
ramBytesUsedin interfaceAccountable
-
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).- Specified by:
getChildResourcesin interfaceAccountable- See Also:
Accountables
-
checkIntegrity
public void checkIntegrity() throws java.io.IOExceptionDescription copied from class:TermVectorsReaderChecks 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 classTermVectorsReader- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-