pub struct EngineState {
pub current_phase: Arc<AtomicU64>,
pub last_committed_phase: Arc<AtomicU64>,
pub is_active: Arc<AtomicBool>,
pub has_quorum: Arc<AtomicBool>,
pub pending_batches: Arc<DashMap<BatchId, PendingBatch>>,
pub phases: Arc<DashMap<PhaseId, PhaseData>>,
pub sync_responses: Arc<DashMap<NodeId, SyncResponseMessage>>,
pub active_nodes: Arc<RwLock<HashSet<NodeId>>>,
pub quorum_size: usize,
pub state_version: Arc<AtomicU64>,
pub last_cleanup: Arc<AtomicU64>,
}Fields§
§current_phase: Arc<AtomicU64>§last_committed_phase: Arc<AtomicU64>§is_active: Arc<AtomicBool>§has_quorum: Arc<AtomicBool>§pending_batches: Arc<DashMap<BatchId, PendingBatch>>§phases: Arc<DashMap<PhaseId, PhaseData>>§sync_responses: Arc<DashMap<NodeId, SyncResponseMessage>>§active_nodes: Arc<RwLock<HashSet<NodeId>>>§quorum_size: usize§state_version: Arc<AtomicU64>§last_cleanup: Arc<AtomicU64>Implementations§
Source§impl EngineState
impl EngineState
pub fn new(quorum_size: usize) -> Self
pub fn current_phase(&self) -> PhaseId
pub fn last_committed_phase(&self) -> PhaseId
pub fn advance_phase(&self) -> PhaseId
pub fn commit_phase(&self, phase_id: PhaseId) -> Result<bool>
pub fn is_active(&self) -> bool
pub fn set_active(&self, active: bool)
pub fn has_quorum(&self) -> bool
pub fn set_quorum(&self, has_quorum: bool)
pub fn get_active_nodes(&self) -> HashSet<NodeId>
pub fn update_active_nodes(&self, nodes: HashSet<NodeId>)
pub fn add_pending_batch( &self, batch: CommandBatch, originator: NodeId, ) -> BatchId
pub fn remove_pending_batch(&self, batch_id: &BatchId) -> Option<PendingBatch>
pub fn get_pending_batch(&self, batch_id: &BatchId) -> Option<PendingBatch>
pub fn get_or_create_phase(&self, phase_id: PhaseId) -> PhaseData
pub fn update_phase<F>(&self, phase_id: PhaseId, update_fn: F) -> Result<()>
pub fn get_phase(&self, phase_id: &PhaseId) -> Option<PhaseData>
pub fn cleanup_old_phases(&self, max_phase_history: usize) -> usize
pub fn cleanup_old_pending_batches(&self, max_age_secs: u64) -> usize
pub fn get_state_version(&self) -> u64
pub fn add_sync_response(&self, node_id: NodeId, response: SyncResponseMessage)
pub fn get_sync_responses(&self) -> HashMap<NodeId, SyncResponseMessage>
pub fn clear_sync_responses(&self)
pub fn get_statistics(&self) -> EngineStatistics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EngineState
impl !RefUnwindSafe for EngineState
impl Send for EngineState
impl Sync for EngineState
impl Unpin for EngineState
impl UnsafeUnpin for EngineState
impl !UnwindSafe for EngineState
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