struct ActiveReplicationState<T> {
replica_ids: BTreeSet<ReplicaId>,
peeks: HashMap<Uuid, PendingPeek>,
subscribes: BTreeSet<GlobalId>,
uppers: HashMap<GlobalId, ReportedUppers<T>>,
index_log_uppers: HashMap<GlobalId, ReportedUppers<T>>,
sink_log_uppers: HashMap<GlobalId, Antichain<T>>,
history: ComputeCommandHistory<T>,
pending_response: VecDeque<ActiveReplicationResponse<T>>,
}
Expand description
The internal state of the client.
This lives in a separate struct from the handles to the individual replica tasks, so that we can call methods on it while holding mutable borrows to those.
Fields
replica_ids: BTreeSet<ReplicaId>
IDs of connected replicas.
peeks: HashMap<Uuid, PendingPeek>
Outstanding peeks, to guide responses (and which to suppress).
subscribes: BTreeSet<GlobalId>
IDs of in-progress subscribes, to guide responses (and which to suppress).
uppers: HashMap<GlobalId, ReportedUppers<T>>
Reported upper frontiers for replicated collections and in-progress subscribes.
index_log_uppers: HashMap<GlobalId, ReportedUppers<T>>
Reported upper frontiers for arranged log collections.
Arranged log collections are special in that their IDs are shared between replicas, but only exist on replicas that have introspection enabled.
sink_log_uppers: HashMap<GlobalId, Antichain<T>>
Reported upper frontiers for persisted log collections.
Persisted log collections are special in that they are replica-specific.
history: ComputeCommandHistory<T>
The command history, used when introducing new replicas or restarting existing replicas.
pending_response: VecDeque<ActiveReplicationResponse<T>>
Responses that should be emitted on the next recv
call.
This is introduced to produce peek cancelation responses eagerly, without awaiting a replica
responding with the response itself, which allows us to compact away the peek in self.history
.
Implementations
sourceimpl<T> ActiveReplicationState<T>where
T: Timestamp + Lattice,
impl<T> ActiveReplicationState<T>where
T: Timestamp + Lattice,
fn add_replica(&mut self, id: ReplicaId)
fn remove_replica(&mut self, id: ReplicaId)
fn handle_command(&mut self, cmd: &ComputeCommand<T>)
fn start_frontier_tracking(&mut self, id: GlobalId)
fn cease_frontier_tracking(&mut self, id: GlobalId)
fn handle_response(
&mut self,
message: ComputeResponse<T>,
replica_id: ReplicaId
) -> Option<ActiveReplicationResponse<T>>
fn handle_peek_response(
&mut self,
uuid: Uuid,
response: PeekResponse,
otel_ctx: OpenTelemetryContext,
replica_id: ReplicaId
) -> Option<ActiveReplicationResponse<T>>
fn handle_frontier_uppers(
&mut self,
list: Vec<(GlobalId, Antichain<T>)>,
replica_id: ReplicaId
) -> Option<ActiveReplicationResponse<T>>
fn handle_subscribe_response(
&mut self,
subscribe_id: GlobalId,
response: SubscribeResponse<T>,
replica_id: ReplicaId
) -> Option<ActiveReplicationResponse<T>>
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for ActiveReplicationState<T>where
T: RefUnwindSafe,
impl<T> Send for ActiveReplicationState<T>where
T: Send,
impl<T> Sync for ActiveReplicationState<T>where
T: Sync,
impl<T> Unpin for ActiveReplicationState<T>where
T: Unpin,
impl<T> UnwindSafe for ActiveReplicationState<T>where
T: UnwindSafe + RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<T> FutureExt for T
impl<T> FutureExt for T
sourcefn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
sourcefn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
sourceimpl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
sourcefn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
RustType::from_proto
.sourcefn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
RustType::into_proto
.