Skip to content

Commit

Permalink
Add a class to pass SeqNr and snapshot payload in (#563)
Browse files Browse the repository at this point in the history
* Add a class to pass SeqNr and snapshot payload in.

The main question here is if we want to have `payload` as an `Option` or
require it always to be filled.

This idea of `Option` was taken from a similar `Event` case class, but
I am not sure it applies the same way to a snapshot.

* Remove option wrapper around a payload.

It was inherited from original `Event` code, but it seems that it
was only needed there to ensure backwards compatibility when introducing
JSON payloads and no longer necessary.

See c6d0543 for more details.
  • Loading branch information
rtar authored Feb 8, 2024
1 parent 5534e5f commit 59f2fb6
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.evolutiongaming.kafka.journal

/** Represents a snapshot to be stored or loaded from a storage.
*
* @param seqNr
* Snapshot sequence number.
* @param payload
* Actual contents of a snapshot.
*/
final case class Snapshot[A](
seqNr: SeqNr,
payload: A
)

0 comments on commit 59f2fb6

Please sign in to comment.