!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:
Martin Krasser 2013-11-12 09:02:02 +01:00
parent e104e2a92c
commit 4489a72bea
32 changed files with 352 additions and 118 deletions

View file

@ -47,11 +47,11 @@ trait SyncWriteJournal extends Actor with AsyncReplay {
}
case c @ Confirm(processorId, sequenceNr, channelId) {
confirm(processorId, sequenceNr, channelId)
context.system.eventStream.publish(c) // TODO: turn off by default and allow to turn on by configuration
if (extension.publishPluginCommands) context.system.eventStream.publish(c)
}
case d @ Delete(processorId, sequenceNr, physical) {
delete(processorId, sequenceNr, physical)
context.system.eventStream.publish(d) // TODO: turn off by default and allow to turn on by configuration
case d @ Delete(processorId, fromSequenceNr, toSequenceNr, permanent) {
delete(processorId, fromSequenceNr, toSequenceNr, permanent)
if (extension.publishPluginCommands) context.system.eventStream.publish(d)
}
case Loop(message, processor) {
processor forward LoopSuccess(message)
@ -72,11 +72,14 @@ trait SyncWriteJournal extends Actor with AsyncReplay {
def writeBatch(persistentBatch: immutable.Seq[PersistentRepr]): Unit
/**
* Plugin API: synchronously deletes a persistent message. If `physical` is set to
* `false`, the persistent message is marked as deleted, otherwise it is physically
* deleted.
* Plugin API: synchronously deletes all persistent messages within the range from
* `fromSequenceNr` to `toSequenceNr` (both inclusive). If `permanent` is set to
* `false`, the persistent messages are marked as deleted, otherwise they are
* permanently deleted.
*
* @see [[AsyncReplay]]
*/
def delete(processorId: String, sequenceNr: Long, physical: Boolean): Unit
def delete(processorId: String, fromSequenceNr: Long, toSequenceNr: Long, permanent: Boolean): Unit
/**
* Plugin API: synchronously writes a delivery confirmation to the journal.