akka-cluster-sharding compiler warnings as fatal errors (#26648)

This commit is contained in:
Johan Andrén 2019-04-05 14:56:33 +02:00 committed by GitHub
parent 38e63a0e41
commit 4bb60bbcc8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 101 additions and 114 deletions

View file

@ -24,6 +24,7 @@ import akka.remote.transport.ThrottlerTransportAdapter.Direction
import akka.testkit._
import akka.util.ccompat._
@ccompatUsedUntil213
object ClusterShardingFailureSpec {
case class Get(id: String)
case class Add(id: String, i: Int)

View file

@ -21,6 +21,7 @@ import akka.cluster.sharding.ShardRegion.GetClusterShardingStats
import akka.cluster.sharding.ShardRegion.ClusterShardingStats
import akka.util.ccompat._
@ccompatUsedUntil213
object ClusterShardingMinMembersSpec {
case object StopEntity
@ -169,7 +170,7 @@ abstract class ClusterShardingMinMembersSpec(config: ClusterShardingMinMembersSp
runOn(first) {
region ! 1
// not allocated because third has not registered yet
expectNoMsg(2.second)
expectNoMessage(2.second)
}
enterBarrier("verified")

View file

@ -19,6 +19,7 @@ import akka.util.ccompat._
import scala.concurrent.duration._
@ccompatUsedUntil213
object ClusterShardingRememberEntitiesSpec {
final case class Started(ref: ActorRef)

View file

@ -30,7 +30,7 @@ import java.io.File
import org.apache.commons.io.FileUtils
import akka.cluster.singleton.ClusterSingletonManager
import akka.cluster.singleton.ClusterSingletonManagerSettings
import akka.pattern.BackoffSupervisor
import akka.pattern.BackoffOpts
object ClusterShardingSpec {
//#counter-actor
@ -202,6 +202,7 @@ object ClusterShardingDocCode {
(id.toLong % numberOfShards).toString
}
//#extractShardId-StartEntity
extractShardId.toString() // keep the compiler happy
}
}
@ -310,15 +311,16 @@ abstract class ClusterShardingSpec(config: ClusterShardingSpecConfig)
"AutoMigrateRememberRegionTest").foreach { typeName =>
val rebalanceEnabled = typeName.toLowerCase.startsWith("rebalancing")
val rememberEnabled = typeName.toLowerCase.contains("remember")
val singletonProps = BackoffSupervisor
.props(
childProps = coordinatorProps(typeName, rebalanceEnabled, rememberEnabled),
childName = "coordinator",
minBackoff = 5.seconds,
maxBackoff = 5.seconds,
randomFactor = 0.1,
maxNrOfRetries = -1)
.withDeploy(Deploy.local)
val singletonProps =
BackoffOpts
.onFailure(
childProps = coordinatorProps(typeName, rebalanceEnabled, rememberEnabled),
childName = "coordinator",
minBackoff = 5.seconds,
maxBackoff = 5.seconds,
randomFactor = 0.1)
.props
.withDeploy(Deploy.local)
system.actorOf(
ClusterSingletonManager
.props(singletonProps, terminationMessage = PoisonPill, settings = ClusterSingletonManagerSettings(system)),
@ -642,6 +644,8 @@ abstract class ClusterShardingSpec(config: ClusterShardingSpecConfig)
extractEntityId = extractEntityId,
extractShardId = extractShardId)
//#counter-start
counterRegion.toString // keep the compiler happy
ClusterSharding(system).start(
typeName = "AnotherCounter",
entityProps = Props[AnotherCounter],
@ -717,6 +721,7 @@ abstract class ClusterShardingSpec(config: ClusterShardingSpecConfig)
extractEntityId = extractEntityId,
extractShardId = extractShardId)
// #proxy-dc
counterProxyDcB.toString // keep the compiler happy
}
enterBarrier("after-dc-proxy")
@ -954,7 +959,7 @@ abstract class ClusterShardingSpec(config: ClusterShardingSpecConfig)
entity ! Identify(n)
receiveOne(3 seconds) match {
case ActorIdentity(id, Some(_)) if id == n => count = count + 1
case ActorIdentity(id, None) => //Not on the fifth shard
case ActorIdentity(_, None) => //Not on the fifth shard
}
}
count should be >= (2)

View file

@ -20,6 +20,7 @@ import akka.testkit._
import com.typesafe.config.ConfigFactory
import akka.util.ccompat._
@ccompatUsedUntil213
object MultiDcClusterShardingSpec {
sealed trait EntityMsg {
def id: String