pub struct Suite<C, LS, SM, B, G>where
C: RaftTypeConfig,
<C as RaftTypeConfig>::D: Debug,
<C as RaftTypeConfig>::R: Debug,
LS: RaftLogStorage<C>,
SM: RaftStateMachine<C>,
B: StoreBuilder<C, LS, SM, G>,
G: Send + Sync,{ /* private fields */ }Expand description
Test suite to ensure a RaftStore impl works as expected.
Additional traits are required to be implemented by the store builder for testing:
C::DandC::RrequiresDebugfor debugging.C::NodeIdrequiresFrom<u64>to build a node id.
Implementations§
Source§impl<C, LS, SM, B, G> Suite<C, LS, SM, B, G>where
C: RaftTypeConfig,
<C as RaftTypeConfig>::D: Debug,
<C as RaftTypeConfig>::R: Debug,
<C as RaftTypeConfig>::NodeId: From<u64>,
LS: RaftLogStorage<C>,
SM: RaftStateMachine<C>,
B: StoreBuilder<C, LS, SM, G>,
G: Send + Sync,
impl<C, LS, SM, B, G> Suite<C, LS, SM, B, G>where
C: RaftTypeConfig,
<C as RaftTypeConfig>::D: Debug,
<C as RaftTypeConfig>::R: Debug,
<C as RaftTypeConfig>::NodeId: From<u64>,
LS: RaftLogStorage<C>,
SM: RaftStateMachine<C>,
B: StoreBuilder<C, LS, SM, G>,
G: Send + Sync,
pub fn test_all( builder: B, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub fn test_store( builder: &B, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn last_membership_in_log_initial( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn last_membership_in_log( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn last_membership_in_log_multi_step( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn get_membership_initial( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn get_membership_from_log_and_empty_sm( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn get_membership_from_empty_log_and_sm( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn get_membership_from_log_le_sm_last_applied( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn get_membership_from_log_gt_sm_last_applied_1( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn get_membership_from_log_gt_sm_last_applied_2( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn get_initial_state_without_init( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn get_initial_state_with_state( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn get_initial_state_membership_from_log_and_sm( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn get_initial_state_last_log_gt_sm( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn get_initial_state_last_log_lt_sm( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn get_initial_state_log_ids( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
Sourcepub async fn get_initial_state_re_apply_committed(
store: LS,
sm: SM,
) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn get_initial_state_re_apply_committed( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
Test if committed logs are re-applied.
pub async fn save_vote( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn get_log_entries( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn limited_get_log_entries( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn try_get_log_entry( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn initial_logs( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn get_log_state( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn get_log_id( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn last_id_in_log( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn last_applied_state( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn purge_logs_upto_0( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn purge_logs_upto_5( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn purge_logs_upto_20( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn delete_logs_since_11( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn delete_logs_since_0( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn append_to_log( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn snapshot_meta( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn apply_single( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn apply_multiple( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
Sourcepub async fn transfer_snapshot(
builder: &B,
) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn transfer_snapshot( builder: &B, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
Rudimentary test for snapshotting that builds a snapshot on one node and installs it on another
pub async fn feed_10_logs_vote_self( sto: &mut LS, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
pub async fn default_vote( sto: &mut LS, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>
Auto Trait Implementations§
impl<C, LS, SM, B, G> Freeze for Suite<C, LS, SM, B, G>
impl<C, LS, SM, B, G> RefUnwindSafe for Suite<C, LS, SM, B, G>
impl<C, LS, SM, B, G> Send for Suite<C, LS, SM, B, G>
impl<C, LS, SM, B, G> Sync for Suite<C, LS, SM, B, G>
impl<C, LS, SM, B, G> Unpin for Suite<C, LS, SM, B, G>
impl<C, LS, SM, B, G> UnsafeUnpin for Suite<C, LS, SM, B, G>
impl<C, LS, SM, B, G> UnwindSafe for Suite<C, LS, SM, B, G>
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> 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> 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