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-actor-testkit-typed/test akka-actor-typed-tests/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-discovery/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,
immutable.Seq(classOf[Config] -> SupervisorStrategyConfiguration))
.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[
ClusterMetricsStrategy].getName}.")
new ClusterMetricsStrategy(SupervisorStrategyConfiguration)

View file

@ -420,7 +420,7 @@ object MetricsSelector {
/**
* A MetricsSelector is responsible for producing weights from the node metrics.
*/
@nowarn("msg=@SerialVersionUID has no effect")
@nowarn("msg=@SerialVersionUID")
@SerialVersionUID(1L)
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.
// extract is the java api
StandardMetrics.extractHeapMemory(node) should not be null
case other =>
fail(other.toString)
}
node match {
@ -297,6 +299,8 @@ class MetricValuesSpec extends AkkaSpec(MetricsConfig.defaultEnabled) with Metri
}
// extract is the java api
StandardMetrics.extractCpu(node) should not be null
case other =>
fail(other.toString)
}
}
}

View file

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

View file

@ -30,7 +30,7 @@ object Dependencies {
val scala212Version = "2.12.14"
val scala213Version = "2.13.6"
// 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"