Package io.etcd.jetcd.election
Class LeaderKey
java.lang.Object
io.etcd.jetcd.election.LeaderKey
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetKey()Returns the opaque key representing the ownership of the election.longgetLease()Returns the lease ID of the election leader.getName()Returns the election identifier that corresponds to the leadership key.longReturns the creation revision of the key.
-
Constructor Details
-
LeaderKey
-
-
Method Details
-
getName
Returns the election identifier that corresponds to the leadership key.- Returns:
- the name.
-
getKey
Returns the opaque key representing the ownership of the election. If the key is deleted, then leadership is lost.- Returns:
- the key.
-
getRevision
public long getRevision()Returns the creation revision of the key. It can be used to test for ownership of an election during transactions by testing the key's creation revision matches rev.- Returns:
- the revision.
-
getLease
public long getLease()Returns the lease ID of the election leader.- Returns:
- the lese id.
-