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: passivationStrategySettings settings for automatic passivation strategy, see descriptions in reference.conf param: tuningParameters additional tuning parameters, see descriptions in reference.conf param: shardRegionQueryTimeout the timeout for querying a shard region, see descriptions in reference.conf param: leaseSettings LeaseSettings for acquiring before creating the shard. Note that if you define a custom lease name and have several sharding entity types each one must have a unique lease name. If the lease name is undefined it will be derived from ActorSystem name and shard name, but that may result in too long lease names.
    • 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,
                                       ClusterShardingSettings.PassivationStrategySettings passivationStrategySettings,
                                       scala.concurrent.duration.FiniteDuration shardRegionQueryTimeout,
                                       ClusterShardingSettings.TuningParameters tuningParameters,
                                       ClusterSingletonManagerSettings coordinatorSingletonSettings,
                                       scala.Option<LeaseUsageSettings> leaseSettings)
        Deprecated.
        Use the ClusterShardingSettings factory methods or the constructor including coordinatorSingletonOverrideRole instead. Since 2.6.20.
      • 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)
        Deprecated.
        Use the ClusterShardingSettings factory methods or the constructor including passivationStrategySettings instead. Since 2.6.18.
      • 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.
    • Method Detail

      • StateStoreModePersistence

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

        public static java.lang.String StateStoreModeDData()
      • 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.
      • 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()
      • shardRegionQueryTimeout

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

        public boolean coordinatorSingletonOverrideRole()
      • withSnapshotPluginId

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

        public scala.concurrent.duration.FiniteDuration passivateIdleEntityAfter()
        Deprecated.
        See passivationStrategySettings.idleEntitySettings instead. Since 2.6.18.
      • withPassivateIdleAfter

        public ClusterShardingSettings withPassivateIdleAfter​(scala.concurrent.duration.FiniteDuration duration)
        Deprecated.
        Use withPassivationStrategy instead. Since 2.6.18.
      • withPassivateIdleAfter

        public ClusterShardingSettings withPassivateIdleAfter​(java.time.Duration duration)
        Deprecated.
        Use withPassivationStrategy instead. Since 2.6.18.
      • withShardRegionQueryTimeout

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

        public ClusterShardingSettings withShardRegionQueryTimeout​(java.time.Duration duration)
      • withLeaseSettings

        public ClusterShardingSettings withLeaseSettings​(LeaseUsageSettings leaseSettings)
        Note that if you define a custom lease name and have several sharding entity types each one must have a unique lease name. If the lease name is undefined it will be derived from ActorSystem name and shard name, but that may result in too long lease names.
      • 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.