Struct tikv_client::request::PlanBuilder
source · pub struct PlanBuilder<PdC: PdClient, P: Plan, Ph: PlanBuilderPhase> { /* private fields */ }
Expand description
Builder type for plans (see that module for more).
Implementations§
source§impl<PdC: PdClient, Req: KvRequest> PlanBuilder<PdC, Dispatch<Req>, NoTarget>
impl<PdC: PdClient, Req: KvRequest> PlanBuilder<PdC, Dispatch<Req>, NoTarget>
pub fn new(pd_client: Arc<PdC>, encoded_request: EncodedRequest<Req>) -> Self
source§impl<PdC: PdClient, P: Plan> PlanBuilder<PdC, P, Targetted>
impl<PdC: PdClient, P: Plan> PlanBuilder<PdC, P, Targetted>
source§impl<PdC: PdClient, P: Plan, Ph: PlanBuilderPhase> PlanBuilder<PdC, P, Ph>
impl<PdC: PdClient, P: Plan, Ph: PlanBuilderPhase> PlanBuilder<PdC, P, Ph>
sourcepub fn resolve_lock(
self,
backoff: Backoff
) -> PlanBuilder<PdC, ResolveLock<P, PdC>, Ph>where
P::Result: HasLocks,
pub fn resolve_lock( self, backoff: Backoff ) -> PlanBuilder<PdC, ResolveLock<P, PdC>, Ph>where P::Result: HasLocks,
If there is a lock error, then resolve the lock and retry the request.
pub fn cleanup_locks( self, ctx: ResolveLocksContext, options: ResolveLocksOptions, backoff: Backoff ) -> PlanBuilder<PdC, CleanupLocks<P, PdC>, Ph>where P: Shardable + NextBatch, P::Result: HasLocks + HasNextBatch + HasRegionError + HasKeyErrors,
sourcepub fn merge<In, M: Merge<In>>(
self,
merge: M
) -> PlanBuilder<PdC, MergeResponse<P, In, M>, Ph>where
In: Clone + Send + Sync + 'static,
P: Plan<Result = Vec<Result<In>>>,
pub fn merge<In, M: Merge<In>>( self, merge: M ) -> PlanBuilder<PdC, MergeResponse<P, In, M>, Ph>where In: Clone + Send + Sync + 'static, P: Plan<Result = Vec<Result<In>>>,
Merge the results of a request. Usually used where a request is sent to multiple regions to combine the responses from each region.
sourcepub fn post_process_default(
self
) -> PlanBuilder<PdC, ProcessResponse<P, DefaultProcessor>, Ph>where
P: Plan,
DefaultProcessor: Process<P::Result>,
pub fn post_process_default( self ) -> PlanBuilder<PdC, ProcessResponse<P, DefaultProcessor>, Ph>where P: Plan, DefaultProcessor: Process<P::Result>,
Apply the default processing step to a response (usually only needed if the request is sent to a single region because post-porcessing can be incorporated in the merge step for multi-region requests).
source§impl<PdC: PdClient, P: Plan + Shardable> PlanBuilder<PdC, P, NoTarget>where
P::Result: HasKeyErrors + HasRegionError,
impl<PdC: PdClient, P: Plan + Shardable> PlanBuilder<PdC, P, NoTarget>where P::Result: HasKeyErrors + HasRegionError,
sourcepub fn retry_multi_region(
self,
backoff: Backoff
) -> PlanBuilder<PdC, RetryableMultiRegion<P, PdC>, Targetted>
pub fn retry_multi_region( self, backoff: Backoff ) -> PlanBuilder<PdC, RetryableMultiRegion<P, PdC>, Targetted>
Split the request into shards sending a request to the region of each shard.
sourcepub fn retry_multi_region_preserve_results(
self,
backoff: Backoff
) -> PlanBuilder<PdC, RetryableMultiRegion<P, PdC>, Targetted>
pub fn retry_multi_region_preserve_results( self, backoff: Backoff ) -> PlanBuilder<PdC, RetryableMultiRegion<P, PdC>, Targetted>
Preserve all results, even some of them are Err. To pass all responses to merge, and handle partial successful results correctly.
source§impl<PdC: PdClient, R: KvRequest> PlanBuilder<PdC, Dispatch<R>, NoTarget>
impl<PdC: PdClient, R: KvRequest> PlanBuilder<PdC, Dispatch<R>, NoTarget>
sourcepub async fn single_region_with_store(
self,
store: RegionStore
) -> Result<PlanBuilder<PdC, Dispatch<R>, Targetted>>
pub async fn single_region_with_store( self, store: RegionStore ) -> Result<PlanBuilder<PdC, Dispatch<R>, Targetted>>
Target the request at a single region; caller supplies the store to target.
source§impl<PdC: PdClient, P: Plan + StoreRequest> PlanBuilder<PdC, P, NoTarget>where
P::Result: HasKeyErrors + HasRegionError,
impl<PdC: PdClient, P: Plan + StoreRequest> PlanBuilder<PdC, P, NoTarget>where P::Result: HasKeyErrors + HasRegionError,
pub fn all_stores( self, backoff: Backoff ) -> PlanBuilder<PdC, RetryableAllStores<P, PdC>, Targetted>
source§impl<PdC: PdClient, P: Plan + Shardable> PlanBuilder<PdC, P, NoTarget>where
P::Result: HasKeyErrors,
impl<PdC: PdClient, P: Plan + Shardable> PlanBuilder<PdC, P, NoTarget>where P::Result: HasKeyErrors,
pub fn preserve_shard(self) -> PlanBuilder<PdC, PreserveShard<P>, NoTarget>
source§impl<PdC: PdClient, P: Plan> PlanBuilder<PdC, P, Targetted>where
P::Result: HasKeyErrors + HasRegionErrors,
impl<PdC: PdClient, P: Plan> PlanBuilder<PdC, P, Targetted>where P::Result: HasKeyErrors + HasRegionErrors,
pub fn extract_error(self) -> PlanBuilder<PdC, ExtractError<P>, Targetted>
Auto Trait Implementations§
impl<PdC, P, Ph> RefUnwindSafe for PlanBuilder<PdC, P, Ph>where P: RefUnwindSafe, PdC: RefUnwindSafe, Ph: RefUnwindSafe,
impl<PdC, P, Ph> Send for PlanBuilder<PdC, P, Ph>where Ph: Send,
impl<PdC, P, Ph> Sync for PlanBuilder<PdC, P, Ph>where Ph: Sync,
impl<PdC, P, Ph> Unpin for PlanBuilder<PdC, P, Ph>where P: Unpin, Ph: Unpin,
impl<PdC, P, Ph> UnwindSafe for PlanBuilder<PdC, P, Ph>where P: UnwindSafe, PdC: RefUnwindSafe, Ph: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request