Skip to main content

Suite

Struct Suite 

Source
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::D and C::R requires Debug for debugging.
  • C::NodeId requires From<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,

Source

pub fn test_all( builder: B, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub fn test_store( builder: &B, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn last_membership_in_log_initial( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn last_membership_in_log( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn last_membership_in_log_multi_step( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn get_membership_initial( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn get_membership_from_log_and_empty_sm( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn get_membership_from_empty_log_and_sm( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn get_membership_from_log_le_sm_last_applied( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn get_membership_from_log_gt_sm_last_applied_1( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn get_membership_from_log_gt_sm_last_applied_2( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn get_initial_state_without_init( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn get_initial_state_with_state( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn get_initial_state_membership_from_log_and_sm( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn get_initial_state_last_log_gt_sm( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn get_initial_state_last_log_lt_sm( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn get_initial_state_log_ids( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

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.

Source

pub async fn save_vote( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn get_log_entries( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn limited_get_log_entries( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn try_get_log_entry( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn initial_logs( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn get_log_state( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn get_log_id( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn last_id_in_log( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn last_applied_state( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn purge_logs_upto_0( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn purge_logs_upto_5( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn purge_logs_upto_20( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn delete_logs_since_11( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn delete_logs_since_0( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn append_to_log( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn snapshot_meta( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn apply_single( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

pub async fn apply_multiple( store: LS, sm: SM, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

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

Source

pub async fn feed_10_logs_vote_self( sto: &mut LS, ) -> Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>

Source

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>
where C: Unpin, LS: Unpin, SM: Unpin, B: Unpin, G: Unpin,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> OptionalSend for T
where T: Send + ?Sized,

Source§

impl<T> OptionalSync for T
where T: Sync + ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more