Compile akka-cluster-metrics on scala3 (#30690)

* Compile akka-cluster-metrics on scala3

* re-introduce serialversionuid

* Avoid weird patternmatch
This commit is contained in:
Arnout Engelen 2021-09-17 07:00:45 +02:00 committed by GitHub
parent 4fe93e85bb
commit 8e5493fb1a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 8 deletions

View file

@ -22,7 +22,7 @@ jobs:
- akka-testkit/test akka-actor-tests/test - akka-testkit/test akka-actor-tests/test
- akka-actor-testkit-typed/test akka-actor-typed-tests/test - akka-actor-testkit-typed/test akka-actor-typed-tests/test
- akka-bench-jmh/test - akka-bench-jmh/test
- akka-cluster/Test/compile akka-cluster-tools/test akka-distributed-data/test - akka-cluster/Test/compile akka-cluster-tools/test akka-distributed-data/test akka-cluster-metrics/Test/compile
- akka-coordination/test - akka-coordination/test
- akka-discovery/test - akka-discovery/test
- akka-persistence/test akka-persistence-shared/test akka-persistence-query/test - akka-persistence/test akka-persistence-shared/test akka-persistence-query/test

View file

@ -52,7 +52,7 @@ class ClusterMetricsExtension(system: ExtendedActorSystem) extends Extension {
SupervisorStrategyProvider, SupervisorStrategyProvider,
immutable.Seq(classOf[Config] -> SupervisorStrategyConfiguration)) immutable.Seq(classOf[Config] -> SupervisorStrategyConfiguration))
.getOrElse { .getOrElse {
val log: LoggingAdapter = Logging(system, getClass) val log: LoggingAdapter = Logging(system, classOf[ClusterMetricsExtension])
log.error(s"Configured strategy provider ${SupervisorStrategyProvider} failed to load, using default ${classOf[ log.error(s"Configured strategy provider ${SupervisorStrategyProvider} failed to load, using default ${classOf[
ClusterMetricsStrategy].getName}.") ClusterMetricsStrategy].getName}.")
new ClusterMetricsStrategy(SupervisorStrategyConfiguration) new ClusterMetricsStrategy(SupervisorStrategyConfiguration)

View file

@ -420,7 +420,7 @@ object MetricsSelector {
/** /**
* A MetricsSelector is responsible for producing weights from the node metrics. * A MetricsSelector is responsible for producing weights from the node metrics.
*/ */
@nowarn("msg=@SerialVersionUID has no effect") @nowarn("msg=@SerialVersionUID")
@SerialVersionUID(1L) @SerialVersionUID(1L)
trait MetricsSelector extends Serializable { trait MetricsSelector extends Serializable {

View file

@ -280,6 +280,8 @@ class MetricValuesSpec extends AkkaSpec(MetricsConfig.defaultEnabled) with Metri
// we don't check the heap max value in this test. // we don't check the heap max value in this test.
// extract is the java api // extract is the java api
StandardMetrics.extractHeapMemory(node) should not be null StandardMetrics.extractHeapMemory(node) should not be null
case other =>
fail(other.toString)
} }
node match { node match {
@ -297,6 +299,8 @@ class MetricValuesSpec extends AkkaSpec(MetricsConfig.defaultEnabled) with Metri
} }
// extract is the java api // extract is the java api
StandardMetrics.extractCpu(node) should not be null StandardMetrics.extractCpu(node) should not be null
case other =>
fail(other.toString)
} }
} }
} }

View file

@ -72,10 +72,9 @@ object Configuration {
provider: Option[ConfigSSLEngineProvider]) provider: Option[ConfigSSLEngineProvider])
def getCipherConfig(cipher: String, enabled: String*): CipherConfig = { def getCipherConfig(cipher: String, enabled: String*): CipherConfig = {
val (localPort, remotePort) = SocketUtil.temporaryServerAddresses(2, "127.0.0.1").map(_.getPort) match { val ports = SocketUtil.temporaryServerAddresses(2, "127.0.0.1").map(_.getPort)
case Seq(local, remote) => (local, remote) assert(ports.size == 2)
case _ => throw new RuntimeException() val (localPort, remotePort) = (ports(0), ports(1))
}
try { try {
//if (true) throw new IllegalArgumentException("Ticket1978*Spec isn't enabled") //if (true) throw new IllegalArgumentException("Ticket1978*Spec isn't enabled")

View file

@ -30,7 +30,7 @@ object Dependencies {
val scala212Version = "2.12.14" val scala212Version = "2.12.14"
val scala213Version = "2.13.6" val scala213Version = "2.13.6"
// To get the fix for https://github.com/lampepfl/dotty/issues/13106 // To get the fix for https://github.com/lampepfl/dotty/issues/13106
val scala3Version = "3.0.3-RC1-bin-20210802-814fca6-NIGHTLY" val scala3Version = "3.1.1-RC1-bin-20210915-ea871c2-NIGHTLY"
val reactiveStreamsVersion = "1.0.3" val reactiveStreamsVersion = "1.0.3"