!per #17832 Remove SyncWriteJournal

This commit is contained in:
Patrik Nordwall 2015-06-25 19:58:47 +02:00
parent 17760c020c
commit 4638f5630e
20 changed files with 218 additions and 357 deletions

View file

@ -14,6 +14,7 @@ import scala.collection.immutable.Seq
import scala.concurrent.Future
import scala.util.Try
import scala.concurrent.duration._
import scala.util.control.NonFatal
//#plugin-imports
import akka.persistence._
@ -127,7 +128,14 @@ trait SharedLeveldbPluginDocSpec {
}
class MyJournal extends AsyncWriteJournal {
def asyncWriteMessages(messages: immutable.Seq[AtomicWrite]): Future[immutable.Seq[Try[Unit]]] = ???
//#sync-journal-plugin-api
def asyncWriteMessages(messages: immutable.Seq[AtomicWrite]): Future[immutable.Seq[Try[Unit]]] =
Future.fromTry(Try {
// blocking call here
???
})
//#sync-journal-plugin-api
def asyncDeleteMessagesTo(persistenceId: String, toSequenceNr: Long): Future[Unit] = ???
def asyncReplayMessages(persistenceId: String, fromSequenceNr: Long,
toSequenceNr: Long, max: Long)(

View file

@ -652,18 +652,17 @@ Plugin development requires the following imports:
Journal plugin API
------------------
A journal plugin either extends ``SyncWriteJournal`` or ``AsyncWriteJournal``. ``SyncWriteJournal`` is an
actor that should be extended when the storage backend API only supports synchronous, blocking writes. In this
case, the methods to be implemented are:
A journal plugin extends ``AsyncWriteJournal``.
.. includecode:: ../../../akka-persistence/src/main/scala/akka/persistence/journal/SyncWriteJournal.scala#journal-plugin-api
``AsyncWriteJournal`` is an actor that should be extended if the storage backend API supports asynchronous,
non-blocking writes. In this case, the methods to be implemented are:
``AsyncWriteJournal`` is an actor and the methods to be implemented are:
.. includecode:: ../../../akka-persistence/src/main/scala/akka/persistence/journal/AsyncWriteJournal.scala#journal-plugin-api
Message replays and sequence number recovery are always asynchronous, therefore, any journal plugin must implement:
If the storage backend API only supports synchronous, blocking writes, the methods should be implemented as:
.. includecode:: code/docs/persistence/PersistencePluginDocSpec.scala#sync-journal-plugin-api
A journal plugin must also implement the methods defined in ``AsyncRecovery`` for replays and sequence number recovery:
.. includecode:: ../../../akka-persistence/src/main/scala/akka/persistence/journal/AsyncRecovery.scala#journal-plugin-api