You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pekko.apache.org by fa...@apache.org on 2025/07/30 06:51:48 UTC
(pekko) branch main updated: persistence deprecations (#1966)
This is an automated email from the ASF dual-hosted git repository.
fanningpj pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko.git
The following commit(s) were added to refs/heads/main by this push:
new 1b9c197fd7 persistence deprecations (#1966)
1b9c197fd7 is described below
commit 1b9c197fd732ccc9fbd26e6d6939277a80fd3cf4
Author: PJ Fanning <pj...@users.noreply.github.com>
AuthorDate: Wed Jul 30 07:51:42 2025 +0100
persistence deprecations (#1966)
* persistence deprecations
* Create remove-deprecated-methods.excludes
---
.../typed/serialization/ReplicatedEventSourcing.java | 10 ----------
.../remove-deprecated-methods.excludes | 20 ++++++++++++++++++++
.../typed/internal/EventSourcedBehaviorImpl.scala | 6 ------
.../typed/javadsl/EventSourcedBehavior.scala | 11 -----------
.../typed/scaladsl/EventSourcedBehavior.scala | 12 ------------
5 files changed, 20 insertions(+), 39 deletions(-)
diff --git a/persistence-typed/src/main/java/org/apache/pekko/persistence/typed/serialization/ReplicatedEventSourcing.java b/persistence-typed/src/main/java/org/apache/pekko/persistence/typed/serialization/ReplicatedEventSourcing.java
index caec2a4a51..b60e9300dd 100644
--- a/persistence-typed/src/main/java/org/apache/pekko/persistence/typed/serialization/ReplicatedEventSourcing.java
+++ b/persistence-typed/src/main/java/org/apache/pekko/persistence/typed/serialization/ReplicatedEventSourcing.java
@@ -68,16 +68,6 @@ public final class ReplicatedEventSourcing {
return value;
}
- /**
- * @param value The numeric wire value of the corresponding enum entry.
- * @return The enum associated with the given numeric wire value.
- * @deprecated Use {@link #forNumber(int)} instead.
- */
- @java.lang.Deprecated
- public static ORSetDeltaOp valueOf(int value) {
- return forNumber(value);
- }
-
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
diff --git a/persistence-typed/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes b/persistence-typed/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes
new file mode 100644
index 0000000000..8d56b42621
--- /dev/null
+++ b/persistence-typed/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes
@@ -0,0 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Remove deprecated methods
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.persistence.typed.javadsl.EventSourcedBehavior.snapshotSelectionCriteria")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.persistence.typed.scaladsl.EventSourcedBehavior.withSnapshotSelectionCriteria")
diff --git a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventSourcedBehaviorImpl.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventSourcedBehaviorImpl.scala
index 1baaeccbb6..938fe5187b 100644
--- a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventSourcedBehaviorImpl.scala
+++ b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventSourcedBehaviorImpl.scala
@@ -50,7 +50,6 @@ import pekko.persistence.typed.ReplicaId
import pekko.persistence.typed.SnapshotAdapter
import pekko.persistence.typed.SnapshotCompleted
import pekko.persistence.typed.SnapshotFailed
-import pekko.persistence.typed.SnapshotSelectionCriteria
import pekko.persistence.typed.scaladsl.RetentionCriteria
import pekko.persistence.typed.scaladsl._
import pekko.persistence.typed.scaladsl.{ Recovery => TypedRecovery }
@@ -273,11 +272,6 @@ private[pekko] final case class EventSourcedBehaviorImpl[Command, Event, State](
copy(snapshotPluginConfig = config)
}
- override def withSnapshotSelectionCriteria(
- selection: SnapshotSelectionCriteria): EventSourcedBehavior[Command, Event, State] = {
- copy(recovery = Recovery(selection.toClassic))
- }
-
override def snapshotWhen(predicate: (State, Event, Long) => Boolean): EventSourcedBehavior[Command, Event, State] =
copy(snapshotWhen = predicate)
diff --git a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/EventSourcedBehavior.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/EventSourcedBehavior.scala
index e2383f21ea..d342589d98 100644
--- a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/EventSourcedBehavior.scala
+++ b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/EventSourcedBehavior.scala
@@ -142,17 +142,6 @@ abstract class EventSourcedBehavior[Command, Event, State] private[pekko] (
*/
def snapshotPluginConfig: Optional[Config] = Optional.empty()
- /**
- * Override and define the snapshot selection criteria used by this actor instead of the default.
- * By default the most recent snapshot is used, and the remaining state updates are recovered by replaying events
- * from the sequence number up until which the snapshot reached.
- *
- * You may configure the behavior to skip replaying snapshots completely, in which case the recovery will be
- * performed by replaying all events -- which may take a long time.
- */
- @deprecated("override recovery instead", "Akka 2.6.5")
- def snapshotSelectionCriteria: SnapshotSelectionCriteria = SnapshotSelectionCriteria.latest
-
/**
* Initiates a snapshot if the given predicate evaluates to true.
*
diff --git a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehavior.scala b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehavior.scala
index f3ecdf945e..03ba7714d1 100644
--- a/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehavior.scala
+++ b/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehavior.scala
@@ -28,7 +28,6 @@ import pekko.annotation.InternalApi
import pekko.persistence.typed.EventAdapter
import pekko.persistence.typed.PersistenceId
import pekko.persistence.typed.SnapshotAdapter
-import pekko.persistence.typed.SnapshotSelectionCriteria
import pekko.persistence.typed.internal._
import scala.annotation.tailrec
@@ -177,17 +176,6 @@ object EventSourcedBehavior {
*/
def withSnapshotPluginConfig(id: Option[Config]): EventSourcedBehavior[Command, Event, State]
- /**
- * Changes the snapshot selection criteria used by this behavior.
- * By default the most recent snapshot is used, and the remaining state updates are recovered by replaying events
- * from the sequence number up until which the snapshot reached.
- *
- * You may configure the behavior to skip replaying snapshots completely, in which case the recovery will be
- * performed by replaying all events -- which may take a long time.
- */
- @deprecated("use withRecovery(Recovery.withSnapshotSelectionCriteria(...))", "Akka 2.6.5")
- def withSnapshotSelectionCriteria(selection: SnapshotSelectionCriteria): EventSourcedBehavior[Command, Event, State]
-
/**
* Initiates a snapshot if the given `predicate` evaluates to true.
*
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org