Skip to content

Commit

Permalink
Yet more Akka version numbers in deprecation warnings (#545)
Browse files Browse the repository at this point in the history
* Yet more Akka version numbers in deprecation warnings

more

* more akka version numbers

Update ClusterMessageSerializer.scala

more changes
  • Loading branch information
pjfanning authored Aug 6, 2023
1 parent 0e89e79 commit 4f570ea
Show file tree
Hide file tree
Showing 25 changed files with 72 additions and 168 deletions.
4 changes: 2 additions & 2 deletions actor/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ pekko {
# CallingThreadDispatcher for a top-level actor.
unstarted-push-timeout = 10s

# TypedActor deprecated since 2.6.0.
# TypedActor deprecated since Akka 2.6.0.
typed {
# Default timeout for the deprecated TypedActor (not the new actor APIs in 2.6)
# Default timeout for the deprecated TypedActor (not the new actor APIs in Akka 2.6)
# methods with non-void return type.
timeout = 5s
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ private[pekko] class RepointableActorRef(
case _ => true
}

@deprecated("Use context.watch(actor) and receive Terminated(actor)", "2.2") def isTerminated: Boolean =
@deprecated("Use context.watch(actor) and receive Terminated(actor)", "Akka 2.2") def isTerminated: Boolean =
underlying.isTerminated

def provider: ActorRefProvider = system.provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import pekko.util.Helpers
* @see org.apache.pekko.dispatch.BalancingDispatcher
* @see org.apache.pekko.dispatch.Dispatchers
*/
@deprecated("Use BalancingPool instead of BalancingDispatcher", "2.3")
@deprecated("Use BalancingPool instead of BalancingDispatcher", "Akka 2.3")
private[pekko] class BalancingDispatcher(
_configurator: MessageDispatcherConfigurator,
_id: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ class Dispatchers @InternalApi private[pekko] (
cfg.getString("type") match {
case "Dispatcher" => new DispatcherConfigurator(cfg, prerequisites)
case "BalancingDispatcher" =>
// FIXME remove this case in 2.4
// FIXME remove this case in Akka 2.4
throw new IllegalArgumentException(
"BalancingDispatcher is deprecated, use a BalancingPool instead. " +
"During a migration period you can still use BalancingDispatcher by specifying the full class name: " +
Expand Down
8 changes: 4 additions & 4 deletions actor/src/main/scala/org/apache/pekko/dispatch/Future.scala
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ object Futures {
* Internal use only.
*/
object japi {
@deprecated("Do not use this directly, use subclasses of this", "2.0")
@deprecated("Do not use this directly, use subclasses of this", "Akka 2.0")
class CallbackBridge[-T] extends AbstractPartialFunction[T, BoxedUnit] {
override final def isDefinedAt(t: T): Boolean = true
override final def apply(t: T): BoxedUnit = {
Expand All @@ -237,20 +237,20 @@ object japi {
protected def internal(@unused result: T): Unit = ()
}

@deprecated("Do not use this directly, use 'Recover'", "2.0")
@deprecated("Do not use this directly, use 'Recover'", "Akka 2.0")
class RecoverBridge[+T] extends AbstractPartialFunction[Throwable, T] {
override final def isDefinedAt(t: Throwable): Boolean = true
override final def apply(t: Throwable): T = internal(t)
protected def internal(@unused result: Throwable): T = null.asInstanceOf[T]
}

@deprecated("Do not use this directly, use subclasses of this", "2.0")
@deprecated("Do not use this directly, use subclasses of this", "Akka 2.0")
class BooleanFunctionBridge[-T] extends scala.Function1[T, Boolean] {
override final def apply(t: T): Boolean = internal(t)
protected def internal(@unused result: T): Boolean = false
}

@deprecated("Do not use this directly, use subclasses of this", "2.0")
@deprecated("Do not use this directly, use subclasses of this", "Akka 2.0")
class UnitFunctionBridge[-T] extends (T => BoxedUnit) {
final def apply$mcLJ$sp(l: Long): BoxedUnit = { internal(l.asInstanceOf[T]); BoxedUnit.UNIT }
final def apply$mcLI$sp(i: Int): BoxedUnit = { internal(i.asInstanceOf[T]); BoxedUnit.UNIT }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ private[pekko] class Mailboxes(
dispatcherConfig.hasPath("mailbox-type") &&
dispatcherConfig.getString("mailbox-type") != Deploy.NoMailboxGiven

// TODO remove in 2.3
// TODO remove in Akka 2.3
if (!hasMailboxType && !mailboxSizeWarningIssued && dispatcherConfig.hasPath("mailbox-size")) {
eventStream.publish(
Warning(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,7 @@ final class ClusterShardingSettings(
coordinatorSingletonSettings,
leaseSettings)

// bin compat for 2.5.23
// bin compat for Akka 2.5.23
@deprecated(
"Use the ClusterShardingSettings factory methods or the constructor including shardRegionQueryTimeout instead",
since = "Akka 2.6.0")
Expand All @@ -1248,7 +1248,7 @@ final class ClusterShardingSettings(
coordinatorSingletonSettings,
leaseSettings)

// bin compat for 2.5.21
// bin compat for Akka 2.5.21
@deprecated(
"Use the ClusterShardingSettings factory methods or the constructor including shardRegionQueryTimeout instead",
since = "Akka 2.5.21")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ final class ClusterSingletonSettings(
val bufferSize: Int,
val leaseSettings: Option[LeaseUsageSettings]) {

// bin compat for 2.6.14
// bin compat for Akka 2.6.14
@deprecated("Use constructor with leaseSettings", "Akka 2.6.15")
def this(
role: Option[String],
Expand Down Expand Up @@ -303,7 +303,7 @@ final class ClusterSingletonManagerSettings(
val handOverRetryInterval: FiniteDuration,
val leaseSettings: Option[LeaseUsageSettings]) {

// bin compat for 2.6.14
// bin compat for Akka 2.6.14
@deprecated("Use constructor with leaseSettings", "Akka 2.6.15")
def this(
singletonName: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ import pekko.util.ccompat.JavaConverters._
@InternalApi
@ccompatUsedUntil213
private[pekko] object ClusterMessageSerializer {
// Kept for one version iteration from 2.6.4 to allow rolling migration to short manifests
// can be removed in 2.6.6 or later.
// Kept for one version iteration from Akka 2.6.4 to allow rolling migration to short manifests
// can be removed in Akka 2.6.6 or later.
val OldJoinManifest = s"org.apache.pekko.cluster.InternalClusterAction$$Join"
val OldWelcomeManifest = s"org.apache.pekko.cluster.InternalClusterAction$$Welcome"
val OldLeaveManifest = s"org.apache.pekko.cluster.ClusterUserAction$$Leave"
Expand All @@ -57,7 +57,7 @@ private[pekko] object ClusterMessageSerializer {
val OldGossipEnvelopeManifest = "org.apache.pekko.cluster.GossipEnvelope"
val OldClusterRouterPoolManifest = "org.apache.pekko.cluster.routing.ClusterRouterPool"

// is handled on the deserializing side in 2.6.2 and then on the serializing side in 2.6.3
// is handled on the deserializing side in Akka 2.6.2 and then on the serializing side in Akka 2.6.3
val JoinManifest = "J"
val WelcomeManifest = "W"
val LeaveManifest = "L"
Expand Down Expand Up @@ -139,7 +139,7 @@ final class ClusterMessageSerializer(val system: ExtendedActorSystem)
case DownManifest => deserializeDown(bytes)
case ExitingConfirmedManifest => deserializeExitingConfirmed(bytes)
case ClusterRouterPoolManifest => deserializeClusterRouterPool(bytes)
// needs to stay in 2.6.5 to be able to talk to a 2.5.{3,4} node during rolling upgrade
// needs to stay in Akka 2.6.5 to be able to talk to an Akka 2.5.{3,4} node during rolling upgrade
case HeartBeatManifestPre2523 => deserializeHeartBeatAsAddress(bytes)
case HeartBeatRspManifest2523 => deserializeHeartBeatRspAsUniqueAddress(bytes)
case OldGossipStatusManifest => deserializeGossipStatus(bytes)
Expand Down Expand Up @@ -417,7 +417,7 @@ final class ClusterMessageSerializer(val system: ExtendedActorSystem)

private def initJoinAckToByteArray(address: Address, configCheck: ConfigCheck): Array[Byte] = {
if (configCheck == ConfigCheckUnsupportedByJoiningNode)
addressToProtoByteArray(address) // plain Address in 2.5.9 or earlier
addressToProtoByteArray(address) // plain Address in Akka 2.5.9 or earlier
else
initJoinAckToProto(address, configCheck).toByteArray
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ class ClusterMessageSerializerSpec extends PekkoSpec("pekko.actor.provider = clu
checkSerialization(InternalClusterAction.Welcome(uniqueAddress, g2))
}

// can be removed in 2.6.3 only checks deserialization with new not yet in effect manifests for 2.6.2
"be de-serializable with class manifests from 2.6.4 and earlier nodes" in {
// can be removed in Akka 2.6.3 only checks deserialization with new not yet in effect manifests for Akka 2.6.2
"be de-serializable with class manifests from Akka 2.6.4 and earlier nodes" in {
val address = Address("pekko", "system", "some.host.org", 4711)
val uniqueAddress = UniqueAddress(address, 17L)
val address2 = Address("pekko", "system", "other.host.org", 4711)
Expand Down Expand Up @@ -189,11 +189,11 @@ class ClusterMessageSerializerSpec extends PekkoSpec("pekko.actor.provider = clu
}
}

// support for deserializing a new format with a string based manifest was added in 2.5.23 but the next step
// support for deserializing a new format with a string based manifest was added in Akka 2.5.23 but the next step
// was never done, meaning that 2.6.4 still emits the old format
"Rolling upgrades for heart beat message changes in 2.5.23" must {
"Rolling upgrades for heart beat message changes in Akka 2.5.23" must {

"deserialize heart beats represented by just an address Address to support versions prior or 2.6.5" in {
"deserialize heart beats represented by just an address Address to support versions prior to Akka 2.6.5" in {
val serialized = serializer.addressToProto(a1.address).build().toByteArray
val deserialized = serializer.fromBinary(serialized, ClusterMessageSerializer.HeartBeatManifestPre2523)
deserialized should ===(ClusterHeartbeatSender.Heartbeat(a1.address, -1, -1))
Expand Down
Loading

0 comments on commit 4f570ea

Please sign in to comment.