+per #3641 Storage plugin API
- Journal plugin API for storage backends with asynchronous client API (default impl: in-memory journal) - Journal plugin API for storage backends with synchronous client API (default impl: LevelDB journal) - Snapshot store plugin API (default impl: local filesystem snapshot store)
This commit is contained in:
parent
1bda2a43d5
commit
da7490bbc9
33 changed files with 1454 additions and 474 deletions
|
|
@ -0,0 +1,48 @@
|
|||
/**
|
||||
* Copyright (C) 2009-2013 Typesafe Inc. <http://www.typesafe.com>
|
||||
*/
|
||||
|
||||
package akka.persistence.journal.japi
|
||||
|
||||
import akka.persistence.journal.{ SyncWriteJournal ⇒ SSyncWriteJournal }
|
||||
import akka.persistence.PersistentImpl
|
||||
|
||||
/**
|
||||
* Java API.
|
||||
*
|
||||
* Abstract journal, optimized for synchronous writes.
|
||||
*/
|
||||
abstract class SyncWriteJournal extends AsyncReplay with SSyncWriteJournal {
|
||||
final def write(persistent: PersistentImpl) =
|
||||
doWrite(persistent)
|
||||
|
||||
final def delete(persistent: PersistentImpl) =
|
||||
doDelete(persistent)
|
||||
|
||||
final def confirm(processorId: String, sequenceNr: Long, channelId: String) =
|
||||
doConfirm(processorId, sequenceNr, channelId)
|
||||
|
||||
/**
|
||||
* Plugin Java API.
|
||||
*
|
||||
* Synchronously writes a `persistent` message to the journal.
|
||||
*/
|
||||
@throws(classOf[Exception])
|
||||
def doWrite(persistent: PersistentImpl): Unit
|
||||
|
||||
/**
|
||||
* Plugin Java API.
|
||||
*
|
||||
* Synchronously marks a `persistent` message as deleted.
|
||||
*/
|
||||
@throws(classOf[Exception])
|
||||
def doDelete(persistent: PersistentImpl): Unit
|
||||
|
||||
/**
|
||||
* Plugin Java API.
|
||||
*
|
||||
* Synchronously writes a delivery confirmation to the journal.
|
||||
*/
|
||||
@throws(classOf[Exception])
|
||||
def doConfirm(processorId: String, sequenceNr: Long, channelId: String): Unit
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue