Public Member Functions | List of all members
rapidsmpf::shuffler::detail::ReceivedChunks Class Reference

A thread-safe container for managing received chunks stratified by partition ID. More...

#include <postbox.hpp>

Public Member Functions

 ReceivedChunks (std::size_t num_keys_hint=0)
 Construct a new container. More...
 
void insert (Chunk &&chunk)
 Insert a chunk. More...
 
bool is_empty (PartID pid) const
 Check whether the specified partition contains any chunks. More...
 
std::vector< Chunkextract (PartID pid)
 Extracts all chunks associated with a specific partition. More...
 
bool empty () const
 Checks if the container is empty. More...
 
std::string str () const
 
std::size_t spill (BufferResource *br, std::size_t amount)
 Spill device data. More...
 

Detailed Description

A thread-safe container for managing received chunks stratified by partition ID.

Definition at line 72 of file postbox.hpp.

Constructor & Destructor Documentation

◆ ReceivedChunks()

rapidsmpf::shuffler::detail::ReceivedChunks::ReceivedChunks ( std::size_t  num_keys_hint = 0)
inline

Construct a new container.

Parameters
num_keys_hintThe number of keys to reserve space for.

Definition at line 79 of file postbox.hpp.

Member Function Documentation

◆ empty()

bool rapidsmpf::shuffler::detail::ReceivedChunks::empty ( ) const

Checks if the container is empty.

Returns
true if the container is empty, false otherwise.
Note
The result reflects a snapshot at the time of the call and may change immediately afterward.

◆ extract()

std::vector<Chunk> rapidsmpf::shuffler::detail::ReceivedChunks::extract ( PartID  pid)

Extracts all chunks associated with a specific partition.

Parameters
pidThe ID of the partition.
Returns
A vector of chunks.
Exceptions
std::out_of_rangeIf the partition is not found.

◆ insert()

void rapidsmpf::shuffler::detail::ReceivedChunks::insert ( Chunk &&  chunk)

Insert a chunk.

Parameters
chunkThe chunk to insert.

◆ is_empty()

bool rapidsmpf::shuffler::detail::ReceivedChunks::is_empty ( PartID  pid) const

Check whether the specified partition contains any chunks.

Parameters
pidIdentifier of the partition to query.
Returns
True if the partition contains no chunks, false otherwise.
Note
The result reflects a snapshot at the time of the call and may change immediately afterward.

◆ spill()

std::size_t rapidsmpf::shuffler::detail::ReceivedChunks::spill ( BufferResource br,
std::size_t  amount 
)

Spill device data.

The spilling is stream ordered by the spilled buffers' CUDA streams.

Parameters
brThe buffer resource for host and device allocations.
amountRequested amount of data to spill in bytes.
Returns
Actual amount of data spilled in bytes.

◆ str()

std::string rapidsmpf::shuffler::detail::ReceivedChunks::str ( ) const
Returns
A description of this container.

The documentation for this class was generated from the following file: