Enum mz_compute_client::command::ComputeCommand
source · pub enum ComputeCommand<T = Timestamp> {
CreateTimely {
config: TimelyConfig,
epoch: ComputeStartupEpoch,
},
CreateInstance(LoggingConfig),
InitializationComplete,
UpdateConfiguration(BTreeSet<ComputeParameter>),
CreateDataflows(Vec<DataflowDescription<Plan<T>, CollectionMetadata, T>>),
AllowCompaction(Vec<(GlobalId, Antichain<T>)>),
Peek(Peek<T>),
CancelPeeks {
uuids: BTreeSet<Uuid>,
},
}
Expand description
Commands related to the computation and maintenance of views.
A replica can consist of multiple clusterd processes. Upon startup, a clusterd will listen for a connection from environmentd. The first command sent to clusterd must be a CreateTimely command, which will build the timely runtime.
CreateTimely is the only command that is sent to every process of the replica by environmentd. The other commands are sent only to the first process, which in turn will disseminate the command to other timely workers using the timely communication fabric.
After a timely runtime has been built with CreateTimely, a sequence of commands that have to be handled in the timely runtime can be sent: First a CreateInstance must be sent which activates logging sources. After this, any combination of UpdateConfiguration, CreateDataflows, AllowCompaction, Peek, and CancelPeeks can be sent.
Within this sequence, exactly one InitializationComplete has to be sent. Commands sent before InitializationComplete are buffered and are compacted. For example a Peek followed by a CancelPeek will become a no-op if sent before InitializationComplete. After InitializationComplete, the clusterd is considered rehydrated and will immediately act upon the commands. If a new cluster is created, InitializationComplete will follow immediately after CreateInstance. If a replica is added to a cluster or environmentd restarts and rehydrates a clusterd, a potentially long command sequence will be sent before InitializationComplete.
Variants§
CreateTimely
Create the timely runtime according to the supplied CommunicationConfig. Must be the first command sent to a clusterd. This is the only command that is broadcasted to all clusterd processes within a replica.
CreateInstance(LoggingConfig)
Setup and logging sources within a running timely instance. Must be the second command after CreateTimely.
InitializationComplete
Indicates that the controller has sent all commands reflecting its initial state.
UpdateConfiguration(BTreeSet<ComputeParameter>)
Update compute instance configuration.
CreateDataflows(Vec<DataflowDescription<Plan<T>, CollectionMetadata, T>>)
Create a sequence of dataflows.
Each of the dataflows must contain as_of
members that are valid
for each of the referenced arrangements, meaning AllowCompaction
should be held back to those values until the command.
Subsequent commands may arbitrarily compact the arrangements;
the dataflow runners are responsible for ensuring that they can
correctly maintain the dataflows.
AllowCompaction(Vec<(GlobalId, Antichain<T>)>)
Enable compaction in compute-managed collections.
Each entry in the vector names a collection and provides a frontier after which accumulations must be correct. The workers gain the liberty of compacting the corresponding maintained traces up through that frontier.
Peek(Peek<T>)
Peek at an arrangement.
CancelPeeks
Cancel the peeks associated with the given uuids
.
Trait Implementations§
source§impl Arbitrary for ComputeCommand<Timestamp>
impl Arbitrary for ComputeCommand<Timestamp>
§type Strategy = Union<BoxedStrategy<ComputeCommand<Timestamp>>>
type Strategy = Union<BoxedStrategy<ComputeCommand<Timestamp>>>
Strategy
used to generate values of type Self
.§type Parameters = ()
type Parameters = ()
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.source§fn arbitrary_with(_: Self::Parameters) -> Self::Strategy
fn arbitrary_with(_: Self::Parameters) -> Self::Strategy
source§impl<T: Clone> Clone for ComputeCommand<T>
impl<T: Clone> Clone for ComputeCommand<T>
source§fn clone(&self) -> ComputeCommand<T>
fn clone(&self) -> ComputeCommand<T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<T: Debug> Debug for ComputeCommand<T>
impl<T: Debug> Debug for ComputeCommand<T>
source§impl<'de, T> Deserialize<'de> for ComputeCommand<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for ComputeCommand<T>where
T: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl<T: Send> GenericClient<ComputeCommand<T>, ComputeResponse<T>> for Box<dyn ComputeClient<T>>
impl<T: Send> GenericClient<ComputeCommand<T>, ComputeResponse<T>> for Box<dyn ComputeClient<T>>
source§fn send<'life0, 'async_trait>(
&'life0 mut self,
cmd: ComputeCommand<T>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send<'life0, 'async_trait>(
&'life0 mut self,
cmd: ComputeCommand<T>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
source§impl<T: PartialEq> PartialEq<ComputeCommand<T>> for ComputeCommand<T>
impl<T: PartialEq> PartialEq<ComputeCommand<T>> for ComputeCommand<T>
source§fn eq(&self, other: &ComputeCommand<T>) -> bool
fn eq(&self, other: &ComputeCommand<T>) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<T> Partitionable<ComputeCommand<T>, ComputeResponse<T>> for (ComputeCommand<T>, ComputeResponse<T>)where
T: Timestamp + Lattice,
impl<T> Partitionable<ComputeCommand<T>, ComputeResponse<T>> for (ComputeCommand<T>, ComputeResponse<T>)where
T: Timestamp + Lattice,
§type PartitionedState = PartitionedComputeState<T>
type PartitionedState = PartitionedComputeState<T>
source§fn new(parts: usize) -> PartitionedComputeState<T>
fn new(parts: usize) -> PartitionedComputeState<T>
PartitionedState
for the command–response pair.source§impl<T> PartitionedState<ComputeCommand<T>, ComputeResponse<T>> for PartitionedComputeState<T>where
T: Timestamp + Lattice,
impl<T> PartitionedState<ComputeCommand<T>, ComputeResponse<T>> for PartitionedComputeState<T>where
T: Timestamp + Lattice,
source§fn split_command(
&mut self,
command: ComputeCommand<T>
) -> Vec<Option<ComputeCommand<T>>> ⓘ
fn split_command(
&mut self,
command: ComputeCommand<T>
) -> Vec<Option<ComputeCommand<T>>> ⓘ
source§fn absorb_response(
&mut self,
shard_id: usize,
message: ComputeResponse<T>
) -> Option<Result<ComputeResponse<T>, Error>>
fn absorb_response(
&mut self,
shard_id: usize,
message: ComputeResponse<T>
) -> Option<Result<ComputeResponse<T>, Error>>
source§impl RustType<ProtoComputeCommand> for ComputeCommand<Timestamp>
impl RustType<ProtoComputeCommand> for ComputeCommand<Timestamp>
source§fn into_proto(&self) -> ProtoComputeCommand
fn into_proto(&self) -> ProtoComputeCommand
Self
into a Proto
value.source§fn from_proto(proto: ProtoComputeCommand) -> Result<Self, TryFromProtoError>
fn from_proto(proto: ProtoComputeCommand) -> Result<Self, TryFromProtoError>
source§impl<T> Serialize for ComputeCommand<T>where
T: Serialize,
impl<T> Serialize for ComputeCommand<T>where
T: Serialize,
impl<T> StructuralPartialEq for ComputeCommand<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for ComputeCommand<T>where
T: RefUnwindSafe,
impl<T> Send for ComputeCommand<T>where
T: Send,
impl<T> Sync for ComputeCommand<T>where
T: Sync,
impl<T> Unpin for ComputeCommand<T>where
T: Unpin,
impl<T> UnwindSafe for ComputeCommand<T>where
T: UnwindSafe + RefUnwindSafe,
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>
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>
RustType::from_proto
.source§fn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
RustType::into_proto
.