Enum paxakos::event::Event[][src]

#[non_exhaustive]
pub enum Event<I: Invocation> {
    Init {
        status: NodeStatus,
        round: RoundNumOf<I>,
        state: Option<Arc<StateOf<I>>>,
    },
    StatusChange {
        old_status: NodeStatus,
        new_status: NodeStatus,
    },
    Activate(RoundNumOf<I>),
    Install {
        round: RoundNumOf<I>,
        state: Arc<StateOf<I>>,
    },
    Commit {
        round: RoundNumOf<I>,
        log_entry: Arc<LogEntryOf<I>>,
    },
    Apply {
        round: RoundNumOf<I>,
        log_entry: Arc<LogEntryOf<I>>,
        effect: EffectOf<I>,
    },
    Gaps(Vec<Gap<RoundNumOf<I>>>),
    Directive {
        kind: DirectiveKind,
        leader: NodeOf<I>,
        round_num: RoundNumOf<I>,
        coord_num: CoordNumOf<I>,
        timestamp: Instant,
    },
}
Expand description

Emitted by Node’s poll_events method.

Variants (Non-exhaustive)

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Init

First event that is fired immediately after construction.

Fields of Init

status: NodeStatus

Initial status of the node.

round: RoundNumOf<I>

Round the node is in.

state: Option<Arc<StateOf<I>>>

Initial state or None when no snapshot was given.

StatusChange

Node’s status changed.

Fields of StatusChange

old_status: NodeStatus

Old status.

new_status: NodeStatus

New status.

Activate(RoundNumOf<I>)

The node is transitioning to partially active participation.

Tuple Fields of Activate

0: RoundNumOf<I>
Install

A snapshot was installed.

Fields of Install

round: RoundNumOf<I>

Round node is in after a snapshot was installed.

state: Arc<StateOf<I>>

State the node is in after a snapshot was installed.

Commit

An entry has been committed to the log.

The event does not imply that the entry was applied to the shared state.

Fields of Commit

round: RoundNumOf<I>

The round for which log_entry was committed.

log_entry: Arc<LogEntryOf<I>>

The log entry which was committed.

Apply

The next log entry was applied to the state.

Fields of Apply

round: RoundNumOf<I>

Round the log entry was applied in.

log_entry: Arc<LogEntryOf<I>>

Log entry that was applied.

effect: EffectOf<I>

The event data that the application.

Gaps(Vec<Gap<RoundNumOf<I>>>)

A log entry was queued, preceeding entries are still missing.

Note: This event is emitted even when the queued entry is within the concurrency bound or if this node created the gap itself. The second case can arise when the leader tries to concurrently append multiple entries and abandons some of the earlier appends.

Tuple Fields of Gaps

0: Vec<Gap<RoundNumOf<I>>>
Directive

This node received a (potentially indirect) directive for the given round and from the given node. The node used the mandate obtained with the given coordination number to issue the directive.

This event is not emitted when this node is disoriented or lagging.

Fields of Directive

kind: DirectiveKind

Kind of directive, either Prepare, Accept or Commit.

leader: NodeOf<I>

Leader that issued the directive.

round_num: RoundNumOf<I>

Round for which the directive was issued.

coord_num: CoordNumOf<I>

Coordination number with which the directive was issued.

timestamp: Instant

Time the directive was (locally) registered.

Trait Implementations

Formats the value using the given formatter. Read more

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

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

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

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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

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