SnapshotStore

interface SnapshotStore : Named

Store for saving and loading snapshots of state aggregates. Snapshots optimize aggregate loading by providing a recent state checkpoint.

Inheritors

Properties

Link copied to clipboard
abstract val name: String

Functions

Link copied to clipboard
open fun getVersion(aggregateId: AggregateId): Mono<Int>

Gets the version of the latest snapshot for the specified aggregate. Returns UNINITIALIZED_VERSION if no snapshot exists.

Link copied to clipboard
abstract fun <S : Any> load(aggregateId: AggregateId): Mono<Snapshot<S>>

Loads the latest snapshot for the specified aggregate.

Link copied to clipboard

Wraps a SnapshotStore with metrics collection capabilities. Returns a MetricSnapshotStore that collects metrics on snapshot storage operations.

Link copied to clipboard
abstract fun <S : Any> save(snapshot: Snapshot<S>): Mono<Void>

Saves a snapshot to the store.