pub struct PartitionServiceClient<T> { /* private fields */ }Expand description
Where each tenant’s data lives when several kernels (partitions) share the tenants.
Every kernel started with --partition serves the tenants the map assigns to it and refuses
the others with FAILED_PRECONDITION wrong_partition: …; the SDKs read the map and send each
request to its tenant’s partition.
Implementations§
Source§impl<T> PartitionServiceClient<T>where
T: GrpcService<Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> PartitionServiceClient<T>where
T: GrpcService<Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
pub fn new(inner: T) -> Self
pub fn with_origin(inner: T, origin: Uri) -> Self
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> PartitionServiceClient<InterceptedService<T, F>>where
F: Interceptor,
T::ResponseBody: Default,
T: Service<Request<Body>, Response = Response<<T as GrpcService<Body>>::ResponseBody>>,
<T as Service<Request<Body>>>::Error: Into<StdError> + Send + Sync,
Sourcepub fn send_compressed(self, encoding: CompressionEncoding) -> Self
pub fn send_compressed(self, encoding: CompressionEncoding) -> Self
Compress requests with the given encoding.
This requires the server to support it otherwise it might respond with an error.
Sourcepub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
Enable decompressing responses.
Sourcepub fn max_decoding_message_size(self, limit: usize) -> Self
pub fn max_decoding_message_size(self, limit: usize) -> Self
Limits the maximum size of a decoded message.
Default: 4MB
Sourcepub fn max_encoding_message_size(self, limit: usize) -> Self
pub fn max_encoding_message_size(self, limit: usize) -> Self
Limits the maximum size of an encoded message.
Default: usize::MAX
Sourcepub async fn map(
&mut self,
request: impl IntoRequest<MapRequest>,
) -> Result<Response<PartitionMap>, Status>
pub async fn map( &mut self, request: impl IntoRequest<MapRequest>, ) -> Result<Response<PartitionMap>, Status>
The newest map this kernel holds. NOT_FOUND without one (a kernel without –partition serves every tenant); with one, the call needs a grant of any key (kernable-grant): the map names tenants and addresses.
Sourcepub async fn apply(
&mut self,
request: impl IntoRequest<PartitionMap>,
) -> Result<Response<MapResult>, Status>
pub async fn apply( &mut self, request: impl IntoRequest<PartitionMap>, ) -> Result<Response<MapResult>, Status>
Applies a new map on the control partition (the kernel started with –partition but
without –control); the other partitions take it from there within seconds. Signed over
kernable.v1.partitions by a key granted manage for *, valid 60 s around issued_at.
Errors: UNAUTHENTICATED, PERMISSION_DENIED, INVALID_ARGUMENT (unknown partitions, a tenant
twice), FAILED_PRECONDITION (not the control partition; an epoch not above the one held).
Sourcepub async fn moving(
&mut self,
request: impl IntoRequest<MoveStatusRequest>,
) -> Result<Response<MoveStatus>, Status>
pub async fn moving( &mut self, request: impl IntoRequest<MoveStatusRequest>, ) -> Result<Response<MoveStatus>, Status>
Asked of the target of a move (needs a grant of any key): whether it copied the tenant.
Trait Implementations§
Source§impl<T: Clone> Clone for PartitionServiceClient<T>
impl<T: Clone> Clone for PartitionServiceClient<T>
Auto Trait Implementations§
impl<T> !Freeze for PartitionServiceClient<T>
impl<T> Forget for PartitionServiceClient<T>
impl<T> Move for PartitionServiceClient<T>
impl<T> RefUnwindSafe for PartitionServiceClient<T>
impl<T> Send for PartitionServiceClient<T>
impl<T> Sync for PartitionServiceClient<T>
impl<T> Unpin for PartitionServiceClient<T>
impl<T> UnsafeUnpin for PartitionServiceClient<T>where
T: UnsafeUnpin,
*const ByteStr is !null: UnsafeUnpin,
PhantomData<ByteStr>: UnsafeUnpin,
*const u8: UnsafeUnpin,
Align8<*mut ()>: UnsafeUnpin,
&'static Vtable: UnsafeUnpin,
impl<T> UnwindSafe for PartitionServiceClient<T>where
T: UnwindSafe,
BoxRaw<ByteStr>: UnwindSafe,
*const u8: UnwindSafe,
Align8<*mut ()>: UnwindSafe,
&'static Vtable: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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>
T in a tonic::Request