Class LeaderElectionConfigurationProperties
java.lang.Object
io.micronaut.kubernetes.client.operator.configuration.LeaderElectionConfigurationProperties
- All Implemented Interfaces:
LeaderElectionConfiguration
@ConfigurationProperties("kubernetes.client.operator.leader-election.lock")
public class LeaderElectionConfigurationProperties
extends Object
implements LeaderElectionConfiguration
ConfigurationProperties
implementation of LeaderElectionConfiguration
.- Since:
- 3.3
- Author:
- Pavol Gressa
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NonNull Duration
The lock lease duration.@NonNull Duration
The lock renew deadline.The lock resource name.The lock resource namespace.@NonNull Duration
The lock acquire retry period.void
setLeaseDuration
(@NonNull Duration leaseDuration) Sets the lock lease duration.void
setRenewDeadline
(@NonNull Duration renewDeadline) Sets the lock renew deadline.void
setResourceName
(@NonNull String resourceName) Sets the lock resource name.void
setResourceNamespace
(@NonNull String resourceNamespace) Sets the lock resource namespace.void
setRetryPeriod
(@NonNull Duration retryPeriod) Sets the lock acquire retry period.
-
Field Details
-
PREFIX
- See Also:
-
DEFAULT_LEASE_DURATION_IN_SECONDS
-
DEFAULT_RENEW_DEADLINE_IN_SECONDS
-
DEFAULT_RETRY_PERIOD_IN_SECONDS
-
-
Constructor Details
-
LeaderElectionConfigurationProperties
public LeaderElectionConfigurationProperties()
-
-
Method Details
-
getLeaseDuration
The lock lease duration. SeeLeaderElector
. DefaultDEFAULT_LEASE_DURATION_IN_SECONDS
.- Specified by:
getLeaseDuration
in interfaceLeaderElectionConfiguration
- Returns:
- lock lease duration
-
setLeaseDuration
Sets the lock lease duration.- Parameters:
leaseDuration
- lock lease duration.
-
getRenewDeadline
The lock renew deadline. If theLeaderElector
fails to renew the lock within the deadline then the controller looses the lock. DefaultDEFAULT_RENEW_DEADLINE_IN_SECONDS
.- Specified by:
getRenewDeadline
in interfaceLeaderElectionConfiguration
- Returns:
- renew deadline
-
setRenewDeadline
Sets the lock renew deadline. If theLeaderElector
fails to renew the lock within the deadline then the controller looses the lock.- Parameters:
renewDeadline
- lock renew deadline.
-
getRetryPeriod
The lock acquire retry period. SeeLeaderElector
. DefaultDEFAULT_RETRY_PERIOD_IN_SECONDS
.- Specified by:
getRetryPeriod
in interfaceLeaderElectionConfiguration
- Returns:
- lock acquire retry period.
-
setRetryPeriod
Sets the lock acquire retry period.- Parameters:
retryPeriod
- lock acquire retry period
-
getResourceName
The lock resource name. If not provided then the application name is used.- Specified by:
getResourceName
in interfaceLeaderElectionConfiguration
- Returns:
- the lock resource name
-
setResourceName
Sets the lock resource name.- Parameters:
resourceName
- lock resource name
-
getResourceNamespace
The lock resource namespace. If not provided then the application namespaces is used.- Specified by:
getResourceNamespace
in interfaceLeaderElectionConfiguration
- Returns:
- the lock resource namespace
-
setResourceNamespace
Sets the lock resource namespace.- Parameters:
resourceNamespace
- the lock resource namespace
-