Interface ForwardIndexReader<T extends ForwardIndexReaderContext>
-
- Type Parameters:
T- Type of the ReaderContext
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Subinterfaces:
MutableForwardIndex,SortedIndexReader<T>
public interface ForwardIndexReader<T extends ForwardIndexReaderContext> extends Closeable
Interface for forward index reader.
-
-
Method Summary
Modifier and Type Method Description default TcreateContext()Creates a newForwardIndexReaderContextof the reader which can be used to accelerate the reads.default BigDecimalgetBigDecimal(int docId, T context)Reads the BIG_DECIMAL type single-value at the given document id.default byte[]getBytes(int docId, T context)Reads the BYTES type single-value at the given document id.default intgetBytesMV(int docId, byte[][] valueBuffer, T context)Reads the bytes type multi-value at the given document id into the passed in value buffer (the buffer size must be enough to hold all the values for the multi-value entry) and returns the number of values within the multi-value entry.default byte[][]getBytesMV(int docId, T context)Reads the bytes type multi-value at the given document id.default ChunkCompressionTypegetCompressionType()Returns the compression type (if valid).default intgetDictId(int docId, T context)Reads the dictionary id for a single-value column at the given document id.default intgetDictIdMV(int docId, int[] dictIdBuffer, T context)Reads the dictionary ids for a multi-value column at the given document id into the passed in buffer (the buffer size must be enough to hold all the values for the multi-value entry) and returns the number of values within the multi-value entry.default int[]getDictIdMV(int docId, T context)Reads the dictionary ids for a multi-value column at the given document id.default doublegetDouble(int docId, T context)Reads the DOUBLE type single-value at the given document id.default intgetDoubleMV(int docId, double[] valueBuffer, T context)Reads the DOUBLE type multi-value at the given document id into the passed in value buffer (the buffer size must be enough to hold all the values for the multi-value entry) and returns the number of values within the multi-value entry.default double[]getDoubleMV(int docId, T context)Reads the DOUBLE type multi-value at the given document id.default floatgetFloat(int docId, T context)Reads the FLOAT type single-value at the given document id.default intgetFloatMV(int docId, float[] valueBuffer, T context)Reads the FLOAT type multi-value at the given document id into the passed in value buffer (the buffer size must be enough to hold all the values for the multi-value entry) and returns the number of values within the multi-value entry.default float[]getFloatMV(int docId, T context)Reads the FLOAT type multi-value at the given document id.default intgetInt(int docId, T context)Reads the INT value at the given document id.default intgetIntMV(int docId, int[] valueBuffer, T context)Reads the INT type multi-value at the given document id into the passed in value buffer (the buffer size must be enough to hold all the values for the multi-value entry) and returns the number of values within the multi-value entry.default int[]getIntMV(int docId, T context)Reads the INT type multi-value at the given document id.default intgetLengthOfLongestEntry()Returns the length of the longest entry.default longgetLong(int docId, T context)Reads the LONG type single-value at the given document id.default intgetLongMV(int docId, long[] valueBuffer, T context)Reads the LONG type multi-value at the given document id into the passed in value buffer (the buffer size must be enough to hold all the values for the multi-value entry) and returns the number of values within the multi-value entry.default long[]getLongMV(int docId, T context)Reads the LONG type multi-value at the given document id.default intgetNumValuesMV(int docId, T context)Gets the number of multi-values at a given document id and returns it.FieldSpec.DataTypegetStoredType()Returns the data type of the values in the forward index.default StringgetString(int docId, T context)Reads the STRING type single-value at the given document id.default intgetStringMV(int docId, String[] valueBuffer, T context)Reads the STRING type multi-value at the given document id into the passed in value buffer (the buffer size must be enough to hold all the values for the multi-value entry) and returns the number of values within the multi-value entry.default String[]getStringMV(int docId, T context)Reads the STRING type multi-value at the given document id.booleanisDictionaryEncoded()Returnstrueif the forward index is dictionary-encoded,falseif it is raw.booleanisSingleValue()Returnstrueif the forward index is for a single-value column,falseif it is for a multi-value column.default voidreadDictIds(int[] docIds, int length, int[] dictIdBuffer, T context)Batch reads multiple dictionary ids for a single-value column at the given document ids into the passed in buffer (the buffer size must be larger than or equal to the length).default voidreadValuesMV(int[] docIds, int length, int maxNumValuesPerMVEntry, byte[][][] values, T context)Fills the valuesdefault voidreadValuesMV(int[] docIds, int length, int maxNumValuesPerMVEntry, double[][] values, T context)Fills the valuesdefault voidreadValuesMV(int[] docIds, int length, int maxNumValuesPerMVEntry, float[][] values, T context)Fills the valuesdefault voidreadValuesMV(int[] docIds, int length, int maxNumValuesPerMVEntry, int[][] values, T context)Fills the valuesdefault voidreadValuesMV(int[] docIds, int length, int maxNumValuesPerMVEntry, long[][] values, T context)Fills the valuesdefault voidreadValuesMV(int[] docIds, int length, int maxNumValuesPerMVEntry, String[][] values, T context)Fills the valuesdefault voidreadValuesSV(int[] docIds, int length, double[] values, T context)Fills the valuesdefault voidreadValuesSV(int[] docIds, int length, float[] values, T context)Fills the valuesdefault voidreadValuesSV(int[] docIds, int length, int[] values, T context)Fills the valuesdefault voidreadValuesSV(int[] docIds, int length, long[] values, T context)Fills the valuesdefault voidreadValuesSV(int[] docIds, int length, BigDecimal[] values, T context)Fills the values
-
-
-
Method Detail
-
isDictionaryEncoded
boolean isDictionaryEncoded()
Returnstrueif the forward index is dictionary-encoded,falseif it is raw.
-
isSingleValue
boolean isSingleValue()
Returnstrueif the forward index is for a single-value column,falseif it is for a multi-value column.
-
getStoredType
FieldSpec.DataType getStoredType()
Returns the data type of the values in the forward index. ReturnsFieldSpec.DataType.INTfor dictionary-encoded forward index.
-
getCompressionType
default ChunkCompressionType getCompressionType()
Returns the compression type (if valid). Only valid for RAW forward index columns implemented in BaseChunkForwardIndexReader.- Returns:
-
getLengthOfLongestEntry
default int getLengthOfLongestEntry()
Returns the length of the longest entry. Only valid for RAW forward index columns implemented in BaseChunkForwardIndexReader. Returns -1 otherwise.- Returns:
-
createContext
@Nullable default T createContext()
Creates a newForwardIndexReaderContextof the reader which can be used to accelerate the reads. NOTE: Caller is responsible for closing the returned reader context.
-
getDictId
default int getDictId(int docId, T context)Reads the dictionary id for a single-value column at the given document id.- Parameters:
docId- Document idcontext- Reader context- Returns:
- Dictionary id at the given document id
-
readDictIds
default void readDictIds(int[] docIds, int length, int[] dictIdBuffer, T context)Batch reads multiple dictionary ids for a single-value column at the given document ids into the passed in buffer (the buffer size must be larger than or equal to the length).- Parameters:
docIds- Array containing the document ids to readlength- Number of values to readdictIdBuffer- Dictionary id buffercontext- Reader context
-
getDictIdMV
default int getDictIdMV(int docId, int[] dictIdBuffer, T context)Reads the dictionary ids for a multi-value column at the given document id into the passed in buffer (the buffer size must be enough to hold all the values for the multi-value entry) and returns the number of values within the multi-value entry.- Parameters:
docId- Document iddictIdBuffer- Dictionary id buffercontext- Reader context- Returns:
- Number of values within the multi-value entry
-
getDictIdMV
default int[] getDictIdMV(int docId, T context)Reads the dictionary ids for a multi-value column at the given document id.- Parameters:
docId- Document idcontext- Reader context- Returns:
- Dictionary ids at the given document id
-
readValuesSV
default void readValuesSV(int[] docIds, int length, int[] values, T context)Fills the values- Parameters:
docIds- Array containing the document ids to readlength- Number of values to readvalues- Values to fillcontext- Reader context
-
readValuesSV
default void readValuesSV(int[] docIds, int length, long[] values, T context)Fills the values- Parameters:
docIds- Array containing the document ids to readlength- Number of values to readvalues- Values to fillcontext- Reader context
-
readValuesSV
default void readValuesSV(int[] docIds, int length, float[] values, T context)Fills the values- Parameters:
docIds- Array containing the document ids to readlength- Number of values to readvalues- Values to fillcontext- Reader context
-
readValuesSV
default void readValuesSV(int[] docIds, int length, double[] values, T context)Fills the values- Parameters:
docIds- Array containing the document ids to readlength- Number of values to readvalues- Values to fillcontext- Reader context
-
readValuesSV
default void readValuesSV(int[] docIds, int length, BigDecimal[] values, T context)Fills the values- Parameters:
docIds- Array containing the document ids to readlength- Number of values to readvalues- Values to fillcontext- Reader context
-
getInt
default int getInt(int docId, T context)Reads the INT value at the given document id.- Parameters:
docId- Document idcontext- Reader context- Returns:
- INT type single-value at the given document id
-
getLong
default long getLong(int docId, T context)Reads the LONG type single-value at the given document id.- Parameters:
docId- Document idcontext- Reader context- Returns:
- LONG type single-value at the given document id
-
getFloat
default float getFloat(int docId, T context)Reads the FLOAT type single-value at the given document id.- Parameters:
docId- Document idcontext- Reader context- Returns:
- FLOAT type single-value at the given document id
-
getDouble
default double getDouble(int docId, T context)Reads the DOUBLE type single-value at the given document id.- Parameters:
docId- Document idcontext- Reader context- Returns:
- DOUBLE type single-value at the given document id
-
getBigDecimal
default BigDecimal getBigDecimal(int docId, T context)
Reads the BIG_DECIMAL type single-value at the given document id.- Parameters:
docId- Document idcontext- Reader context- Returns:
- BIG_DECIMAL type single-value at the given document id
-
getString
default String getString(int docId, T context)
Reads the STRING type single-value at the given document id.- Parameters:
docId- Document idcontext- Reader context- Returns:
- STRING type single-value at the given document id
-
getBytes
default byte[] getBytes(int docId, T context)Reads the BYTES type single-value at the given document id.- Parameters:
docId- Document idcontext- Reader context- Returns:
- BYTES type single-value at the given document id
-
readValuesMV
default void readValuesMV(int[] docIds, int length, int maxNumValuesPerMVEntry, int[][] values, T context)Fills the values- Parameters:
docIds- Array containing the document ids to readlength- Number of values to readmaxNumValuesPerMVEntry- Maximum number of values per MV entryvalues- Values to fillcontext- Reader context
-
readValuesMV
default void readValuesMV(int[] docIds, int length, int maxNumValuesPerMVEntry, long[][] values, T context)Fills the values- Parameters:
docIds- Array containing the document ids to readlength- Number of values to readmaxNumValuesPerMVEntry- Maximum number of values per MV entryvalues- Values to fillcontext- Reader context
-
readValuesMV
default void readValuesMV(int[] docIds, int length, int maxNumValuesPerMVEntry, float[][] values, T context)Fills the values- Parameters:
docIds- Array containing the document ids to readlength- Number of values to readmaxNumValuesPerMVEntry- Maximum number of values per MV entryvalues- Values to fillcontext- Reader context
-
readValuesMV
default void readValuesMV(int[] docIds, int length, int maxNumValuesPerMVEntry, double[][] values, T context)Fills the values- Parameters:
docIds- Array containing the document ids to readlength- Number of values to readmaxNumValuesPerMVEntry- Maximum number of values per MV entryvalues- Values to fillcontext- Reader context
-
readValuesMV
default void readValuesMV(int[] docIds, int length, int maxNumValuesPerMVEntry, String[][] values, T context)Fills the values- Parameters:
docIds- Array containing the document ids to readlength- Number of values to readmaxNumValuesPerMVEntry- Maximum number of values per MV entryvalues- Values to fillcontext- Reader context
-
readValuesMV
default void readValuesMV(int[] docIds, int length, int maxNumValuesPerMVEntry, byte[][][] values, T context)Fills the values- Parameters:
docIds- Array containing the document ids to readlength- Number of values to readmaxNumValuesPerMVEntry- Maximum number of values per MV entryvalues- Values to fillcontext- Reader context
-
getIntMV
default int getIntMV(int docId, int[] valueBuffer, T context)Reads the INT type multi-value at the given document id into the passed in value buffer (the buffer size must be enough to hold all the values for the multi-value entry) and returns the number of values within the multi-value entry.- Parameters:
docId- Document idvalueBuffer- Value buffercontext- Reader context- Returns:
- Number of values within the multi-value entry
-
getIntMV
default int[] getIntMV(int docId, T context)Reads the INT type multi-value at the given document id.- Parameters:
docId- Document idcontext- Reader context- Returns:
- INT values at the given document id
-
getLongMV
default int getLongMV(int docId, long[] valueBuffer, T context)Reads the LONG type multi-value at the given document id into the passed in value buffer (the buffer size must be enough to hold all the values for the multi-value entry) and returns the number of values within the multi-value entry.- Parameters:
docId- Document idvalueBuffer- Value buffercontext- Reader context- Returns:
- Number of values within the multi-value entry
-
getLongMV
default long[] getLongMV(int docId, T context)Reads the LONG type multi-value at the given document id.- Parameters:
docId- Document idcontext- Reader context- Returns:
- LONG values at the given document id
-
getFloatMV
default int getFloatMV(int docId, float[] valueBuffer, T context)Reads the FLOAT type multi-value at the given document id into the passed in value buffer (the buffer size must be enough to hold all the values for the multi-value entry) and returns the number of values within the multi-value entry.- Parameters:
docId- Document idvalueBuffer- Value buffercontext- Reader context- Returns:
- Number of values within the multi-value entry
-
getFloatMV
default float[] getFloatMV(int docId, T context)Reads the FLOAT type multi-value at the given document id.- Parameters:
docId- Document idcontext- Reader context- Returns:
- FLOAT values at the given document id
-
getDoubleMV
default int getDoubleMV(int docId, double[] valueBuffer, T context)Reads the DOUBLE type multi-value at the given document id into the passed in value buffer (the buffer size must be enough to hold all the values for the multi-value entry) and returns the number of values within the multi-value entry.- Parameters:
docId- Document idvalueBuffer- Value buffercontext- Reader context- Returns:
- Number of values within the multi-value entry
-
getDoubleMV
default double[] getDoubleMV(int docId, T context)Reads the DOUBLE type multi-value at the given document id.- Parameters:
docId- Document idcontext- Reader context- Returns:
- DOUBLE values at the given document id
-
getStringMV
default int getStringMV(int docId, String[] valueBuffer, T context)Reads the STRING type multi-value at the given document id into the passed in value buffer (the buffer size must be enough to hold all the values for the multi-value entry) and returns the number of values within the multi-value entry.- Parameters:
docId- Document idvalueBuffer- Value buffercontext- Reader context- Returns:
- Number of values within the multi-value entry
-
getStringMV
default String[] getStringMV(int docId, T context)
Reads the STRING type multi-value at the given document id.- Parameters:
docId- Document idcontext- Reader context- Returns:
- STRING values at the given document id
-
getBytesMV
default int getBytesMV(int docId, byte[][] valueBuffer, T context)Reads the bytes type multi-value at the given document id into the passed in value buffer (the buffer size must be enough to hold all the values for the multi-value entry) and returns the number of values within the multi-value entry.- Parameters:
docId- Document idvalueBuffer- Value buffercontext- Reader context- Returns:
- Number of values within the multi-value entry
-
getBytesMV
default byte[][] getBytesMV(int docId, T context)Reads the bytes type multi-value at the given document id.- Parameters:
docId- Document idcontext- Reader context- Returns:
- BYTE values at the given document id
-
getNumValuesMV
default int getNumValuesMV(int docId, T context)Gets the number of multi-values at a given document id and returns it.- Parameters:
docId- Document idcontext- Reader context- Returns:
- Number of values within the multi-value entry
-
-