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 Details

    • PREFIX

      public static final String PREFIX
      See Also:
    • DEFAULT_LEASE_DURATION_IN_SECONDS

      public static final Integer DEFAULT_LEASE_DURATION_IN_SECONDS
    • DEFAULT_RENEW_DEADLINE_IN_SECONDS

      public static final Integer DEFAULT_RENEW_DEADLINE_IN_SECONDS
    • DEFAULT_RETRY_PERIOD_IN_SECONDS

      public static final Integer DEFAULT_RETRY_PERIOD_IN_SECONDS
  • Constructor Details

    • LeaderElectionConfigurationProperties

      public LeaderElectionConfigurationProperties()
  • Method Details

    • getLeaseDuration

      @NonNull public @NonNull Duration getLeaseDuration()
      The lock lease duration. See LeaderElector. Default DEFAULT_LEASE_DURATION_IN_SECONDS.
      Specified by:
      getLeaseDuration in interface LeaderElectionConfiguration
      Returns:
      lock lease duration
    • setLeaseDuration

      public void setLeaseDuration(@NonNull @NonNull Duration leaseDuration)
      Sets the lock lease duration.
      Parameters:
      leaseDuration - lock lease duration.
    • getRenewDeadline

      @NonNull public @NonNull Duration getRenewDeadline()
      The lock renew deadline. If the LeaderElector fails to renew the lock within the deadline then the controller looses the lock. Default DEFAULT_RENEW_DEADLINE_IN_SECONDS.
      Specified by:
      getRenewDeadline in interface LeaderElectionConfiguration
      Returns:
      renew deadline
    • setRenewDeadline

      public void setRenewDeadline(@NonNull @NonNull Duration renewDeadline)
      Sets the lock renew deadline. If the LeaderElector fails to renew the lock within the deadline then the controller looses the lock.
      Parameters:
      renewDeadline - lock renew deadline.
    • getRetryPeriod

      @NonNull public @NonNull Duration getRetryPeriod()
      The lock acquire retry period. See LeaderElector. Default DEFAULT_RETRY_PERIOD_IN_SECONDS.
      Specified by:
      getRetryPeriod in interface LeaderElectionConfiguration
      Returns:
      lock acquire retry period.
    • setRetryPeriod

      public void setRetryPeriod(@NonNull @NonNull Duration retryPeriod)
      Sets the lock acquire retry period.
      Parameters:
      retryPeriod - lock acquire retry period
    • getResourceName

      @NonNull public @NonNull Optional<String> getResourceName()
      The lock resource name. If not provided then the application name is used.
      Specified by:
      getResourceName in interface LeaderElectionConfiguration
      Returns:
      the lock resource name
    • setResourceName

      public void setResourceName(@NonNull @NonNull String resourceName)
      Sets the lock resource name.
      Parameters:
      resourceName - lock resource name
    • getResourceNamespace

      @NonNull public @NonNull Optional<String> getResourceNamespace()
      The lock resource namespace. If not provided then the application namespaces is used.
      Specified by:
      getResourceNamespace in interface LeaderElectionConfiguration
      Returns:
      the lock resource namespace
    • setResourceNamespace

      public void setResourceNamespace(@NonNull @NonNull String resourceNamespace)
      Sets the lock resource namespace.
      Parameters:
      resourceNamespace - the lock resource namespace