All Known Implementing Classes:
ConfigMapLock, EndpointsLock, LeaseLock

public interface Lock
Lock offers a common interface for locking on arbitrary resources used in leader election. The Lock is used to hide the details on specific implementations in order to allow them to change over time. This interface is strictly for use by the leaderelection code.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    create attempts to create a LeaderElectionRecord
    Describe is used to convert details on current resource lock into a string
    get()
    get returns the LeaderElectionRecord which contains the information about the current lock holder
    identity returns the locks Identity
    boolean
    update attempts to update the existing LeaderElectionRecord
  • Method Details

    • get

      LeaderElectionRecord get() throws io.kubernetes.client.openapi.ApiException
      get returns the LeaderElectionRecord which contains the information about the current lock holder
      Returns:
      the Leader election record
      Throws:
      io.kubernetes.client.openapi.ApiException
    • create

      boolean create(LeaderElectionRecord record)
      create attempts to create a LeaderElectionRecord
      Parameters:
      record - the information of this candidate
      Returns:
      the result is successful or not
    • update

      boolean update(LeaderElectionRecord record)
      update attempts to update the existing LeaderElectionRecord
      Parameters:
      record - the information of this candidate
      Returns:
      the result is successful or not
    • identity

      String identity()
      identity returns the locks Identity
      Returns:
      the identity
    • describe

      String describe()
      Describe is used to convert details on current resource lock into a string
      Returns:
      the description