Package com.qfs.chunk

Interface IChunkComposite

All Superinterfaces:
IArray, IArrayReader, IArrayWriter, ICanCollectVectors<IArrayReader>, IChunk<IArrayReader>, IMemoryMonitored, IWritableArray, Serializable
All Known Implementing Classes:
ChunkComposite, ChunkCompositeSparse

public interface IChunkComposite extends ICanCollectVectors<IArrayReader>, Serializable
Interface for chunks used for performing user-defined aggregations.

These chunks can store several typed values in one position.

Author:
ActiveViam
  • Method Details

    • copy

      void copy(int position, IArrayReader array)
      Copies the values of the array in the specified rows.
      Parameters:
      position - the position where to copy the values
      array - the object containing the values to copy
    • moveCursor

      void moveCursor(IInternalCompositeColumnCursor cursor, int position)
      Method used to move a cursor.
      Parameters:
      cursor - the cursor to move
      position - the position to move at
    • getColumnCount

      int getColumnCount()
      Gets the number of values that are stored in a position.
      Returns:
      the number of values that are stored in a position
    • readRow

      Object[] readRow(int position)
      Performs a read operation on the underlying chunkset of this chunk.

      This method must only be called within tests.

      Parameters:
      position - position at which we read the values in the underlying chunkset
      Returns:
      the values stored in the underlying chunks at the given position
    • write

      default void write(int position, Object value)
      Description copied from interface: IArrayWriter
      Writes a piece of data at a position in the array.

      For better performance, use the primitive type operations.

      Specified by:
      write in interface IArrayWriter
      Parameters:
      position - 0-based index in the array
      value - the value to write
    • findRowsEqualTo

      default void findRowsEqualTo(Object value, long epoch, IChunkLong version, int offset, int chunkLimit, IRowMapping mapping, int limit, IBitmap result)
      Description copied from interface: IChunk
      Scans all the records and returns all the rows matching with the sought object in the chunk.
      Specified by:
      findRowsEqualTo in interface IChunk<IArrayReader>
      Parameters:
      value - the sought object
      epoch - the epoch will define which rows are read. Only rows created before or deleted after this epoch will be read
      version - the column holding the version number at which each row has been inserted or removed
      offset - the offset in the result, the offset is the row number in the store corresponding to the first row in this chunk
      chunkLimit - the number of rows to iterate in this chunk, it should not be bigger than the chunk size
      mapping - this mapping is only used when this chunk is a SparseChunk, and it is a map of the global row chunk to the underlying chunk, otherwise is null
      limit - the size limit for the result of this search, it can be 0 for a non limit size result
      result - a bitmap to add the row numbers matching with the sought object
    • findRowsEqualTo

      default void findRowsEqualTo(Object value, int offset, int chunkLimit, IRowMapping mapping, int limit, IBitmap result)
      Description copied from interface: IChunk
      Scans all the records and returns all the rows matching with the sought object in the chunk.
      Specified by:
      findRowsEqualTo in interface IChunk<IArrayReader>
      Parameters:
      value - the sought object
      offset - the offset in the result, the offset is the row number in the store corresponding to the first row in this chunk
      chunkLimit - the number of rows to iterate in this chunk, it should not be bigger than the chunk size
      mapping - this mapping is only used when this chunk is a SparseChunk, and it is a map of the global row chunk to the underlying chunk, otherwise is null
      limit - the size limit for the result of this search, it can be 0 for a non limit size result
      result - a bitmap to add the row numbers matching with the sought object
    • findRowsEqualTo

      default void findRowsEqualTo(Object value, IIntIterator filter, int offset, IRowMapping mapping, int limit, IBitmap result)
      Description copied from interface: IChunk
      Scans all the records and returns all the rows matching with the sought object in the chunk.
      Specified by:
      findRowsEqualTo in interface IChunk<IArrayReader>
      Parameters:
      value - the sought object
      filter - all the row numbers that should be considered for this research
      offset - the offset in the result, the offset is the row number in the store corresponding to the first row in this chunk
      mapping - this mapping is only used when this chunk is a SparseChunk, and it is a map of the global row chunk to the underlying chunk, otherwise is null
      limit - the size limit for the result of this search, it can be 0 for a non limit size result
      result - a bitmap to add the row numbers matching with the sought object
    • findRowsInSet

      default void findRowsInSet(Set<Object> values, IIntIterator filter, int offset, IRowMapping mapping, int limit, IBitmap result)
      Description copied from interface: IChunk
      Scans all the records and returns all the rows matching with any object in the set of sought objects in the chunk.
      Specified by:
      findRowsInSet in interface IChunk<IArrayReader>
      Parameters:
      values - the set of sought objects
      filter - all the row numbers that should be considered for this research
      offset - the offset in the result, the offset is the row number in the store corresponding to the first row in this chunk
      mapping - this mapping is only used when this chunk is a SparseChunk, and it is a map of the global row chunk to the underlying chunk, otherwise is null
      limit - the size limit for the result of this search, it can be 0 for a non limit size result
      result - a bitmap to add the row numbers matching with any object in the set of sought objects
    • findRowsInSet

      default void findRowsInSet(Set<Object> values, int offset, int chunkLimit, IRowMapping mapping, int limit, IBitmap result)
      Description copied from interface: IChunk
      Scans all the records and returns all the rows matching with any object in the set of sought objects in the chunk.
      Specified by:
      findRowsInSet in interface IChunk<IArrayReader>
      Parameters:
      values - the set of sought objects
      offset - the offset in the result, the offset is the row number in the store corresponding to the first row in this chunk
      chunkLimit - the number of rows to iterate in this chunk, it should not be bigger than the chunk size
      mapping - this mapping is only used when this chunk is a SparseChunk, and it is a map of the global row chunk to the underlying chunk, otherwise is null
      limit - the size limit for the result of this search, it can be 0 for a non limit size result
      result - a bitmap to add the row numbers matching with any object in the set of sought objects
    • findRowsInSet

      default void findRowsInSet(Set<Object> values, long epoch, IChunkLong version, int offset, int chunkLimit, IRowMapping mapping, int limit, IBitmap result)
      Description copied from interface: IChunk
      Scans all the records and returns all the rows matching with any object in the set of sought objects in the chunk.
      Specified by:
      findRowsInSet in interface IChunk<IArrayReader>
      Parameters:
      values - the set of sought objects
      epoch - the epoch will define which rows are read, only rows created before or deleted after this epoch will be read
      version - the column holding the version number at which each row has been inserted or removed
      offset - the offset in the result, the offset is the row number in the store corresponding to the first row in this chunk
      chunkLimit - the number of rows to iterate in this chunk, it should not be bigger than the chunk size
      mapping - this mapping is only used when this chunk is a SparseChunk, and it is a map of the global row chunk to the underlying chunk, otherwise is null
      limit - the size limit for the result of this search, it can be 0 for a non limit size result
      result - a bitmap to add the row numbers matching with any object in the set of sought objects
    • findRowsInTransactionEqualTo

      default void findRowsInTransactionEqualTo(Object value, IChunkLong version, int offset, int chunkLimit, IRowMapping mapping, int limit, IBitmap result)
      Description copied from interface: IChunk
      Scans all the records and returns all the rows matching with the sought object in the chunk.
      Specified by:
      findRowsInTransactionEqualTo in interface IChunk<IArrayReader>
      Parameters:
      value - the sought object
      version - the column holding the version number at which each row has been inserted or removed corresponding to this chunk
      offset - the offset in the result, the offset is the row number in the store corresponding to the first row in this chunk
      chunkLimit - the number of rows to iterate in this chunk, it should not be bigger than the chunk size
      mapping - this mapping is only used when this chunk is a SparseChunk, and it is a map of the global row chunk to the underlying chunk, otherwise is null
      limit - the size limit for the result of this search, it can be 0 for a non limit size result
      result - a bitmap to add the row numbers matching with the sought object
    • findRowsInTransactionEqualTo

      default void findRowsInTransactionEqualTo(Object value, IChunkLong version, IBitmap deletions, int offset, int chunkLimit, IRowMapping mapping, int limit, IBitmap result)
      Description copied from interface: IChunk
      Scans all the records and returns all the rows matching with the sought object in the chunk.
      Specified by:
      findRowsInTransactionEqualTo in interface IChunk<IArrayReader>
      Parameters:
      value - the sought object
      version - the column holding the version number at which each row has been inserted or removed corresponding to this chunk
      deletions - a bitmap of deleted rows, that should not be scanned
      offset - the offset in the result, the offset is the row number in the store corresponding to the first row in this chunk
      chunkLimit - the number of rows to iterate in this chunk, it should not be bigger than the chunk size
      mapping - this mapping is only used when this chunk is a SparseChunk, and it is a map of the global row chunk to the underlying chunk, otherwise is null
      limit - the size limit for the result of this search, it can be 0 for a non limit size result
      result - a bitmap to add the row numbers matching with the sought object
    • findRowsInTransactionEqualTo

      default void findRowsInTransactionEqualTo(Object value, IIntIterator filter, IBitmap deletions, int offset, IRowMapping mapping, int limit, IBitmap result)
      Description copied from interface: IChunk
      Scans all the records and returns all the rows matching with the sought object in the chunk.
      Specified by:
      findRowsInTransactionEqualTo in interface IChunk<IArrayReader>
      Parameters:
      value - the sought object
      filter - all the row numbers that should be considered for this research
      deletions - a bitmap of deleted rows, that should not be scanned
      offset - the offset in the result, the offset is the row number in the store corresponding to the first row in this chunk
      mapping - this mapping is only used when this chunk is a SparseChunk, and it is a map of the global row chunk to the underlying chunk, otherwise is null
      limit - the size limit for the result of this search, it can be 0 for a non limit size result
      result - a bitmap to add the row numbers matching with the sought object
    • findRowsInTransactionInSet

      default void findRowsInTransactionInSet(Set<Object> values, IIntIterator filter, IBitmap deletions, int offset, IRowMapping mapping, int limit, IBitmap result)
      Description copied from interface: IChunk
      Scans all the records and returns all the rows matching with any object in the set of sought objects in the chunk.
      Specified by:
      findRowsInTransactionInSet in interface IChunk<IArrayReader>
      Parameters:
      values - the set of sought objects
      filter - all the row numbers that should be considered for this research
      deletions - a bitmap of deleted rows, that should not be scanned
      offset - the offset in the result, the offset is the row number in the store corresponding to the first row in this chunk
      mapping - this mapping is only used when this chunk is a SparseChunk, and it is a map of the global row chunk to the underlying chunk, otherwise is null
      limit - the size limit for the result of this search, it can be 0 for a non limit size result
      result - a bitmap to add the row numbers matching with any object in the set of sought objects
    • findRowsInTransactionInSet

      default void findRowsInTransactionInSet(Set<Object> values, IChunkLong version, IBitmap deletions, int offset, int chunkLimit, IRowMapping mapping, int limit, IBitmap result)
      Description copied from interface: IChunk
      Scans all the records and returns all the rows matching with any object in the set of sought objects in the chunk.
      Specified by:
      findRowsInTransactionInSet in interface IChunk<IArrayReader>
      Parameters:
      values - the set of sought objects
      version - the column holding the version number at which each row has been inserted or removed corresponding to this chunk
      deletions - a bitmap of deleted rows, that should not be scanned
      offset - the offset in the result, the offset is the row number in the store corresponding to the first row in this chunk
      chunkLimit - the number of rows to iterate in this chunk, it should not be bigger than the chunk size
      mapping - this mapping is only used when this chunk is a SparseChunk, and it is a map of the global row chunk to the underlying chunk, otherwise is null
      limit - the size limit for the result of this search, it can be 0 for a non limit size result
      result - a bitmap to add the row numbers matching with any object in the set of sought objects
    • findRowsInTransactionInSet

      default void findRowsInTransactionInSet(Set<Object> values, IChunkLong version, int offset, int chunkLimit, IRowMapping mapping, int limit, IBitmap result)
      Description copied from interface: IChunk
      Scans all the records and returns all the rows matching with any object in the set of sought objects in the chunk.
      Specified by:
      findRowsInTransactionInSet in interface IChunk<IArrayReader>
      Parameters:
      values - the set of sought objects
      version - the column holding the version number at which each row has been inserted or removed corresponding to this chunk
      offset - the offset in the result, the offset is the row number in the store corresponding to the first row in this chunk
      chunkLimit - the number of rows to iterate in this chunk, it should not be bigger than the chunk size
      mapping - this mapping is only used when this chunk is a SparseChunk, and it is a map of the global row chunk to the underlying chunk, otherwise is null
      limit - the size limit for the result of this search, it can be 0 for a non limit size result
      result - a bitmap to add the row numbers matching with any object in the set of sought objects
    • readInt

      default int readInt(int position)
      Description copied from interface: IArrayReader
      Reads an int primitive value from the array.

      An exception is thrown if the value is not of the right type.

      Specified by:
      readInt in interface IArrayReader
      Parameters:
      position - 0-based index in an array
      Returns:
      int value
    • readDouble

      default double readDouble(int position)
      Description copied from interface: IArrayReader
      Reads a double primitive value from the array.

      An exception is thrown if the value is not of the right type.

      Specified by:
      readDouble in interface IArrayReader
      Parameters:
      position - 0-based index in an array
      Returns:
      double value
    • readLong

      default long readLong(int position)
      Description copied from interface: IArrayReader
      Reads a long primitive value from the array.

      An exception is thrown if the value is not of the right type.

      Specified by:
      readLong in interface IArrayReader
      Parameters:
      position - 0-based index in an array
      Returns:
      long value
    • readBoolean

      default boolean readBoolean(int position)
      Description copied from interface: IArrayReader
      Reads a boolean primitive value from the array.

      An exception is thrown if the value is not of the right type.

      Specified by:
      readBoolean in interface IArrayReader
      Parameters:
      position - 0-based index in an array
      Returns:
      boolean value
    • createArrayCursor

      default IArrayCursor createArrayCursor()
      Description copied from interface: IArray
      Creates a new read-only cursor that can be moved up and down the array. This cursor delegates all reading calls to the underlying array.
      Specified by:
      createArrayCursor in interface IArray
      Specified by:
      createArrayCursor in interface IChunk<IArrayReader>
      Specified by:
      createArrayCursor in interface IWritableArray
      Returns:
      the cursor, stationed at index 0 of the array