9 #include <unordered_map>
12 #include <rapidsmpf/error.hpp>
13 #include <rapidsmpf/shuffler/chunk.hpp>
29 void insert(std::unique_ptr<Chunk> c);
43 [[nodiscard]]
bool empty()
const;
48 [[nodiscard]] std::string
str()
const;
51 mutable std::mutex mutex_{};
52 std::vector<std::unique_ptr<Chunk>> chunks_{};
80 if (num_keys_hint > 0) {
81 pigeonhole_.reserve(num_keys_hint);
126 [[nodiscard]] std::string
str()
const;
141 mutable std::mutex mutex_;
142 std::unordered_map<PartID, std::vector<Chunk>>
Class managing buffer resources.
A partition chunk representing either a data message or a control message.
A thread-safe container for managing outgoing (to send) chunks.
std::vector< Chunk > extract_ready()
Extract ready chunks.
void insert(std::unique_ptr< Chunk > c)
Insert a chunk into the container.
A thread-safe container for managing received chunks stratified by partition ID.
ReceivedChunks(std::size_t num_keys_hint=0)
Construct a new container.
std::size_t spill(BufferResource *br, std::size_t amount)
Spill device data.
void insert(Chunk &&chunk)
Insert a chunk.
bool is_empty(PartID pid) const
Check whether the specified partition contains any chunks.
std::vector< Chunk > extract(PartID pid)
Extracts all chunks associated with a specific partition.
bool empty() const
Checks if the container is empty.
Shuffler private interfaces.
std::ostream & operator<<(std::ostream &os, Chunk const &obj)
Overloads the stream insertion operator for the Chunk class.
std::uint32_t PartID
Partition ID, which goes from 0 to the total number of partitions.