pub struct PersistReadWorker<T: Timestamp + Lattice + Codec64> {
tx: UnboundedSender<(Span, PersistReadWorkerCmd<T>)>,
}
Expand description
A wrapper that holds on to backing persist shards/collections that the storage controller is aware of. The handles hold back the since frontier and we need to downgrade them when the read capabilities change.
Internally, this has an async task and the methods for registering a handle and downgrading sinces add commands to a queue that this task is working off. This makes the methods non-blocking and moves the work outside the main coordinator task, meaning the coordinator is spending less time waiting on persist calls.
Fields§
§tx: UnboundedSender<(Span, PersistReadWorkerCmd<T>)>
Implementations§
source§impl<T: Timestamp + Lattice + Codec64> PersistReadWorker<T>
impl<T: Timestamp + Lattice + Codec64> PersistReadWorker<T>
pub(crate) fn new() -> Self
pub(crate) fn register(
&self,
id: GlobalId,
since_handle: SinceHandle<SourceData, (), T, Diff, PersistEpoch>
)
sourcepub(crate) fn update(
&self,
id: GlobalId,
since_handle: SinceHandle<SourceData, (), T, Diff, PersistEpoch>
)
pub(crate) fn update(
&self,
id: GlobalId,
since_handle: SinceHandle<SourceData, (), T, Diff, PersistEpoch>
)
Update the existing since handle associated with id
to since_handle
.
Note that this should only be called when updating a since handle; to
initially associate an id
to a since handle, use Self::register
.
Panics
- If
id
is not currently associated with any since handle.
pub(crate) fn downgrade(&self, frontiers: BTreeMap<GlobalId, Antichain<T>>)
fn send(&self, cmd: PersistReadWorkerCmd<T>)
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for PersistReadWorker<T>
impl<T> Send for PersistReadWorker<T>
impl<T> Sync for PersistReadWorker<T>
impl<T> Unpin for PersistReadWorker<T>
impl<T> !UnwindSafe for PersistReadWorker<T>
Blanket Implementations§
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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<T> Pointable for T
impl<T> Pointable for T
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
.