pub struct MockPurgeExecutor { /* private fields */ }Expand description
Defines the behavior for log entry compaction and physical deletion.
§Safety Requirements
Implementations MUST guarantee:
- All entries up to
last_included.indexare preserved in snapshots - No concurrent modifications during purge execution
- Atomic persistence of purge metadata
Implementations§
Source§impl MockPurgeExecutor
impl MockPurgeExecutor
Sourcepub fn checkpoint(&mut self)
pub fn checkpoint(&mut self)
Validate that all current expectations for all methods have been satisfied, and discard them.
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new mock object with no expectations.
This method will not be generated if the real struct
already has a new method. However, it will be
generated if the struct implements a trait with a new
method. The trait’s new method can still be called
like <MockX as TraitY>::new
Source§impl MockPurgeExecutor
impl MockPurgeExecutor
Sourcepub fn expect_execute_purge(&mut self) -> &mut Expectation
pub fn expect_execute_purge(&mut self) -> &mut Expectation
Create an Expectation for mocking the execute_purge method
Sourcepub fn expect_validate_purge(&mut self) -> &mut Expectation
pub fn expect_validate_purge(&mut self) -> &mut Expectation
Create an Expectation for mocking the validate_purge method
Sourcepub fn expect_pre_purge(&mut self) -> &mut Expectation
pub fn expect_pre_purge(&mut self) -> &mut Expectation
Create an Expectation for mocking the pre_purge method
Sourcepub fn expect_post_purge(&mut self) -> &mut Expectation
pub fn expect_post_purge(&mut self) -> &mut Expectation
Create an Expectation for mocking the post_purge method
Trait Implementations§
Source§impl Debug for MockPurgeExecutor
impl Debug for MockPurgeExecutor
Source§impl Default for MockPurgeExecutor
impl Default for MockPurgeExecutor
Source§impl PurgeExecutor for MockPurgeExecutor
Defines the behavior for log entry compaction and physical deletion.
impl PurgeExecutor for MockPurgeExecutor
Defines the behavior for log entry compaction and physical deletion.
§Safety Requirements
Implementations MUST guarantee:
- All entries up to
last_included.indexare preserved in snapshots - No concurrent modifications during purge execution
- Atomic persistence of purge metadata
Source§fn execute_purge<'life0, 'async_trait>(
&'life0 self,
last_included: LogId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute_purge<'life0, 'async_trait>(
&'life0 self,
last_included: LogId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn validate_purge<'life0, 'async_trait>(
&'life0 self,
last_included: LogId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn validate_purge<'life0, 'async_trait>(
&'life0 self,
last_included: LogId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Validates if purge can be safely executed
§Key Characteristics
- Stateless: Does NOT validate Raft protocol state (commit index/purge order/cluster progress)
- Storage-focused: Performs physical storage checks (disk space/snapshot integrity/I/O health)
Default implementation checks:
- No pending purge operations
Auto Trait Implementations§
impl Freeze for MockPurgeExecutor
impl RefUnwindSafe for MockPurgeExecutor
impl Send for MockPurgeExecutor
impl Sync for MockPurgeExecutor
impl Unpin for MockPurgeExecutor
impl UnwindSafe for MockPurgeExecutor
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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request