Class ClusterShardingSettings

  • All Implemented Interfaces:
    NoSerializationVerificationNeeded

    public final class ClusterShardingSettings
    extends java.lang.Object
    implements NoSerializationVerificationNeeded
    param: role specifies that this entity type requires cluster nodes with a specific role. If the role is not specified all nodes in the cluster are used. param: rememberEntities true if active entity actors shall be automatically restarted upon Shard restart. i.e. if the Shard is started on a different ShardRegion due to rebalance or crash. param: journalPluginId Absolute path to the journal plugin configuration entity that is to be used for the internal persistence of ClusterSharding. If not defined the default journal plugin is used. Note that this is not related to persistence used by the entity actors. param: snapshotPluginId Absolute path to the snapshot plugin configuration entity that is to be used for the internal persistence of ClusterSharding. If not defined the default snapshot plugin is used. Note that this is not related to persistence used by the entity actors. param: passivateIdleEntityAfter Passivate entities that have not received any message in this interval. Note that only messages sent through sharding are counted, so direct messages to the ActorRef of the actor or messages that it sends to itself are not counted as activity. Use 0 to disable automatic passivation. param: tuningParameters additional tuning parameters, see descriptions in reference.conf
    • Constructor Detail

      • ClusterShardingSettings

        public ClusterShardingSettings​(scala.Option<java.lang.String> role,
                                       boolean rememberEntities,
                                       java.lang.String journalPluginId,
                                       java.lang.String snapshotPluginId,
                                       java.lang.String stateStoreMode,
                                       scala.concurrent.duration.FiniteDuration passivateIdleEntityAfter,
                                       ClusterShardingSettings.TuningParameters tuningParameters,
                                       ClusterSingletonManagerSettings coordinatorSingletonSettings)
      • ClusterShardingSettings

        public ClusterShardingSettings​(scala.Option<java.lang.String> role,
                                       boolean rememberEntities,
                                       java.lang.String journalPluginId,
                                       java.lang.String snapshotPluginId,
                                       java.lang.String stateStoreMode,
                                       ClusterShardingSettings.TuningParameters tuningParameters,
                                       ClusterSingletonManagerSettings coordinatorSingletonSettings)
        Deprecated.
        Use the ClusterShardingSettings factory methods or the constructor including passivateIdleEntityAfter instead. Since 2.5.18.
    • Method Detail

      • StateStoreModePersistence

        public static java.lang.String StateStoreModePersistence()
      • StateStoreModeDData

        public static java.lang.String StateStoreModeDData()
      • apply

        public static ClusterShardingSettings apply​(ActorSystem system)
        Create settings from the default configuration akka.cluster.sharding.
        Parameters:
        system - (undocumented)
        Returns:
        (undocumented)
      • apply

        public static ClusterShardingSettings apply​(com.typesafe.config.Config config)
        Create settings from a configuration with the same layout as the default configuration akka.cluster.sharding.
        Parameters:
        config - (undocumented)
        Returns:
        (undocumented)
      • create

        public static ClusterShardingSettings create​(ActorSystem system)
        Java API: Create settings from the default configuration akka.cluster.sharding.
        Parameters:
        system - (undocumented)
        Returns:
        (undocumented)
      • create

        public static ClusterShardingSettings create​(com.typesafe.config.Config config)
        Java API: Create settings from a configuration with the same layout as the default configuration akka.cluster.sharding.
        Parameters:
        config - (undocumented)
        Returns:
        (undocumented)
      • roleOption

        public static scala.Option<java.lang.String> roleOption​(java.lang.String role)
        INTERNAL API
        Parameters:
        role - (undocumented)
        Returns:
        (undocumented)
      • role

        public scala.Option<java.lang.String> role()
      • rememberEntities

        public boolean rememberEntities()
      • journalPluginId

        public java.lang.String journalPluginId()
      • snapshotPluginId

        public java.lang.String snapshotPluginId()
      • stateStoreMode

        public java.lang.String stateStoreMode()
      • passivateIdleEntityAfter

        public scala.concurrent.duration.FiniteDuration passivateIdleEntityAfter()
      • shouldHostShard

        public boolean shouldHostShard​(Cluster cluster)
        If true, this node should run the shard region, otherwise just a shard proxy should started on this node.
      • withSnapshotPluginId

        public ClusterShardingSettings withSnapshotPluginId​(java.lang.String snapshotPluginId)
      • withPassivateIdleAfter

        public ClusterShardingSettings withPassivateIdleAfter​(scala.concurrent.duration.FiniteDuration duration)
      • withCoordinatorSingletonSettings

        public ClusterShardingSettings withCoordinatorSingletonSettings​(ClusterSingletonManagerSettings coordinatorSingletonSettings)
        The role of the ClusterSingletonManagerSettings is not used. The role of the coordinator singleton will be the same as the role of ClusterShardingSettings.
        Parameters:
        coordinatorSingletonSettings - (undocumented)
        Returns:
        (undocumented)