pub struct SqlitePartitionCoordinator { /* private fields */ }Implementations§
Source§impl SqlitePartitionCoordinator
impl SqlitePartitionCoordinator
pub fn new(conn: SqliteConn, config: SqlitePartitionCoordinatorConfig) -> Self
pub fn connect( conn: SqliteConn, config: SqlitePartitionCoordinatorConfig, ) -> Result<Self>
pub fn prepare_schema( conn: &SqliteConn, config: &SqlitePartitionCoordinatorConfig, ) -> Result<()>
pub fn schema_sql(config: &SqlitePartitionCoordinatorConfig) -> String
Trait Implementations§
Source§impl Clone for SqlitePartitionCoordinator
impl Clone for SqlitePartitionCoordinator
Source§impl PartitionCoordinator<SqliteCursor> for SqlitePartitionCoordinator
impl PartitionCoordinator<SqliteCursor> for SqlitePartitionCoordinator
async fn heartbeat<'a>( &'a self, scope: &'a CheckpointScope, owner_id: &'a OwnerId, lease_duration: Duration, ) -> Result<()>
async fn live_consumers<'a>( &'a self, scope: &'a CheckpointScope, ) -> Result<usize>
Source§async fn release_consumer<'a>(
&'a self,
scope: &'a CheckpointScope,
owner_id: &'a OwnerId,
) -> Result<()>
async fn release_consumer<'a>( &'a self, scope: &'a CheckpointScope, owner_id: &'a OwnerId, ) -> Result<()>
Remove this consumer’s registration so other consumers stop counting it
as live when computing
target_partition_count. Called by
CoordinatedReader on stream shutdown. Should be idempotent and must
not return an error when the consumer record is missing.Source§async fn claim<'a>(
&'a self,
scope: &'a CheckpointScope,
owner_id: &'a OwnerId,
partition: Partition,
lease_duration: Duration,
) -> Result<Option<PartitionLease<SqliteCursor>>>
async fn claim<'a>( &'a self, scope: &'a CheckpointScope, owner_id: &'a OwnerId, partition: Partition, lease_duration: Duration, ) -> Result<Option<PartitionLease<SqliteCursor>>>
Attempt to take a partition. Returns
Ok(Some(lease)) on success or
Ok(None) if another live owner holds it. Increments generation on
every successful claim.Source§async fn renew<'a>(
&'a self,
lease: &'a PartitionLease<SqliteCursor>,
lease_duration: Duration,
) -> Result<()>
async fn renew<'a>( &'a self, lease: &'a PartitionLease<SqliteCursor>, lease_duration: Duration, ) -> Result<()>
Extend
lease_until only if (owner_id, generation) still matches.
Returns Err(Error::OwnershipLost(_)) on mismatch.Source§async fn release<'a>(
&'a self,
lease: &'a PartitionLease<SqliteCursor>,
) -> Result<()>
async fn release<'a>( &'a self, lease: &'a PartitionLease<SqliteCursor>, ) -> Result<()>
Clear
owner_id and lease_until only if (owner_id, generation)
matches. Increments generation. Returns Err(Error::OwnershipLost(_))
on mismatch.Source§async fn checkpoint<'a>(
&'a self,
lease: &'a PartitionLease<SqliteCursor>,
cursor: SqliteCursor,
) -> Result<()>
async fn checkpoint<'a>( &'a self, lease: &'a PartitionLease<SqliteCursor>, cursor: SqliteCursor, ) -> Result<()>
Write
cursor only if (owner_id, generation) matches. The update
is monotonic via Cursor::order_key(). Returns
Err(Error::OwnershipLost(_)) on mismatch.Auto Trait Implementations§
impl Freeze for SqlitePartitionCoordinator
impl RefUnwindSafe for SqlitePartitionCoordinator
impl Send for SqlitePartitionCoordinator
impl Sync for SqlitePartitionCoordinator
impl Unpin for SqlitePartitionCoordinator
impl UnsafeUnpin for SqlitePartitionCoordinator
impl UnwindSafe for SqlitePartitionCoordinator
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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