Class GatherMap

java.lang.Object
ai.rapids.cudf.GatherMap
All Implemented Interfaces:
AutoCloseable

public class GatherMap extends Object implements AutoCloseable
This class tracks the data associated with a gather map, a buffer of INT32 elements that index a source table and can be passed to a table gather operation.
  • Constructor Details

    • GatherMap

      public GatherMap(DeviceMemoryBuffer buffer)
      Construct a gather map instance from a device buffer. The buffer length must be a multiple of the DType.INT32 size, as each row of the gather map is an INT32.
      Parameters:
      buffer - device buffer backing the gather map data
  • Method Details

    • getRowCount

      public long getRowCount()
      Return the number of rows in the gather map
    • toColumnView

      public ColumnView toColumnView(long startRow, int numRows)
      Create a column view that can be used to perform a gather operation. Note that the resulting column view MUST NOT outlive the underlying device buffer within this instance!
      Parameters:
      startRow - row offset where the resulting gather map will start
      numRows - number of rows in the resulting gather map
      Returns:
      column view of gather map data
    • releaseBuffer

      public DeviceMemoryBuffer releaseBuffer()
      Release the underlying device buffer instance. After this is called, closing this instance will not close the underlying device buffer. It is the responsibility of the caller to close the returned device buffer.
      Returns:
      device buffer backing gather map data or null if the buffer has already been released
    • close

      public void close()
      Close the device buffer backing the gather map data.
      Specified by:
      close in interface AutoCloseable