Skip to content

Instantly share code, notes, and snippets.

@mhamrah
Created December 7, 2014 05:12
Show Gist options
  • Save mhamrah/eb0b6823d972dbadb1a3 to your computer and use it in GitHub Desktop.
Save mhamrah/eb0b6823d972dbadb1a3 to your computer and use it in GitHub Desktop.
persistence-test
rocksdb-journal {
class = "com.hamrah.akka.persistence.rocksdb.RocksDbJournal"
plugin-dispatcher = "akka.actor.default-dispatcher"
}
package com.hamrah.akka.persistence.rocksdb
package journal
import akka.persistence._
import akka.persistence.journal._
import com.typesafe.config._
import scala.collection._
import scala.concurrent.Future
import scala.concurrent.duration._
class RocksDbJournal extends AsyncWriteJournal {
import context.dispatcher
def asyncWriteMessages(messages: immutable.Seq[PersistentRepr]): Future[Unit] = {
Future {}
}
def asyncDeleteMessagesTo(persistenceId: String, toSequenceNr: Long, permanent: Boolean): Future[Unit] = {
Future {}
}
def asyncReplayMessages(persistenceId: String, fromSequenceNr: Long, toSequenceNr: Long, max: Long)(replayCallback: PersistentRepr Unit): Future[Unit] = {
Future {}
}
def asyncReadHighestSequenceNr(persistenceId: String, fromSequenceNr: Long): Future[Long] = {
Future { 1L }
}
def asyncDeleteMessages(messageIds: scala.collection.immutable.Seq[akka.persistence.PersistentId],permanent: Boolean): scala.concurrent.Future[Unit] = Future { }
def asyncWriteConfirmations(confirmations: scala.collection.immutable.Seq[akka.persistence.PersistentConfirmation]): scala.concurrent.Future[Unit] = Future { }
}
package com.hamrah.akka.persistence.rocksdb
package journal
import akka.persistence.journal._
import com.typesafe.config.ConfigFactory
import akka.actor._
class RocksDbJournalSpec
extends JournalSpec {
override val config = ConfigFactory.parseString(
"""
akka.persistence.journal.plugin = "rocksdb-journal"
""".stripMargin)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment