pub struct CheckpointCoalescer { /* private fields */ }Expand description
Tracks high-water seq per subscription partition; flushes periodically.
Implementations§
Source§impl CheckpointCoalescer
impl CheckpointCoalescer
Sourcepub fn new(port: Arc<dyn StoragePort>) -> CheckpointCoalescer
pub fn new(port: Arc<dyn StoragePort>) -> CheckpointCoalescer
Start a background flush loop bound to port.
Sourcepub fn attach_reclaimer(&self, reclaimer: Arc<dyn PartitionReclaim>)
pub fn attach_reclaimer(&self, reclaimer: Arc<dyn PartitionReclaim>)
Wire opportunistic reclaim after checkpoint commits.
Sourcepub async fn record(
&self,
subscription_name: &str,
topic_name: &str,
topic_key: Option<&str>,
seq: i64,
) -> Result<(), PhotonError>
pub async fn record( &self, subscription_name: &str, topic_name: &str, topic_key: Option<&str>, seq: i64, ) -> Result<(), PhotonError>
Record delivered seq; may trigger immediate flush when batch threshold hit.
§Errors
Returns an error if the operation fails.
Sourcepub async fn flush(&self) -> Result<(), PhotonError>
pub async fn flush(&self) -> Result<(), PhotonError>
Sourcepub async fn pending_min_seq(
&self,
topic: &str,
topic_key: Option<&str>,
) -> Option<i64>
pub async fn pending_min_seq( &self, topic: &str, topic_key: Option<&str>, ) -> Option<i64>
Minimum unflushed seq for a storage partition.
Sourcepub async fn pending_partitions(&self) -> Vec<TopicPartition>
pub async fn pending_partitions(&self) -> Vec<TopicPartition>
Storage partitions with unflushed checkpoint state.
Auto Trait Implementations§
impl !RefUnwindSafe for CheckpointCoalescer
impl !UnwindSafe for CheckpointCoalescer
impl Freeze for CheckpointCoalescer
impl Send for CheckpointCoalescer
impl Sync for CheckpointCoalescer
impl Unpin for CheckpointCoalescer
impl UnsafeUnpin for CheckpointCoalescer
Blanket Implementations§
impl<T> AsyncConnector for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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