pub struct ResourceGroup {
pub name: String,
pub max_concurrency: usize,
pub max_queue: usize,
pub memory_bytes: u64,
pub temporary_disk_bytes: u64,
pub work_units: u64,
pub cpu_weight: u32,
pub priority: u8,
pub max_result_bytes: u64,
}Expand description
Bounds for one class of admitted work (spec section 10.5, S1E-002).
The field set is exactly the spec’s. priority is a u8, so the spec’s
0..=255 range is enforced by the type itself (and by serde on the
cluster-settings path); validate covers the remaining
invariants: non-empty name and nonzero weights.
Fields§
§name: StringUnique (per tenant) group name.
max_concurrency: usizeMaximum concurrently executing queries.
max_queue: usizeMaximum queued queries awaiting a concurrency slot.
memory_bytes: u64Memory budget in bytes (enforced via the memory governor, S1E-003).
temporary_disk_bytes: u64Temporary-disk budget in bytes (spill manager, S1E-004).
work_units: u64Work-unit budget (weighted CPU/I/O accounting units).
cpu_weight: u32CPU scheduling weight (relative share; must be nonzero).
priority: u8Scheduling priority, 0..=255 (higher runs first).
max_result_bytes: u64Maximum bytes of one query’s result.
Implementations§
Source§impl ResourceGroup
impl ResourceGroup
Sourcepub fn validate(&self) -> Result<(), ResourceError>
pub fn validate(&self) -> Result<(), ResourceError>
Checks the invariants not carried by the field types: non-empty name
and nonzero weights (priority’s 0..=255 range is the u8 type).
Sourcepub fn for_class(class: WorkloadClass) -> Self
pub fn for_class(class: WorkloadClass) -> Self
The configured default group for a workload class (spec §13.1 queue set). Control and replication receive generous, always-reserved capacity; foreground classes outrank analytics, which outranks maintenance and backup. Operators reconfigure these through the registry; the numbers are starting points, not policy.
Trait Implementations§
Source§impl Clone for ResourceGroup
impl Clone for ResourceGroup
Source§fn clone(&self) -> ResourceGroup
fn clone(&self) -> ResourceGroup
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResourceGroup
impl Debug for ResourceGroup
Source§impl<'de> Deserialize<'de> for ResourceGroup
impl<'de> Deserialize<'de> for ResourceGroup
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>,
impl Eq for ResourceGroup
Source§impl PartialEq for ResourceGroup
impl PartialEq for ResourceGroup
Source§impl Serialize for ResourceGroup
impl Serialize for ResourceGroup
impl StructuralPartialEq for ResourceGroup
Auto Trait Implementations§
impl Freeze for ResourceGroup
impl RefUnwindSafe for ResourceGroup
impl Send for ResourceGroup
impl Sync for ResourceGroup
impl Unpin for ResourceGroup
impl UnsafeUnpin for ResourceGroup
impl UnwindSafe for ResourceGroup
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more