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
 
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. 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.