pub struct Machine<K, V, T, D> {
cfg: PersistConfig,
consensus: Arc<dyn Consensus + Send + Sync>,
metrics: Arc<Metrics>,
shard_metrics: Arc<ShardMetrics>,
state: State<K, V, T, D>,
}
Fields
cfg: PersistConfig
consensus: Arc<dyn Consensus + Send + Sync>
metrics: Arc<Metrics>
shard_metrics: Arc<ShardMetrics>
state: State<K, V, T, D>
Implementations
sourceimpl<K, V, T, D> Machine<K, V, T, D> where
K: Debug + Codec,
V: Debug + Codec,
T: Timestamp + Lattice + Codec64,
D: Semigroup + Codec64,
impl<K, V, T, D> Machine<K, V, T, D> where
K: Debug + Codec,
V: Debug + Codec,
T: Timestamp + Lattice + Codec64,
D: Semigroup + Codec64,
pub async fn new(
cfg: PersistConfig,
shard_id: ShardId,
consensus: Arc<dyn Consensus + Send + Sync>,
metrics: Arc<Metrics>
) -> Result<Self, CodecMismatch>
pub fn shard_id(&self) -> ShardId
pub async fn fetch_upper(&mut self) -> &Antichain<T>
pub fn upper(&self) -> &Antichain<T>
pub async fn register_reader(
&mut self,
reader_id: &ReaderId,
heartbeat_timestamp_ms: u64
) -> (Upper<T>, ReaderState<T>)
pub async fn register_writer(
&mut self,
writer_id: &WriterId,
lease_duration: Duration,
heartbeat_timestamp_ms: u64
) -> (Upper<T>, WriterState)
pub async fn clone_reader(
&mut self,
new_reader_id: &ReaderId,
heartbeat_timestamp_ms: u64
) -> ReaderState<T>
pub async fn compare_and_append(
&mut self,
batch: &HollowBatch<T>,
writer_id: &WriterId,
heartbeat_timestamp_ms: u64
) -> Result<Result<Result<(SeqNo, WriterMaintenance<T>), Upper<T>>, InvalidUsage<T>>, Indeterminate>
pub async fn merge_res(&mut self, res: &FueledMergeRes<T>) -> bool
pub async fn downgrade_since(
&mut self,
reader_id: &ReaderId,
new_since: &Antichain<T>,
heartbeat_timestamp_ms: u64
) -> (SeqNo, Since<T>, RoutineMaintenance)
pub async fn heartbeat_reader(
&mut self,
reader_id: &ReaderId,
heartbeat_timestamp_ms: u64
) -> (SeqNo, RoutineMaintenance)
pub async fn heartbeat_writer(
&mut self,
writer_id: &WriterId,
heartbeat_timestamp_ms: u64
) -> (SeqNo, RoutineMaintenance)
pub async fn expire_reader(&mut self, reader_id: &ReaderId) -> SeqNo
pub async fn expire_writer(&mut self, writer_id: &WriterId) -> SeqNo
pub async fn snapshot(
&mut self,
as_of: &Antichain<T>
) -> Result<Vec<HollowBatch<T>>, Since<T>>
pub async fn verify_listen(&self, as_of: &Antichain<T>) -> Result<(), Since<T>>
pub async fn next_listen_batch(
&mut self,
frontier: &Antichain<T>
) -> HollowBatch<T>
async fn apply_unbatched_idempotent_cmd<R, WorkFn: FnMut(SeqNo, &mut StateCollections<T>) -> ControlFlow<Infallible, R>>(
&mut self,
cmd: &CmdMetrics,
work_fn: WorkFn
) -> (SeqNo, R, RoutineMaintenance)
async fn apply_unbatched_cmd<R, E, WorkFn: FnMut(SeqNo, &mut StateCollections<T>) -> ControlFlow<E, R>>(
&mut self,
cmd: &CmdMetrics,
work_fn: WorkFn
) -> Result<(SeqNo, Result<R, E>, RoutineMaintenance), Indeterminate>
async fn maybe_init_state(
cfg: &PersistConfig,
consensus: &(dyn Consensus + Send + Sync),
retry_metrics: &RetriesMetrics,
shard_id: ShardId
) -> Result<State<K, V, T, D>, CodecMismatch>
pub async fn fetch_and_update_state(&mut self)
async fn update_state(&mut self, current: Option<VersionedData>)
Trait Implementations
Auto Trait Implementations
impl<K, V, T, D> !RefUnwindSafe for Machine<K, V, T, D>
impl<K, V, T, D> Send for Machine<K, V, T, D> where
T: Send,
impl<K, V, T, D> Sync for Machine<K, V, T, D> where
T: Sync,
impl<K, V, T, D> Unpin for Machine<K, V, T, D> where
T: Unpin,
impl<K, V, T, D> !UnwindSafe for Machine<K, V, T, D>
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<T> ProgressEventTimestamp for T where
T: Data + Debug + Any,
impl<T> ProgressEventTimestamp for T where
T: Data + Debug + Any,
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