Struct pd_client::RpcClient [−][src]
Fields
cluster_id: u64
pd_client: Arc<Client>
monitor: Arc<ThreadPool<TaskCell>>
Implementations
impl RpcClient
[src]
pub fn new(
cfg: &Config,
shared_env: Option<Arc<Environment>>,
security_mgr: Arc<SecurityManager>
) -> Result<RpcClient>
[src]
cfg: &Config,
shared_env: Option<Arc<Environment>>,
security_mgr: Arc<SecurityManager>
) -> Result<RpcClient>
pub async fn new_async(
cfg: &Config,
shared_env: Option<Arc<Environment>>,
security_mgr: Arc<SecurityManager>
) -> Result<RpcClient>
[src]
cfg: &Config,
shared_env: Option<Arc<Environment>>,
security_mgr: Arc<SecurityManager>
) -> Result<RpcClient>
fn header(&self) -> RequestHeader
[src]
Creates a new request header.
pub fn get_leader(&self) -> Member
[src]
Gets the leader of PD.
pub fn reconnect(&self) -> Result<()>
[src]
Re-establishes connection with PD leader in synchronized fashion.
fn call_option(client: &Client) -> CallOption
[src]
Creates a new call option with default request timeout.
fn get_region_and_leader(&self, key: &[u8]) -> PdFuture<(Region, Option<Peer>)>
[src]
Gets given key’s Region and Region’s leader from PD.
fn get_store_and_stats(&self, store_id: u64) -> PdFuture<(Store, StoreStats)>
[src]
Trait Implementations
impl Debug for RpcClient
[src]
impl PdClient for RpcClient
[src]
fn get_cluster_id(&self) -> Result<u64>
[src]
fn bootstrap_cluster(
&self,
stores: Store,
region: Region
) -> Result<Option<ReplicationStatus>>
[src]
&self,
stores: 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_store(&self, store_id: u64) -> Result<Store>
[src]
fn get_store_async(&self, store_id: u64) -> PdFuture<Store>
[src]
fn get_all_stores(&self, exclude_tombstone: bool) -> Result<Vec<Store>>
[src]
fn get_cluster_config(&self) -> Result<Cluster>
[src]
fn get_region(&self, key: &[u8]) -> Result<Region>
[src]
fn get_region_info(&self, key: &[u8]) -> Result<RegionInfo>
[src]
fn get_region_async<'k>(
&'k self,
key: &'k [u8]
) -> BoxFuture<'k, Result<Region>>
[src]
&'k self,
key: &'k [u8]
) -> BoxFuture<'k, Result<Region>>
fn get_region_info_async<'k>(
&'k self,
key: &'k [u8]
) -> BoxFuture<'k, Result<RegionInfo>>
[src]
&'k self,
key: &'k [u8]
) -> BoxFuture<'k, Result<RegionInfo>>
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 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, _: u64, f: F) -> PdFuture<()> where
F: Fn(RegionHeartbeatResponse) + Send + 'static,
[src]
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 scatter_region(&self, region: RegionInfo) -> Result<()>
[src]
fn handle_reconnect<F: Fn() + Sync + Send + 'static>(&self, f: F)
[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]
Auto Trait Implementations
impl !RefUnwindSafe for RpcClient
impl Send for RpcClient
impl Sync for RpcClient
impl Unpin for RpcClient
impl !UnwindSafe for RpcClient
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<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> 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>,