Skip to main content

Module query_admission

Module query_admission 

Source
Expand description

fair per-identity admission scheduler for queries Fair per-identity admission scheduler for FlightSQL queries.

The scheduler never rejects: every identity gets its own FIFO queue, a per-process budget caps the cost in flight, and each time capacity frees up the next query comes from the identity with the least cost in flight. It is generic over cost and identity and knows nothing about DataFusion.

Structs§

AdmissionConfig
AdmissionPermit
Holds an identity’s share of the budget until dropped.
AdmissionScheduler

Constants§

ADMISSION_BUDGET_ENV
ADMISSION_MAX_PER_IDENTITY_ENV
ADMISSION_MIN_COST_ENV
ADMISSION_OPAQUE_LEAF_COST_ENV

Functions§

admission_scheduler_from_env
Builds the scheduler from the environment. None (budget unset) means admission is disabled. The min-cost and per-identity knobs are not read then, so they cannot fail startup.
gb_to_bytes
Converts a decimal GB value to bytes, rejecting anything that is not a finite non-negative number that fits in a u64.
opaque_leaf_cost_from_env
Flat cost charged for a plan leaf whose work cannot be seen at plan time.
parse_gb_env
Parses a decimal-GB env knob: unset is None, anything unparseable is an error so a typo such as 4GB cannot silently leave the knob off. Takes the std::env::var result so it can be tested without touching the process environment.