Struct raftstore::store::fsm::PeerFsm [−][src]
Fields
peer: Peer<EK, ER>
tick_registry: PeerTicks
A registry for all scheduled ticks. This can avoid scheduling ticks twice accidentally.
missing_ticks: usize
Ticks for speed up campaign in chaos state.
Followers will keep ticking in Idle mode to measure how many ticks have been skipped. Once it becomes chaos, those skipped ticks will be ticked so that it can campaign quickly instead of waiting an election timeout.
This will be reset to 0 once it receives any messages from leader.
hibernate_state: HibernateState
stopped: bool
has_ready: bool
mailbox: Option<BasicMailbox<PeerFsm<EK, ER>>>
receiver: Receiver<PeerMsg<EK>>
skip_split_count: usize
when snapshot is generating or sending, skip split check at most REGION_SPLIT_SKIT_MAX_COUNT times.
skip_gc_raft_log_ticks: usize
Sometimes applied raft logs won’t be compacted in time, because less compact means less
sync-log in apply threads. Stale logs will be deleted if the skip time reaches this
skip_gc_raft_log_ticks
.
batch_req_builder: BatchRaftCmdRequestBuilder<EK>
Implementations
impl<EK, ER> PeerFsm<EK, ER> where
EK: KvEngine,
ER: RaftEngine,
[src]
EK: KvEngine,
ER: RaftEngine,
pub fn create(
store_id: u64,
cfg: &Config,
sched: Scheduler<RegionTask<EK::Snapshot>>,
engines: Engines<EK, ER>,
region: &Region
) -> Result<(LooseBoundedSender<PeerMsg<EK>>, Box<PeerFsm<EK, ER>>)>
[src]
store_id: u64,
cfg: &Config,
sched: Scheduler<RegionTask<EK::Snapshot>>,
engines: Engines<EK, ER>,
region: &Region
) -> Result<(LooseBoundedSender<PeerMsg<EK>>, Box<PeerFsm<EK, ER>>)>
pub fn replicate(
store_id: u64,
cfg: &Config,
sched: Scheduler<RegionTask<EK::Snapshot>>,
engines: Engines<EK, ER>,
region_id: u64,
peer: Peer
) -> Result<(LooseBoundedSender<PeerMsg<EK>>, Box<PeerFsm<EK, ER>>)>
[src]
store_id: u64,
cfg: &Config,
sched: Scheduler<RegionTask<EK::Snapshot>>,
engines: Engines<EK, ER>,
region_id: u64,
peer: Peer
) -> Result<(LooseBoundedSender<PeerMsg<EK>>, Box<PeerFsm<EK, ER>>)>
pub fn region_id(&self) -> u64
[src]
pub fn get_peer(&self) -> &Peer<EK, ER>
[src]
pub fn peer_id(&self) -> u64
[src]
pub fn stop(&mut self)
[src]
pub fn set_pending_merge_state(&mut self, state: MergeState)
[src]
pub fn schedule_applying_snapshot(&mut self)
[src]
Trait Implementations
impl<EK: KvEngine, ER: RaftEngine> AbstractPeer for PeerFsm<EK, ER>
[src]
fn meta_peer(&self) -> &Peer
[src]
fn group_state(&self) -> GroupState
[src]
fn region(&self) -> &Region
[src]
fn apply_state(&self) -> &RaftApplyState
[src]
fn raft_status(&self) -> Status<'_>
[src]
fn raft_commit_index(&self) -> u64
[src]
fn raft_request_snapshot(&mut self, index: u64)
[src]
fn pending_merge_state(&self) -> Option<&MergeState>
[src]
impl<EK, ER> Drop for PeerFsm<EK, ER> where
EK: KvEngine,
ER: RaftEngine,
[src]
EK: KvEngine,
ER: RaftEngine,
impl<EK, ER> Fsm for PeerFsm<EK, ER> where
EK: KvEngine,
ER: RaftEngine,
[src]
EK: KvEngine,
ER: RaftEngine,
type Message = PeerMsg<EK>
fn is_stopped(&self) -> bool
[src]
fn set_mailbox(&mut self, mailbox: Cow<'_, BasicMailbox<Self>>) where
Self: Sized,
[src]
Self: Sized,
Set a mailbox to Fsm, which should be used to send message to itself.
fn take_mailbox(&mut self) -> Option<BasicMailbox<Self>> where
Self: Sized,
[src]
Self: Sized,
Take the mailbox from Fsm. Implementation should ensure there will be no reference to mailbox after calling this method.
pub fn get_priority(&self) -> Priority
[src]
impl<EK, ER, T> HandlerBuilder<PeerFsm<EK, ER>, StoreFsm<EK>> for RaftPollerBuilder<EK, ER, T> where
EK: KvEngine + 'static,
ER: RaftEngine + 'static,
T: Transport + 'static,
[src]
EK: KvEngine + 'static,
ER: RaftEngine + 'static,
T: Transport + 'static,
type Handler = RaftPoller<EK, ER, T>
fn build(&mut self, _: Priority) -> RaftPoller<EK, ER, T>
[src]
impl<EK: KvEngine, ER: RaftEngine, T: Transport> PollHandler<PeerFsm<EK, ER>, StoreFsm<EK>> for RaftPoller<EK, ER, T>
[src]
fn begin(&mut self, _batch_size: usize)
[src]
fn handle_control(&mut self, store: &mut StoreFsm<EK>) -> Option<usize>
[src]
fn handle_normal(&mut self, peer: &mut PeerFsm<EK, ER>) -> Option<usize>
[src]
fn end(&mut self, peers: &mut [Box<PeerFsm<EK, ER>>])
[src]
fn pause(&mut self)
[src]
pub fn get_priority(&self) -> Priority
[src]
Auto Trait Implementations
impl<EK, ER> !RefUnwindSafe for PeerFsm<EK, ER>
impl<EK, ER> Send for PeerFsm<EK, ER>
impl<EK, ER> !Sync for PeerFsm<EK, ER>
impl<EK, ER> Unpin for PeerFsm<EK, ER> where
ER: Unpin,
<EK as KvEngine>::Snapshot: Unpin,
ER: Unpin,
<EK as KvEngine>::Snapshot: Unpin,
impl<EK, ER> !UnwindSafe for PeerFsm<EK, ER>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<V, W> ConvertFrom<W> for V where
W: ConvertTo<V>,
[src]
W: ConvertTo<V>,
pub fn convert_from(ctx: &mut EvalContext, from: W) -> Result<V, Error>
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
[src]
pub const ALIGN: usize
[src]
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
[src]
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
[src]
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
[src]
pub unsafe fn drop(ptr: usize)
[src]
impl<T> Pointable for T
[src]
pub const ALIGN: usize
[src]
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
[src]
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
[src]
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
[src]
pub unsafe fn drop(ptr: usize)
[src]
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> Sealed<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,