Struct raftstore::store::fsm::peer::PeerFsmDelegate [−][src]
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]
EK: KvEngine,
ER: RaftEngine,
pub fn new(
fsm: &'a mut PeerFsm<EK, ER>,
ctx: &'a mut PollContext<EK, ER, T>
) -> PeerFsmDelegate<'a, EK, ER, T>
[src]
fsm: &'a mut PeerFsm<EK, ER>,
ctx: &'a mut PollContext<EK, ER, T>
) -> PeerFsmDelegate<'a, EK, ER, T>
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]
&mut self,
cmd: ChangeObserver,
region_epoch: RegionEpoch,
cb: Callback<EK::Snapshot>
)
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]
&mut self,
msg: &RaftMessage
) -> Result<Either<SnapKey, Vec<(u64, bool)>>>
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]
&mut self,
derived: Region,
regions: Vec<Region>,
new_split_regions: HashMap<u64, NewSplitPeer>
)
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]
&mut self,
target_region_id: u64,
target: Peer,
result: MergeResultKind
)
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]
&mut self,
exec_results: &mut VecDeque<ExecResult<EK::Snapshot>>,
metrics: &ApplyMetrics
)
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]
&mut self,
msg: &RaftCmdRequest
) -> Result<Option<RaftCmdResponse>>
fn propose_raft_command(
&mut self,
msg: RaftCmdRequest,
cb: Callback<EK::Snapshot>
)
[src]
&mut self,
msg: RaftCmdRequest,
cb: Callback<EK::Snapshot>
)
fn collect_sibling_region(
&self,
requested_version: u64,
regions: &mut Vec<Region>
)
[src]
&self,
requested_version: u64,
regions: &mut Vec<Region>
)
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]
&mut self,
region_epoch: RegionEpoch,
split_keys: Vec<Vec<u8>>,
cb: Callback<EK::Snapshot>,
source: &str
)
fn validate_split_region(
&mut self,
epoch: &RegionEpoch,
split_keys: &[Vec<u8>]
) -> Result<()>
[src]
&mut self,
epoch: &RegionEpoch,
split_keys: &[Vec<u8>]
) -> Result<()>
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]
&mut self,
region_epoch: &RegionEpoch,
policy: CheckPolicy,
source: &str
)
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]
EK: KvEngine,
ER: RaftEngine,
fn on_ready_compute_hash(
&mut self,
region: Region,
index: u64,
context: Vec<u8>,
snap: EK::Snapshot
)
[src]
&mut self,
region: Region,
index: u64,
context: Vec<u8>,
snap: EK::Snapshot
)
fn on_ready_verify_hash(
&mut self,
expected_index: u64,
context: Vec<u8>,
expected_hash: Vec<u8>
)
[src]
&mut self,
expected_index: u64,
context: Vec<u8>,
expected_hash: Vec<u8>
)
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]
&mut self,
expected_index: u64,
_context: Vec<u8>,
expected_hash: Vec<u8>
) -> bool
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]
EK: KvEngine,
ER: RaftEngine,
fn execute_status_command(
&mut self,
request: &RaftCmdRequest
) -> Result<RaftCmdResponse>
[src]
&mut self,
request: &RaftCmdRequest
) -> Result<RaftCmdResponse>
fn execute_region_leader(&mut self) -> Result<StatusResponse>
[src]
fn execute_region_detail(
&mut self,
request: &RaftCmdRequest
) -> Result<StatusResponse>
[src]
&mut self,
request: &RaftCmdRequest
) -> Result<StatusResponse>
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,
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]
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>,