QueryBudget

class QueryBudget(val label: String, val maxListSize: Int = 1000, val maxPageSize: Int = 100, val maxPageWindow: Long, val maxFilterNodes: Int = DEFAULT_MAX_FILTER_NODES, val maxFilterValues: Int = 1000, val allowExpensiveOperators: Boolean = true, val maxResidualGroups: Int = DEFAULT_MAX_RESIDUAL_GROUPS)

Size limits and expensive-operator gates for one QueryEntry, checked at admission step 0: against the query as the caller submitted it plus the caller's scope from the edge, before any extension rewrites it. A route's selection (what a load route names in its URL), policy conditions, the model's default scope and cursor tie-breakers therefore never count, and a policy may use a gated operator.

A limit of 0 disables that limit. Every rejection is a request QueryViolation whose text label opens, e.g. HTTP page size[0] ....

maxResidualGroups is metered during execution instead: when a storage cannot run an aggregation's HAVING or metric sort natively, the core reads every group to compute it, and fails once more than this many groups arrive.

Constructors

Link copied to clipboard
constructor(label: String, maxListSize: Int = 1000, maxPageSize: Int = 100, maxPageWindow: Long, maxFilterNodes: Int = DEFAULT_MAX_FILTER_NODES, maxFilterValues: Int = 1000, allowExpensiveOperators: Boolean = true, maxResidualGroups: Int = DEFAULT_MAX_RESIDUAL_GROUPS)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun check(query: AggregationQuery, scope: FilterExpression = MatchAllFilter)
fun check(query: ICursorQuery, scope: FilterExpression = MatchAllFilter)
fun check(query: IListQuery, scope: FilterExpression = MatchAllFilter)
fun check(query: IPagedQuery, scope: FilterExpression = MatchAllFilter)
fun check(query: ISingleQuery, scope: FilterExpression = MatchAllFilter)
Link copied to clipboard
fun checkCount(filter: FilterExpression, scope: FilterExpression = MatchAllFilter)
Link copied to clipboard
fun listDefault(default: Int): Int?

The list size applied to a list query that sends none, from the configured default: at most maxListSize, and null (none applied, 0 keeps meaning unlimited) when either is 0.