Interface Lock
@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 Summary
Modifier and TypeMethodDescriptionboolean
create
(LeaderElectionRecord leaderElectionRecord) Stores the leader election record.get()
Loads the leader election record.Returns the identity of this service instance.boolean
update
(LeaderElectionRecord leaderElectionRecord) Updates the leader election record.
-
Method Details
-
get
Loads the leader election record.- Returns:
- the leader election record
- Throws:
IOException
-
create
Stores the leader election record.- Parameters:
leaderElectionRecord
- the leader election record- Returns:
true
if the record has been successfully stored
-
update
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
-