Class ClusterShardingSettings
java.lang.Object
org.apache.pekko.cluster.sharding.typed.ClusterShardingSettings
param: numberOfShards number of shards used by the default
HashCodeMessageExtractor
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 the ShardRegion 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 the ShardRegion will be started
in proxy mode.
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: passivationStrategySettings settings for automatic passivation strategy, see descriptions in reference.conf
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 ClassesModifier and TypeClassDescriptionstatic final classAPI MAY CHANGE: Settings for passivation strategies may change after additional testing and feedback.static classAPI MAY CHANGE: Settings for passivation strategies may change after additional testing and feedback.static interfacestatic classstatic classstatic classstatic interfacestatic classstatic classstatic classstatic final class -
Constructor Summary
ConstructorsConstructorDescriptionClusterShardingSettings(int numberOfShards, scala.Option<String> role, scala.Option<String> dataCenter, boolean rememberEntities, String journalPluginId, String snapshotPluginId, ClusterShardingSettings.PassivationStrategySettings passivationStrategySettings, scala.concurrent.duration.FiniteDuration shardRegionQueryTimeout, ClusterShardingSettings.StateStoreMode stateStoreMode, ClusterShardingSettings.RememberEntitiesStoreMode rememberEntitiesStoreMode, ClusterShardingSettings.TuningParameters tuningParameters, boolean coordinatorSingletonOverrideRole, ClusterSingletonManagerSettings coordinatorSingletonSettings, scala.Option<LeaseUsageSettings> leaseSettings) -
Method Summary
Modifier and TypeMethodDescriptionstatic ClusterShardingSettingsapply(ActorSystem<?> system) Scala API: Creates new cluster sharding settings objectbooleanstatic ClusterShardingSettingscreate(ActorSystem<?> system) Java API: Creates new cluster sharding settings objectscala.Option<String>static ClusterShardingSettingsfromConfig(com.typesafe.config.Config config) scala.Option<LeaseUsageSettings>intbooleanJava APIJava APIscala.Option<String>role()scala.concurrent.duration.FiniteDurationJava APIJava APIwithCoordinatorSingletonSettings(ClusterSingletonManagerSettings coordinatorSingletonSettings) Theroleof theClusterSingletonManagerSettingsis not used.withDataCenter(String dataCenter) withJournalPluginId(String journalPluginId) withLeaseSettings(LeaseUsageSettings leaseSettings) API MAY CHANGE: Settings for passivation strategies may change after additional testing and feedback.withRememberEntities(boolean rememberEntities) withRememberEntitiesStoreMode(ClusterShardingSettings.RememberEntitiesStoreMode rememberEntitiesStoreMode) withShardRegionQueryTimeout(Duration duration) withShardRegionQueryTimeout(scala.concurrent.duration.FiniteDuration duration) withSnapshotPluginId(String snapshotPluginId) withStateStoreMode(ClusterShardingSettings.StateStoreMode stateStoreMode) withTuningParameters(ClusterShardingSettings.TuningParameters tuningParameters)
-
Constructor Details
-
ClusterShardingSettings
public ClusterShardingSettings(int numberOfShards, scala.Option<String> role, scala.Option<String> dataCenter, boolean rememberEntities, String journalPluginId, String snapshotPluginId, ClusterShardingSettings.PassivationStrategySettings passivationStrategySettings, scala.concurrent.duration.FiniteDuration shardRegionQueryTimeout, ClusterShardingSettings.StateStoreMode stateStoreMode, ClusterShardingSettings.RememberEntitiesStoreMode rememberEntitiesStoreMode, ClusterShardingSettings.TuningParameters tuningParameters, boolean coordinatorSingletonOverrideRole, ClusterSingletonManagerSettings coordinatorSingletonSettings, scala.Option<LeaseUsageSettings> leaseSettings)
-
-
Method Details
-
apply
Scala API: Creates new cluster sharding settings object -
fromConfig
-
create
Java API: Creates new cluster sharding settings object -
stateStoreModePersistence
Java API -
stateStoreModeDdata
Java API -
rememberEntitiesStoreModeEventSourced
public static ClusterShardingSettings.RememberEntitiesStoreMode rememberEntitiesStoreModeEventSourced()Java API -
rememberEntitiesStoreModeDdata
Java API -
numberOfShards
public int numberOfShards() -
role
-
dataCenter
-
rememberEntities
public boolean rememberEntities() -
journalPluginId
-
snapshotPluginId
-
passivationStrategySettings
-
shardRegionQueryTimeout
public scala.concurrent.duration.FiniteDuration shardRegionQueryTimeout() -
stateStoreMode
-
rememberEntitiesStoreMode
-
tuningParameters
-
coordinatorSingletonOverrideRole
public boolean coordinatorSingletonOverrideRole() -
coordinatorSingletonSettings
-
leaseSettings
-
withRole
-
withDataCenter
-
withRememberEntities
-
withJournalPluginId
-
withSnapshotPluginId
-
withTuningParameters
public ClusterShardingSettings withTuningParameters(ClusterShardingSettings.TuningParameters tuningParameters) -
withStateStoreMode
public ClusterShardingSettings withStateStoreMode(ClusterShardingSettings.StateStoreMode stateStoreMode) -
withRememberEntitiesStoreMode
public ClusterShardingSettings withRememberEntitiesStoreMode(ClusterShardingSettings.RememberEntitiesStoreMode rememberEntitiesStoreMode) -
withPassivationStrategy
public ClusterShardingSettings withPassivationStrategy(ClusterShardingSettings.PassivationStrategySettings settings) API MAY CHANGE: Settings for passivation strategies may change after additional testing and feedback. -
withNoPassivationStrategy
-
withShardRegionQueryTimeout
public ClusterShardingSettings withShardRegionQueryTimeout(scala.concurrent.duration.FiniteDuration duration) -
withShardRegionQueryTimeout
-
withLeaseSettings
-
withCoordinatorSingletonSettings
public ClusterShardingSettings withCoordinatorSingletonSettings(ClusterSingletonManagerSettings coordinatorSingletonSettings) Theroleof theClusterSingletonManagerSettingsis not used. Theroleof the coordinator singleton will be the same as theroleofClusterShardingSettings.
-