Struct mz_persist_client::cache::PersistClientCache
source · pub struct PersistClientCache { /* private fields */ }
Expand description
A cache of PersistClients indexed by PersistLocations.
There should be at most one of these per process. All production PersistClients should be created through this cache.
This is because, in production, persist is heavily limited by the number of server-side Postgres/Aurora connections. This cache allows PersistClients to share, for example, these Postgres connections.
Implementations§
source§impl PersistClientCache
impl PersistClientCache
sourcepub fn new(cfg: PersistConfig, registry: &MetricsRegistry) -> Self
pub fn new(cfg: PersistConfig, registry: &MetricsRegistry) -> Self
Returns a new PersistClientCache.
sourcepub fn cfg(&self) -> &PersistConfig
pub fn cfg(&self) -> &PersistConfig
Returns the PersistConfig being used by this cache.
sourcepub async fn open(
&self,
location: PersistLocation
) -> Result<PersistClient, ExternalError>
pub async fn open(
&self,
location: PersistLocation
) -> Result<PersistClient, ExternalError>
Returns a new PersistClient for interfacing with persist shards made durable to the given PersistLocation.
The same location
may be used concurrently from multiple processes.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for PersistClientCache
impl Send for PersistClientCache
impl Sync for PersistClientCache
impl Unpin for PersistClientCache
impl !UnwindSafe for PersistClientCache
Blanket Implementations§
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>
Wrap the input message
T
in a tonic::Request
source§impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
source§fn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
See
RustType::from_proto
.source§fn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
See
RustType::into_proto
.