Interface ForwardIndexReader<T extends ForwardIndexReaderContext>

    • Method Summary

      Modifier and Type Method Description
      default T createContext()
      Creates a new ForwardIndexReaderContext of the reader which can be used to accelerate the reads.
      default BigDecimal getBigDecimal​(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 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.
      default byte[][] getBytesMV​(int docId, T context)
      Reads the bytes type multi-value at the given document id.
      default ChunkCompressionType getCompressionType()
      Returns the compression type (if valid).
      default int getDictId​(int docId, T context)
      Reads the dictionary id for a single-value column at the given document id.
      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.
      default int[] getDictIdMV​(int docId, T context)
      Reads the dictionary ids for a multi-value column at the given document id.
      default double getDouble​(int docId, T context)
      Reads the DOUBLE type single-value at the given document id.
      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.
      default double[] getDoubleMV​(int docId, T context)
      Reads the DOUBLE type multi-value at the given document id.
      default float getFloat​(int docId, T context)
      Reads the FLOAT type single-value at the given document id.
      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.
      default float[] getFloatMV​(int docId, T context)
      Reads the FLOAT type multi-value at the given document id.
      default int getInt​(int docId, T context)
      Reads the INT value at the given document id.
      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.
      default int[] getIntMV​(int docId, T context)
      Reads the INT type multi-value at the given document id.
      default int getLengthOfLongestEntry()
      Returns the length of the longest entry.
      default long getLong​(int docId, T context)
      Reads the LONG type single-value at the given document id.
      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.
      default long[] getLongMV​(int docId, T context)
      Reads the LONG type multi-value at the given document id.
      default int getNumValuesMV​(int docId, T context)
      Gets the number of multi-values at a given document id and returns it.
      FieldSpec.DataType getStoredType()
      Returns the data type of the values in the forward index.
      default String getString​(int docId, T context)
      Reads the STRING type single-value at the given document id.
      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.
      default String[] getStringMV​(int docId, T context)
      Reads the STRING type multi-value at the given document id.
      boolean isDictionaryEncoded()
      Returns true if the forward index is dictionary-encoded, false if it is raw.
      boolean isSingleValue()
      Returns true if the forward index is for a single-value column, false if it is for a multi-value column.
      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).
      default void readValuesMV​(int[] docIds, int length, int maxNumValuesPerMVEntry, byte[][][] values, T context)
      Fills the values
      default void readValuesMV​(int[] docIds, int length, int maxNumValuesPerMVEntry, double[][] values, T context)
      Fills the values
      default void readValuesMV​(int[] docIds, int length, int maxNumValuesPerMVEntry, float[][] values, T context)
      Fills the values
      default void readValuesMV​(int[] docIds, int length, int maxNumValuesPerMVEntry, int[][] values, T context)
      Fills the values
      default void readValuesMV​(int[] docIds, int length, int maxNumValuesPerMVEntry, long[][] values, T context)
      Fills the values
      default void readValuesMV​(int[] docIds, int length, int maxNumValuesPerMVEntry, String[][] values, T context)
      Fills the values
      default void readValuesSV​(int[] docIds, int length, double[] values, T context)
      Fills the values
      default void readValuesSV​(int[] docIds, int length, float[] values, T context)
      Fills the values
      default void readValuesSV​(int[] docIds, int length, int[] values, T context)
      Fills the values
      default void readValuesSV​(int[] docIds, int length, long[] values, T context)
      Fills the values
      default void readValuesSV​(int[] docIds, int length, BigDecimal[] values, T context)
      Fills the values
    • Method Detail

      • isDictionaryEncoded

        boolean isDictionaryEncoded()
        Returns true if the forward index is dictionary-encoded, false if it is raw.
      • isSingleValue

        boolean isSingleValue()
        Returns true if the forward index is for a single-value column, false if it is for a multi-value column.
      • 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 new ForwardIndexReaderContext of 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 id
        context - 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 read
        length - Number of values to read
        dictIdBuffer - Dictionary id buffer
        context - 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 id
        dictIdBuffer - Dictionary id buffer
        context - 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 id
        context - 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 read
        length - Number of values to read
        values - Values to fill
        context - 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 read
        length - Number of values to read
        values - Values to fill
        context - 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 read
        length - Number of values to read
        values - Values to fill
        context - 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 read
        length - Number of values to read
        values - Values to fill
        context - 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 read
        length - Number of values to read
        values - Values to fill
        context - Reader context
      • getInt

        default int getInt​(int docId,
                           T context)
        Reads the INT value at the given document id.
        Parameters:
        docId - Document id
        context - 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 id
        context - 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 id
        context - 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 id
        context - 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 id
        context - 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 id
        context - 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 id
        context - 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 read
        length - Number of values to read
        maxNumValuesPerMVEntry - Maximum number of values per MV entry
        values - Values to fill
        context - 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 read
        length - Number of values to read
        maxNumValuesPerMVEntry - Maximum number of values per MV entry
        values - Values to fill
        context - 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 read
        length - Number of values to read
        maxNumValuesPerMVEntry - Maximum number of values per MV entry
        values - Values to fill
        context - 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 read
        length - Number of values to read
        maxNumValuesPerMVEntry - Maximum number of values per MV entry
        values - Values to fill
        context - 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 read
        length - Number of values to read
        maxNumValuesPerMVEntry - Maximum number of values per MV entry
        values - Values to fill
        context - 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 read
        length - Number of values to read
        maxNumValuesPerMVEntry - Maximum number of values per MV entry
        values - Values to fill
        context - 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 id
        valueBuffer - Value buffer
        context - 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 id
        context - 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 id
        valueBuffer - Value buffer
        context - 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 id
        context - 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 id
        valueBuffer - Value buffer
        context - 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 id
        context - 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 id
        valueBuffer - Value buffer
        context - 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 id
        context - 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 id
        valueBuffer - Value buffer
        context - 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 id
        context - 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 id
        valueBuffer - Value buffer
        context - 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 id
        context - 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 id
        context - Reader context
        Returns:
        Number of values within the multi-value entry