Class RetentionCriteria$


  • public class RetentionCriteria$
    extends java.lang.Object
    Criteria for retention/deletion of snapshots and events.
    • Field Detail

      • MODULE$

        public static final RetentionCriteria$ MODULE$
        Static reference to the singleton instance of this Scala object.
    • Constructor Detail

      • RetentionCriteria$

        public RetentionCriteria$()
    • Method Detail

      • disabled

        public RetentionCriteria disabled()
        Snapshots are not saved and deleted automatically, events are not deleted.
      • snapshotEvery

        public SnapshotCountRetentionCriteria snapshotEvery​(int numberOfEvents,
                                                            int keepNSnapshots)
        Save snapshots automatically every numberOfEvents. Snapshots that have sequence number less than sequence number of the saved snapshot minus keepNSnapshots * numberOfEvents are automatically deleted.

        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.

      • snapshotEvery

        public SnapshotCountRetentionCriteria snapshotEvery​(int numberOfEvents)
        Save snapshots automatically every numberOfEvents.

        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.