Struct raftstore::store::fsm::peer::PeerFsmDelegate[][src]

pub struct PeerFsmDelegate<'a, EK, ER, T: 'static> where
    EK: KvEngine,
    ER: RaftEngine
{ fsm: &'a mut PeerFsm<EK, ER>, ctx: &'a mut PollContext<EK, ER, T>, }

Fields

fsm: &'a mut PeerFsm<EK, ER>ctx: &'a mut PollContext<EK, ER, T>

Implementations

impl<'a, EK, ER, T: Transport> PeerFsmDelegate<'a, EK, ER, T> where
    EK: KvEngine,
    ER: RaftEngine
[src]

pub fn new(
    fsm: &'a mut PeerFsm<EK, ER>,
    ctx: &'a mut PollContext<EK, ER, T>
) -> PeerFsmDelegate<'a, EK, ER, T>
[src]

pub fn handle_msgs(&mut self, msgs: &mut Vec<PeerMsg<EK>>)[src]

fn propose_batch_raft_command(&mut self)[src]

fn on_update_replication_mode(&mut self)[src]

fn on_casual_msg(&mut self, msg: CasualMessage<EK>)[src]

fn on_tick(&mut self, tick: PeerTicks)[src]

fn start(&mut self)[src]

fn on_gc_snap(&mut self, snaps: Vec<(SnapKey, bool)>)[src]

fn on_clear_region_size(&mut self)[src]

fn on_capture_change(
    &mut self,
    cmd: ChangeObserver,
    region_epoch: RegionEpoch,
    cb: Callback<EK::Snapshot>
)
[src]

fn on_significant_msg(&mut self, msg: SignificantMsg<EK::Snapshot>)[src]

fn report_snapshot_status(&mut self, to_peer_id: u64, status: SnapshotStatus)[src]

fn on_leader_callback(&mut self, cb: Callback<EK::Snapshot>)[src]

fn on_role_changed(&mut self, ready: &Ready)[src]

pub fn collect_ready(&mut self)[src]

pub fn post_raft_ready_append(&mut self, ready: CollectedReady)[src]

fn region_id(&self) -> u64[src]

fn region(&self) -> &Region[src]

fn store_id(&self) -> u64[src]

fn schedule_tick(&mut self, tick: PeerTicks)[src]

fn register_raft_base_tick(&mut self)[src]

fn on_raft_base_tick(&mut self)[src]

fn on_apply_res(&mut self, res: ApplyTaskRes<EK::Snapshot>)[src]

fn on_raft_message(&mut self, msg: RaftMessage) -> Result<()>[src]

fn all_agree_to_hibernate(&mut self) -> bool[src]

fn on_hibernate_request(&mut self, from: &Peer)[src]

fn on_hibernate_response(&mut self, from: &Peer)[src]

fn on_extra_message(&mut self, msg: RaftMessage)[src]

fn reset_raft_tick(&mut self, state: GroupState)[src]

fn validate_raft_msg(&mut self, msg: &RaftMessage) -> bool[src]

fn check_msg(&mut self, msg: &RaftMessage) -> bool[src]

Checks if the message is sent to the correct peer.

Returns true means that the message can be dropped silently.

fn need_gc_merge(&mut self, msg: &RaftMessage) -> Result<bool>[src]

Check if it’s necessary to gc the source merge peer.

If the target merge peer won’t be created on this store, then it’s appropriate to destroy it immediately.

fn handle_gc_peer_msg(&mut self, msg: &RaftMessage)[src]

fn check_snapshot(
    &mut self,
    msg: &RaftMessage
) -> Result<Either<SnapKey, Vec<(u64, bool)>>>
[src]

fn destroy_regions_for_snapshot(&mut self, regions_to_destroy: Vec<(u64, bool)>)[src]

fn check_request_snapshot(&mut self, msg: &RaftMessage) -> bool[src]

fn handle_destroy_peer(&mut self, job: DestroyPeerJob) -> bool[src]

fn destroy_peer(&mut self, merged_by_target: bool)[src]

fn update_region(&mut self, region: Region)[src]

fn on_ready_change_peer(&mut self, cp: ChangePeer)[src]

fn on_ready_compact_log(&mut self, first_index: u64, state: RaftTruncatedState)[src]

fn on_ready_split_region(
    &mut self,
    derived: Region,
    regions: Vec<Region>,
    new_split_regions: HashMap<u64, NewSplitPeer>
)
[src]

fn register_merge_check_tick(&mut self)[src]

fn is_merge_target_region_stale(&self, target_region: &Region) -> Result<bool>[src]

Check if merge target region is staler than the local one in kv engine. It should be called when target region is not in region map in memory. If everything is ok, the answer should always be true because PD should ensure all target peers exist. So if not, error log will be printed and return false.

fn validate_merge_peer(&self, target_region: &Region) -> Result<bool>[src]

fn schedule_merge(&mut self) -> Result<()>[src]

fn rollback_merge(&mut self)[src]

fn on_check_merge(&mut self)[src]

fn on_ready_prepare_merge(&mut self, region: Region, state: MergeState)[src]

fn on_catch_up_logs_for_merge(&mut self, catch_up_logs: CatchUpLogs)[src]

fn on_ready_commit_merge(&mut self, region: Region, source: Region)[src]

fn on_ready_rollback_merge(&mut self, commit: u64, region: Option<Region>)[src]

Handle rollbacking Merge result.

If commit is 0, it means that Merge is rollbacked by a snapshot; otherwise it’s rollbacked by a proposal, and its value should be equal to the commit index of previous PrepareMerge.

fn on_merge_result(
    &mut self,
    target_region_id: u64,
    target: Peer,
    result: MergeResultKind
)
[src]

fn on_stale_merge(&mut self, target_region_id: u64)[src]

fn on_ready_apply_snapshot(&mut self, apply_result: ApplySnapResult)[src]

fn on_ready_result(
    &mut self,
    exec_results: &mut VecDeque<ExecResult<EK::Snapshot>>,
    metrics: &ApplyMetrics
)
[src]

fn check_merge_proposal(&self, msg: &mut RaftCmdRequest) -> Result<()>[src]

Check if a request is valid if it has valid prepare_merge/commit_merge proposal.

fn pre_propose_raft_command(
    &mut self,
    msg: &RaftCmdRequest
) -> Result<Option<RaftCmdResponse>>
[src]

fn propose_raft_command(
    &mut self,
    msg: RaftCmdRequest,
    cb: Callback<EK::Snapshot>
)
[src]

fn collect_sibling_region(
    &self,
    requested_version: u64,
    regions: &mut Vec<Region>
)
[src]

fn register_raft_gc_log_tick(&mut self)[src]

fn on_raft_gc_log_tick(&mut self, force_compact: bool)[src]

fn register_split_region_check_tick(&mut self)[src]

fn region_split_skip_max_count(&self) -> usize[src]

fn on_split_region_check_tick(&mut self)[src]

fn on_prepare_split_region(
    &mut self,
    region_epoch: RegionEpoch,
    split_keys: Vec<Vec<u8>>,
    cb: Callback<EK::Snapshot>,
    source: &str
)
[src]

fn validate_split_region(
    &mut self,
    epoch: &RegionEpoch,
    split_keys: &[Vec<u8>]
) -> Result<()>
[src]

fn on_approximate_region_size(&mut self, size: u64)[src]

fn on_approximate_region_keys(&mut self, keys: u64)[src]

fn on_compaction_declined_bytes(&mut self, declined_bytes: u64)[src]

fn on_schedule_half_split_region(
    &mut self,
    region_epoch: &RegionEpoch,
    policy: CheckPolicy,
    source: &str
)
[src]

fn on_pd_heartbeat_tick(&mut self)[src]

fn register_pd_heartbeat_tick(&mut self)[src]

fn on_check_peer_stale_state_tick(&mut self)[src]

fn register_check_peer_stale_state_tick(&mut self)[src]

impl<'a, EK, ER, T: Transport> PeerFsmDelegate<'a, EK, ER, T> where
    EK: KvEngine,
    ER: RaftEngine
[src]

fn on_ready_compute_hash(
    &mut self,
    region: Region,
    index: u64,
    context: Vec<u8>,
    snap: EK::Snapshot
)
[src]

fn on_ready_verify_hash(
    &mut self,
    expected_index: u64,
    context: Vec<u8>,
    expected_hash: Vec<u8>
)
[src]

fn on_hash_computed(&mut self, index: u64, context: Vec<u8>, hash: Vec<u8>)[src]

fn on_ingest_sst_result(&mut self, ssts: Vec<SSTMetaInfo>)[src]

fn verify_and_store_hash(
    &mut self,
    expected_index: u64,
    _context: Vec<u8>,
    expected_hash: Vec<u8>
) -> bool
[src]

Verify and store the hash to state. return true means the hash has been stored successfully.

impl<'a, EK, ER, T: Transport> PeerFsmDelegate<'a, EK, ER, T> where
    EK: KvEngine,
    ER: RaftEngine
[src]

fn execute_status_command(
    &mut self,
    request: &RaftCmdRequest
) -> Result<RaftCmdResponse>
[src]

fn execute_region_leader(&mut self) -> Result<StatusResponse>[src]

fn execute_region_detail(
    &mut self,
    request: &RaftCmdRequest
) -> Result<StatusResponse>
[src]

Auto Trait Implementations

impl<'a, EK, ER, T> !RefUnwindSafe for PeerFsmDelegate<'a, EK, ER, T>

impl<'a, EK, ER, T> Send for PeerFsmDelegate<'a, EK, ER, T> where
    T: Send

impl<'a, EK, ER, T> !Sync for PeerFsmDelegate<'a, EK, ER, T>

impl<'a, EK, ER, T> Unpin for PeerFsmDelegate<'a, EK, ER, T>

impl<'a, EK, ER, T> !UnwindSafe for PeerFsmDelegate<'a, EK, ER, T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<V, W> ConvertFrom<W> for V where
    W: ConvertTo<V>, 
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> Sealed<T> for T where
    T: ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]