Package akka.cluster.sharding.typed
Class ClusterShardingSettings
- java.lang.Object
-
- akka.cluster.sharding.typed.ClusterShardingSettings
-
public final class ClusterShardingSettings extends java.lang.Object
param: numberOfShards number of shards used by the defaultHashCodeMessageExtractor
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. If the given role does not match the role of the current node theShardRegion
will be started in proxy mode. param: dataCenter The data center of the cluster nodes where the cluster sharding is running. If the dataCenter is not specified then the same data center as current node. If the given dataCenter does not match the data center of the current node theShardRegion
will be started in proxy mode. param: rememberEntities true if active entity actors shall be automatically restarted uponShard
restart. i.e. if theShard
is started on a differentShardRegion
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: 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 theActorRef
of the actor or messages that it sends to itself are not counted as activity. Use 0 to disable automatic passivation. 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: tuningParameters additional tuning parameters, see descriptions in reference.conf
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ClusterShardingSettings.RememberEntitiesStoreMode
static class
ClusterShardingSettings.RememberEntitiesStoreMode$
static class
ClusterShardingSettings.RememberEntitiesStoreModeDData$
static class
ClusterShardingSettings.RememberEntitiesStoreModeEventSourced$
static interface
ClusterShardingSettings.StateStoreMode
static class
ClusterShardingSettings.StateStoreMode$
static class
ClusterShardingSettings.StateStoreModeDData$
static class
ClusterShardingSettings.StateStoreModePersistence$
static class
ClusterShardingSettings.TuningParameters
-
Constructor Summary
Constructors Constructor Description ClusterShardingSettings(int numberOfShards, scala.Option<java.lang.String> role, scala.Option<java.lang.String> dataCenter, boolean rememberEntities, java.lang.String journalPluginId, java.lang.String snapshotPluginId, scala.concurrent.duration.FiniteDuration passivateIdleEntityAfter, scala.concurrent.duration.FiniteDuration shardRegionQueryTimeout, ClusterShardingSettings.StateStoreMode stateStoreMode, ClusterShardingSettings.RememberEntitiesStoreMode rememberEntitiesStoreMode, ClusterShardingSettings.TuningParameters tuningParameters, ClusterSingletonManagerSettings coordinatorSingletonSettings)
ClusterShardingSettings(int numberOfShards, scala.Option<java.lang.String> role, scala.Option<java.lang.String> dataCenter, boolean rememberEntities, java.lang.String journalPluginId, java.lang.String snapshotPluginId, scala.concurrent.duration.FiniteDuration passivateIdleEntityAfter, scala.concurrent.duration.FiniteDuration shardRegionQueryTimeout, ClusterShardingSettings.StateStoreMode stateStoreMode, ClusterShardingSettings.TuningParameters tuningParameters, ClusterSingletonManagerSettings coordinatorSingletonSettings)
Deprecated.Use constructor with rememberEntitiesStoreMode.
-
Method Summary
-
-
-
Constructor Detail
-
ClusterShardingSettings
public ClusterShardingSettings(int numberOfShards, scala.Option<java.lang.String> role, scala.Option<java.lang.String> dataCenter, boolean rememberEntities, java.lang.String journalPluginId, java.lang.String snapshotPluginId, scala.concurrent.duration.FiniteDuration passivateIdleEntityAfter, scala.concurrent.duration.FiniteDuration shardRegionQueryTimeout, ClusterShardingSettings.StateStoreMode stateStoreMode, ClusterShardingSettings.RememberEntitiesStoreMode rememberEntitiesStoreMode, ClusterShardingSettings.TuningParameters tuningParameters, ClusterSingletonManagerSettings coordinatorSingletonSettings)
-
ClusterShardingSettings
public ClusterShardingSettings(int numberOfShards, scala.Option<java.lang.String> role, scala.Option<java.lang.String> dataCenter, boolean rememberEntities, java.lang.String journalPluginId, java.lang.String snapshotPluginId, scala.concurrent.duration.FiniteDuration passivateIdleEntityAfter, scala.concurrent.duration.FiniteDuration shardRegionQueryTimeout, ClusterShardingSettings.StateStoreMode stateStoreMode, ClusterShardingSettings.TuningParameters tuningParameters, ClusterSingletonManagerSettings coordinatorSingletonSettings)
Deprecated.Use constructor with rememberEntitiesStoreMode. Since 2.6.6.
-
-
Method Detail
-
apply
public static ClusterShardingSettings apply(ActorSystem<?> system)
Scala API: Creates new cluster sharding settings object
-
fromConfig
public static ClusterShardingSettings fromConfig(com.typesafe.config.Config config)
-
create
public static ClusterShardingSettings create(ActorSystem<?> system)
Java API: Creates new cluster sharding settings object
-
fromClassicSettings
public static ClusterShardingSettings fromClassicSettings(int numberOfShards, ClusterShardingSettings classicSettings)
INTERNAL API: Intended only for internal use, it is not recommended to keep converting between the setting types
-
toClassicSettings
public static ClusterShardingSettings toClassicSettings(ClusterShardingSettings settings)
INTERNAL API: Intended only for internal use, it is not recommended to keep converting between the setting types
-
stateStoreModePersistence
public static ClusterShardingSettings.StateStoreMode stateStoreModePersistence()
Java API
-
stateStoreModeDdata
public static ClusterShardingSettings.StateStoreMode stateStoreModeDdata()
Java API
-
rememberEntitiesStoreModeEventSourced
public static ClusterShardingSettings.RememberEntitiesStoreMode rememberEntitiesStoreModeEventSourced()
Java API
-
rememberEntitiesStoreModeDdata
public static ClusterShardingSettings.RememberEntitiesStoreMode rememberEntitiesStoreModeDdata()
Java API
-
numberOfShards
public int numberOfShards()
-
role
public scala.Option<java.lang.String> role()
-
dataCenter
public scala.Option<java.lang.String> dataCenter()
-
rememberEntities
public boolean rememberEntities()
-
journalPluginId
public java.lang.String journalPluginId()
-
snapshotPluginId
public java.lang.String snapshotPluginId()
-
passivateIdleEntityAfter
public scala.concurrent.duration.FiniteDuration passivateIdleEntityAfter()
-
shardRegionQueryTimeout
public scala.concurrent.duration.FiniteDuration shardRegionQueryTimeout()
-
stateStoreMode
public ClusterShardingSettings.StateStoreMode stateStoreMode()
-
rememberEntitiesStoreMode
public ClusterShardingSettings.RememberEntitiesStoreMode rememberEntitiesStoreMode()
-
tuningParameters
public ClusterShardingSettings.TuningParameters tuningParameters()
-
coordinatorSingletonSettings
public ClusterSingletonManagerSettings coordinatorSingletonSettings()
-
shouldHostShard
public boolean shouldHostShard(Cluster cluster)
INTERNAL API If true, this node should run the shard region, otherwise just a shard proxy should started on this node. It's checking if therole
anddataCenter
are matching.
-
withRole
public ClusterShardingSettings withRole(java.lang.String role)
-
withDataCenter
public ClusterShardingSettings withDataCenter(java.lang.String dataCenter)
-
withRememberEntities
public ClusterShardingSettings withRememberEntities(boolean rememberEntities)
-
withJournalPluginId
public ClusterShardingSettings withJournalPluginId(java.lang.String journalPluginId)
-
withSnapshotPluginId
public ClusterShardingSettings withSnapshotPluginId(java.lang.String snapshotPluginId)
-
withTuningParameters
public ClusterShardingSettings withTuningParameters(ClusterShardingSettings.TuningParameters tuningParameters)
-
withStateStoreMode
public ClusterShardingSettings withStateStoreMode(ClusterShardingSettings.StateStoreMode stateStoreMode)
-
withRememberEntitiesStoreMode
public ClusterShardingSettings withRememberEntitiesStoreMode(ClusterShardingSettings.RememberEntitiesStoreMode rememberEntitiesStoreMode)
-
withPassivateIdleEntityAfter
public ClusterShardingSettings withPassivateIdleEntityAfter(scala.concurrent.duration.FiniteDuration duration)
-
withPassivateIdleEntityAfter
public ClusterShardingSettings withPassivateIdleEntityAfter(java.time.Duration duration)
-
withShardRegionQueryTimeout
public ClusterShardingSettings withShardRegionQueryTimeout(scala.concurrent.duration.FiniteDuration duration)
-
withShardRegionQueryTimeout
public ClusterShardingSettings withShardRegionQueryTimeout(java.time.Duration duration)
-
withCoordinatorSingletonSettings
public ClusterShardingSettings withCoordinatorSingletonSettings(ClusterSingletonManagerSettings coordinatorSingletonSettings)
Therole
of theClusterSingletonManagerSettings
is not used. Therole
of the coordinator singleton will be the same as therole
ofClusterShardingSettings
.
-
-