Skip to content

Commit

Permalink
Deprecate raft.eventsourced.Save class
Browse files Browse the repository at this point in the history
Use CommitLogStoreActor.AppendCommittedEntries instead.
  • Loading branch information
Taichi Yamakawa committed Mar 15, 2022
1 parent 759968e commit 01754e0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import lerna.akka.entityreplication.{ model, raft, typed, ClusterReplicationSeri

import java.io.NotSerializableException
import java.util.UUID
import scala.annotation.nowarn
import scala.collection.immutable.HashMap

private[entityreplication] final class ClusterReplicationSerializer(val system: ExtendedActorSystem)
Expand Down Expand Up @@ -408,6 +409,7 @@ private[entityreplication] final class ClusterReplicationSerializer(val system:
raft.eventsourced.InternalEvent
}

@nowarn("msg=Use CommitLogStoreActor.AppendCommittedEntries instead.")
private def commitLogStoreSaveToBinary(message: raft.eventsourced.Save): Array[Byte] = {
msg.CommitLogStoreSave
.of(
Expand All @@ -417,6 +419,7 @@ private[entityreplication] final class ClusterReplicationSerializer(val system:
).toByteArray
}

@nowarn("msg=Use CommitLogStoreActor.AppendCommittedEntries instead.")
private def commitLogStoreSaveFromBinary(bytes: Array[Byte]): raft.eventsourced.Save = {
val proto = msg.CommitLogStoreSave.parseFrom(bytes)
raft.eventsourced.Save(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import lerna.akka.entityreplication.util.ActorIds

import java.net.URLDecoder

@deprecated("Use CommitLogStoreActor.AppendCommittedEntries instead.", "2.1.0")
private[entityreplication] final case class Save(
shardId: NormalizedShardId,
index: LogEntryIndex,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,16 @@ import lerna.akka.entityreplication.typed.ReplicationEnvelope

import java.io.NotSerializableException
import java.util.UUID
import scala.annotation.nowarn

object ClusterReplicationSerializerSpec {
case class MyEntity(id: Long, name: String, age: Int) extends KryoSerializable
case class MyCommand(id: Long, message: String) extends KryoSerializable
case class MyEvent(id: Long, message: String) extends KryoSerializable
object MyStopMessage extends KryoSerializable
}

@nowarn("msg=Use CommitLogStoreActor.AppendCommittedEntries instead.")
final class ClusterReplicationSerializerSpec
extends SerializerSpecBase(ActorSystem("ClusterReplicationSerializerSpec")) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import lerna.akka.entityreplication.raft.model.{ EntityEvent, LogEntry, LogEntry
import org.scalatest.{ BeforeAndAfterAll, OptionValues }

import java.util.UUID
import scala.annotation.nowarn

object CommitLogStoreActorSpec {

Expand Down Expand Up @@ -55,6 +56,7 @@ object CommitLogStoreActorSpec {

}

@nowarn("msg=Use CommitLogStoreActor.AppendCommittedEntries instead.")
final class CommitLogStoreActorSpec
extends TestKit(ActorSystem("CommitLogStoreActorSpec", CommitLogStoreActorSpec.config))
with ActorSpec
Expand Down

0 comments on commit 01754e0

Please sign in to comment.