Packages

final class EventSourcedCleanup extends AnyRef

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.

Annotations
@ApiMayChange()
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. EventSourcedCleanup
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new EventSourcedCleanup(systemProvider: ClassicActorSystemProvider)
  2. new EventSourcedCleanup(systemProvider: ClassicActorSystemProvider, configPath: String)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def cleanupBeforeSnapshot(persistenceIds: List[String]): CompletionStage[Done]

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

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

    Deletes all events for the given persistence id from before the snapshot.

    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.

  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  8. def deleteAll(persistenceIds: List[String], resetSequenceNumber: Boolean): CompletionStage[Done]

    Delete everything related to the given list of persistenceIds.

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

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

    Delete everything related to one single persistenceId.

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

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

    Delete all events related to the given list of persistenceIds.

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

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

    Delete all events related to one single persistenceId.

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

  12. def deleteEventsBefore(entityType: String, slice: Int, timestamp: Instant): CompletionStage[Done]

    Delete events before a timestamp for the given entityType and slice.

    Delete events before a timestamp for the given entityType and slice. Snapshots are not deleted.

    This can be useful for DurableStateBehavior with change events, where the events are only used for the Projections and not for the recovery of the DurableStateBehavior state. The timestamp may correspond to the offset timestamp of the Projections, if events are not needed after all Projections have processed them.

    Be aware of that if all events of a persistenceId are removed the sequence number will start from 1 again if an EventSourcedBehavior with the same persistenceId is used again.

    entityType

    the entity type to delete for

    slice

    the slice to delete for

    timestamp

    timestamp (exclusive) to delete up to

  13. def deleteEventsBefore(persistenceId: String, timestamp: Instant): CompletionStage[Done]

    Delete events before a timestamp for the given persistence id.

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

    This can be useful for DurableStateBehavior with change events, where the events are only used for the Projections and not for the recovery of the DurableStateBehavior state. The timestamp may correspond to the offset timestamp of the Projections, if events are not needed after all Projections have processed them.

    Be aware of that if all events of a persistenceId are removed the sequence number will start from 1 again if an EventSourcedBehavior with the same persistenceId is used again.

    persistenceId

    the persistence id to delete for

    timestamp

    timestamp (exclusive) to delete up to

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

    Delete all events before a sequenceNr for the given persistence id.

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

    persistenceId

    the persistence id to delete for

    toSequenceNr

    sequence nr (inclusive) to delete up to

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

    Delete snapshots related to one single persistenceId.

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

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

    Delete all snapshots related to the given list of persistenceIds.

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

  17. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  19. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  20. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  21. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  22. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  23. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  24. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  25. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  26. def toString(): String
    Definition Classes
    AnyRef → Any
  27. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  28. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  29. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from AnyRef

Inherited from Any

Ungrouped