ChunkedPack#
- public class ChunkedPack implements AutoCloseable#
JNI interface to cudf::chunked_pack.
ChunkedPack has an Iterator-like API with the familiar
hasNextandnextmethods.nextshould be used in a loop untilhasNextreturns false.However,
ChunkedPack.nextis special because it takes aDeviceMemoryBufferas a parameter, which means that the caller can callnextgiving any bounce buffer it may have previously allocated. No requirement exists that the bounce buffer be the same each time, the only requirement is that their sizes are all the same, and match the size that was passed toTable.makeChunkedPack(which instantiates this class).The user of
ChunkedPackmust close.close()when done using it to clear up both host and device resources.Constructor Summary
This constructor is invoked by Table.makeChunkedPack after creating a native cudf::chunked_pack.
Method Summary
Generates opaque table metadata that can be unpacked via cudf::unpack at a later time.
Get the final contiguous size of the table we are packing.
Method to be called to ensure that ChunkedPack has work left.
Place the next contiguous chunk of our table into userPtr.
Constructors
- public ChunkedPack(long nativePtr)#
This constructor is invoked by
Table.makeChunkedPackafter creating a nativecudf::chunked_pack.- Parameters:
nativePtr – pointer to a
cudf::chunked_pack
Methods
- public long getTotalContiguousSize()#
Get the final contiguous size of the table we are packing.
This is the size that the final buffer should be, just like if the user called
cudf::packinstead.- Returns:
the total number of bytes for the table in contiguous layout
- public boolean hasNext()#
Method to be called to ensure that
ChunkedPackhas work left.This method should be invoked followed by a call to
next, untilhasNextreturns false.- Returns:
true if there is work left to be done (
nextshould be called), false otherwise.
- public long next(DeviceMemoryBuffer userPtr)#
Place the next contiguous chunk of our table into
userPtr.This method throws if
hasNextis false.- Parameters:
userPtr – the bounce buffer to use for this iteration
- Returns:
the number of bytes that we were able to place in
userPtr. This is at mostuserPtr.getLength().
- public PackedColumnMetadata buildMetadata()#
Generates opaque table metadata that can be unpacked via
cudf::unpackat a later time.- Returns:
a
PackedColumnMetadatainstance referencing cuDF packed table metadata
- public void close()#