AdmittedQuery

class AdmittedQuery<out Q : Any>

A query that admission let through, with the entry it ran under, the execution timeout its budget gives and the resolution of every field reference it carries. Only QueryAdmission creates it, so a QueryBackend cannot receive a query that skipped admission.

query is the normalized query in its original AST types. Every node of it that carries a field is a fresh instance, and field / systemField answer that node's ResolvedField by identity: backends read resolutions instead of looking fields up. A count (me.ahoo.wow.api.query.CountQuery) carries its effective limit, the caller's or its budget's.

Properties

Link copied to clipboard
Link copied to clipboard

The query model the query was admitted against.

Link copied to clipboard

The one tenant every record query matches belongs to, or null when its filter does not pin one. Its filter pins a tenant when it requires a TenantIdFilter: alone, or among the operands of an AND (at any depth of ANDs), as admission ANDs a caller's scope, all of one value. Any other shape (an OR, a NOT, several values) pins none, so a trusted cross-tenant query is never read as one tenant's. A backend whose order breaks ties by the tenant reads that key as a constant under a pinned tenant: it orders nothing and bounds nothing.

Link copied to clipboard

Whether the query was admitted against a provisional schema, compiled for storage that did not exist yet: a backend that finds the storage refuses it rather than run it on bindings the storage never proved.

Link copied to clipboard
val query: Q
Link copied to clipboard

How long the query may run, or null for no limit: the backend passes it to its storage (SET LOCAL statement_timeout, maxTimeMS), and the core fails the query with QueryTimeoutException once it is spent.

Functions

Link copied to clipboard
fun field(reference: QueryField<*>): ResolvedField

The resolution of one field reference of query, by the identity of its QueryField instance.

Link copied to clipboard
fun physicalPath(reference: QueryField<*>): String

The absolute physical path reference resolved to: where a backend reads the field.

Link copied to clipboard

The resolution of the system field a system-field filter of query (ID, TENANT_ID, DELETION, ...) targets.

Link copied to clipboard

The physical path of the system field a system-field filter of query targets.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard

The same query under timeout: how admission applies its budget's timeout, and how trusted callers of QueryAdmission.Trusted (conformance tests, tools) give one.