NodeQueries

@Configuration(proxyBeanMethods = false)
@ConditionalOnBean(value = [ServiceNode::class])
class NodeQueries

The node's queries, once it has a ServiceNode.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
@Bean(initMethod = "start", destroyMethod = "close")
fun wowAdaptiveQueryLimits(stores: QueryStores): AdaptiveQueryLimits
Link copied to clipboard
@Bean
@ConditionalOnMissingBean
fun wowContextQueries(api: NodeQueryApi): ContextQueries

The queries of the subscription handlers (ContextQueries.of): the node's NodeQueryApi pinned to the tenant of each commit, as trusted code; an application's own NodeQueryApi bean as a caller of that tenant.

Link copied to clipboard
@Bean(value = ["wowDatasetBindings"])
fun wowDatasetBindings(application: ObjectProvider<QueryBindings<QueryDataset>>, beanFactory: ConfigurableListableBeanFactory, environment: Environment): HostDatasetBindings

The bindings of the datasets: the application's QueryBindings<QueryDataset> bean, else the one dataset backend on the class path that is available (HostDatasets.provided), else none.

Link copied to clipboard

The engine's dataset gateways; the dataset bindings forget a dataset that leaves the QueryDatasets.

Link copied to clipboard
@Bean
@ConditionalOnMissingBean
fun wowEventQueryBackend(manifest: Manifest, models: WowModels, backends: HostBackends, wow: ObjectProvider<WowProperties>): EventQueryBackend

The events query backend of each aggregate type, by its events store: the store wow.aggregates.[<context>.<aggregate>].query.events.store names (an Elasticsearch store its event search Sink writes, say), else the store its log is on. The application's own EventQueryBackend bean when it has one, else the one of the query provider of the store's type: PostgreSQL's or MongoDB's over the log in place (the store's query-read-preference), Elasticsearch's over the Sink's events index, and a log in memory scanned in memory unless wow.query.memory.enabled is false, as its snapshots are queried then. Any other log, in memory without it, on a store whose type has no query provider, or the application's own, is not queried: its events model is not served, and an info log says so. A store named for a type that cannot serve its events queries fails the start.

Link copied to clipboard
@Bean
@ConditionalOnMissingBean
fun wowGovernedAggregates(engine: ObjectProvider<QueryEngine>): GovernedAggregates

Which of the service's aggregates its access policies govern, as its QueryEngine resolved them: what the ClickHouse Sink records of each aggregate in wow_catalog, so that the analytics catalog refuses their rows. Asked when a Sink describes its tables, once the node has started.

Link copied to clipboard
@Bean
@ConditionalOnMissingBean
fun wowHttpQueries(engine: QueryEngine, node: ServiceNode, properties: QueryProperties): HttpQueries

The query models the public routes serve: the engine's, wow.query.budgets.http.default-list-size.

Link copied to clipboard
@Bean
@ConditionalOnMissingBean
fun wowQueryApi(engine: QueryEngine, node: ServiceNode, properties: QueryProperties, reads: ObjectProvider<StateReads>, peers: PeerClients): NodeQueryApi

The node's typed NodeQueryApi: the engine's gateways and read facade, each aggregate type found by its model's state class, its states read as the public port's state reads, its lists defaulted by wow.query.budgets.in-process.default-list-size and its streams read in wow.query.stream.chunk-size chunks. An application replaces it by declaring a NodeQueryApi bean, not by calling this method.

Link copied to clipboard
fun wowQueryBeans(datasetBindings: HostDatasetBindings, datasetVisibility: ObjectProvider<DatasetVisibility>, strategies: ObjectProvider<MaskStrategyResolver>, sources: ObjectProvider<QuerySchemaSource>, filters: ObjectProvider<QueryFilter>, observers: ObjectProvider<QueryObserver>, access: ObjectProvider<AccessPolicy<*>>, readers: ObjectProvider<ReadAuthorizer>): QueryBeans

The application's beans the engine is built of, which it may give or not.

Link copied to clipboard
@Bean
@ConditionalOnMissingBean
@ConditionalOnProperty(prefix = "wow.query", name = ["count-cache.enabled"], matchIfMissing = true)
fun wowQueryCountCache(node: ServiceNode, properties: QueryProperties): QueryCountCache

The count cache of the snapshot gateways, unless wow.query.count-cache.enabled is off: each count valid while the snapshot write checkpoint of its type on this node (me.ahoo.wow.runtime.node.ContextNode.snapshotCheckpoint) holds.

Link copied to clipboard
@Bean
@ConditionalOnMissingBean
fun wowQueryDatasets(properties: QueryProperties, beanFactory: ConfigurableListableBeanFactory): QueryDatasets

The datasets of the dataset files, wow.query.dataset.config-directory first, then the classpath; an application may give its own QueryDatasets, or add to this one while the node runs.

Link copied to clipboard
@Bean
@ConditionalOnMissingBean
fun wowQueryEngine(manifest: Manifest, node: ServiceNode, properties: QueryProperties, backend: SnapshotQueryBackend, events: EventQueryBackend, datasets: QueryDatasets, entryPolicy: QueryEntryPolicy, beans: QueryBeans, counts: ObjectProvider<QueryCountCache>, masks: PayloadMasks, stores: QueryStores, wow: ObjectProvider<WowProperties>): QueryEngine

The node's read side: the QueryEngine of the Manifest over the snapshot, events and dataset backends, the application's schema sources, mask strategies, access policies, read authorizers, filters and observers and its count caches, under wow.query.* (sensitivity, entry policy). The engine holds every security rule of the read side; this only maps the configuration onto it.

Link copied to clipboard
@Bean
@ConditionalOnMissingBean
fun wowQueryEntryPolicy(properties: QueryProperties): QueryEntryPolicy
Link copied to clipboard
Link copied to clipboard
fun wowQueryNode(nodes: ObjectProvider<ServiceNode>): HostQueryNode

The node whose write pressure the stores' query bounds adapt to, once the context has built it.

Link copied to clipboard

The engine's schema Catalog.

Link copied to clipboard
fun wowQueryStores(node: HostQueryNode, properties: QueryProperties, backends: HostBackends, events: ObjectProvider<EventQueryBackend>, wow: ObjectProvider<WowProperties>): QueryStores

How the queries of each store run: the bulkheads of the stores (wow.stores.<name>.query. max-concurrent, wow.query.max-concurrent, else the provider's from its pool), and whether each type's events queries that name no aggregate run. They are built before the node, which replays its states under them (wowReplayGate), so they take none of its beans: the node's write pressure is read as the bounds adapt (HostQueryNode), and the events backend, which the application's may build over the node, when a query asks.

Link copied to clipboard

Ends the open query streams before the public server's graceful shutdown waits for them.

Link copied to clipboard
@Bean
@ConditionalOnMissingBean
fun wowReplayGate(stores: QueryStores, backends: HostBackends): ReplayGate

How the state reads replay the log of an aggregate without a snapshot, and the node's subscriptions rebuild a state: under the query bulkhead of its log store, as that store's queries run; and whether that store's writes pressed, as its adaptive bound read them, which the access walk gives way to. The node is built with it (ServiceNode's replayGate), so it depends on no bean of the node's.

Link copied to clipboard
@Bean
@ConditionalOnMissingBean
fun wowSnapshotQueryBackend(manifest: Manifest, node: ServiceNode, backends: HostBackends, applicationBindings: ObjectProvider<QueryBindings<AggregateType>>, wow: ObjectProvider<WowProperties>): SnapshotQueryBackend