This commit is contained in:
parent
d55990fa64
commit
a13f5cab00
7 changed files with 114 additions and 38 deletions
|
|
@ -7,7 +7,9 @@ import scala.concurrent.duration._
|
|||
import scala.concurrent.duration.FiniteDuration
|
||||
import akka.actor.ActorSystem
|
||||
import akka.actor.NoSerializationVerificationNeeded
|
||||
import akka.annotation.InternalApi
|
||||
import com.typesafe.config.Config
|
||||
import akka.cluster.Cluster
|
||||
import akka.cluster.singleton.ClusterSingletonManagerSettings
|
||||
|
||||
object ClusterShardingSettings {
|
||||
|
|
@ -204,6 +206,11 @@ final class ClusterShardingSettings(
|
|||
stateStoreMode == StateStoreModePersistence || stateStoreMode == StateStoreModeDData,
|
||||
s"Unknown 'state-store-mode' [$stateStoreMode], valid values are '$StateStoreModeDData' or '$StateStoreModePersistence'")
|
||||
|
||||
/** If true, this node should run the shard region, otherwise just a shard proxy should started on this node. */
|
||||
@InternalApi
|
||||
private[akka] def shouldHostShard(cluster: Cluster): Boolean =
|
||||
role.forall(cluster.selfMember.roles.contains)
|
||||
|
||||
def withRole(role: String): ClusterShardingSettings = copy(role = ClusterShardingSettings.roleOption(role))
|
||||
|
||||
def withRole(role: Option[String]): ClusterShardingSettings = copy(role = role)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue