!per #15230 rename processorId => persistentId
* This is NOT binary compatible, we're in an *experimental* module. * disabled binary compat checks for package akka.persistence * Source compatibility is retained, but users should migrate do the new method name ASAP. * Plugin APIs were migrated in a way that allows the old plugins to compile agains 2.3.4 without having to change anything. Hopefuly this will help authors migrate to 2.3.4 sooner. This is only source level compatible, not binary compatible. * added deprecation warnings on all processorId methods and provided bridges where possible * for users, the migration should be painless, they can still override the old method, and it'll work. But we encourage them to move to persistenceId; All delegation code will have to be removed afterwards ofc. Conflicts: akka-persistence/src/main/scala/akka/persistence/Channel.scala akka-persistence/src/main/scala/akka/persistence/JournalProtocol.scala akka-persistence/src/main/scala/akka/persistence/Persistent.scala akka-persistence/src/main/scala/akka/persistence/PersistentChannel.scala akka-persistence/src/main/scala/akka/persistence/Processor.scala akka-persistence/src/main/scala/akka/persistence/Snapshot.scala akka-persistence/src/main/scala/akka/persistence/journal/AsyncWriteProxy.scala akka-persistence/src/main/scala/akka/persistence/journal/inmem/InmemJournal.scala akka-persistence/src/main/scala/akka/persistence/journal/leveldb/LeveldbKey.scala akka-persistence/src/main/scala/akka/persistence/snapshot/SnapshotStore.scala akka-persistence/src/test/scala/akka/persistence/serialization/SerializerSpec.scala project/AkkaBuild.scala
This commit is contained in:
parent
c8406e3466
commit
4bb321a83a
58 changed files with 502 additions and 435 deletions
|
|
@ -111,9 +111,9 @@ trait PersistenceDocSpec {
|
|||
|
||||
new AnyRef {
|
||||
trait ProcessorMethods {
|
||||
//#processor-id
|
||||
def processorId: String
|
||||
//#processor-id
|
||||
//#persistence-id
|
||||
def persistenceId: String
|
||||
//#persistence-id
|
||||
//#recovery-status
|
||||
def recoveryRunning: Boolean
|
||||
def recoveryFinished: Boolean
|
||||
|
|
@ -123,9 +123,9 @@ trait PersistenceDocSpec {
|
|||
//#current-message
|
||||
}
|
||||
class MyProcessor1 extends Processor with ProcessorMethods {
|
||||
//#processor-id-override
|
||||
override def processorId = "my-stable-processor-id"
|
||||
//#processor-id-override
|
||||
//#persistence-id-override
|
||||
override def persistenceId = "my-stable-persistence-id"
|
||||
//#persistence-id-override
|
||||
def receive = {
|
||||
case _ =>
|
||||
}
|
||||
|
|
@ -411,7 +411,7 @@ trait PersistenceDocSpec {
|
|||
|
||||
//#view
|
||||
class MyView extends View {
|
||||
def processorId: String = "some-processor-id"
|
||||
override def persistenceId: String = "some-persistence-id"
|
||||
|
||||
def receive: Actor.Receive = {
|
||||
case Persistent(payload, sequenceNr) => // ...
|
||||
|
|
@ -440,26 +440,26 @@ trait PersistenceDocSpec {
|
|||
|
||||
val materializer = FlowMaterializer(MaterializerSettings())
|
||||
|
||||
val flow: Flow[Persistent] = PersistentFlow.fromProcessor("some-processor-id")
|
||||
val flow: Flow[Persistent] = PersistentFlow.fromPersistence("some-persistence-id")
|
||||
val producer: Producer[Persistent] = flow.toProducer(materializer)
|
||||
//#producer-creation
|
||||
|
||||
//#producer-buffer-size
|
||||
PersistentFlow.fromProcessor("some-processor-id", PersistentPublisherSettings(maxBufferSize = 200))
|
||||
PersistentFlow.fromPersistence("some-persistence-id", PersistentPublisherSettings(maxBufferSize = 200))
|
||||
//#producer-buffer-size
|
||||
|
||||
//#producer-examples
|
||||
// 1 producer and 2 consumers:
|
||||
val producer1: Producer[Persistent] =
|
||||
PersistentFlow.fromProcessor("processor-1").toProducer(materializer)
|
||||
PersistentFlow.fromPersistence("processor-1").toProducer(materializer)
|
||||
Flow(producer1).foreach(p => println(s"consumer-1: ${p.payload}")).consume(materializer)
|
||||
Flow(producer1).foreach(p => println(s"consumer-2: ${p.payload}")).consume(materializer)
|
||||
|
||||
// 2 producers (merged) and 1 consumer:
|
||||
val producer2: Producer[Persistent] =
|
||||
PersistentFlow.fromProcessor("processor-2").toProducer(materializer)
|
||||
PersistentFlow.fromPersistence("processor-2").toProducer(materializer)
|
||||
val producer3: Producer[Persistent] =
|
||||
PersistentFlow.fromProcessor("processor-3").toProducer(materializer)
|
||||
PersistentFlow.fromPersistence("processor-3").toProducer(materializer)
|
||||
Flow(producer2).merge(producer3).foreach { p =>
|
||||
println(s"consumer-3: ${p.payload}")
|
||||
}.consume(materializer)
|
||||
|
|
|
|||
|
|
@ -126,16 +126,16 @@ trait SharedLeveldbPluginDocSpec {
|
|||
class MyJournal extends AsyncWriteJournal {
|
||||
def asyncWriteMessages(messages: Seq[PersistentRepr]): Future[Unit] = ???
|
||||
def asyncWriteConfirmations(confirmations: Seq[PersistentConfirmation]): Future[Unit] = ???
|
||||
def asyncDeleteMessages(messageIds: Seq[PersistentId], permanent: Boolean): Future[Unit] = ???
|
||||
def asyncDeleteMessagesTo(processorId: String, toSequenceNr: Long, permanent: Boolean): Future[Unit] = ???
|
||||
def asyncReplayMessages(processorId: String, fromSequenceNr: Long, toSequenceNr: Long, max: Long)(replayCallback: (PersistentRepr) => Unit): Future[Unit] = ???
|
||||
def asyncReadHighestSequenceNr(processorId: String, fromSequenceNr: Long): Future[Long] = ???
|
||||
def asyncDeleteMessages(messageIds: Seq[PersistenceId], permanent: Boolean): Future[Unit] = ???
|
||||
def asyncDeleteMessagesTo(persistenceId: String, toSequenceNr: Long, permanent: Boolean): Future[Unit] = ???
|
||||
def asyncReplayMessages(persistenceId: String, fromSequenceNr: Long, toSequenceNr: Long, max: Long)(replayCallback: (PersistentRepr) => Unit): Future[Unit] = ???
|
||||
def asyncReadHighestSequenceNr(persistenceId: String, fromSequenceNr: Long): Future[Long] = ???
|
||||
}
|
||||
|
||||
class MySnapshotStore extends SnapshotStore {
|
||||
def loadAsync(processorId: String, criteria: SnapshotSelectionCriteria): Future[Option[SelectedSnapshot]] = ???
|
||||
def loadAsync(persistenceId: String, criteria: SnapshotSelectionCriteria): Future[Option[SelectedSnapshot]] = ???
|
||||
def saveAsync(metadata: SnapshotMetadata, snapshot: Any): Future[Unit] = ???
|
||||
def saved(metadata: SnapshotMetadata): Unit = ???
|
||||
def delete(metadata: SnapshotMetadata): Unit = ???
|
||||
def delete(processorId: String, criteria: SnapshotSelectionCriteria): Unit = ???
|
||||
def delete(persistenceId: String, criteria: SnapshotSelectionCriteria): Unit = ???
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue