Package ai.rapids.cudf
Class GatherMap
java.lang.Object
ai.rapids.cudf.GatherMap
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionGatherMap
(DeviceMemoryBuffer buffer) Construct a gather map instance from a device buffer. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the device buffer backing the gather map data.long
Return the number of rows in the gather mapRelease the underlying device buffer instance.toColumnView
(long startRow, int numRows) Create a column view that can be used to perform a gather operation.
-
Constructor Details
-
GatherMap
Construct a gather map instance from a device buffer. The buffer length must be a multiple of theDType.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
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 startnumRows
- number of rows in the resulting gather map- Returns:
- column view of gather map data
-
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 interfaceAutoCloseable
-