Package-level declarations

Types

Link copied to clipboard

Stable serialization schema for one aggregate state type.

Link copied to clipboard
Link copied to clipboard
data class Snapshot<out STATE : AggregateState>(val aggregateType: String, val aggregateId: String, val version: Long, val aggregateStateSchemaVersion: AggregateStateSchemaVersion, val sourceEventOccurredAt: Instant, val sourceEventPreparedAt: Instant, val generatedAt: Instant, val state: STATE)

A versioned derived state image for one aggregate stream.

Link copied to clipboard

Determines which aggregate versions should be snapshotted.

Link copied to clipboard
data class SnapshotDefinition<STATE : AggregateState, STATE_PERSISTED : Any>(val stateSchema: AggregateStateSchema<STATE, STATE_PERSISTED>, val strategy: SnapshotCreationPolicy, val retention: SnapshotRetentionPolicy = SnapshotRetentionPolicy.MaxCount(1))

Shared snapshot schema and scheduling policy for readers and maintainers.

Link copied to clipboard
data class SnapshotEveryNVersions(val versionIncrements: Long = 100) : SnapshotCreationPolicy

Snapshots every versionIncrements aggregate versions. Never the first event (version 0): a load replays it as cheaply as it reads a snapshot, so most aggregates, which never grow past a few events, write none.

Link copied to clipboard

Prepares a stopped snapshot runner to seed all aggregate state from a full committed replay.

Link copied to clipboard
class SnapshotMaintainer<STATE : AggregateState, EVENT, CHECKPOINT : Checkpoint>(aggregate: AggregateStateDefinition<STATE, EVENT>, eventStore: AggregateEventStoreRead<EVENT>, snapshotStore: SnapshotStore<STATE>, definition: SnapshotDefinition<STATE, *>, maxCachedAggregates: Int, clock: Clock = Clock.System) : EventSubscriber<EVENT, CHECKPOINT>

Checkpointed asynchronous projection that derives snapshots from committed events.

Link copied to clipboard
class SnapshotMaintenanceException(val aggregateId: String, val version: Long, cause: Throwable) : RuntimeException
Link copied to clipboard
class SnapshotMaintenanceOperations<STATE : AggregateState, EVENT>(aggregate: AggregateStateDefinition<STATE, EVENT>, stateSchemaVersion: AggregateStateSchemaVersion, eventStore: AggregateEventStoreRead<EVENT>, snapshotStore: SnapshotStore<STATE>, retention: SnapshotRetentionPolicy = SnapshotRetentionPolicy.MaxCount(1), clock: Clock = Clock.System)

Explicit operator-facing rebuild, delete, and verification operations for snapshots.

Link copied to clipboard
Link copied to clipboard
sealed interface SnapshotRetentionPolicy
Link copied to clipboard

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

Link copied to clipboard

Stable subscription identity for one aggregate state's snapshot projection.

Link copied to clipboard