com.sleepycat.je.rep.elections
Class RankingProposer
java.lang.Object
com.sleepycat.je.rep.elections.Proposer
com.sleepycat.je.rep.elections.RankingProposer
public class RankingProposer
- extends Proposer
Extends the base proposer to choose a phase 2 value based on a suggestion's
relative ranking.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RankingProposer
public RankingProposer(Elections elections,
NameIdPair nameIdPair)
choosePhase2Value
protected Protocol.Value choosePhase2Value(Set<TextProtocol.MessageExchange> exchanges)
- Chooses a Value based on the relative ranking of all Promise responses.
The one with the highest ranking is chosen. In the case of a tie, the
socket address is used to order the choice so that a consistent result
is obtained across the set irrespective of the iteration order over the
set.
- Specified by:
choosePhase2Value
in class Proposer
- Parameters:
exchanges
- the message exchanges from Phase 1
- Returns:
- the candidate value for Phase2 must not be null
nextProposal
public Proposer.Proposal nextProposal()
- Returns a proposal number. Note that the proposal numbers must increase
over time, even across restarts of the proposer process.
- Specified by:
nextProposal
in class Proposer
- Returns:
- a 24 character string representing the proposal number
Copyright (c) 2004-2010 Oracle. All rights reserved.