Skip to main content

ResourceGroup

Struct ResourceGroup 

Source
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: String

Unique (per tenant) group name.

§max_concurrency: usize

Maximum concurrently executing queries.

§max_queue: usize

Maximum queued queries awaiting a concurrency slot.

§memory_bytes: u64

Memory budget in bytes (enforced via the memory governor, S1E-003).

§temporary_disk_bytes: u64

Temporary-disk budget in bytes (spill manager, S1E-004).

§work_units: u64

Work-unit budget (weighted CPU/I/O accounting units).

§cpu_weight: u32

CPU scheduling weight (relative share; must be nonzero).

§priority: u8

Scheduling priority, 0..=255 (higher runs first).

§max_result_bytes: u64

Maximum bytes of one query’s result.

Implementations§

Source§

impl ResourceGroup

Source

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).

Source

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

Source§

fn clone(&self) -> ResourceGroup

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ResourceGroup

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ResourceGroup

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for ResourceGroup

Source§

impl PartialEq for ResourceGroup

Source§

fn eq(&self, other: &ResourceGroup) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ResourceGroup

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ResourceGroup

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.