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. It is always disabled if rememberEntities is enabled. param: tuningParameters additional tuning parameters, see descriptions in reference.conf param: shardRegionQueryTimeout the timeout for querying a shard region, 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,
                                       java.lang.String rememberEntitiesStore,
                                       scala.concurrent.duration.FiniteDuration passivateIdleEntityAfter,
                                       scala.concurrent.duration.FiniteDuration shardRegionQueryTimeout,
                                       ClusterShardingSettings.TuningParameters tuningParameters,
                                       ClusterSingletonManagerSettings coordinatorSingletonSettings,
                                       scala.Option<LeaseUsageSettings> leaseSettings)
      • 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,
                                       scala.concurrent.duration.FiniteDuration shardRegionQueryTimeout,
                                       ClusterShardingSettings.TuningParameters tuningParameters,
                                       ClusterSingletonManagerSettings coordinatorSingletonSettings,
                                       scala.Option<LeaseUsageSettings> leaseSettings)
        Deprecated.
        Use the ClusterShardingSettings factory methods or the constructor including rememberedEntitiesStore instead. Since 2.6.7.
      • 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,
                                       scala.Option<LeaseUsageSettings> leaseSettings)
        Deprecated.
        Use the ClusterShardingSettings factory methods or the constructor including shardRegionQueryTimeout instead. Since 2.6.0.
      • 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)
        Deprecated.
        Use the ClusterShardingSettings factory methods or the constructor including shardRegionQueryTimeout instead. Since 2.5.21.
      • 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()
      • RememberEntitiesStoreCustom

        public static java.lang.String RememberEntitiesStoreCustom()
        Only for testing INTERNAL API
      • RememberEntitiesStoreDData

        public static java.lang.String RememberEntitiesStoreDData()
        INTERNAL API
      • RememberEntitiesStoreEventsourced

        public static java.lang.String RememberEntitiesStoreEventsourced()
        INTERNAL API
      • 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.
      • 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.
      • roleOption

        public static scala.Option<java.lang.String> roleOption​(java.lang.String role)
        INTERNAL API
      • 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()
      • rememberEntitiesStore

        public java.lang.String rememberEntitiesStore()
      • passivateIdleEntityAfter

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

        public scala.concurrent.duration.FiniteDuration shardRegionQueryTimeout()
      • 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.
      • shouldPassivateIdleEntities

        public boolean shouldPassivateIdleEntities()
        If true, idle entities should be passivated if they have not received any message by this interval, otherwise it is not enabled.
      • withSnapshotPluginId

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

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

        public ClusterShardingSettings withShardRegionQueryTimeout​(scala.concurrent.duration.FiniteDuration duration)
      • withShardRegionQueryTimeout

        public ClusterShardingSettings withShardRegionQueryTimeout​(java.time.Duration 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.