Interface Lock
-
- All Known Implementing Classes:
ConfigMapLock,LeaseLock,ResourceLock
public interface Lock
-
-
Field Summary
Fields Modifier and Type Field Description static StringLEADER_ELECTION_RECORD_ANNOTATION_KEY
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcreate(KubernetesClient client, LeaderElectionRecord leaderElectionRecord)Attempt to create a newLeaderElectionRecord.Stringdescribe()Full description of the current lock.LeaderElectionRecordget(KubernetesClient client)Returns the currentLeaderElectionRecordor null if none.Stringidentity()Returns the unique id of the lock holder.voidupdate(KubernetesClient client, LeaderElectionRecord leaderElectionRecord)Attempts to update the currentLeaderElectionRecord.
-
-
-
Field Detail
-
LEADER_ELECTION_RECORD_ANNOTATION_KEY
static final String LEADER_ELECTION_RECORD_ANNOTATION_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
get
LeaderElectionRecord get(KubernetesClient client)
Returns the currentLeaderElectionRecordor null if none.- Parameters:
client- used to retrieve the LeaderElectionRecord- Returns:
- the current LeaderElectionRecord or null if none
-
create
void create(KubernetesClient client, LeaderElectionRecord leaderElectionRecord)
Attempt to create a newLeaderElectionRecord.- Parameters:
client- used to retrieve the LeaderElectionRecordleaderElectionRecord- to update
-
update
void update(KubernetesClient client, LeaderElectionRecord leaderElectionRecord)
Attempts to update the currentLeaderElectionRecord.- Parameters:
client- used to retrieve the LeaderElectionRecordleaderElectionRecord- to update
-
identity
String identity()
Returns the unique id of the lock holder. This id is to compare ids with currentLeaderElectionRecord.getHolderIdentity()to check for leadership.- Returns:
- unique id for the lock
-
describe
String describe()
Full description of the current lock.- Returns:
- lock description
-
-