pub struct Controller<T = Timestamp> {
    pub storage: Box<dyn StorageController<Timestamp = T>>,
    pub compute: ComputeController<T>,
    pub(crate) clusterd_image: String,
    pub(crate) init_container_image: Option<String>,
    pub(crate) orchestrator: Arc<dyn NamespacedOrchestrator>,
    pub(crate) readiness: Readiness,
    pub(crate) metrics_tasks: HashMap<ReplicaId, AbortOnDropHandle<()>>,
    pub(crate) metrics_tx: UnboundedSender<(ReplicaId, Vec<ServiceProcessMetrics>)>,
    pub(crate) metrics_rx: Peekable<UnboundedReceiverStream<(ReplicaId, Vec<ServiceProcessMetrics>)>>,
}
Expand description

A client that maintains soft state and validates commands, in addition to forwarding them.

Fields§

§storage: Box<dyn StorageController<Timestamp = T>>§compute: ComputeController<T>§clusterd_image: String

The clusterd image to use when starting new cluster processes.

§init_container_image: Option<String>

The init container image to use for clusterd.

§orchestrator: Arc<dyn NamespacedOrchestrator>

The cluster orchestrator.

§readiness: Readiness

Tracks the readiness of the underlying controllers.

§metrics_tasks: HashMap<ReplicaId, AbortOnDropHandle<()>>

Tasks for collecting replica metrics.

§metrics_tx: UnboundedSender<(ReplicaId, Vec<ServiceProcessMetrics>)>

Sender for the channel over which replica metrics are sent.

§metrics_rx: Peekable<UnboundedReceiverStream<(ReplicaId, Vec<ServiceProcessMetrics>)>>

Receiver for the channel over which replica metrics are sent.

Implementations§

Creates a cluster with the specified identifier and configuration.

A cluster is a combination of a storage instance and a compute instance. A cluster has zero or more replicas; each replica colocates the storage and compute layers on the same physical resources.

Drops the specified cluster.

Panics

Panics if the cluster still has replicas.

Creates a replica of the specified cluster with the specified identifier and configuration.

This method is NOT idempotent; It can fail between processing of different replicas and leave the controller in an inconsistent state. It is almost always wrong to do anything but abort the process on Err.

Drops the specified replica of the specified cluster.

Remove orphaned replicas.

Provisions a replica with the service orchestrator.

Deprovisions a replica with the service orchestrator.

Marks the end of any initialization commands.

The implementor may wait for this method to be called before implementing prior commands, and so it is important for a user to invoke this method as soon as it is comfortable. This method can be invoked immediately, at the potential expense of performance.

Waits until the controller is ready to process a response.

This method may block for an arbitrarily long time.

When the method returns, the owner should call Controller::ready to process the ready message.

This method is cancellation safe.

Processes the work queued by Controller::ready.

This method is guaranteed to return “quickly” unless doing so would compromise the correctness of the system.

This method is not guaranteed to be cancellation safe. It must be awaited to completion.

Produces a timestamp that reflects all data available in source_ids at the time of the function call.

Creates a new controller.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Attaches the current Context to this type, returning a WithContext wrapper. Read more
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Wrap the input message T in a tonic::Request
The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more