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§
- Admission
Config - Admission
Permit - Holds an identity’s share of the budget until dropped.
- Admission
Scheduler
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 as4GBcannot silently leave the knob off. Takes thestd::env::varresult so it can be tested without touching the process environment.