Class ClusterSingletonManagerSettings
The settings used for the ClusterSingletonManager
Implements
Inherited Members
Namespace: Akka.Cluster.Tools.Singleton
Assembly: Akka.Cluster.Tools.dll
Syntax
[Serializable]
public sealed class ClusterSingletonManagerSettings : INoSerializationVerificationNeeded
Constructors
| Edit this page View SourceClusterSingletonManagerSettings(string, string, TimeSpan, TimeSpan, LeaseUsageSettings, bool)
Creates a new instance of the ClusterSingletonManagerSettings.
Declaration
public ClusterSingletonManagerSettings(string singletonName, string role, TimeSpan removalMargin, TimeSpan handOverRetryInterval, LeaseUsageSettings leaseSettings, bool considerAppVersion)
Parameters
| Type | Name | Description |
|---|---|---|
| string | singletonName | The actor name of the child singleton actor. |
| string | role | Singleton among the nodes tagged with specified role. If the role is not specified it's a singleton among all nodes in the cluster. |
| TimeSpan | removalMargin | Margin until the singleton instance that belonged to a downed/removed partition is created in surviving partition. The purpose of this margin is that in case of a network partition the singleton actors in the non-surviving partitions must be stopped before corresponding actors are started somewhere else. This is especially important for persistent actors. |
| TimeSpan | handOverRetryInterval | When a node is becoming oldest it sends hand-over
request to previous oldest, that might be leaving the cluster. This is
retried with this interval until the previous oldest confirms that the hand
over has started or the previous oldest member is removed from the cluster
(+ |
| LeaseUsageSettings | leaseSettings | LeaseSettings for acquiring before creating the singleton actor |
| bool | considerAppVersion | Should AppVersion be considered when the cluster singleton instance is being moved to another node. When set to false, singleton instance will always be created on oldest member. When set to true, singleton instance will be created on the oldest member with the highest AppVersion number. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | TBD |
ClusterSingletonManagerSettings(string, string, TimeSpan, TimeSpan, bool)
Creates a new instance of the ClusterSingletonManagerSettings.
Declaration
public ClusterSingletonManagerSettings(string singletonName, string role, TimeSpan removalMargin, TimeSpan handOverRetryInterval, bool considerAppVersion)
Parameters
| Type | Name | Description |
|---|---|---|
| string | singletonName | The actor name of the child singleton actor. |
| string | role | Singleton among the nodes tagged with specified role. If the role is not specified it's a singleton among all nodes in the cluster. |
| TimeSpan | removalMargin | Margin until the singleton instance that belonged to a downed/removed partition is created in surviving partition. The purpose of this margin is that in case of a network partition the singleton actors in the non-surviving partitions must be stopped before corresponding actors are started somewhere else. This is especially important for persistent actors. |
| TimeSpan | handOverRetryInterval | When a node is becoming oldest it sends hand-over
request to previous oldest, that might be leaving the cluster. This is
retried with this interval until the previous oldest confirms that the hand
over has started or the previous oldest member is removed from the cluster
(+ |
| bool | considerAppVersion | Should AppVersion be considered when the cluster singleton instance is being moved to another node. When set to false, singleton instance will always be created on oldest member. When set to true, singleton instance will be created on the oldest member with the highest AppVersion number. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | TBD |
Properties
| Edit this page View SourceConsiderAppVersion
Should AppVersion be considered when the cluster singleton instance is being moved to another node. When set to false, singleton instance will always be created on oldest member. When set to true, singleton instance will be created on the oldest member with the highest AppVersion number.
Declaration
[Obsolete("ConsiderAppVersion is not used anymore and will be removed in future versions.")]
public bool ConsiderAppVersion { get; }
Property Value
| Type | Description |
|---|---|
| bool |
HandOverRetryInterval
When a node is becoming oldest it sends hand-over request to previous oldest, that might be leaving the cluster.
Declaration
public TimeSpan HandOverRetryInterval { get; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
LeaseSettings
LeaseSettings for acquiring before creating the singleton actor
Declaration
public LeaseUsageSettings LeaseSettings { get; }
Property Value
| Type | Description |
|---|---|
| LeaseUsageSettings |
RemovalMargin
Margin until the singleton instance that belonged to a downed/removed partition is created in surviving partition.
Declaration
public TimeSpan RemovalMargin { get; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
Role
Singleton among the nodes tagged with specified role.
Declaration
public string Role { get; }
Property Value
| Type | Description |
|---|---|
| string |
SingletonName
The actor name of the child singleton actor.
Declaration
public string SingletonName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
| Edit this page View SourceCreate(ActorSystem)
Creates a new ClusterSingletonManagerSettings instance.
Declaration
public static ClusterSingletonManagerSettings Create(ActorSystem system)
Parameters
| Type | Name | Description |
|---|---|---|
| ActorSystem | system | The ActorSystem to which this singleton manager belongs. |
Returns
| Type | Description |
|---|---|
| ClusterSingletonManagerSettings | The requested settings. |
Exceptions
| Type | Condition |
|---|---|
| ConfigurationException | Thrown if no "akka.cluster.singleton" section is defined. |
Create(Config)
Creates a new ClusterSingletonManagerSettings instance.
Declaration
public static ClusterSingletonManagerSettings Create(Config config)
Parameters
| Type | Name | Description |
|---|---|---|
| Config | config | The HOCON configuration used to create the settings. |
Returns
| Type | Description |
|---|---|
| ClusterSingletonManagerSettings | The requested settings. |
WithHandOverRetryInterval(TimeSpan)
Create a singleton manager with specified singleton removal margin hand-over retry interval.
Declaration
public ClusterSingletonManagerSettings WithHandOverRetryInterval(TimeSpan handOverRetryInterval)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | handOverRetryInterval | TBD |
Returns
| Type | Description |
|---|---|
| ClusterSingletonManagerSettings | TBD |
WithLeaseSettings(LeaseUsageSettings)
Create a singleton manager with specified singleton lease settings.
Declaration
public ClusterSingletonManagerSettings WithLeaseSettings(LeaseUsageSettings leaseSettings)
Parameters
| Type | Name | Description |
|---|---|---|
| LeaseUsageSettings | leaseSettings | TBD |
Returns
| Type | Description |
|---|---|
| ClusterSingletonManagerSettings |
WithRemovalMargin(TimeSpan)
Create a singleton manager with specified singleton removal margin.
Declaration
public ClusterSingletonManagerSettings WithRemovalMargin(TimeSpan removalMargin)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | removalMargin | TBD |
Returns
| Type | Description |
|---|---|
| ClusterSingletonManagerSettings | TBD |
WithRole(string)
Create a singleton manager with specified singleton role.
Declaration
public ClusterSingletonManagerSettings WithRole(string role)
Parameters
| Type | Name | Description |
|---|---|---|
| string | role | TBD |
Returns
| Type | Description |
|---|---|
| ClusterSingletonManagerSettings | TBD |
WithSingletonName(string)
Create a singleton manager with specified singleton name.
Declaration
public ClusterSingletonManagerSettings WithSingletonName(string singletonName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | singletonName | TBD |
Returns
| Type | Description |
|---|---|
| ClusterSingletonManagerSettings | TBD |
Edit this page