QueryAutoConfiguration

@AutoConfiguration(after = [WowAutoConfiguration::class])
@ConditionalOnClass(name = ["me.ahoo.wow.query.QueryModule"])
@ConditionalOnProperty(prefix = "wow.query", name = ["enabled"], matchIfMissing = true)
@EnableConfigurationProperties(value = [QueryProperties::class])
class QueryAutoConfiguration

The query plane (–), active when wow-query is on the classpath (wow-http brings it) and wow.query.enabled is not off. Over the node's Manifest it builds:

  • a SnapshotQueryBackend chosen by the classpath as the stores are: the application's own QueryBindings<AggregateType> bean when it has one, else, for each aggregate type, the query provider of the store its snapshot queries read: its primary snapshot store, or the one of its snapshot stores wow.aggregates.[<context>.<aggregate>].query.snapshot.store names (an Elasticsearch store, say); the snapshots in memory (or of the application's own me.ahoo.wow.runtime.node.BackendFactory) are not queried without one, and their routes are not served;

  • the EventQueryBackend of each aggregate type's log store, from the query provider of the store's type (PostgreSQL or MongoDB in place, a log in memory scanned in memory unless wow.query.memory.enabled is false, any other log not queried), and the QueryDatasets of the dataset files (HostDatasets);

  • the QueryEngine: this maps wow.query.* (sensitivity, the entry gates, the count caches) and the application's beans (its QueryBindings<QueryDataset>, MaskStrategyResolver, QuerySchemaSource, ReadAuthorizer, QueryFilter, QueryObserver and DatasetVisibility beans, and the AccessPolicy of each aggregate, which the engine checks against the Manifest) onto QueryEngine.Builder, whose are every rule of the read side: the Catalog, the gateways of the three models and their policies, the policy gateways of the types whose snapshots are not queried and the state reads' me.ahoo.wow.query.engine.ReadFacade. The host decides no query policy itself (an architecture rule holds it);

  • the node's typed NodeQueryApi, in process over the same engine, under wow.query.budgets.in-process.*, a caller's queries and trusted code's;

  • HttpQueries, which the public routes serve (the datasets under /wow/dataset, seen as DatasetVisibility says: the application's bean, else by scope), and QueryIndexesLifecycle, which manages the x-wow-index indexes at startup as each store's ddl says.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
@Configuration(proxyBeanMethods = false)
@ConditionalOnBean(value = [ServiceNode::class])
class NodeQueries

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