EventSourcedCleanup

akka.persistence.r2dbc.cleanup.javadsl.EventSourcedCleanup
@ApiMayChange

Java API: Tool for deleting all events and/or snapshots for a given list of persistenceIds without using persistent actors. It's important that the actors with corresponding persistenceId are not running at the same time as using the tool.

WARNING: deleting events is generally discouraged in event sourced systems.

If resetSequenceNumber is true then the creating entity with the same persistenceId will start from 0. Otherwise it will continue from the latest highest used sequence number.

WARNING: reusing the same persistenceId after resetting the sequence number should be avoided, since it might be confusing to reuse the same sequence number for new events.

When a list of persistenceIds are given they are deleted sequentially in the order of the list. It's possible to parallelize the deletes by running several cleanup operations at the same time operating on different sets of persistenceIds.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Constructors

def this(systemProvider: ClassicActorSystemProvider, configPath: String)
def this(systemProvider: ClassicActorSystemProvider)

Concrete methods

def cleanupBeforeSnapshot(persistenceId: String): CompletionStage[Done]

Deletes all events for the given persistence id from before the snapshot. The snapshot is not deleted. The event with the same sequence number as the remaining snapshot is deleted.

Deletes all events for the given persistence id from before the snapshot. The snapshot is not deleted. The event with the same sequence number as the remaining snapshot is deleted.

Attributes

def cleanupBeforeSnapshot(persistenceIds: List[String]): CompletionStage[Done]

See single persistenceId overload for what is done for each persistence id

See single persistenceId overload for what is done for each persistence id

Attributes

def deleteAll(persistenceId: String, resetSequenceNumber: Boolean): CompletionStage[Done]

Delete everything related to one single persistenceId. All events and snapshots are deleted.

Delete everything related to one single persistenceId. All events and snapshots are deleted.

Attributes

def deleteAll(persistenceIds: List[String], resetSequenceNumber: Boolean): CompletionStage[Done]

Delete everything related to the given list of persistenceIds. All events and snapshots are deleted.

Delete everything related to the given list of persistenceIds. All events and snapshots are deleted.

Attributes

def deleteAllEvents(persistenceId: String, resetSequenceNumber: Boolean): CompletionStage[Done]

Delete all events related to one single persistenceId. Snapshots are not deleted.

Delete all events related to one single persistenceId. Snapshots are not deleted.

Attributes

def deleteAllEvents(persistenceIds: List[String], resetSequenceNumber: Boolean): CompletionStage[Done]

Delete all events related to the given list of persistenceIds. Snapshots are not deleted.

Delete all events related to the given list of persistenceIds. Snapshots are not deleted.

Attributes

def deleteEventsTo(persistenceId: String, toSequenceNr: Long): CompletionStage[Done]

Delete all events before a sequenceNr for the given persistence id. Snapshots are not deleted.

Delete all events before a sequenceNr for the given persistence id. Snapshots are not deleted.

Attributes

persistenceId

the persistence id to delete for

toSequenceNr

sequence nr (inclusive) to delete up to

def deleteSnapshot(persistenceId: String): CompletionStage[Done]

Delete snapshots related to one single persistenceId. Events are not deleted.

Delete snapshots related to one single persistenceId. Events are not deleted.

Attributes

def deleteSnapshots(persistenceIds: List[String]): CompletionStage[Done]

Delete all snapshots related to the given list of persistenceIds. Events are not deleted.

Delete all snapshots related to the given list of persistenceIds. Events are not deleted.

Attributes