Skip to content

Commit 83b1b31

Browse files
pjfanningCopilot
andauthored
fix javadoc durable state deleteobject (#2972)
* fix: clarify deleteObject revision must be expected next revision (current + 1) in docs Agent-Logs-Url: https://github.com/pjfanning/incubator-pekko/sessions/e855d7d3-4827-4438-9c9d-8f288f2f0c4d Co-authored-by: pjfanning <11783444+pjfanning@users.noreply.github.com> * further changes --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pjfanning <11783444+pjfanning@users.noreply.github.com>
1 parent fd5b64e commit 83b1b31

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

persistence/src/main/scala/org/apache/pekko/persistence/state/javadsl/DurableStateUpdateStore.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,15 @@ trait DurableStateUpdateStore[A] extends DurableStateStore[A] {
5050
* Delete the object with the given `persistenceId` and `revision`.
5151
*
5252
* <p>
53-
* Since Pekko v1.1, if the revision does not match the current revision
53+
* If the revision does not match the expected revision
5454
* of the object, the delete operation will fail. The returned CompletionStage
5555
* will complete with a failed result wrapping the exception.
5656
* </p>
5757
*
5858
* @param persistenceId the persistenceId of the object to delete
59-
* @param revision the revision of the object to delete
60-
* @return a CompletionStage that completes when the object has been deleted
59+
* @param revision the expected next revision for the `persistenceId` — this must be one more than
60+
* the current (existing) revision of the object
61+
* @return a CompletionStage that completes when the object has been deleted or fails if the revision does not match the expected revision of the object
6162
*/
6263
def deleteObject(persistenceId: String, revision: Long): CompletionStage[Done]
6364
}

persistence/src/main/scala/org/apache/pekko/persistence/state/scaladsl/DurableStateUpdateStore.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,15 @@ trait DurableStateUpdateStore[A] extends DurableStateStore[A] {
5050
* Delete the object with the given `persistenceId` and `revision`.
5151
*
5252
* <p>
53-
* Since Pekko v1.1, if the revision does not match the current revision
53+
* If the revision does not match the expected revision
5454
* of the object, the delete operation will fail. The returned Future
5555
* will complete with a failed result wrapping the exception.
5656
* </p>
5757
*
5858
* @param persistenceId the persistenceId of the object to delete
59-
* @param revision the revision of the object to delete
60-
* @return a Future that completes when the object has been deleted
59+
* @param revision the expected next revision for the `persistenceId` — this must be one more than
60+
* the current (existing) revision of the object
61+
* @return a Future that completes when the object has been deleted or fails if the revision does not match the expected revision of the object
6162
*/
6263
def deleteObject(persistenceId: String, revision: Long): Future[Done]
6364
}

0 commit comments

Comments
 (0)