|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.rep.elections.Proposer
public abstract class Proposer
Plays the role of a Proposer in the consensus algorithm. Note that the Proposer also plays the role of a distinguished learner and informs all other listeners about the acceptance of a proposal.
Nested Class Summary | |
---|---|
static class |
Proposer.MaxRetriesException
Exception thrown when a Proposal issue fails because the retry limit has been exceeded. |
static interface |
Proposer.Proposal
The Interface defining a Proposal. |
static interface |
Proposer.ProposalParser
|
static interface |
Proposer.RetryPredicate
Interface to determine whether the Proposer should be retry with a new Proposal or abandon the effort. |
static class |
Proposer.WinningProposal
Summarizes the results of the election |
Field Summary | |
---|---|
protected Elections |
elections
|
protected Formatter |
formatter
|
protected Logger |
logger
|
protected IntStat |
phase1NoNonZeroPrio
|
Constructor Summary | |
---|---|
Proposer(Elections elections,
NameIdPair nameIdPair)
Initializes a proposer with the set of acceptors identified by the sockets on which they accept proposals. |
Method Summary | |
---|---|
protected abstract Protocol.Value |
choosePhase2Value(Set<TextProtocol.MessageExchange> exchanges)
Selects the value to be used during Phase2, which if it succeeds will become the "chosen value". |
StatGroup |
getProposerStats()
Returns the current proposer statistics. |
Proposer.WinningProposal |
issueProposal(QuorumPolicy quorumPolicy,
Proposer.RetryPredicate retryPredicate)
Runs an election using the consensus algorithm. |
protected abstract Proposer.Proposal |
nextProposal()
Creates the next unique Proposal to be used |
void |
shutDown()
Shut down the proposer and reclaim its resources. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Elections elections
protected final IntStat phase1NoNonZeroPrio
protected final Logger logger
protected final Formatter formatter
Constructor Detail |
---|
public Proposer(Elections elections, NameIdPair nameIdPair)
Method Detail |
---|
public void shutDown()
public StatGroup getProposerStats()
protected abstract Protocol.Value choosePhase2Value(Set<TextProtocol.MessageExchange> exchanges)
exchanges
- the message exchanges from Phase 1
protected abstract Proposer.Proposal nextProposal()
public Proposer.WinningProposal issueProposal(QuorumPolicy quorumPolicy, Proposer.RetryPredicate retryPredicate) throws Proposer.MaxRetriesException, InterruptedException
quorumPolicy
- the policy used to determine whether we have a
quorum.retryPredicate
- the interface which determines whether a retry
should be attempted.
Proposer.MaxRetriesException
- when a winning proposal could not be
established.
InterruptedException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |