com.sleepycat.je.rep.elections
Class Protocol

java.lang.Object
  extended by com.sleepycat.je.rep.impl.TextProtocol
      extended by com.sleepycat.je.rep.elections.Protocol

public class Protocol
extends TextProtocol

Defines the request/response messages used in the implementation of elections. From Proposer to Acceptor: Propose -> Promise | Reject Accept -> Accepted | Reject From Proposer initiator to Learners: Result -> none The following exchange is not part of the elections process, but is used by the Monitor to query a Learner for the latest election result it's aware of, when the Monitor first starts up. From Monitor to Learner MasterQuery -> MasterQueryResponse | None


Nested Class Summary
 class Protocol.Accept
          Accept request issued in Phase 2 of paxos.
 class Protocol.Accepted
          Response to a successful Accept message.
 class Protocol.MasterQuery
          Used to query the Learner for a current master
 class Protocol.MasterQueryResponse
          The response to a Master Query request.
 class Protocol.Promise
          Promise response message.
 class Protocol.Propose
          Propose request used in Phase 1 of Paxos
 class Protocol.Reject
          Reject response to a message.
 class Protocol.Result
          Used to inform Learners of a "chosen value".
 class Protocol.Shutdown
           
static class Protocol.StringValue
          A String based value implementation used as the "default" Value
static interface Protocol.Value
           
static interface Protocol.ValueParser
           
 
Nested classes/interfaces inherited from class com.sleepycat.je.rep.impl.TextProtocol
TextProtocol.Fail, TextProtocol.InvalidMessageException, TextProtocol.Message, TextProtocol.MessageError, TextProtocol.MessageExchange, TextProtocol.MessageOp, TextProtocol.OK, TextProtocol.ProtocolError, TextProtocol.RequestMessage, TextProtocol.ResponseMessage, TextProtocol.StringFormatable, TextProtocol.TOKENS, TextProtocol.WireFormatable
 
Field Summary
 TextProtocol.MessageOp ACCEPT
           
 TextProtocol.MessageOp ACCEPTED
           
 TextProtocol.MessageOp MASTER_QUERY
           
 TextProtocol.MessageOp MASTER_QUERY_RESPONSE
           
 TextProtocol.MessageOp PROMISE
           
 TextProtocol.MessageOp PROPOSE
           
 TextProtocol.MessageOp REJECT
           
 TextProtocol.MessageOp RESULT
           
 TextProtocol.MessageOp SHUTDOWN
           
 
Fields inherited from class com.sleepycat.je.rep.impl.TextProtocol
envImpl, FAIL_RESP, formatter, logger, messageNocheckSuffix, OK_RESP, PROTOCOL_ERROR, SEPARATOR, SEPARATOR_REGEXP
 
Constructor Summary
Protocol(Proposer.ProposalParser proposalParser, Protocol.ValueParser valueParser, String groupName, NameIdPair nameIdPair, RepImpl repImpl)
          Creates an instance of the Protocol.
 
Method Summary
 
Methods inherited from class com.sleepycat.je.rep.impl.TextProtocol
getMajorVersionNumber, getOpenTimeout, getReadTimeout, getRequestMessage, initializeMessageOps, messageCount, parse, parseRequest, process, setTimeouts, updateNodeIds
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPOSE

public final TextProtocol.MessageOp PROPOSE

ACCEPT

public final TextProtocol.MessageOp ACCEPT

RESULT

public final TextProtocol.MessageOp RESULT

MASTER_QUERY

public final TextProtocol.MessageOp MASTER_QUERY

SHUTDOWN

public final TextProtocol.MessageOp SHUTDOWN

REJECT

public final TextProtocol.MessageOp REJECT

PROMISE

public final TextProtocol.MessageOp PROMISE

ACCEPTED

public final TextProtocol.MessageOp ACCEPTED

MASTER_QUERY_RESPONSE

public final TextProtocol.MessageOp MASTER_QUERY_RESPONSE
Constructor Detail

Protocol

public Protocol(Proposer.ProposalParser proposalParser,
                Protocol.ValueParser valueParser,
                String groupName,
                NameIdPair nameIdPair,
                RepImpl repImpl)
Creates an instance of the Protocol.

Parameters:
proposalParser - parses a string into a Proposal object.
valueParser - parses a string into a Value object.
nameIdPair - a unique identifier for this election participant.


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