13 #include <cuda_runtime_api.h>
15 #include <cudf/types.hpp>
17 #include <rapidsmpf/memory/buffer_resource.hpp>
18 #include <rapidsmpf/memory/content_description.hpp>
19 #include <rapidsmpf/streaming/core/message.hpp>
20 #include <rapidsmpf/streaming/cudf/table_chunk.hpp>
81 std::vector<OrderKey>
keys;
100 std::vector<OrderKey>
keys,
147 enum class Type : std::uint8_t {
155 std::optional<HashScheme>
hash;
180 return {.
type =
Type::HASH, .hash = std::move(h), .order = std::nullopt};
Class managing buffer resources.
Type-erased message wrapper around a payload.
Message to_message(std::uint64_t sequence_number, std::unique_ptr< PackedData > chunk)
Wrap PackedData into a Message.
Hash partitioning scheme.
std::vector< cudf::size_type > column_indices
Column indices to hash on.
bool operator==(HashScheme const &) const =default
Equality comparison.
int modulus
Hash modulus (number of partitions).
A single sort key: column index, sort direction, and null placement.
cudf::null_order null_order
BEFORE or AFTER.
bool operator!=(OrderKey const &) const =default
Inequality comparison.
bool operator==(OrderKey const &) const =default
Equality comparison.
cudf::size_type column_index
Column to sort on.
cudf::order order
ASCENDING or DESCENDING.
Order-based partitioning scheme for sorted/range-partitioned data.
std::vector< OrderKey > keys
Sort keys (column, order, null_order per entry).
bool boundaries_aligned_with(OrderScheme const &other, rapidsmpf::BufferResource const &br) const
Check whether boundary values are aligned with another scheme.
std::shared_ptr< TableChunk > boundaries
OrderScheme with_keys(std::vector< OrderKey > new_keys) const
Return a new OrderScheme with updated key column indices, sharing boundaries.
OrderScheme(std::vector< OrderKey > keys, std::shared_ptr< TableChunk > boundaries, bool strict_boundaries=false)
Construct a validated OrderScheme.
bool strict_boundaries
See struct-level note on strict_boundaries semantics.
OrderScheme()=default
Default constructor. Produces an invalid (empty) scheme.
Partitioning specification for a single hierarchical level.
std::optional< OrderScheme > order
Valid only when type == ORDER.
static PartitioningSpec from_order(OrderScheme o)
Create a spec for order/range partitioning.
Type
Type tag for PartitioningSpec.
@ ORDER
Order/range partitioning.
@ NONE
No partitioning information at this level.
@ INHERIT
Partitioning is inherited from parent level unchanged.
static PartitioningSpec inherit()
Create a spec indicating partitioning passes through from parent.
Type type
The type of partitioning.
std::optional< HashScheme > hash
Valid only when type == HASH.
static PartitioningSpec none()
Create a spec indicating no partitioning information.
static PartitioningSpec from_hash(HashScheme h)
Create a spec for hash partitioning.
Hierarchical partitioning metadata for a data stream.
PartitioningSpec inter_rank
Distribution across ranks (corresponds to primary communicator).
PartitioningSpec local
Distribution within a rank (corresponds to local/single communicator).