pub struct EventDrivenGroupCommit { /* private fields */ }Expand description
Event-driven group commit buffer with proper synchronization
Implementations§
Source§impl EventDrivenGroupCommit
impl EventDrivenGroupCommit
Sourcepub fn new<F>(flush_fn: F) -> Self
pub fn new<F>(flush_fn: F) -> Self
Create a new event-driven group commit buffer
§Arguments
flush_fn- Callback that performs WAL fsync. Takes list of txn_ids, returns commit timestamp.
Sourcepub fn with_config<F>(flush_fn: F, config: GroupCommitConfig) -> Self
pub fn with_config<F>(flush_fn: F, config: GroupCommitConfig) -> Self
Create with custom configuration
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Check if running
Sourcepub fn submit_and_wait(&self, txn_id: u64) -> Result<u64, String>
pub fn submit_and_wait(&self, txn_id: u64) -> Result<u64, String>
Submit a commit and wait for it to complete
This blocks until the transaction’s batch has been fsynced. Returns the commit timestamp on success.
Sourcepub fn flush_batch(&self)
pub fn flush_batch(&self)
Flush one batch of pending commits
Called by background flush thread or inline when needed.
Sourcepub fn flush_loop(&self)
pub fn flush_loop(&self)
Background flush loop (call from owner thread)
Sourcepub fn stats(&self) -> GroupCommitStatsV2
pub fn stats(&self) -> GroupCommitStatsV2
Get statistics for monitoring
Auto Trait Implementations§
impl !Freeze for EventDrivenGroupCommit
impl !RefUnwindSafe for EventDrivenGroupCommit
impl !UnwindSafe for EventDrivenGroupCommit
impl Send for EventDrivenGroupCommit
impl Sync for EventDrivenGroupCommit
impl Unpin for EventDrivenGroupCommit
impl UnsafeUnpin for EventDrivenGroupCommit
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
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