pub struct Suite<C, LS, SM, B, G>where
C: RaftTypeConfig,
C::D: Debug,
C::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::D
andC::R
requiresDebug
for debugging.C::NodeId
requiresFrom<u64>
to build a node id.
Implementations§
source§impl<C, LS, SM, B, G> Suite<C, LS, SM, B, G>where
C: RaftTypeConfig,
C::D: Debug,
C::R: Debug,
C::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::D: Debug,
C::R: Debug,
C::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::NodeId>>
pub fn test_store(builder: &B) -> Result<(), StorageError<C::NodeId>>
pub async fn last_membership_in_log_initial( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
pub async fn last_membership_in_log( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
pub async fn last_membership_in_log_multi_step( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
pub async fn get_membership_initial( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
pub async fn get_membership_from_log_and_empty_sm( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
pub async fn get_membership_from_empty_log_and_sm( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
pub async fn get_membership_from_log_le_sm_last_applied( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
pub async fn get_membership_from_log_gt_sm_last_applied_1( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
pub async fn get_membership_from_log_gt_sm_last_applied_2( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
pub async fn get_initial_state_without_init( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
pub async fn get_initial_state_with_state( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
pub async fn get_initial_state_membership_from_log_and_sm( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
pub async fn get_initial_state_last_log_gt_sm( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
pub async fn get_initial_state_last_log_lt_sm( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
pub async fn get_initial_state_log_ids( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
sourcepub async fn get_initial_state_re_apply_committed(
store: LS,
sm: SM
) -> Result<(), StorageError<C::NodeId>>
pub async fn get_initial_state_re_apply_committed( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
Test if committed logs are re-applied.
pub async fn save_vote(store: LS, sm: SM) -> Result<(), StorageError<C::NodeId>>
pub async fn get_log_entries( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
pub async fn try_get_log_entry( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
pub async fn initial_logs( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
pub async fn get_log_state( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
pub async fn get_log_id( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
pub async fn last_id_in_log( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
pub async fn last_applied_state( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
pub async fn purge_logs_upto_0( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
pub async fn purge_logs_upto_5( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
pub async fn purge_logs_upto_20( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
pub async fn delete_logs_since_11( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
pub async fn delete_logs_since_0( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
pub async fn append_to_log( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
pub async fn snapshot_meta( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
pub async fn apply_single( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
pub async fn apply_multiple( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>
pub async fn feed_10_logs_vote_self( sto: &mut LS ) -> Result<(), StorageError<C::NodeId>>
pub async fn default_vote(sto: &mut LS) -> Result<(), StorageError<C::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> 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