Interface Lock
- 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 TypeMethodDescriptionboolean
create
(LeaderElectionRecord record) create attempts to create a LeaderElectionRecorddescribe()
Describe is used to convert details on current resource lock into a stringget()
get returns the LeaderElectionRecord which contains the information about the current lock holderidentity()
identity returns the locks Identityboolean
update
(LeaderElectionRecord record) update attempts to update the existing LeaderElectionRecord
-
Method Details
-
get
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
create attempts to create a LeaderElectionRecord- Parameters:
record
- the information of this candidate- Returns:
- the result is successful or not
-
update
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
-