public final class ClusterSingletonManagerSettings extends java.lang.Object implements NoSerializationVerificationNeeded
param: 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.
param: maxHandOverRetries When a node is becoming oldest it sends
hand-over request to previous oldest. This is retried with the
retryInterval
until the previous oldest confirms that the hand
over has started, or this maxHandOverRetries
limit has been
reached. If the retry limit is reached it takes the decision to be
the new oldest if previous oldest is unknown (typically removed),
otherwise it initiates a new round by throwing
ClusterSingletonManagerIsStuck
and expecting
restart with fresh state. For a cluster with many members you might
need to increase this retry limit because it takes longer time to
propagate changes across all nodes.
param: maxTakeOverRetries When a oldest node leaves the cluster it is
not oldest any more and then it sends take over request to the new oldest to
initiate the hand-over process. This is retried with the retryInterval
until
this retry limit has been reached. If the retry limit is reached it initiates
a new round by throwing ClusterSingletonManagerIsStuck
and expecting restart with fresh state. This will also cause the singleton actor
to be stopped. maxTakeOverRetries
must be less than maxHandOverRetries
to
ensure that new oldest doesn't start singleton actor before previous is
stopped for certain corner cases.
param: retryInterval Interval for hand over and take over messages
Constructor and Description |
---|
ClusterSingletonManagerSettings(java.lang.String singletonName,
scala.Option<java.lang.String> role,
int maxHandOverRetries,
int maxTakeOverRetries,
scala.concurrent.duration.FiniteDuration retryInterval) |
Modifier and Type | Method and Description |
---|---|
static ClusterSingletonManagerSettings |
apply(ActorSystem system)
Create settings from the default configuration
akka.cluster.singleton . |
static ClusterSingletonManagerSettings |
apply(com.typesafe.config.Config config)
Create settings from a configuration with the same layout as
the default configuration
akka.cluster.singleton . |
static ClusterSingletonManagerSettings |
create(ActorSystem system)
Java API: Create settings from the default configuration
akka.cluster.singleton . |
static ClusterSingletonManagerSettings |
create(com.typesafe.config.Config config)
Java API: Create settings from a configuration with the same layout as
the default configuration
akka.cluster.singleton . |
int |
maxHandOverRetries() |
int |
maxTakeOverRetries() |
scala.concurrent.duration.FiniteDuration |
retryInterval() |
scala.Option<java.lang.String> |
role() |
static scala.Option<java.lang.String> |
roleOption(java.lang.String role)
INTERNAL API
|
java.lang.String |
singletonName() |
ClusterSingletonManagerSettings |
withRetry(int maxHandOverRetries,
int maxTakeOverRetries,
scala.concurrent.duration.FiniteDuration retryInterval) |
ClusterSingletonManagerSettings |
withRole(scala.Option<java.lang.String> role) |
ClusterSingletonManagerSettings |
withRole(java.lang.String role) |
ClusterSingletonManagerSettings |
withSingletonName(java.lang.String name) |
public ClusterSingletonManagerSettings(java.lang.String singletonName, scala.Option<java.lang.String> role, int maxHandOverRetries, int maxTakeOverRetries, scala.concurrent.duration.FiniteDuration retryInterval)
public static ClusterSingletonManagerSettings apply(ActorSystem system)
akka.cluster.singleton
.system
- (undocumented)public static ClusterSingletonManagerSettings apply(com.typesafe.config.Config config)
akka.cluster.singleton
.config
- (undocumented)public static ClusterSingletonManagerSettings create(ActorSystem system)
akka.cluster.singleton
.system
- (undocumented)public static ClusterSingletonManagerSettings create(com.typesafe.config.Config config)
akka.cluster.singleton
.config
- (undocumented)public static scala.Option<java.lang.String> roleOption(java.lang.String role)
role
- (undocumented)public java.lang.String singletonName()
public scala.Option<java.lang.String> role()
public int maxHandOverRetries()
public int maxTakeOverRetries()
public scala.concurrent.duration.FiniteDuration retryInterval()
public ClusterSingletonManagerSettings withSingletonName(java.lang.String name)
public ClusterSingletonManagerSettings withRole(java.lang.String role)
public ClusterSingletonManagerSettings withRole(scala.Option<java.lang.String> role)
public ClusterSingletonManagerSettings withRetry(int maxHandOverRetries, int maxTakeOverRetries, scala.concurrent.duration.FiniteDuration retryInterval)