InMemorySnapshotStore

In-memory implementation of SnapshotStore for testing and development. Stores snapshots as detached JSON trees in a thread-safe map.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val name: String

The name of this repository.

Functions

Link copied to clipboard
open override fun close()

Closes this snapshot store and releases owned resources.

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
open override fun <S : Any> load(aggregateId: AggregateId): Mono<Snapshot<S>>

Loads a snapshot from the in-memory map by deserializing the JSON tree.

Link copied to clipboard

Wraps a SnapshotStore with metrics collection capabilities. Returns a MetricSnapshotStore that collects metrics on snapshot storage operations. RoutingSnapshotStore remains transparent because the selected leaf store owns storage metrics.

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

Saves a snapshot to the in-memory map by serializing it to JSON. The atomic map computation ignores candidates older than the stored snapshot.