Struct test_raftstore::TestPdClient [−][src]
Fields
cluster_id: u64
cluster: Arc<RwLock<Cluster>>
timer: Handle
is_incompatible: bool
tso: AtomicU64
trigger_tso_failure: AtomicBool
feature_gate: FeatureGate
Implementations
impl TestPdClient
[src]
pub fn new(cluster_id: u64, is_incompatible: bool) -> TestPdClient
[src]
pub fn get_stores(&self) -> Result<Vec<Store>>
[src]
fn check_bootstrap(&self) -> Result<()>
[src]
fn is_regions_empty(&self) -> bool
[src]
fn schedule_operator(&self, region_id: u64, op: Operator)
[src]
pub fn get_region_epoch(&self, region_id: u64) -> RegionEpoch
[src]
pub fn get_regions_number(&self) -> usize
[src]
pub fn disable_default_operator(&self)
[src]
pub fn enable_default_operator(&self)
[src]
pub fn must_have_peer(&self, region_id: u64, peer: Peer)
[src]
pub fn must_none_peer(&self, region_id: u64, peer: Peer)
[src]
pub fn must_none_pending_peer(&self, peer: Peer)
[src]
pub fn must_finish_joint_confchange(
&self,
region_id: u64,
add_peers: Vec<Peer>,
remove_peers: Vec<Peer>
)
[src]
&self,
region_id: u64,
add_peers: Vec<Peer>,
remove_peers: Vec<Peer>
)
pub fn must_not_in_joint(&self, region_id: u64)
[src]
pub fn add_region(&self, region: &Region)
[src]
pub fn transfer_leader(&self, region_id: u64, peer: Peer)
[src]
pub fn add_peer(&self, region_id: u64, peer: Peer)
[src]
pub fn remove_peer(&self, region_id: u64, peer: Peer)
[src]
pub fn joint_confchange(
&self,
region_id: u64,
changes: Vec<(ConfChangeType, Peer)>
) -> (Vec<Peer>, Vec<Peer>)
[src]
&self,
region_id: u64,
changes: Vec<(ConfChangeType, Peer)>
) -> (Vec<Peer>, Vec<Peer>)
pub fn leave_joint(&self, region_id: u64)
[src]
pub fn is_in_joint(&self, region_id: u64) -> bool
[src]
pub fn split_region(
&self,
region: Region,
policy: CheckPolicy,
keys: Vec<Vec<u8>>
)
[src]
&self,
region: Region,
policy: CheckPolicy,
keys: Vec<Vec<u8>>
)
pub fn must_split_region(
&self,
region: Region,
policy: CheckPolicy,
keys: Vec<Vec<u8>>
)
[src]
&self,
region: Region,
policy: CheckPolicy,
keys: Vec<Vec<u8>>
)
pub fn must_add_peer(&self, region_id: u64, peer: Peer)
[src]
pub fn must_remove_peer(&self, region_id: u64, peer: Peer)
[src]
pub fn must_joint_confchange(
&self,
region_id: u64,
changes: Vec<(ConfChangeType, Peer)>
)
[src]
&self,
region_id: u64,
changes: Vec<(ConfChangeType, Peer)>
)
pub fn must_leave_joint(&self, region_id: u64)
[src]
pub fn merge_region(&self, from: u64, target: u64)
[src]
pub fn must_merge(&self, from: u64, target: u64)
[src]
pub fn check_merged(&self, from: u64) -> bool
[src]
pub fn check_merged_timeout(&self, from: u64, duration: Duration)
[src]
pub fn region_leader_must_be(&self, region_id: u64, peer: Peer)
[src]
pub fn check_split(&self, region: &Region, split_key: &[u8]) -> bool
[src]
pub fn get_store_stats(&self, store_id: u64) -> Option<StoreStats>
[src]
pub fn get_split_count(&self) -> usize
[src]
pub fn get_down_peers(&self) -> HashMap<u64, PeerStats>
[src]
pub fn get_pending_peers(&self) -> HashMap<u64, Peer>
[src]
pub fn set_bootstrap(&self, is_bootstraped: bool)
[src]
pub fn configure_dr_auto_sync(&self, label_key: &str)
[src]
pub fn switch_replication_mode(&self, state: DrAutoSyncState)
[src]
pub fn region_replication_status(
&self,
region_id: u64
) -> RegionReplicationStatus
[src]
&self,
region_id: u64
) -> RegionReplicationStatus
pub fn get_region_approximate_size(&self, region_id: u64) -> Option<u64>
[src]
pub fn get_region_approximate_keys(&self, region_id: u64) -> Option<u64>
[src]
pub fn get_region_last_report_ts(&self, region_id: u64) -> Option<UnixSecs>
[src]
pub fn get_region_last_report_term(&self, region_id: u64) -> Option<u64>
[src]
pub fn get_store_hotspots(
&self,
store_id: u64
) -> Option<HashMap<u64, PeerStat>>
[src]
&self,
store_id: u64
) -> Option<HashMap<u64, PeerStat>>
pub fn set_gc_safe_point(&self, safe_point: u64)
[src]
pub fn trigger_tso_failure(&self)
[src]
pub fn shutdown_store(&self, store_id: u64)
[src]
pub fn ignore_merge_target_integrity(&self)
[src]
pub fn set_tso(&self, ts: TimeStamp)
[src]
pub fn reset_version(&self, version: &str)
[src]
Trait Implementations
impl PdClient for TestPdClient
[src]
fn get_cluster_id(&self) -> Result<u64>
[src]
fn bootstrap_cluster(
&self,
store: Store,
region: Region
) -> Result<Option<ReplicationStatus>>
[src]
&self,
store: Store,
region: Region
) -> Result<Option<ReplicationStatus>>
fn is_cluster_bootstrapped(&self) -> Result<bool>
[src]
fn alloc_id(&self) -> Result<u64>
[src]
fn put_store(&self, store: Store) -> Result<Option<ReplicationStatus>>
[src]
fn get_all_stores(&self, _exclude_tombstone: bool) -> Result<Vec<Store>>
[src]
fn get_store(&self, store_id: u64) -> Result<Store>
[src]
fn get_store_async(&self, store_id: u64) -> PdFuture<Store>
[src]
fn get_region(&self, key: &[u8]) -> Result<Region>
[src]
fn get_region_info(&self, key: &[u8]) -> Result<RegionInfo>
[src]
fn get_region_by_id(&self, region_id: u64) -> PdFuture<Option<Region>>
[src]
fn get_region_leader_by_id(
&self,
region_id: u64
) -> PdFuture<Option<(Region, Peer)>>
[src]
&self,
region_id: u64
) -> PdFuture<Option<(Region, Peer)>>
fn get_cluster_config(&self) -> Result<Cluster>
[src]
fn region_heartbeat(
&self,
term: u64,
region: Region,
leader: Peer,
region_stat: RegionStat,
replication_status: Option<RegionReplicationStatus>
) -> PdFuture<()>
[src]
&self,
term: u64,
region: Region,
leader: Peer,
region_stat: RegionStat,
replication_status: Option<RegionReplicationStatus>
) -> PdFuture<()>
fn handle_region_heartbeat_response<F>(
&self,
store_id: u64,
f: F
) -> PdFuture<()> where
Self: Sized,
F: Fn(RegionHeartbeatResponse) + Send + 'static,
[src]
&self,
store_id: u64,
f: F
) -> PdFuture<()> where
Self: Sized,
F: Fn(RegionHeartbeatResponse) + Send + 'static,
fn ask_split(&self, region: Region) -> PdFuture<AskSplitResponse>
[src]
fn ask_batch_split(
&self,
region: Region,
count: usize
) -> PdFuture<AskBatchSplitResponse>
[src]
&self,
region: Region,
count: usize
) -> PdFuture<AskBatchSplitResponse>
fn store_heartbeat(&self, stats: StoreStats) -> PdFuture<StoreHeartbeatResponse>
[src]
fn report_batch_split(&self, regions: Vec<Region>) -> PdFuture<()>
[src]
fn get_gc_safe_point(&self) -> PdFuture<u64>
[src]
fn get_store_stats_async(
&self,
store_id: u64
) -> BoxFuture<'_, Result<StoreStats>>
[src]
&self,
store_id: u64
) -> BoxFuture<'_, Result<StoreStats>>
fn get_operator(&self, region_id: u64) -> Result<GetOperatorResponse>
[src]
fn get_tso(&self) -> PdFuture<TimeStamp>
[src]
fn feature_gate(&self) -> &FeatureGate
[src]
pub fn get_region_async(
&'k self,
_key: &'k [u8]
) -> Pin<Box<dyn Future<Output = Result<Region, Error>> + 'k + Send, Global>>
[src]
&'k self,
_key: &'k [u8]
) -> Pin<Box<dyn Future<Output = Result<Region, Error>> + 'k + Send, Global>>
pub fn get_region_info_async(
&'k self,
_key: &'k [u8]
) -> Pin<Box<dyn Future<Output = Result<RegionInfo, Error>> + 'k + Send, Global>>
[src]
&'k self,
_key: &'k [u8]
) -> Pin<Box<dyn Future<Output = Result<RegionInfo, Error>> + 'k + Send, Global>>
pub fn scatter_region(&self, RegionInfo) -> Result<(), Error>
[src]
pub fn handle_reconnect<F>(&self, F) where
F: 'static + Fn() + Sync + Send,
[src]
F: 'static + Fn() + Sync + Send,
Auto Trait Implementations
impl !RefUnwindSafe for TestPdClient
impl Send for TestPdClient
impl Sync for TestPdClient
impl Unpin for TestPdClient
impl !UnwindSafe for TestPdClient
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>,