Package-level declarations

Types

Link copied to clipboard
class LogProgress(val group: String, val log: EventLog, val checkpoints: CheckpointStore)

Where the subscriptions of one log group of a context keep their checkpoints: group's, over log.

Link copied to clipboard

The state of one rebuild instance: how many rebuild requests it took.

Link copied to clipboard
class SnapshotMaintenance(val context: String, group: String, node: String, models: Collection<AggregateModel<*>>, val targets: SnapshotTargets, kernel: Kernel, codec: EventCodec, log: EventLog, leases: LeaseStore, progress: List<LogProgress>, options: SnapshotOptions = SnapshotOptions(), address: () -> String = { node }, observer: Observer = Observer.NONE, gate: ReplayGate = ReplayGate.OPEN) : SnapshotStatus

Keeps the snapshot targets of one bounded context in step with the log and the code, on every node, every SnapshotOptions.interval:

Link copied to clipboard
class SnapshotOptions @InternalWowApi constructor(val interval: Duration = DEFAULT_INTERVAL, val batch: Int = DEFAULT_BATCH, val pages: Int = DEFAULT_PAGES, val leaseTtl: Duration = DEFAULT_TTL, val memberTtl: Duration = DEFAULT_TTL, val writeBatch: Int = DEFAULT_WRITE_BATCH)

The tuning of each context's SnapshotMaintenance: it runs every interval; an in-place rebuild rewrites batch snapshots a page, at most pages pages a run, under a lease of leaseTtl; a node stays a member of its state revision for memberTtl after its last run, so a rollback waits that long after the last node of the higher revision is gone (none when it leaves gracefully). The snapshot subscriptions write at most writeBatch snapshots of a partition with one me.ahoo.wow.spi.snapshot.SnapshotStore.saveAll.

Link copied to clipboard
class SnapshotPlacement @InternalWowApi constructor(val targets: List<String>, val primary: String = targets.firstOrNull().orEmpty())

Where an aggregate type's snapshots are written: its targets, the names of the stores that each keep them, and its primary, the one the write side reads as its cache and queries read.

Link copied to clipboard

The built-in aggregate that takes a context's snapshot rebuild requests: <context>.snapshot, one instance per snapshotted aggregate type in each tenant, whose id is the aggregate type's name. It belongs to its tenant (no owner), has no lifecycle commands and no snapshots of its own, and decides wow.snapshot.Rebuild(ids): it commits wow.SnapshotRebuildRequested(ids), each id once, which the built-in rebuild subscription (SnapshotMaintenance.REBUILD_SUBSCRIPTION) carries out. A request to an instance that is no snapshotted aggregate type of the context is rejected with FrameworkCodes.COMMAND_INVALID.

Link copied to clipboard

Whether the snapshots of an aggregate type are being rebuilt or backfilled: its primary target is not caught up, so a query of them answers with rebuilding.

Link copied to clipboard

The snapshots of a context whose aggregate types keep them on different stores: each aggregate's snapshot is in the store stores names for its type, else in default.

Link copied to clipboard
class SnapshotSubscription(context: String, models: Collection<AggregateModel<*>>, store: SnapshotStore, kernel: Kernel, log: EventLog, codec: EventCodec = EventCodec(), views: SharedStates? = null, capacity: Int = SharedStateOptions.DEFAULT_CAPACITY, val name: String = Hop.SNAPSHOT_SUBSCRIPTION, answers: (AggregateType) -> Boolean = { true }, active: (AggregateType) -> Boolean = { true }, writeBatch: Int = SnapshotOptions.DEFAULT_WRITE_BATCH, gate: ReplayGate = ReplayGate.OPEN)

The built-in wow.snapshot subscription of one bounded context: keeps the latest snapshot of every aggregate of the models given, the aggregate types whose snapshots are enabled. Register subscription in the context's me.ahoo.wow.runtime.subscription.SubscriptionRuntime and give views to the me.ahoo.wow.runtime.Executor: it then runs on each partition's owner, checkpoints, parks and signals like any subscription, and completes the default wait, snapshot (handled(wow.snapshot)). An aggregate type not among models has no snapshot, and its default wait is committed.

Link copied to clipboard
class SnapshotTargets(val default: String, val stores: Map<String, SnapshotStore>, placements: Map<AggregateType, SnapshotPlacement> = emptyMap(), val fallback: SnapshotPlacement = SnapshotPlacement(listOf(default)))

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.