Struct tikv::coprocessor::endpoint::Endpoint [−][src]
A pool to build and run Coprocessor request handlers.
Fields
read_pool: ReadPoolHandle
The thread pool to run Coprocessor requests.
semaphore: Option<Arc<Semaphore>>
The concurrency limiter of the coprocessor.
concurrency_manager: ConcurrencyManager
perf_level: PerfLevel
recursion_limit: u32
The recursion limit when parsing Coprocessor Protobuf requests.
Note that this limit is ignored if we are using Prost.
batch_row_limit: usize
stream_batch_row_limit: usize
stream_channel_size: usize
max_handle_duration: Duration
The soft time limit of handling Coprocessor requests.
slow_log_threshold: Duration
_phantom: PhantomData<E>
Implementations
impl<E: Engine> Endpoint<E>
[src]
pub fn new(
cfg: &Config,
read_pool: ReadPoolHandle,
concurrency_manager: ConcurrencyManager,
perf_level: PerfLevel
) -> Self
[src]
cfg: &Config,
read_pool: ReadPoolHandle,
concurrency_manager: ConcurrencyManager,
perf_level: PerfLevel
) -> Self
fn check_memory_locks(&self, req_ctx: &ReqContext) -> Result<()>
[src]
fn parse_request_and_check_memory_locks(
&self,
req: Request,
peer: Option<String>,
is_streaming: bool
) -> Result<(Box<dyn FnOnce(E::Snap, &ReqContext) -> Result<Box<dyn RequestHandler>> + Send>, ReqContext)>
[src]
&self,
req: Request,
peer: Option<String>,
is_streaming: bool
) -> Result<(Box<dyn FnOnce(E::Snap, &ReqContext) -> Result<Box<dyn RequestHandler>> + Send>, ReqContext)>
Parse the raw Request
to create RequestHandlerBuilder
and ReqContext
.
Returns Err
if fails.
It also checks if there are locks in memory blocking this read request.
fn get_batch_row_limit(&self, is_streaming: bool) -> usize
[src]
Get the batch row limit configuration.
fn async_snapshot(
engine: &E,
ctx: &ReqContext
) -> impl Future<Output = Result<E::Snap>>
[src]
engine: &E,
ctx: &ReqContext
) -> impl Future<Output = Result<E::Snap>>
async fn handle_unary_request_impl(
semaphore: Option<Arc<Semaphore>>,
tracker: Box<Tracker>,
handler_builder: Box<dyn FnOnce(E::Snap, &ReqContext) -> Result<Box<dyn RequestHandler>> + Send>
) -> Result<Response>
[src]
semaphore: Option<Arc<Semaphore>>,
tracker: Box<Tracker>,
handler_builder: Box<dyn FnOnce(E::Snap, &ReqContext) -> Result<Box<dyn RequestHandler>> + Send>
) -> Result<Response>
The real implementation of handling a unary request.
It first retrieves a snapshot, then builds the RequestHandler
over the snapshot and
the given handler_builder
. Finally, it calls the unary request interface of the
RequestHandler
to process the request and produce a result.
fn handle_unary_request(
&self,
req_ctx: ReqContext,
handler_builder: Box<dyn FnOnce(E::Snap, &ReqContext) -> Result<Box<dyn RequestHandler>> + Send>
) -> impl Future<Output = Result<Response>>
[src]
&self,
req_ctx: ReqContext,
handler_builder: Box<dyn FnOnce(E::Snap, &ReqContext) -> Result<Box<dyn RequestHandler>> + Send>
) -> impl Future<Output = Result<Response>>
Handle a unary request and run on the read pool.
Returns Err(err)
if the read pool is full. Returns Ok(future)
in other cases.
The future inside may be an error however.
pub fn parse_and_handle_unary_request(
&self,
req: Request,
peer: Option<String>
) -> impl Future<Output = Response>
[src]
&self,
req: Request,
peer: Option<String>
) -> impl Future<Output = Response>
Parses and handles a unary request. Returns a future that will never fail. If there are
errors during parsing or handling, they will be converted into a Response
as the success
result of the future.
fn handle_stream_request_impl(
semaphore: Option<Arc<Semaphore>>,
tracker: Box<Tracker>,
handler_builder: Box<dyn FnOnce(E::Snap, &ReqContext) -> Result<Box<dyn RequestHandler>> + Send>
) -> impl Stream<Item = Result<Response>>
[src]
semaphore: Option<Arc<Semaphore>>,
tracker: Box<Tracker>,
handler_builder: Box<dyn FnOnce(E::Snap, &ReqContext) -> Result<Box<dyn RequestHandler>> + Send>
) -> impl Stream<Item = Result<Response>>
The real implementation of handling a stream request.
It first retrieves a snapshot, then builds the RequestHandler
over the snapshot and
the given handler_builder
. Finally, it calls the stream request interface of the
RequestHandler
multiple times to process the request and produce multiple results.
fn handle_stream_request(
&self,
req_ctx: ReqContext,
handler_builder: Box<dyn FnOnce(E::Snap, &ReqContext) -> Result<Box<dyn RequestHandler>> + Send>
) -> Result<impl Stream<Item = Result<Response>>>
[src]
&self,
req_ctx: ReqContext,
handler_builder: Box<dyn FnOnce(E::Snap, &ReqContext) -> Result<Box<dyn RequestHandler>> + Send>
) -> Result<impl Stream<Item = Result<Response>>>
Handle a stream request and run on the read pool.
Returns Err(err)
if the read pool is full. Returns Ok(stream)
in other cases.
The stream inside may produce errors however.
pub fn parse_and_handle_stream_request(
&self,
req: Request,
peer: Option<String>
) -> impl Stream<Item = Response>
[src]
&self,
req: Request,
peer: Option<String>
) -> impl Stream<Item = Response>
Parses and handles a stream request. Returns a stream that produce each result in a
Response
and will never fail. If there are errors during parsing or handling, they will
be converted into a Response
as the only stream item.
Trait Implementations
Auto Trait Implementations
impl<E> !RefUnwindSafe for Endpoint<E>
impl<E> Send for Endpoint<E>
impl<E> Sync for Endpoint<E> where
E: Sync,
E: Sync,
impl<E> Unpin for Endpoint<E> where
E: Unpin,
E: Unpin,
impl<E> !UnwindSafe for Endpoint<E>
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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>,