@Internal public sealed interface Lock
Interface for kubernetes object lock implementation. It is strictly used by the leader election code.

The code has been copied from the official client and modified: Lock

  • Method Details

    • get

      Loads the leader election record.
      Returns:
      the leader election record
      Throws:
      IOException
    • create

      boolean create(LeaderElectionRecord leaderElectionRecord)
      Stores the leader election record.
      Parameters:
      leaderElectionRecord - the leader election record
      Returns:
      true if the record has been successfully stored
    • update

      boolean update(LeaderElectionRecord leaderElectionRecord)
      Updates the leader election record.
      Parameters:
      leaderElectionRecord - the leader election record
      Returns:
      true if the record has been successfully updated
    • getIdentity

      String getIdentity()
      Returns the identity of this service instance.
      Returns:
      the identity