!per #3717 Deletion API for snapshots and persistent messages
- single and bulk deletion of messages - single and bulk deletion of snapshots - run journal and snapshot store as system actors - rename physical parameter in delete methods to permanent - StashSupport.prepend docs and implementation enhancements
This commit is contained in:
parent
e104e2a92c
commit
4489a72bea
32 changed files with 352 additions and 118 deletions
|
|
@ -101,7 +101,7 @@ public class PersistenceDocTest {
|
|||
@Override
|
||||
public void preRestart(Throwable reason, Option<Object> message) {
|
||||
if (message.isDefined() && message.get() instanceof Persistent) {
|
||||
deleteMessage((Persistent) message.get());
|
||||
deleteMessage(((Persistent) message.get()).sequenceNr());
|
||||
}
|
||||
super.preRestart(reason, message);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,10 @@ public class PersistencePluginDocTest {
|
|||
@Override
|
||||
public void doDelete(SnapshotMetadata metadata) throws Exception {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doDelete(String processorId, SnapshotSelectionCriteria criteria) throws Exception {
|
||||
}
|
||||
}
|
||||
|
||||
class MyAsyncJournal extends AsyncWriteJournal {
|
||||
|
|
@ -51,7 +55,7 @@ public class PersistencePluginDocTest {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Future<Void> doDeleteAsync(String processorId, long sequenceNr, boolean physical) {
|
||||
public Future<Void> doDeleteAsync(String processorId, long fromSequenceNr, long toSequenceNr, boolean permanent) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -143,11 +143,12 @@ a replay of that message during recovery it can be deleted.
|
|||
Message deletion
|
||||
----------------
|
||||
|
||||
A processor can delete messages by calling the ``delete`` method with a ``Persistent`` message object or a
|
||||
sequence number as argument. An optional ``physical`` parameter specifies whether the message shall be
|
||||
physically deleted from the journal or only marked as deleted. In both cases, the message won't be replayed.
|
||||
Later extensions to Akka persistence will allow to replay messages that have been marked as deleted which can
|
||||
be useful for debugging purposes, for example.
|
||||
A processor can delete a single message by calling the ``deleteMessage`` method with the sequence number of
|
||||
that message as argument. An optional ``permanent`` parameter specifies whether the message shall be permanently
|
||||
deleted from the journal or only marked as deleted. In both cases, the message won't be replayed. Later extensions
|
||||
to Akka persistence will allow to replay messages that have been marked as deleted which can be useful for debugging
|
||||
purposes, for example. To delete all messages (journaled by a single processor) up to a specified sequence number,
|
||||
processors can call the ``deleteMessages`` method.
|
||||
|
||||
Identifiers
|
||||
-----------
|
||||
|
|
@ -315,6 +316,13 @@ If not specified, they default to ``SnapshotSelectionCriteria.latest()`` which s
|
|||
To disable snapshot-based recovery, applications should use ``SnapshotSelectionCriteria.none()``. A recovery where no
|
||||
saved snapshot matches the specified ``SnapshotSelectionCriteria`` will replay all journaled messages.
|
||||
|
||||
Snapshot deletion
|
||||
-----------------
|
||||
|
||||
A processor can delete a single snapshot by calling the ``deleteSnapshot`` method with the sequence number and the
|
||||
timestamp of the snapshot as argument. To bulk-delete snapshots that match a specified ``SnapshotSelectionCriteria``
|
||||
argument, processors can call the ``deleteSnapshots`` method.
|
||||
|
||||
.. _event-sourcing-java:
|
||||
|
||||
Event sourcing
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue