Merge pull request #28062 from chbatey/clarify-snapshot-every

Clarify snapshop every n events
This commit is contained in:
Patrik Nordwall 2019-11-05 15:48:35 +01:00 committed by GitHub
commit c74e9720f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View file

@ -531,5 +531,6 @@ private[akka] object Running {
@unused event: PersistentRepr): Unit = ()
@InternalStableApi
private[akka] def onWriteSuccess(@unused ctx: ActorContext[_], @unused event: PersistentRepr): Unit = ()
@InternalStableApi
private[akka] def onWriteDone(@unused ctx: ActorContext[_], @unused event: PersistentRepr): Unit = ()
}

View file

@ -32,6 +32,9 @@ object RetentionCriteria {
*
* Use [[SnapshotCountRetentionCriteria.withDeleteEventsOnSnapshot]] to
* delete old events. Events are not deleted by default.
*
* If multiple events are persisted with a single Effect, the snapshot will happen after
* all of the events are persisted rather than precisely every `numberOfEvents`.
*/
def snapshotEvery(numberOfEvents: Int, keepNSnapshots: Int): SnapshotCountRetentionCriteria =
SnapshotCountRetentionCriteriaImpl(numberOfEvents, keepNSnapshots, deleteEventsOnSnapshot = false)

View file

@ -32,6 +32,9 @@ object RetentionCriteria {
*
* Use [[SnapshotCountRetentionCriteria.withDeleteEventsOnSnapshot]] to
* delete old events. Events are not deleted by default.
*
* If multiple events are persisted with a single Effect the snapshot will happen after
* all of the events are persisted rather than precisely every `numberOfEvents`.
*/
def snapshotEvery(numberOfEvents: Int, keepNSnapshots: Int): SnapshotCountRetentionCriteria =
SnapshotCountRetentionCriteriaImpl(numberOfEvents, keepNSnapshots, deleteEventsOnSnapshot = false)