From 63b671c8985335751b8320a46971a2c800c96f61 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Thu, 31 Jul 2025 08:31:11 +0100 Subject: [PATCH] remove some deprecated cluster code (#1959) * remove some deprecated cluster code * build issues * Update Member.scala * mima checks --- .../protobuf/msg/ClusterMetricsMessages.java | 10 --- .../remove-deprecated-methods.excludes | 1 + .../pubsub/DistributedPubSubMediator.scala | 15 ---- .../remove-deprecated-methods.excludes | 20 ++++++ .../cluster/typed/ClusterSingleton.scala | 20 ------ .../cluster/protobuf/msg/ClusterMessages.java | 30 -------- .../remove-deprecated-methods.excludes | 34 +++++++++ .../apache/pekko/cluster/ClusterEvent.scala | 27 +------ .../org/apache/pekko/cluster/Member.scala | 25 +------ .../protobuf/ClusterMessageSerializer.scala | 8 +-- .../cluster/routing/ClusterRouterConfig.scala | 70 ------------------- 11 files changed, 59 insertions(+), 201 deletions(-) create mode 100644 cluster-typed/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes create mode 100644 cluster/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes diff --git a/cluster-metrics/src/main/java/org/apache/pekko/cluster/metrics/protobuf/msg/ClusterMetricsMessages.java b/cluster-metrics/src/main/java/org/apache/pekko/cluster/metrics/protobuf/msg/ClusterMetricsMessages.java index 9909c51ae0..afb0702dd0 100644 --- a/cluster-metrics/src/main/java/org/apache/pekko/cluster/metrics/protobuf/msg/ClusterMetricsMessages.java +++ b/cluster-metrics/src/main/java/org/apache/pekko/cluster/metrics/protobuf/msg/ClusterMetricsMessages.java @@ -2467,16 +2467,6 @@ public final class ClusterMetricsMessages { return value; } - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static NumberType valueOf(int value) { - return forNumber(value); - } - /** * @param value The numeric wire value of the corresponding enum entry. * @return The enum associated with the given numeric wire value. diff --git a/cluster-tools/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes b/cluster-tools/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes index f6aeb0b6fb..08061c51dc 100644 --- a/cluster-tools/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes +++ b/cluster-tools/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes @@ -17,3 +17,4 @@ # Remove deprecated methods ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.cluster.singleton.ClusterSingletonManager.setTimer*") +ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.cluster.pubsub.DistributedPubSubSettings.this") diff --git a/cluster-tools/src/main/scala/org/apache/pekko/cluster/pubsub/DistributedPubSubMediator.scala b/cluster-tools/src/main/scala/org/apache/pekko/cluster/pubsub/DistributedPubSubMediator.scala index fd7263992e..15f18ea21a 100644 --- a/cluster-tools/src/main/scala/org/apache/pekko/cluster/pubsub/DistributedPubSubMediator.scala +++ b/cluster-tools/src/main/scala/org/apache/pekko/cluster/pubsub/DistributedPubSubMediator.scala @@ -109,21 +109,6 @@ final class DistributedPubSubSettings( val sendToDeadLettersWhenNoSubscribers: Boolean) extends NoSerializationVerificationNeeded { - @deprecated("Use the other constructor instead.", "Akka 2.5.5") - def this( - role: Option[String], - routingLogic: RoutingLogic, - gossipInterval: FiniteDuration, - removedTimeToLive: FiniteDuration, - maxDeltaElements: Int) = - this( - role, - routingLogic, - gossipInterval, - removedTimeToLive, - maxDeltaElements, - sendToDeadLettersWhenNoSubscribers = true) - require( !routingLogic.isInstanceOf[ConsistentHashingRoutingLogic], "'ConsistentHashingRoutingLogic' can't be used by the pub-sub mediator") diff --git a/cluster-typed/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes b/cluster-typed/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes new file mode 100644 index 0000000000..5a8ad16eee --- /dev/null +++ b/cluster-typed/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes @@ -0,0 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Remove deprecated methods +ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.cluster.typed.ClusterSingletonManagerSettings.this") +ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.cluster.typed.ClusterSingletonSettings.this") diff --git a/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/ClusterSingleton.scala b/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/ClusterSingleton.scala index 8e3c0dcab8..c8ad70ce8b 100644 --- a/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/ClusterSingleton.scala +++ b/cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/ClusterSingleton.scala @@ -62,17 +62,6 @@ final class ClusterSingletonSettings( val bufferSize: Int, val leaseSettings: Option[LeaseUsageSettings]) { - // bin compat for Akka 2.6.14 - @deprecated("Use constructor with leaseSettings", "Akka 2.6.15") - def this( - role: Option[String], - dataCenter: Option[DataCenter], - singletonIdentificationInterval: FiniteDuration, - removalMargin: FiniteDuration, - handOverRetryInterval: FiniteDuration, - bufferSize: Int) = - this(role, dataCenter, singletonIdentificationInterval, removalMargin, handOverRetryInterval, bufferSize, None) - def withRole(role: String): ClusterSingletonSettings = copy(role = Some(role)) def withNoRole(): ClusterSingletonSettings = copy(role = None) @@ -303,15 +292,6 @@ final class ClusterSingletonManagerSettings( val handOverRetryInterval: FiniteDuration, val leaseSettings: Option[LeaseUsageSettings]) { - // bin compat for Akka 2.6.14 - @deprecated("Use constructor with leaseSettings", "Akka 2.6.15") - def this( - singletonName: String, - role: Option[String], - removalMargin: FiniteDuration, - handOverRetryInterval: FiniteDuration) = - this(singletonName, role, removalMargin, handOverRetryInterval, None) - def withSingletonName(name: String): ClusterSingletonManagerSettings = copy(singletonName = name) def withRole(role: String): ClusterSingletonManagerSettings = diff --git a/cluster/src/main/java/org/apache/pekko/cluster/protobuf/msg/ClusterMessages.java b/cluster/src/main/java/org/apache/pekko/cluster/protobuf/msg/ClusterMessages.java index ab9db00b37..b667473c01 100644 --- a/cluster/src/main/java/org/apache/pekko/cluster/protobuf/msg/ClusterMessages.java +++ b/cluster/src/main/java/org/apache/pekko/cluster/protobuf/msg/ClusterMessages.java @@ -89,16 +89,6 @@ public final class ClusterMessages { return value; } - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static ReachabilityStatus valueOf(int value) { - return forNumber(value); - } - /** * @param value The numeric wire value of the corresponding enum entry. * @return The enum associated with the given numeric wire value. @@ -256,16 +246,6 @@ public final class ClusterMessages { return value; } - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static MemberStatus valueOf(int value) { - return forNumber(value); - } - /** * @param value The numeric wire value of the corresponding enum entry. * @return The enum associated with the given numeric wire value. @@ -3599,16 +3579,6 @@ public final class ClusterMessages { return value; } - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static Type valueOf(int value) { - return forNumber(value); - } - /** * @param value The numeric wire value of the corresponding enum entry. * @return The enum associated with the given numeric wire value. diff --git a/cluster/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes b/cluster/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes new file mode 100644 index 0000000000..0b332db9ee --- /dev/null +++ b/cluster/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes @@ -0,0 +1,34 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Remove deprecated methods +ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.cluster.ClusterEvent#CurrentClusterState.this") +ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.cluster.ClusterEvent#CurrentClusterState.*") +ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.cluster.Member.pickHighestPriority") +ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.cluster.UniqueAddress.apply") +ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.cluster.UniqueAddress.uid") +ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.cluster.UniqueAddress.copy*") +ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.cluster.UniqueAddress.this") +ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.cluster.routing.ClusterRouterGroupSettings.apply") +ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.cluster.routing.ClusterRouterGroupSettings.useRole") +ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.cluster.routing.ClusterRouterGroupSettings.copy*") +ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.cluster.routing.ClusterRouterGroupSettings.copy$default$1") +ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.cluster.routing.ClusterRouterGroupSettings.this") +ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.cluster.routing.ClusterRouterPoolSettings.apply") +ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.cluster.routing.ClusterRouterPoolSettings.useRole") +ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.cluster.routing.ClusterRouterPoolSettings.copy*") +ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.cluster.routing.ClusterRouterPoolSettings.this") diff --git a/cluster/src/main/scala/org/apache/pekko/cluster/ClusterEvent.scala b/cluster/src/main/scala/org/apache/pekko/cluster/ClusterEvent.scala index 5355a94880..b83be7fb7c 100644 --- a/cluster/src/main/scala/org/apache/pekko/cluster/ClusterEvent.scala +++ b/cluster/src/main/scala/org/apache/pekko/cluster/ClusterEvent.scala @@ -13,12 +13,11 @@ package org.apache.pekko.cluster +import scala.annotation.nowarn import scala.collection.immutable import scala.collection.immutable.{ SortedSet, VectorBuilder } import scala.runtime.AbstractFunction5 -import scala.annotation.nowarn - import org.apache.pekko import pekko.actor.{ Actor, ActorRef, Address } import pekko.actor.DeadLetterSuppression @@ -80,14 +79,13 @@ object ClusterEvent { immutable.SortedSet[Member], Set[Member], Set[Address], Option[Address], Map[String, Option[Address]], CurrentClusterState] { - @nowarn("msg=deprecated") def apply( members: immutable.SortedSet[Member] = immutable.SortedSet.empty, unreachable: Set[Member] = Set.empty, seenBy: Set[Address] = Set.empty, leader: Option[Address] = None, roleLeaderMap: Map[String, Option[Address]] = Map.empty): CurrentClusterState = - new CurrentClusterState(members, unreachable, seenBy, leader, roleLeaderMap) + new CurrentClusterState(members, unreachable, seenBy, leader, roleLeaderMap, Set.empty, Set.empty) def unapply(cs: CurrentClusterState): Option[ (immutable.SortedSet[Member], Set[Member], Set[Address], Option[Address], Map[String, Option[Address]])] = @@ -114,27 +112,6 @@ object ClusterEvent { immutable.SortedSet[Member], Set[Member], Set[Address], Option[Address], Map[String, Option[Address]]] with Serializable { - // for binary compatibility - @deprecated("use main constructor", since = "Akka 2.6.10") - def this( - members: immutable.SortedSet[Member], - unreachable: Set[Member], - seenBy: Set[Address], - leader: Option[Address], - roleLeaderMap: Map[String, Option[Address]], - unreachableDataCenters: Set[DataCenter]) = - this(members, unreachable, seenBy, leader, roleLeaderMap, unreachableDataCenters, Set.empty) - - // for binary compatibility - @deprecated("use main constructor", since = "Akka 2.6.10") - def this( - members: immutable.SortedSet[Member] = immutable.SortedSet.empty, - unreachable: Set[Member] = Set.empty, - seenBy: Set[Address] = Set.empty, - leader: Option[Address] = None, - roleLeaderMap: Map[String, Option[Address]] = Map.empty) = - this(members, unreachable, seenBy, leader, roleLeaderMap, Set.empty, Set.empty) - /** * Java API: get current member list. */ diff --git a/cluster/src/main/scala/org/apache/pekko/cluster/Member.scala b/cluster/src/main/scala/org/apache/pekko/cluster/Member.scala index 0c813132f9..23219ba63c 100644 --- a/cluster/src/main/scala/org/apache/pekko/cluster/Member.scala +++ b/cluster/src/main/scala/org/apache/pekko/cluster/Member.scala @@ -179,10 +179,6 @@ object Member { a.isOlderThan(b) } - @deprecated("Was accidentally made a public API, internal", since = "Akka 2.5.4") - def pickHighestPriority(a: Set[Member], b: Set[Member]): Set[Member] = - pickHighestPriority(a, b, Map.empty) - /** * INTERNAL API. */ @@ -317,10 +313,7 @@ object MemberStatus { Removed -> Set.empty[MemberStatus]) } -object UniqueAddress extends AbstractFunction2[Address, Int, UniqueAddress] { - // for binary compatibility - @deprecated("Use Long UID apply instead", since = "Akka 2.4.11") - def apply(address: Address, uid: Int) = new UniqueAddress(address, uid.toLong) +object UniqueAddress extends AbstractFunction2[Address, Long, UniqueAddress] { def apply(remoteUniqueAddress: pekko.remote.UniqueAddress): UniqueAddress = new UniqueAddress(remoteUniqueAddress.address, remoteUniqueAddress.uid) @@ -364,20 +357,4 @@ final class UniqueAddress(val address: Address, val longUid: Long) else result } - // for binary compatibility - - @deprecated("Use Long UID constructor instead", since = "Akka 2.4.11") - def this(address: Address, uid: Int) = this(address, uid.toLong) - - @deprecated("Use longUid instead", since = "Akka 2.4.11") - def uid = longUid.toInt - - /** - * For binary compatibility - * Stops `copy(Address, Long)` copy from being generated, use `apply` instead. - */ - @deprecated("Use Long UID constructor instead", since = "Akka 2.4.11") - @nowarn("msg=deprecated") - def copy(address: Address = address, uid: Int = uid) = new UniqueAddress(address, uid.toLong) - } diff --git a/cluster/src/main/scala/org/apache/pekko/cluster/protobuf/ClusterMessageSerializer.scala b/cluster/src/main/scala/org/apache/pekko/cluster/protobuf/ClusterMessageSerializer.scala index 8bc70504fd..a97b54e63c 100644 --- a/cluster/src/main/scala/org/apache/pekko/cluster/protobuf/ClusterMessageSerializer.scala +++ b/cluster/src/main/scala/org/apache/pekko/cluster/protobuf/ClusterMessageSerializer.scala @@ -18,7 +18,6 @@ import java.util.zip.{ GZIPInputStream, GZIPOutputStream } import scala.annotation.tailrec import scala.collection.immutable import scala.concurrent.duration.Deadline -import scala.annotation.nowarn import com.typesafe.config.{ Config, ConfigFactory, ConfigRenderOptions } import org.apache.pekko import pekko.actor.{ Address, ExtendedActorSystem } @@ -244,7 +243,6 @@ final class ClusterMessageSerializer(val system: ExtendedActorSystem) builder.build() } - @nowarn("msg=deprecated") private def clusterRouterPoolSettingsToProto(settings: ClusterRouterPoolSettings): cm.ClusterRouterPoolSettings = { val builder = cm.ClusterRouterPoolSettings.newBuilder() builder @@ -252,11 +250,7 @@ final class ClusterMessageSerializer(val system: ExtendedActorSystem) .setMaxInstancesPerNode(settings.maxInstancesPerNode) .setTotalInstances(settings.totalInstances) .addAllUseRoles(settings.useRoles.asJava) - - // for backwards compatibility - settings.useRole.foreach(builder.setUseRole) - - builder.build() + .build() } // we don't care about races here since it's just a cache diff --git a/cluster/src/main/scala/org/apache/pekko/cluster/routing/ClusterRouterConfig.scala b/cluster/src/main/scala/org/apache/pekko/cluster/routing/ClusterRouterConfig.scala index 38fb002907..8bbca406be 100644 --- a/cluster/src/main/scala/org/apache/pekko/cluster/routing/ClusterRouterConfig.scala +++ b/cluster/src/main/scala/org/apache/pekko/cluster/routing/ClusterRouterConfig.scala @@ -16,7 +16,6 @@ package org.apache.pekko.cluster.routing import java.util.concurrent.atomic.AtomicInteger import scala.annotation.{ tailrec, varargs } import scala.collection.immutable -import scala.annotation.nowarn import com.typesafe.config.Config import com.typesafe.config.ConfigFactory import org.apache.pekko @@ -42,13 +41,6 @@ import pekko.util.HashCode import pekko.util.ccompat.JavaConverters._ object ClusterRouterGroupSettings { - @deprecated("useRole has been replaced with useRoles", since = "Akka 2.5.4") - def apply( - totalInstances: Int, - routeesPaths: immutable.Seq[String], - allowLocalRoutees: Boolean, - useRole: Option[String]): ClusterRouterGroupSettings = - new ClusterRouterGroupSettings(totalInstances, routeesPaths, allowLocalRoutees, useRole.toSet) @varargs def apply( @@ -122,25 +114,6 @@ final class ClusterRouterGroupSettings( override def toString: String = s"ClusterRouterGroupSettings($totalInstances,$routeesPaths,$allowLocalRoutees,$useRoles)" - // For binary compatibility - @deprecated("useRole has been replaced with useRoles", since = "Akka 2.5.4") - def useRole: Option[String] = useRoles.headOption - - @deprecated("useRole has been replaced with useRoles", since = "Akka 2.5.4") - def this( - totalInstances: Int, - routeesPaths: immutable.Seq[String], - allowLocalRoutees: Boolean, - useRole: Option[String]) = - this(totalInstances, routeesPaths, allowLocalRoutees, useRole.toSet) - - /** - * Java API - */ - @deprecated("useRole has been replaced with useRoles", since = "Akka 2.5.4") - def this(totalInstances: Int, routeesPaths: java.lang.Iterable[String], allowLocalRoutees: Boolean, useRole: String) = - this(totalInstances, immutableSeq(routeesPaths), allowLocalRoutees, Option(useRole).toSet) - /** * Java API */ @@ -151,16 +124,6 @@ final class ClusterRouterGroupSettings( useRoles: java.util.Set[String]) = this(totalInstances, immutableSeq(routeesPaths), allowLocalRoutees, useRoles.asScala.toSet) - // For binary compatibility - @deprecated("Use constructor with useRoles instead", since = "Akka 2.5.4") - @nowarn("msg=deprecated") - def copy( - totalInstances: Int = totalInstances, - routeesPaths: immutable.Seq[String] = routeesPaths, - allowLocalRoutees: Boolean = allowLocalRoutees, - useRole: Option[String] = useRole): ClusterRouterGroupSettings = - new ClusterRouterGroupSettings(totalInstances, routeesPaths, allowLocalRoutees, useRole) - if (totalInstances <= 0) throw new IllegalArgumentException("totalInstances of cluster router must be > 0") if ((routeesPaths eq null) || routeesPaths.isEmpty || routeesPaths.head == "") throw new IllegalArgumentException("routeesPaths must be defined") @@ -194,14 +157,6 @@ object ClusterRouterPoolSettings { useRoles: Set[String]): ClusterRouterPoolSettings = new ClusterRouterPoolSettings(totalInstances, maxInstancesPerNode, allowLocalRoutees, useRoles) - @deprecated("useRole has been replaced with useRoles", since = "Akka 2.5.4") - def apply( - totalInstances: Int, - maxInstancesPerNode: Int, - allowLocalRoutees: Boolean, - useRole: Option[String]): ClusterRouterPoolSettings = - new ClusterRouterPoolSettings(totalInstances, maxInstancesPerNode, allowLocalRoutees, useRole.toSet) - @varargs def apply( totalInstances: Int, @@ -269,37 +224,12 @@ final class ClusterRouterPoolSettings( override def toString: String = s"ClusterRouterPoolSettings($totalInstances,$maxInstancesPerNode,$allowLocalRoutees,$useRoles)" - // For binary compatibility - @deprecated("useRole has been replaced with useRoles", since = "Akka 2.5.4") - def useRole: Option[String] = useRoles.headOption - - @deprecated("useRole has been replaced with useRoles", since = "Akka 2.5.4") - def this(totalInstances: Int, maxInstancesPerNode: Int, allowLocalRoutees: Boolean, useRole: Option[String]) = - this(totalInstances, maxInstancesPerNode, allowLocalRoutees, useRole.toSet) - - /** - * Java API - */ - @deprecated("useRole has been replaced with useRoles", since = "Akka 2.5.4") - def this(totalInstances: Int, maxInstancesPerNode: Int, allowLocalRoutees: Boolean, useRole: String) = - this(totalInstances, maxInstancesPerNode, allowLocalRoutees, Option(useRole).toSet) - /** * Java API */ def this(totalInstances: Int, maxInstancesPerNode: Int, allowLocalRoutees: Boolean, useRoles: java.util.Set[String]) = this(totalInstances, maxInstancesPerNode, allowLocalRoutees, useRoles.asScala.toSet) - // For binary compatibility - @deprecated("Use copy with useRoles instead", since = "Akka 2.5.4") - @nowarn("msg=deprecated") - def copy( - totalInstances: Int = totalInstances, - maxInstancesPerNode: Int = maxInstancesPerNode, - allowLocalRoutees: Boolean = allowLocalRoutees, - useRole: Option[String] = useRole): ClusterRouterPoolSettings = - new ClusterRouterPoolSettings(totalInstances, maxInstancesPerNode, allowLocalRoutees, useRole) - if (maxInstancesPerNode <= 0) throw new IllegalArgumentException("maxInstancesPerNode of cluster pool router must be > 0")