com.sleepycat.je.rep.stream
Class MasterSuggestionGenerator

java.lang.Object
  extended by com.sleepycat.je.rep.stream.MasterSuggestionGenerator
All Implemented Interfaces:
Acceptor.SuggestionGenerator

public class MasterSuggestionGenerator
extends Object
implements Acceptor.SuggestionGenerator

A Basic suggestion generator. A more sophisticated version may contact other replica nodes to see if it has sufficient connectivity to implement the commit policy in effect for the Replication Group. KIS for now.


Constructor Summary
MasterSuggestionGenerator(RepNode repNode)
           
 
Method Summary
 void forceMaster(boolean force)
          This entry point is for testing only.
 Protocol.Value get(Proposer.Proposal proposal)
          Used to generate a suggested value for use by a Proposer.
 long getRanking(Proposer.Proposal proposal)
          The importance associated with the above suggestion.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MasterSuggestionGenerator

public MasterSuggestionGenerator(RepNode repNode)
Method Detail

get

public Protocol.Value get(Proposer.Proposal proposal)
Description copied from interface: Acceptor.SuggestionGenerator
Used to generate a suggested value for use by a Proposer. It's a hint. The proposal argument may be used to freeze values like the VLSN number from advancing (if they were used in the ranking) until an election has completed.

Specified by:
get in interface Acceptor.SuggestionGenerator
Parameters:
proposal - the Proposal for which the value is being suggested.
Returns:
the suggested value.

getRanking

public long getRanking(Proposer.Proposal proposal)
Description copied from interface: Acceptor.SuggestionGenerator
The importance associated with the above suggestion. Acceptors have to agree on a common system for ranking importance so that the relative importance of different suggestions can be meaningfully compared.

Specified by:
getRanking in interface Acceptor.SuggestionGenerator
Returns:
the importance of the suggestion as a number

forceMaster

public void forceMaster(boolean force)
This entry point is for testing only. It will submit a Proposal with a premptive ranking so that it's guaranteed to be the selected as the master at the next election.

Parameters:
force - determines whether the forced proposal is in effect


Copyright (c) 2004-2010 Oracle. All rights reserved.