Package-level declarations

Types

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

Where the subscriptions of one log group of a context keep their checkpoints, group's over log, and park their aggregates (ledger).

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, val skips: MaintenanceSkips? = null) : SnapshotStatus

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

Link copied to clipboard
class SnapshotOptions @InternalWowApi constructor(val maintenanceInterval: Duration = DEFAULT_MAINTENANCE_INTERVAL, val rebuildPageSize: Int = DEFAULT_REBUILD_PAGE_SIZE, val rebuildMaxPages: Int = DEFAULT_REBUILD_MAX_PAGES, val leaseTtl: Duration = DEFAULT_TTL, val memberTtl: Duration = DEFAULT_TTL, val writeBatch: Int = DEFAULT_WRITE_BATCH, val loadTimeout: Duration = KernelOptions.DEFAULT_SNAPSHOT_LOAD_TIMEOUT, val writesInFlight: Int? = null)

The tuning of each context's SnapshotMaintenance: it runs every maintenanceInterval; an in-place rebuild rewrites rebuildPageSize snapshots a page, at most rebuildMaxPages pages a run, under a lease of leaseTtl; a node is a member of its state revision from when it is ready to join until it stops, heartbeated every third of memberTtl whatever its runs take, and stays one for memberTtl after its last heartbeat, so a rollback waits up to that long after the last node of the higher revision is gone (none when it leaves gracefully). A node on standby has its prepare's one heartbeat only: memberTtl after its start, a node of a lower revision rolls its claim back. The snapshot subscriptions write at most writeBatch snapshots of a partition with one me.ahoo.wow.spi.snapshot.SnapshotStore.saveAll. A command's cache miss, and a shared state's, waits at most loadTimeout for a snapshot before it replays the log (me.ahoo.wow.kernel.KernelOptions.snapshotLoadTimeout). With writesInFlight, the subscriptions run that many writes at once over the store's own me.ahoo.wow.spi.snapshot.SnapshotStore.writesInFlight: a seam for measuring the count, bound to no configuration and internal like the constructor; null, the store's. Once the writes follow their backlog it fixes the count, steady and behind alike.

Link copied to clipboard
class SnapshotPlacement(val store: String, val copy: String? = null, val generation: Int = 1, val copyGeneration: Int = 1)

Where an aggregate type's snapshots are written: its store, the one the write side reads as its cache and its state reads read, and, when its queries read another, that store's copy, written by a subscription of its own.

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.RebuildSnapshot(ids): it commits wow.snapshot.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; and the store that target's table was removed from under its record (removedFrom), so a query of them is refused.

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 = SystemSubscriptions.SNAPSHOT, answers: (AggregateType) -> Set<String> = { OWN_AND_QUERIED }, active: (AggregateType) -> Boolean = { true }, writeBatch: Int = SnapshotOptions.DEFAULT_WRITE_BATCH, writesInFlight: Int? = null, 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(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.

Link copied to clipboard

What a snapshot subscription's writes (SnapshotWrites) did, from the first SnapshotSubscription.writeCounts on: a diagnostic, which the writes keep only once something reads it.