Packages

final class EventSourcedCleanup extends AnyRef

Java API: Tool for deleting or setting expiration (time to live) of events and/or snapshots for a given list of persistenceIds without using persistent actors.

When running an operation with EventSourcedCleanup that deletes all events for a persistence id, the actor with that persistence id must not be running! If the actor is restarted it would in that case be recovered to the wrong state since the stored events have been deleted. Delete events before snapshot can still be used while the actor is running.

If resetSequenceNumber is true then an entity created 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 same order as the list. It's possible to parallelize the deletes by running several cleanup operations at the same time, each operating on different sets of persistenceIds.

Annotations
@ApiMayChange()
Linear Supertypes
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.

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

    persistenceIds

    the persistence ids to delete for

  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.

    persistenceId

    the persistence id to delete for

  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @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.

    persistenceIds

    the persistence ids to delete for

    resetSequenceNumber

    whether the entity will start from zero again, or continue from highest sequence number

  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.

    persistenceId

    the persistence id to delete for

    resetSequenceNumber

    whether the entity will start from zero again, or continue from highest sequence number

  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.

    persistenceIds

    the persistence ids to delete for

    resetSequenceNumber

    whether the entities will start from zero again, or continue from highest sequence number

  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.

    persistenceId

    the persistence id to delete for

    resetSequenceNumber

    whether the entity will start from zero again, or continue from highest sequence number

  12. 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

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

    Delete snapshots related to one single persistenceId.

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

    persistenceId

    the persistence id to delete for

  14. 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.

    persistenceIds

    the persistence ids to delete for

  15. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  17. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  19. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  20. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  23. def setExpiryForAllEvents(persistenceIds: List[String], resetSequenceNumber: Boolean, timeToLive: Duration): CompletionStage[Done]

    Set expiry (time to live) for all events related to the given list of persistenceIds.

    Set expiry (time to live) for all events related to the given list of persistenceIds. Snapshots do not have expiry set.

    persistenceIds

    the persistence ids to delete for

    resetSequenceNumber

    whether the entities will start from zero again, or continue from highest sequence number

    timeToLive

    time-to-live duration from now

  24. def setExpiryForAllEvents(persistenceIds: List[String], resetSequenceNumber: Boolean, expiryTimestamp: Instant): CompletionStage[Done]

    Set expiry (time to live) for all events related to the given list of persistenceIds.

    Set expiry (time to live) for all events related to the given list of persistenceIds. Snapshots do not have expiry set.

    persistenceIds

    the persistence ids to delete for

    resetSequenceNumber

    whether the entities will start from zero again, or continue from highest sequence number

    expiryTimestamp

    expiration timestamp to set on all events

  25. def setExpiryForAllEvents(persistenceId: String, resetSequenceNumber: Boolean, timeToLive: Duration): CompletionStage[Done]

    Set expiry (time to live) for all events related to a single persistence id.

    Set expiry (time to live) for all events related to a single persistence id. Snapshots do not have expiry set.

    persistenceId

    the persistence id to set expiry for

    resetSequenceNumber

    whether the entity will start from zero again, or continue from highest sequence number

    timeToLive

    time-to-live duration from now

  26. def setExpiryForAllEvents(persistenceId: String, resetSequenceNumber: Boolean, expiryTimestamp: Instant): CompletionStage[Done]

    Set expiry (time to live) for all events related to a single persistence id.

    Set expiry (time to live) for all events related to a single persistence id. Snapshots do not have expiry set.

    persistenceId

    the persistence id to set expiry for

    resetSequenceNumber

    whether the entity will start from zero again, or continue from highest sequence number

    expiryTimestamp

    expiration timestamp to set on all events

  27. def setExpiryForAllEventsAndSnapshot(persistenceId: String, resetSequenceNumber: Boolean, timeToLive: Duration): CompletionStage[Done]

    Set expiry for everything related to a single persistence id.

    Set expiry for everything related to a single persistence id. All events and the snapshot have expiry set.

    persistenceId

    the persistence id to delete for

    resetSequenceNumber

    whether the entity will start from zero again, or continue from highest sequence number

    timeToLive

    time-to-live duration from now

  28. def setExpiryForAllEventsAndSnapshot(persistenceId: String, resetSequenceNumber: Boolean, expiryTimestamp: Instant): CompletionStage[Done]

    Set expiry for everything related to a single persistence id.

    Set expiry for everything related to a single persistence id. All events and the snapshot have expiry set.

    persistenceId

    the persistence id to delete for

    resetSequenceNumber

    whether the entity will start from zero again, or continue from highest sequence number

    expiryTimestamp

    expiration timestamp to set on all events before snapshot

  29. def setExpiryForAllEventsAndSnapshots(persistenceIds: List[String], resetSequenceNumber: Boolean, timeToLive: Duration): CompletionStage[Done]

    Set expiry for everything related to the given persistence ids.

    Set expiry for everything related to the given persistence ids. All events and snapshots have expiry set.

    persistenceIds

    the persistence ids to delete for

    resetSequenceNumber

    whether the entity will start from zero again, or continue from highest sequence number

    timeToLive

    time-to-live duration from now

  30. def setExpiryForAllEventsAndSnapshots(persistenceIds: List[String], resetSequenceNumber: Boolean, expiryTimestamp: Instant): CompletionStage[Done]

    Set expiry for everything related to the given persistence ids.

    Set expiry for everything related to the given persistence ids. All events and snapshots have expiry set.

    persistenceIds

    the persistence ids to delete for

    resetSequenceNumber

    whether the entity will start from zero again, or continue from highest sequence number

    expiryTimestamp

    expiration timestamp to set on all events before snapshot

  31. def setExpiryForEvents(persistenceId: String, toSequenceNr: Long, timeToLive: Duration): CompletionStage[Done]

    Set expiry (time to live) for all events up to a sequence number for the given persistence id.

    Set expiry (time to live) for all events up to a sequence number for the given persistence id. Snapshots do not have expiry set.

    persistenceId

    the persistence id to set expiry for

    toSequenceNr

    sequence number (inclusive) to set expiry

    timeToLive

    time-to-live duration from now

  32. def setExpiryForEvents(persistenceId: String, toSequenceNr: Long, expiryTimestamp: Instant): CompletionStage[Done]

    Set expiry (time to live) for all events up to a sequence number for the given persistence id.

    Set expiry (time to live) for all events up to a sequence number for the given persistence id. Snapshots do not have expiry set.

    persistenceId

    the persistence id to set expiry for

    toSequenceNr

    sequence number (inclusive) to set expiry

    expiryTimestamp

    expiration timestamp to set on selected events

  33. def setExpiryForEventsBeforeSnapshot(persistenceId: String, timeToLive: Duration): CompletionStage[Done]

    Set expiry (time to live) for all events for the given persistence id from before its snapshot.

    Set expiry (time to live) for all events for the given persistence id from before its snapshot. The snapshot does not have expiry set. The event with the same sequence number as the snapshot does have expiry set.

    persistenceId

    the persistence id to set expiry for

    timeToLive

    time-to-live duration from now

  34. def setExpiryForEventsBeforeSnapshot(persistenceId: String, expiryTimestamp: Instant): CompletionStage[Done]

    Set expiry (time to live) for all events for the given persistence id from before its snapshot.

    Set expiry (time to live) for all events for the given persistence id from before its snapshot. The snapshot does not have expiry set. The event with the same sequence number as the snapshot does have expiry set.

    persistenceId

    the persistence id to set expiry for

    expiryTimestamp

    expiration timestamp to set on all events before snapshot

  35. def setExpiryForEventsBeforeSnapshots(persistenceIds: List[String], timeToLive: Duration): CompletionStage[Done]

    Set expiry (time to live) for all events for the given persistence ids from before their snapshots.

    Set expiry (time to live) for all events for the given persistence ids from before their snapshots. The snapshots do not have expiry set. The events with the same sequence number as the snapshots do have expiry set.

    persistenceIds

    the persistence ids to set expiry for

    timeToLive

    time-to-live duration from now

  36. def setExpiryForEventsBeforeSnapshots(persistenceIds: List[String], expiryTimestamp: Instant): CompletionStage[Done]

    Set expiry (time to live) for all events for the given persistence ids from before their snapshots.

    Set expiry (time to live) for all events for the given persistence ids from before their snapshots. The snapshots do not have expiry set. The events with the same sequence number as the snapshots do have expiry set.

    persistenceIds

    the persistence ids to set expiry for

    expiryTimestamp

    expiration timestamp to set on all events before snapshot

  37. def setExpiryForSnapshot(persistenceId: String, timeToLive: Duration): CompletionStage[Done]

    Set expiry (time to live) for the snapshot related to a single persistence id.

    Set expiry (time to live) for the snapshot related to a single persistence id. Events do not have expiry set.

    persistenceId

    the persistence id to set expiry for

    timeToLive

    time-to-live duration from now

  38. def setExpiryForSnapshot(persistenceId: String, expiryTimestamp: Instant): CompletionStage[Done]

    Set expiry (time to live) for the snapshot related to a single persistence id.

    Set expiry (time to live) for the snapshot related to a single persistence id. Events do not have expiry set.

    persistenceId

    the persistence id to set expiry for

    expiryTimestamp

    expiration timestamp to set on the snapshot

  39. def setExpiryForSnapshots(persistenceIds: List[String], timeToLive: Duration): CompletionStage[Done]

    Set expiry (time to live) for all snapshots related to the given list of persistence ids.

    Set expiry (time to live) for all snapshots related to the given list of persistence ids. Events do not have expiry set.

    persistenceIds

    the persistence ids to set expiry for

    timeToLive

    time-to-live duration from now

  40. def setExpiryForSnapshots(persistenceIds: List[String], expiryTimestamp: Instant): CompletionStage[Done]

    Set expiry (time to live) for all snapshots related to the given list of persistence ids.

    Set expiry (time to live) for all snapshots related to the given list of persistence ids. Events do not have expiry set.

    persistenceIds

    the persistence ids to set expiry for

    expiryTimestamp

    expiration timestamp to set on all snapshots

  41. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  42. def toString(): String
    Definition Classes
    AnyRef → Any
  43. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  44. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  45. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

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