Public Member Functions | Public Attributes | List of all members
rapidsmpf::streaming::OrderScheme Struct Reference

Order-based partitioning scheme for sorted/range-partitioned data. More...

#include <channel_metadata.hpp>

Public Member Functions

 OrderScheme ()=default
 Default constructor. Produces an invalid (empty) scheme.
 
 OrderScheme (std::vector< OrderKey > keys, std::shared_ptr< TableChunk > boundaries, bool strict_boundaries=false)
 Construct a validated OrderScheme. More...
 
OrderScheme with_keys (std::vector< OrderKey > new_keys) const
 Return a new OrderScheme with updated key column indices, sharing boundaries. More...
 
bool boundaries_aligned_with (OrderScheme const &other, rapidsmpf::BufferResource const &br) const
 Check whether boundary values are aligned with another scheme. More...
 

Public Attributes

std::vector< OrderKeykeys
 Sort keys (column, order, null_order per entry).
 
std::shared_ptr< TableChunkboundaries
 
bool strict_boundaries {false}
 See struct-level note on strict_boundaries semantics.
 

Detailed Description

Order-based partitioning scheme for sorted/range-partitioned data.

Data is partitioned by value ranges based on predetermined boundaries. For N partitions, there are N-1 boundary rows:

keys[i] is the i-th sort column; ordering is lexicographic by keys[0], then keys[1], and so on.

When boundaries is set, its columns must align with keys (same count and compatible dtypes). Mismatched dtypes are a usage error.

strict_boundaries: when true, every row in a chunk belongs to a single partition's half-open key range (partition keys do not straddle chunk interiors). When false, a chunk may contain keys spanning multiple partitions.

Definition at line 80 of file channel_metadata.hpp.

Constructor & Destructor Documentation

◆ OrderScheme()

rapidsmpf::streaming::OrderScheme::OrderScheme ( std::vector< OrderKey keys,
std::shared_ptr< TableChunk boundaries,
bool  strict_boundaries = false 
)

Construct a validated OrderScheme.

Parameters
keysNon-empty sort keys; size must equal boundaries->shape().second.
boundariesNon-null, device-resident boundary table (N-1 rows for N partitions). Accepts a unique_ptr<TableChunk> via implicit conversion.
strict_boundariesSee struct-level doc. Defaults to false.
Exceptions
std::invalid_argumentif keys is empty, boundaries is null or not device-resident, or keys.size() != boundaries->shape().second.

Member Function Documentation

◆ boundaries_aligned_with()

bool rapidsmpf::streaming::OrderScheme::boundaries_aligned_with ( OrderScheme const &  other,
rapidsmpf::BufferResource const &  br 
) const

Check whether boundary values are aligned with another scheme.

Parameters
otherThe OrderScheme to compare against.
brBuffer resource used for temporary allocations during comparison.
Returns
True when both schemes have matching boundary values and strict_boundaries attributes, and the schemes are otherwise compatible (same order and null_order).

◆ with_keys()

OrderScheme rapidsmpf::streaming::OrderScheme::with_keys ( std::vector< OrderKey new_keys) const

Return a new OrderScheme with updated key column indices, sharing boundaries.

The new key count must match the existing boundary column count.

Parameters
new_keysReplacement sort keys; size must equal boundaries->shape().second.
Returns
A new OrderScheme with new_keys and the same boundaries and strict_boundaries.
Exceptions
std::invalid_argumentif new_keys is empty or size mismatches boundaries.

Member Data Documentation

◆ boundaries

std::shared_ptr<TableChunk> rapidsmpf::streaming::OrderScheme::boundaries

N-1 boundary rows for N partitions.

Definition at line 82 of file channel_metadata.hpp.


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