Struct mz_dataflow_types::client::controller::Controller
source · [−]pub struct Controller<T = Timestamp> { /* private fields */ }
Expand description
A client that maintains soft state and validates commands, in addition to forwarding them.
NOTE(benesch): I find the fact that this type is called Controller
but is
referred to as the dataflow_client
in the coordinator to be very
confusing. We should find the one correct name, and use it everywhere!
Implementations
sourceimpl<T> Controller<T> where
T: Timestamp + Lattice + Codec64 + Copy + Unpin,
ComputeCommand<T>: RustType<ProtoComputeCommand>,
ComputeResponse<T>: RustType<ProtoComputeResponse>,
impl<T> Controller<T> where
T: Timestamp + Lattice + Codec64 + Copy + Unpin,
ComputeCommand<T>: RustType<ProtoComputeCommand>,
ComputeResponse<T>: RustType<ProtoComputeResponse>,
pub async fn create_instance(
&mut self,
instance: ComputeInstanceId,
logging: Option<LoggingConfig>
) -> Result<(), Error>
sourcepub async fn add_replica_to_instance(
&mut self,
instance_id: ComputeInstanceId,
replica_id: ReplicaId,
config: ConcreteComputeInstanceReplicaConfig
) -> Result<(), Error>
pub async fn add_replica_to_instance(
&mut self,
instance_id: ComputeInstanceId,
replica_id: ReplicaId,
config: ConcreteComputeInstanceReplicaConfig
) -> Result<(), Error>
Adds replicas of an instance.
Panics
- If the identified
instance
has not yet been created viaSelf::create_instance
.
sourcepub async fn drop_replica(
&mut self,
instance_id: ComputeInstanceId,
replica_id: ReplicaId,
config: ConcreteComputeInstanceReplicaConfig
) -> Result<(), Error>
pub async fn drop_replica(
&mut self,
instance_id: ComputeInstanceId,
replica_id: ReplicaId,
config: ConcreteComputeInstanceReplicaConfig
) -> Result<(), Error>
Removes a replica from an instance, including its service in the orchestrator.
sourcepub async fn drop_instance(
&mut self,
instance: ComputeInstanceId
) -> Result<(), Error>
pub async fn drop_instance(
&mut self,
instance: ComputeInstanceId
) -> Result<(), Error>
Removes an instance from the orchestrator.
Panics
- If the identified
instance
still has active replicas.
sourcepub fn watch_compute_services(&self) -> BoxStream<'static, ComputeInstanceEvent>
pub fn watch_compute_services(&self) -> BoxStream<'static, ComputeInstanceEvent>
Listen for changes to compute services reported by the orchestrator.
sourceimpl<T> Controller<T>
impl<T> Controller<T>
sourcepub fn storage(&self) -> &dyn StorageController<Timestamp = T>
pub fn storage(&self) -> &dyn StorageController<Timestamp = T>
Acquires an immutable handle to a controller for the storage instance.
sourcepub fn storage_mut(&mut self) -> &mut dyn StorageController<Timestamp = T>
pub fn storage_mut(&mut self) -> &mut dyn StorageController<Timestamp = T>
Acquires a mutable handle to a controller for the storage instance.
sourcepub fn compute(
&self,
instance: ComputeInstanceId
) -> Option<ComputeController<'_, T>>
pub fn compute(
&self,
instance: ComputeInstanceId
) -> Option<ComputeController<'_, T>>
Acquires an immutable handle to a controller for the indicated compute instance, if it exists.
sourcepub fn compute_mut(
&mut self,
instance: ComputeInstanceId
) -> Option<ComputeControllerMut<'_, T>>
pub fn compute_mut(
&mut self,
instance: ComputeInstanceId
) -> Option<ComputeControllerMut<'_, T>>
Acquires a mutable handle to a controller for the indicated compute instance, if it exists.
sourceimpl<T> Controller<T> where
T: Timestamp + Lattice + Codec64,
impl<T> Controller<T> where
T: Timestamp + Lattice + Codec64,
sourcepub async fn ready(&mut self) -> Result<(), Error>
pub async fn ready(&mut self) -> Result<(), Error>
Wait until the controller is ready to process a response.
This method may await indefinitely.
This method is intended to be cancel-safe: dropping the returned future at any await point and restarting from the beginning is fine.
sourcepub async fn process(&mut self) -> Result<Option<ControllerResponse<T>>, Error>
pub async fn process(&mut self) -> Result<Option<ControllerResponse<T>>, Error>
Process any queued messages.
This method is not known to be cancel-safe, and should not be called
in the receiver of a tokio::select
branch. Calling it in the handler of
such a branch is fine.
This method is not intended to await indefinitely for reconnections and such; the coordinator relies on this property in order to not hang.
sourceimpl<T> Controller<T> where
T: Timestamp + Lattice + TotalOrder + TryInto<i64> + TryFrom<i64> + Codec64 + Unpin,
<T as TryInto<i64>>::Error: Debug,
<T as TryFrom<i64>>::Error: Debug,
StorageCommand<T>: RustType<ProtoStorageCommand>,
StorageResponse<T>: RustType<ProtoStorageResponse>,
impl<T> Controller<T> where
T: Timestamp + Lattice + TotalOrder + TryInto<i64> + TryFrom<i64> + Codec64 + Unpin,
<T as TryInto<i64>>::Error: Debug,
<T as TryFrom<i64>>::Error: Debug,
StorageCommand<T>: RustType<ProtoStorageCommand>,
StorageResponse<T>: RustType<ProtoStorageResponse>,
sourcepub async fn new(config: ControllerConfig) -> Self
pub async fn new(config: ControllerConfig) -> Self
Creates a new controller.
Auto Trait Implementations
impl<T = u64> !RefUnwindSafe for Controller<T>
impl<T> Send for Controller<T> where
T: Send,
impl<T = u64> !Sync for Controller<T>
impl<T> Unpin for Controller<T> where
T: Unpin,
impl<T = u64> !UnwindSafe for Controller<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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>
Wrap the input message T
in a tonic::Request
sourceimpl<P, R> ProtoType<R> for P where
R: RustType<P>,
impl<P, R> ProtoType<R> for P where
R: RustType<P>,
sourcefn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
See RustType::from_proto
.
sourcefn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
See RustType::into_proto
.
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more