pub struct CoreWatermarkState { /* private fields */ }Expand description
Per-core partition watermark aggregator.
Each core tracks watermarks for its assigned partitions. The global tracker aggregates across cores.
This is used in thread-per-core architectures where each core processes a subset of partitions.
Implementations§
Source§impl CoreWatermarkState
impl CoreWatermarkState
Sourcepub fn with_partitions(core_id: usize, partitions: Vec<PartitionId>) -> Self
pub fn with_partitions(core_id: usize, partitions: Vec<PartitionId>) -> Self
Creates with pre-assigned partitions.
Sourcepub fn assign_partition(&mut self, partition: PartitionId)
pub fn assign_partition(&mut self, partition: PartitionId)
Assigns a partition to this core.
Sourcepub fn remove_partition(&mut self, partition: PartitionId) -> bool
pub fn remove_partition(&mut self, partition: PartitionId) -> bool
Removes a partition from this core.
Sourcepub fn update_partition(
&mut self,
partition: PartitionId,
watermark: i64,
) -> Option<i64>
pub fn update_partition( &mut self, partition: PartitionId, watermark: i64, ) -> Option<i64>
Updates a partition watermark on this core.
§Returns
Some(i64) with the new local watermark if it advances.
Sourcepub fn mark_idle(&mut self, partition: PartitionId) -> Option<i64>
pub fn mark_idle(&mut self, partition: PartitionId) -> Option<i64>
Marks a partition as idle on this core.
Sourcepub fn local_watermark(&self) -> i64
pub fn local_watermark(&self) -> i64
Returns the local (per-core) watermark.
Sourcepub fn assigned_partitions(&self) -> &[PartitionId]
pub fn assigned_partitions(&self) -> &[PartitionId]
Returns the assigned partitions.
Sourcepub fn partition_count(&self) -> usize
pub fn partition_count(&self) -> usize
Returns the number of assigned partitions.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CoreWatermarkState
impl RefUnwindSafe for CoreWatermarkState
impl Send for CoreWatermarkState
impl Sync for CoreWatermarkState
impl Unpin for CoreWatermarkState
impl UnwindSafe for CoreWatermarkState
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.