SnapshotStore

Stores disposable aggregate-state snapshots used to accelerate reconstruction. Event history remains authoritative.

Inheritors

Functions

Link copied to clipboard
abstract suspend fun delete(aggregateId: String, aggregateStateSchemaVersion: AggregateStateSchemaVersion)

Deletes every retained snapshot for one aggregate and aggregateStateSchemaVersion.

Link copied to clipboard
abstract suspend fun deleteAll()

Deletes every snapshot for this store's aggregate type across all schema versions.

abstract suspend fun deleteAll(aggregateStateSchemaVersion: AggregateStateSchemaVersion)

Deletes every snapshot for this store's type and aggregateStateSchemaVersion.

Link copied to clipboard
abstract suspend fun load(aggregateId: String): Snapshot<STATE>?

Loads the newest compatible snapshot for aggregateId.

Link copied to clipboard
open suspend fun loadBefore(aggregateId: String, versionExclusive: Long): Snapshot<STATE>?

Loads the newest compatible snapshot strictly before versionExclusive.

Link copied to clipboard
abstract suspend fun save(snapshot: Snapshot<STATE>, retention: SnapshotRetentionPolicy = SnapshotRetentionPolicy.MaxCount(1))

Saves snapshot and applies retention for its aggregate and state schema.