SnapshotTargets

class SnapshotTargets(val default: String, val stores: Map<String, SnapshotStore>, placements: Map<AggregateType, SnapshotPlacement> = emptyMap(), val fallback: SnapshotPlacement = SnapshotPlacement(default), loading: Map<String, SnapshotStore> = stores)

The snapshot targets of one bounded context: its snapshot stores by name, and the placement of each aggregate type, fallback for a type that has none: by default the default store alone.

Each store has a built-in subscription, with its own checkpoints, which writes the snapshots of every type it is a target of, as the type's own store or as its copy (subscriptionOf): wow.snapshot for the default store, and wow.snapshot:<store> for each other one. A store keeps its subscription, and its checkpoints, whatever role it plays for which type. The snapshot hop of a wait is the subscription of the type's own store; no caller spells a store's subscription in a wait.

A cache miss loads each type's snapshot from its own store as loading holds it (loads): the store as it is, or behind a gate that skips its loads while it does not answer (withLoads).

Constructors

Link copied to clipboard
constructor(default: String, stores: Map<String, SnapshotStore>, placements: Map<AggregateType, SnapshotPlacement> = emptyMap(), fallback: SnapshotPlacement = SnapshotPlacement(default), loading: Map<String, SnapshotStore> = stores)

Types

Link copied to clipboard

Properties

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

primary as a cache miss loads it, the kernel's and the shared states' reads that replay the log for a load that fails: each type's own store as loading holds it.

Link copied to clipboard

The snapshots each type's own store keeps: what the state reads and the write side read.

Link copied to clipboard

Functions

Link copied to clipboard
fun generationOf(store: String, type: AggregateType): Int

The configured generation of type's table in store (SnapshotPlacement.generationOf).

Link copied to clipboard

Where type's snapshots are written.

Link copied to clipboard

The store type's snapshots are read from by its commands and its state reads: its own.

Link copied to clipboard

The subscription of type's own store: the one whose handling ends a wait's snapshot hop.

Link copied to clipboard

The subscription that writes the store type's queries read: its copy's when it has one, else its own's.

Link copied to clipboard

The stores that are a target of one of types, each with the types it keeps, own or copied, in the order of stores: what the maintenance claims and rebuilds.

Link copied to clipboard

The subscription that writes the snapshots store keeps, own or copied: wow.snapshot for the default store, wow.snapshot:<store> for another.

Link copied to clipboard

These targets, each store's cache-miss loads through what gate makes of it, by the store's name.