com.sleepycat.je.rep.elections
Class RankingProposer

java.lang.Object
  extended by com.sleepycat.je.rep.elections.Proposer
      extended by 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.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sleepycat.je.rep.elections.Proposer
Proposer.MaxRetriesException, Proposer.Proposal, Proposer.ProposalParser, Proposer.RetryPredicate, Proposer.WinningProposal
 
Field Summary
 
Fields inherited from class com.sleepycat.je.rep.elections.Proposer
elections, formatter, logger, phase1NoNonZeroPrio
 
Constructor Summary
RankingProposer(Elections elections, NameIdPair nameIdPair)
           
 
Method Summary
protected  Protocol.Value choosePhase2Value(Set<TextProtocol.MessageExchange> exchanges)
          Chooses a Value based on the relative ranking of all Promise responses.
 Proposer.Proposal nextProposal()
          Returns a proposal number.
 
Methods inherited from class com.sleepycat.je.rep.elections.Proposer
getProposerStats, issueProposal, shutDown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RankingProposer

public RankingProposer(Elections elections,
                       NameIdPair nameIdPair)
Method Detail

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. Zero priority responses are never chosen. In the case of a tie, priority is used to resolve it. If priority is insufficient 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, or null, if no suitable value was found during phase 1

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-2012 Oracle. All rights reserved.