GatherMap#

public class GatherMap 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 Summary

GatherMap(DeviceMemoryBuffer buffer)

Construct a gather map instance from a device buffer.

Method Summary

close()

Close the device buffer backing the gather map data.

getBufferAddress()

Get the address of the underlying device buffer.

getBufferLength()

Get the length of the underlying device buffer.

getRowCount()

Return the number of rows in the gather map.

releaseBuffer()

Release the underlying device buffer instance.

toColumnView(long startRow, int numRows)

Create a column view that can be used to perform a gather operation.

toString()

Constructors

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

Methods

public String toString()#
public long getRowCount()#

Return the number of rows in the gather map.

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

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

public long getBufferAddress()#

Get the address of the underlying device buffer.

This is to be used for JNI calls and with a lot of care.

public long getBufferLength()#

Get the length of the underlying device buffer.

This is to be used for JNI calls and with a lot of care.

Returns:

the length of the buffer in bytes.

public void close()#

Close the device buffer backing the gather map data.