pub struct PartitionRouter { /* private fields */ }Expand description
Routes execution operations to the correct partition.
In a Valkey Cluster deployment, the ferriskey client handles slot-level
routing transparently — all keys for a partition share the same {p:N}
hash tag, so they land on the same shard. The router’s job is partition
computation and key context construction, not connection selection.
Implementations§
Source§impl PartitionRouter
impl PartitionRouter
pub fn new(config: PartitionConfig) -> Self
Sourcepub fn partition_for(&self, eid: &ExecutionId) -> Partition
pub fn partition_for(&self, eid: &ExecutionId) -> Partition
Resolve an execution ID to its partition.
Sourcepub fn exec_keys(&self, eid: &ExecutionId) -> ExecKeyContext
pub fn exec_keys(&self, eid: &ExecutionId) -> ExecKeyContext
Build an ExecKeyContext for the given execution.
Sourcepub fn index_keys(&self, partition_index: u16) -> IndexKeys
pub fn index_keys(&self, partition_index: u16) -> IndexKeys
Build IndexKeys for a given partition index.
Sourcepub fn config(&self) -> &PartitionConfig
pub fn config(&self) -> &PartitionConfig
The partition config.
Sourcepub fn num_flow_partitions(&self) -> u16
pub fn num_flow_partitions(&self) -> u16
Total number of flow partitions.
Post-RFC-011: exec keys co-locate with their parent flow’s partition
under hash-tag routing, so this count governs exec routing too.
There is no separate num_execution_partitions.
Auto Trait Implementations§
impl Freeze for PartitionRouter
impl RefUnwindSafe for PartitionRouter
impl Send for PartitionRouter
impl Sync for PartitionRouter
impl Unpin for PartitionRouter
impl UnsafeUnpin for PartitionRouter
impl UnwindSafe for PartitionRouter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more