Skip to content

Commit

Permalink
revert rename of SnapshotterInterop as it collides with one in akka…
Browse files Browse the repository at this point in the history
…-effect (revert 467188f)
  • Loading branch information
mr-git committed Nov 6, 2024
1 parent 655a4b3 commit eac95ac
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
package akka.persistence

import akka.persistence.SnapshotProtocol.SaveSnapshot
import com.evolutiongaming.safeakka
import com.evolutiongaming.safeakka.persistence.SeqNr

/*
The class has been renamed to SnapshotterInterop by Yaroslav Klymko after 3.0.0 release, but the changes never got
to release.
The class has been restored with deprecation to satisfy MiMa bincompat report.
*/

@deprecated(message = "use SnapshotterInterop", since = "3.1.0")
object SnapshotterFromPersistenceSnapshotter {
def apply[A](snapshotter: Snapshotter): safeakka.persistence.Snapshotter[A] = SnapshotterInterop.apply(snapshotter)
}

def apply[A](
snapshotter: Snapshotter
): safeakka.persistence.Snapshotter[A] = new safeakka.persistence.Snapshotter[A] {

def save(snapshot: A) = snapshotter.saveSnapshot(snapshot)

def save(seqNr: SeqNr, snapshot: A) = {
val saveSnapshot = SaveSnapshot(SnapshotMetadata(snapshotter.snapshotterId, seqNr), snapshot)
snapshotter.snapshotStore.tell(saveSnapshot, snapshotter.self)
}

def delete(seqNr: SeqNr) = snapshotter.deleteSnapshot(seqNr)

def delete(criteria: SnapshotSelectionCriteria) = snapshotter.deleteSnapshots(criteria)
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ object Snapshotter {


def apply[S](snapshotter: akka.persistence.Snapshotter): Snapshotter[S] = {
SnapshotterInterop(snapshotter)
SnapshotterFromPersistenceSnapshotter(snapshotter)
}


Expand Down

0 comments on commit eac95ac

Please sign in to comment.