diff --git a/core/src/main/scala/akka/persistence/dynamodb/internal/TimestampOffsetBySlice.scala b/core/src/main/scala/akka/persistence/dynamodb/internal/TimestampOffsetBySlice.scala deleted file mode 100644 index 1ac4e7b..0000000 --- a/core/src/main/scala/akka/persistence/dynamodb/internal/TimestampOffsetBySlice.scala +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2024 Lightbend Inc. - */ - -package akka.persistence.dynamodb.internal - -import akka.annotation.InternalApi -import akka.persistence.query.Offset -import akka.persistence.query.TimestampOffset - -// FIXME maybe move to akka-persistence-query if it should be shared with r2dbc - -/** - * INTERNAL API - */ -@InternalApi private[akka] object TimestampOffsetBySlice { - val empty: TimestampOffsetBySlice = new TimestampOffsetBySlice(Map.empty) - - def apply(offsets: Map[Int, TimestampOffset]): TimestampOffsetBySlice = - new TimestampOffsetBySlice(offsets) - -} - -/** - * INTERNAL API - */ -@InternalApi private[akka] class TimestampOffsetBySlice(val offsets: Map[Int, TimestampOffset]) extends Offset { - override def toString = s"TimestampOffsetBySlice($offsets)" -} diff --git a/core/src/main/scala/akka/persistence/dynamodb/query/scaladsl/DynamoDBReadJournal.scala b/core/src/main/scala/akka/persistence/dynamodb/query/scaladsl/DynamoDBReadJournal.scala index 9e113f5..e00de68 100644 --- a/core/src/main/scala/akka/persistence/dynamodb/query/scaladsl/DynamoDBReadJournal.scala +++ b/core/src/main/scala/akka/persistence/dynamodb/query/scaladsl/DynamoDBReadJournal.scala @@ -27,11 +27,11 @@ import akka.persistence.dynamodb.internal.SerializedJournalItem import akka.persistence.dynamodb.internal.SerializedSnapshotItem import akka.persistence.dynamodb.internal.SnapshotDao import akka.persistence.dynamodb.internal.StartingFromSnapshotStage -import akka.persistence.dynamodb.internal.TimestampOffsetBySlice import akka.persistence.dynamodb.util.ClientProvider import akka.persistence.query.NoOffset import akka.persistence.query.Offset import akka.persistence.query.TimestampOffset +import akka.persistence.query.TimestampOffsetBySlice import akka.persistence.query.scaladsl._ import akka.persistence.query.typed.EventEnvelope import akka.persistence.query.typed.scaladsl.CurrentEventsBySliceQuery @@ -227,8 +227,8 @@ final class DynamoDBReadJournal(system: ExtendedActorSystem, config: Config, cfg private def sliceStartOffset(slice: Int, offset: Offset): Offset = { offset match { - case offsetBySlice: TimestampOffsetBySlice => offsetBySlice.offsets.getOrElse(slice, NoOffset) - case _ => offset + case TimestampOffsetBySlice(offsets) => offsets.getOrElse(slice, NoOffset) + case _ => offset } } diff --git a/project/Dependencies.scala b/project/Dependencies.scala index b8af49f..9749562 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -9,7 +9,7 @@ object Dependencies { val Scala3 = "3.3.3" val Scala2Versions = Seq(Scala213) val ScalaVersions = Dependencies.Scala2Versions :+ Dependencies.Scala3 - val AkkaVersion = System.getProperty("override.akka.version", "2.9.4") + val AkkaVersion = System.getProperty("override.akka.version", "2.9.5") val AkkaVersionInDocs = VersionNumber(AkkaVersion).numbers match { case Seq(major, minor, _*) => s"$major.$minor" } val AkkaProjectionVersion = "1.5.4" val AkkaProjectionVersionInDocs = "current" diff --git a/projection/src/main/scala/akka/projection/dynamodb/internal/DynamoDBOffsetStore.scala b/projection/src/main/scala/akka/projection/dynamodb/internal/DynamoDBOffsetStore.scala index 89067a0..07340f8 100644 --- a/projection/src/main/scala/akka/projection/dynamodb/internal/DynamoDBOffsetStore.scala +++ b/projection/src/main/scala/akka/projection/dynamodb/internal/DynamoDBOffsetStore.scala @@ -19,10 +19,10 @@ import akka.annotation.InternalApi import akka.dispatch.ExecutionContexts import akka.persistence.Persistence import akka.persistence.dynamodb.internal.EnvelopeOrigin -import akka.persistence.dynamodb.internal.TimestampOffsetBySlice import akka.persistence.query.DeletedDurableState import akka.persistence.query.DurableStateChange import akka.persistence.query.TimestampOffset +import akka.persistence.query.TimestampOffsetBySlice import akka.persistence.query.UpdatedDurableState import akka.persistence.query.typed.EventEnvelope import akka.persistence.query.typed.scaladsl.EventTimestampQuery diff --git a/projection/src/test/scala/akka/projection/dynamodb/DynamoDBTimestampOffsetProjectionSpec.scala b/projection/src/test/scala/akka/projection/dynamodb/DynamoDBTimestampOffsetProjectionSpec.scala index 2428a4b..a5c1530 100644 --- a/projection/src/test/scala/akka/projection/dynamodb/DynamoDBTimestampOffsetProjectionSpec.scala +++ b/projection/src/test/scala/akka/projection/dynamodb/DynamoDBTimestampOffsetProjectionSpec.scala @@ -33,9 +33,9 @@ import akka.actor.typed.ActorRef import akka.actor.typed.ActorSystem import akka.dispatch.ExecutionContexts import akka.persistence.dynamodb.internal.EnvelopeOrigin -import akka.persistence.dynamodb.internal.TimestampOffsetBySlice import akka.persistence.query.Offset import akka.persistence.query.TimestampOffset +import akka.persistence.query.TimestampOffsetBySlice import akka.persistence.query.typed.EventEnvelope import akka.persistence.query.typed.scaladsl.EventTimestampQuery import akka.persistence.query.typed.scaladsl.LoadEventQuery diff --git a/projection/src/test/scala/akka/projection/dynamodb/DynamoDBTimestampOffsetStoreSpec.scala b/projection/src/test/scala/akka/projection/dynamodb/DynamoDBTimestampOffsetStoreSpec.scala index 4a4761b..cb8b5dd 100644 --- a/projection/src/test/scala/akka/projection/dynamodb/DynamoDBTimestampOffsetStoreSpec.scala +++ b/projection/src/test/scala/akka/projection/dynamodb/DynamoDBTimestampOffsetStoreSpec.scala @@ -16,8 +16,8 @@ import akka.actor.testkit.typed.scaladsl.LogCapturing import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import akka.actor.typed.ActorSystem import akka.persistence.dynamodb.internal.EnvelopeOrigin -import akka.persistence.dynamodb.internal.TimestampOffsetBySlice import akka.persistence.query.TimestampOffset +import akka.persistence.query.TimestampOffsetBySlice import akka.persistence.query.UpdatedDurableState import akka.persistence.query.typed.EventEnvelope import akka.persistence.query.typed.scaladsl.EventTimestampQuery