public interface Election extends CloseableClient
| Modifier and Type | Interface and Description |
|---|---|
static interface |
Election.Listener
Interface of leadership notification listener.
|
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<CampaignResponse> |
campaign(ByteSequence electionName,
long leaseId,
ByteSequence proposal)
Campaign waits to acquire leadership in an election, returning a leader key
representing the leadership if successful.
|
CompletableFuture<LeaderResponse> |
leader(ByteSequence electionName)
Returns the current election proclamation, if any.
|
void |
observe(ByteSequence electionName,
Election.Listener listener)
Listens to election proclamations in-order as made by the election's
elected leaders.
|
CompletableFuture<ProclaimResponse> |
proclaim(LeaderKey leaderKey,
ByteSequence proposal)
Proclaim updates the leader's posted value with a new value.
|
CompletableFuture<ResignResponse> |
resign(LeaderKey leaderKey)
Resign releases election leadership so other campaigners may acquire
leadership on the election.
|
closeCompletableFuture<CampaignResponse> campaign(ByteSequence electionName, long leaseId, ByteSequence proposal)
electionName - election nameleaseId - lease identifierproposal - proposalCompletableFuture<ProclaimResponse> proclaim(LeaderKey leaderKey, ByteSequence proposal)
leaderKey - leader keyproposal - new proposalCompletableFuture<LeaderResponse> leader(ByteSequence electionName)
electionName - election namevoid observe(ByteSequence electionName, Election.Listener listener)
electionName - election namelistener - listenerCompletableFuture<ResignResponse> resign(LeaderKey leaderKey)
leaderKey - leader keyCopyright © 2021. All rights reserved.