!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

@ -67,7 +67,7 @@ trait PersistenceDocSpec {
//#deletion
override def preRestart(reason: Throwable, message: Option[Any]) {
message match {
case Some(p: Persistent) deleteMessage(p)
case Some(p: Persistent) deleteMessage(p.sequenceNr)
case _
}
super.preRestart(reason, message)

View file

@ -71,7 +71,7 @@ class PersistencePluginDocSpec extends WordSpec {
class MyJournal extends AsyncWriteJournal {
def writeAsync(persistent: PersistentRepr): Future[Unit] = ???
def writeBatchAsync(persistentBatch: Seq[PersistentRepr]): Future[Unit] = ???
def deleteAsync(processorId: String, sequenceNr: Long, physical: Boolean): Future[Unit] = ???
def deleteAsync(processorId: String, fromSequenceNr: Long, toSequenceNr: Long, permanent: Boolean): Future[Unit] = ???
def confirmAsync(processorId: String, sequenceNr: Long, channelId: String): Future[Unit] = ???
def replayAsync(processorId: String, fromSequenceNr: Long, toSequenceNr: Long)(replayCallback: (PersistentRepr) Unit): Future[Long] = ???
}
@ -79,6 +79,7 @@ class MyJournal extends AsyncWriteJournal {
class MySnapshotStore extends SnapshotStore {
def loadAsync(processorId: String, criteria: SnapshotSelectionCriteria): Future[Option[SelectedSnapshot]] = ???
def saveAsync(metadata: SnapshotMetadata, snapshot: Any): Future[Unit] = ???
def saved(metadata: SnapshotMetadata) {}
def delete(metadata: SnapshotMetadata) {}
def saved(metadata: SnapshotMetadata): Unit = ???
def delete(metadata: SnapshotMetadata): Unit = ???
def delete(processorId: String, criteria: SnapshotSelectionCriteria): Unit = ???
}