#[repr(u8)]pub enum CommandKind {
Show 14 variants
AssertEdge = 0,
RetireEdge = 1,
UpsertConcept = 2,
WriteBulkAtomic = 3,
RebuildCurrent = 4,
RegisterModel = 5,
Shutdown = 6,
BulkImportChunk = 7,
WriteConceptsChunk = 8,
WriteAnalyticsChunk = 9,
UpsertEmbeddingChunk = 10,
Archive = 11,
RebuildFts = 12,
ShadowRebuild = 13,
}Expand description
The command kinds the actor can spend a turn on.
One flat enum across both channels rather than one per channel. The question this exists to answer is “which command broke the budget”, and a reader looking at a 400 ms hold does not first want to know which queue it came off. Priority is a property of scheduling; kind is a property of cost.
Variants§
AssertEdge = 0
RetireEdge = 1
UpsertConcept = 2
WriteBulkAtomic = 3
RebuildCurrent = 4
RegisterModel = 5
Shutdown = 6
BulkImportChunk = 7
WriteConceptsChunk = 8
WriteAnalyticsChunk = 9
UpsertEmbeddingChunk = 10
Archive = 11
RebuildFts = 12
ShadowRebuild = 13
One step of a chunked shadow rebuild (T1.2). Its own kind rather than
folded into RebuildCurrent, because the two have opposite latency
profiles and the whole point of the chunked path is that its turns are
short — averaging them together would hide exactly the improvement.
Implementations§
Source§impl CommandKind
impl CommandKind
Sourcepub const ALL: &'static [CommandKind]
pub const ALL: &'static [CommandKind]
Every kind, in declaration order. Indexing into the per-kind arrays is by
position in this slice, so the two must not drift — which is why the
arrays are sized from ALL.len() rather than from a hand-written count.
pub const COUNT: usize
pub const fn index(self) -> usize
pub const fn as_str(self) -> &'static str
Sourcepub const fn exempt_from_budget(self) -> bool
pub const fn exempt_from_budget(self) -> bool
Whether this kind is exempt from crate::CHUNK_BUDGET by contract.
The three exemptions are the table in CHUNK_BUDGET’s own rustdoc, and
they are carried here so a dashboard can separate “the budget is being
broken” from “the budget does not apply and never claimed to”. Counting
an archive as a budget violation would make the violation count useless
on any database that archives.
CommandKind::ShadowRebuild is deliberately not exempt. Its fill
chunks are meant to fit the budget and its swap turn is not going to —
the swap rebuilds three indexes under the lock, which is the residual
cost T1.2 could not remove. Both facts are worth seeing, and exempting
the kind would hide the first to excuse the second.
Trait Implementations§
Source§impl Clone for CommandKind
impl Clone for CommandKind
Source§fn clone(&self) -> CommandKind
fn clone(&self) -> CommandKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CommandKind
Source§impl Debug for CommandKind
impl Debug for CommandKind
Source§impl Display for CommandKind
impl Display for CommandKind
impl Eq for CommandKind
Source§impl Hash for CommandKind
impl Hash for CommandKind
Source§impl Ord for CommandKind
impl Ord for CommandKind
Source§fn cmp(&self, other: &CommandKind) -> Ordering
fn cmp(&self, other: &CommandKind) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for CommandKind
impl PartialEq for CommandKind
Source§impl PartialOrd for CommandKind
impl PartialOrd for CommandKind
impl StructuralPartialEq for CommandKind
Auto Trait Implementations§
impl Freeze for CommandKind
impl RefUnwindSafe for CommandKind
impl Send for CommandKind
impl Sync for CommandKind
impl Unpin for CommandKind
impl UnsafeUnpin for CommandKind
impl UnwindSafe for CommandKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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