InMemoryDatasetStorage

The in-memory reference dataset storage: tables of rows, each row a record with its fields at the root, and the InMemoryQueryBackend of each dataset bound to one, which passes DatasetQueryBackendSpec (the :query test fixtures). A dataset names its table in its storage binding, {"table": "<name>"} (binding).

It also holds the current access record of each aggregate (putAccess), as the ClickHouse Sink's _state does: a dataset bound to an aggregate (me.ahoo.wow.query.dataset.QueryDatasetAccess) reads each row by the record of its aggregate, the one of the row's tenant (a platform dataset's, QueryDatasetScope.PLATFORM_TENANT) and of the id its id column holds (me.ahoo.wow.query.dataset.DatasetAccess); a row whose aggregate has none matches no access restriction.

delay holds every primitive back that long before it answers, as InMemoryQueryStorage does.

Constructors

Link copied to clipboard
constructor(delay: Duration = Duration.ZERO)

Types

Link copied to clipboard

Functions

Link copied to clipboard
fun put(table: String, rows: List<ObjectNode>): ObjectNode

Replaces the rows of table; returns the storage binding a dataset of that table declares.

Link copied to clipboard
fun putAccess(aggregate: AggregateType, tenantId: String, aggregateId: String, version: Int, access: Map<String, Any?>?)

Records the access attributes of aggregate's aggregateId in tenantId after its commit of version (a stream's, the built-in owner and space among them; null for a commit that recorded none), unless a later version is recorded: the newest commit's are the aggregate's current ones, as the Sink's _state replaces its rows by version.

Link copied to clipboard
fun rows(table: String): List<ObjectNode>

The rows of table, each a fresh tree; none when there is no such table.