A thread-safe container for managing and retrieving data chunks by partition and chunk ID. More...
#include <postbox.hpp>
Public Types | |
| using | key_type = KeyType |
| The type of the key used to map chunks. | |
Public Member Functions | |
| template<typename Fn > | |
| PostBox (Fn &&key_map_fn, size_t num_keys_hint=0) | |
| Construct a new PostBox. More... | |
| void | insert (Chunk &&chunk) |
| Inserts a chunk into the PostBox. More... | |
| bool | is_empty (PartID pid) const |
| Check whether the specified partition contains any chunks. More... | |
| Chunk | extract (PartID pid, ChunkID cid) |
| Extracts a specific chunk from the PostBox. More... | |
| std::unordered_map< ChunkID, Chunk > | extract (PartID pid) |
| Extracts all chunks associated with a specific partition. More... | |
| std::unordered_map< ChunkID, Chunk > | extract_by_key (KeyType key) |
| Extracts all chunks associated with a specific key. More... | |
| std::vector< Chunk > | extract_all_ready () |
| Extracts all ready chunks from the PostBox. More... | |
| bool | empty () const |
| Checks if the PostBox is empty. More... | |
| std::vector< std::tuple< key_type, ChunkID, std::size_t > > | search (MemoryType mem_type) const |
| Searches for chunks of the specified memory type. More... | |
| std::string | str () const |
| Returns a description of this instance. More... | |
A thread-safe container for managing and retrieving data chunks by partition and chunk ID.
| KeyType | The type of the key used to map chunks. |
Definition at line 25 of file postbox.hpp.
|
inline |
Construct a new PostBox.
| Fn | The type of the function that maps a partition ID to a key. |
| key_map_fn | A function that maps a partition ID to a key. |
| num_keys_hint | The number of keys to reserve space for. |
key_map_fn must be convertible to a function that takes a PartID and returns a KeyType. Definition at line 40 of file postbox.hpp.
| bool rapidsmpf::shuffler::detail::PostBox< KeyType >::empty | ( | ) | const |
| std::unordered_map<ChunkID, Chunk> rapidsmpf::shuffler::detail::PostBox< KeyType >::extract | ( | PartID | pid | ) |
Extracts all chunks associated with a specific partition.
| pid | The ID of the partition. |
| std::out_of_range | If the partition is not found. |
| Chunk rapidsmpf::shuffler::detail::PostBox< KeyType >::extract | ( | PartID | pid, |
| ChunkID | cid | ||
| ) |
Extracts a specific chunk from the PostBox.
| pid | The ID of the partition containing the chunk. |
| cid | The ID of the chunk to be accessed. |
| std::out_of_range | If the chunk is not found. |
| std::vector<Chunk> rapidsmpf::shuffler::detail::PostBox< KeyType >::extract_all_ready | ( | ) |
| std::unordered_map<ChunkID, Chunk> rapidsmpf::shuffler::detail::PostBox< KeyType >::extract_by_key | ( | KeyType | key | ) |
Extracts all chunks associated with a specific key.
| key | The key. |
| std::out_of_range | If the key is not found. |
| void rapidsmpf::shuffler::detail::PostBox< KeyType >::insert | ( | Chunk && | chunk | ) |
Inserts a chunk into the PostBox.
| chunk | The chunk to insert. |
| bool rapidsmpf::shuffler::detail::PostBox< KeyType >::is_empty | ( | PartID | pid | ) | const |
Check whether the specified partition contains any chunks.
| pid | Identifier of the partition to query. |
| std::vector<std::tuple<key_type, ChunkID, std::size_t> > rapidsmpf::shuffler::detail::PostBox< KeyType >::search | ( | MemoryType | mem_type | ) | const |
Searches for chunks of the specified memory type.
| mem_type | The type of memory to search within. |
| std::string rapidsmpf::shuffler::detail::PostBox< KeyType >::str | ( | ) | const |
Returns a description of this instance.