com.sleepycat.je.rep.stream
Class Protocol

java.lang.Object
  extended by com.sleepycat.je.rep.utilint.BinaryProtocol
      extended by com.sleepycat.je.rep.stream.Protocol

public class Protocol
extends BinaryProtocol

Defines the messages used to set up a feeder-replica replication stream. From Feeder to Replica Heartbeat -> HeartbeatResponse Commit -> Ack Entry Note: in the future, we may want to support bulk entry messages From Replica to Feeder The following subset of messages represents the handshake protocol that precedes the transmission of replication log entries. ReplicaProtocolVersion -> FeederProtocolVersion | DuplicateNodeReject ReplicaJEVersions -> FeederJEVersions | JEVersions Reject MembershipInfo -> MembershipInfoOK | MembershipInfoReject SNTPRequest -> SNTPResponse Note that there may be multiple SNTPRequest/SNTPResponse message pairs that are exchanged as part of a single handshake. So a successful handshake requested sequence generated by the Replica looks like: ReplicaProtocolVersion ReplicaJEVersions MembershipInfo [SNTPRequest]+ The following messages constitute the syncup and the transmission of log entries. EntryRequest -> Entry | EntryNotFound | AlternateMatchpoint RestoreRequest -> RestoreResponse StartStream The Protocol instance has local state in terms of buffers that are reused across multiple messages. A Protocol instance is expected to be used in strictly serial fashion. Consequently, there is an instance for each Replica to Feeder connection, and two instances per Feeder to Replica connection: one for the InputThread and one for the OutputThread.


Nested Class Summary
 class Protocol.Ack
           
 class Protocol.AlternateMatchpoint
           
 class Protocol.Commit
           
 class Protocol.DuplicateNodeReject
           
 class Protocol.Entry
          A message containing a log entry in the replication stream.
 class Protocol.EntryNotFound
          Response when the EntryRequest asks for a VLSN that is below the VLSN range covered by the Feeder.
 class Protocol.EntryRequest
          A replica node asks a feeder for the log entry at this VLSN.
 class Protocol.FeederJEVersions
           
 class Protocol.FeederProtocolVersion
          The feeder sends the replica its proposed version.
(package private)  class Protocol.HandshakeMessage
          Base class for all protocol handshake messages.
 class Protocol.Heartbeat
           
 class Protocol.HeartbeatResponse
           
(package private)  class Protocol.JEVersions
          Abstract message used as the basis for the exchange of software versions between replicated nodes
 class Protocol.JEVersionsReject
           
 class Protocol.NodeGroupInfo
           
 class Protocol.NodeGroupInfoOK
           
 class Protocol.NodeGroupInfoReject
           
(package private)  class Protocol.ProtocolVersion
          Version broadcasts the sending node's protocol version.
 class Protocol.ReplicaJEVersions
           
 class Protocol.ReplicaProtocolVersion
          The replica sends the feeder its protocol version.
 class Protocol.RestoreRequest
          Request from the replica to the feeder for sufficient information to start a network restore.
 class Protocol.RestoreResponse
          Response when the replica needs information to instigate a network restore.
 class Protocol.ShutdownRequest
          Message used to shutdown a node
 class Protocol.ShutdownResponse
          Message in response to a shutdown request.
 class Protocol.SNTPRequest
           
 class Protocol.SNTPResponse
           
 class Protocol.StartStream
          StartStream indicates that the replica would like the feeder to start the replication stream at the proposed vlsn.
(package private)  class Protocol.VLSNMessage
          Base class for messages which contain only a VLSN
 
Nested classes/interfaces inherited from class com.sleepycat.je.rep.utilint.BinaryProtocol
BinaryProtocol.ClientVersion, BinaryProtocol.IncompatibleVersion, BinaryProtocol.Message, BinaryProtocol.MessageOp, BinaryProtocol.ProtocolError, BinaryProtocol.ProtocolException, BinaryProtocol.RejectMessage, BinaryProtocol.ServerVersion, BinaryProtocol.SimpleMessage
 
Field Summary
static BinaryProtocol.MessageOp ACK
           
static BinaryProtocol.MessageOp ALT_MATCHPOINT
           
static BinaryProtocol.MessageOp COMMIT
           
static BinaryProtocol.MessageOp DUP_NODE_REJECT
           
static BinaryProtocol.MessageOp ENTRY
           
static BinaryProtocol.MessageOp ENTRY_NOTFOUND
           
static BinaryProtocol.MessageOp ENTRY_REQUEST
           
static BinaryProtocol.MessageOp FEEDER_JE_VERSIONS
           
static BinaryProtocol.MessageOp FEEDER_PROTOCOL_VERSION
           
static BinaryProtocol.MessageOp HEARTBEAT
           
static BinaryProtocol.MessageOp HEARTBEAT_RESPONSE
           
static BinaryProtocol.MessageOp JE_VERSIONS_REJECT
           
static BinaryProtocol.MessageOp MEMBERSHIP_INFO
           
static BinaryProtocol.MessageOp MEMBERSHIP_INFO_OK
           
static BinaryProtocol.MessageOp MEMBERSHIP_INFO_REJECT
           
static BinaryProtocol.MessageOp REPLICA_JE_VERSIONS
           
static BinaryProtocol.MessageOp REPLICA_PROTOCOL_VERSION
           
static BinaryProtocol.MessageOp RESTORE_REQUEST
           
static BinaryProtocol.MessageOp RESTORE_RESPONSE
           
static BinaryProtocol.MessageOp SHUTDOWN_REQUEST
           
static BinaryProtocol.MessageOp SHUTDOWN_RESPONSE
           
static BinaryProtocol.MessageOp SNTP_REQUEST
           
static BinaryProtocol.MessageOp SNTP_RESPONSE
           
static BinaryProtocol.MessageOp START_STREAM
           
 
Fields inherited from class com.sleepycat.je.rep.utilint.BinaryProtocol
CLIENT_VERSION, codeVersion, configuredVersion, envImpl, formatter, header, INCOMPATIBLE_VERSION, logger, MESSAGE_HEADER_SIZE, nameIdPair, nBytesRead, nBytesWritten, nMessagesRead, nMessagesWritten, nReadNanos, nWriteNanos, PROTOCOL_ERROR, SERVER_VERSION, stats
 
Method Summary
static Protocol get(RepNode repNode, int version)
          Returns a protocol object that supports the specific requested version.
static int getDefaultVersion()
           
(package private) static Protocol getProtocol(RepNode repNode)
           
static void setDefaultVersion(int testVersion)
           
 
Methods inherited from class com.sleepycat.je.rep.utilint.BinaryProtocol
getPredefinedMessageCount, getStats, getString, getVersion, initializeMessageOps, messageCount, putString, read, read, resetStats, stringSize, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REPLICA_PROTOCOL_VERSION

public static final BinaryProtocol.MessageOp REPLICA_PROTOCOL_VERSION

FEEDER_PROTOCOL_VERSION

public static final BinaryProtocol.MessageOp FEEDER_PROTOCOL_VERSION

DUP_NODE_REJECT

public static final BinaryProtocol.MessageOp DUP_NODE_REJECT

REPLICA_JE_VERSIONS

public static final BinaryProtocol.MessageOp REPLICA_JE_VERSIONS

FEEDER_JE_VERSIONS

public static final BinaryProtocol.MessageOp FEEDER_JE_VERSIONS

JE_VERSIONS_REJECT

public static final BinaryProtocol.MessageOp JE_VERSIONS_REJECT

MEMBERSHIP_INFO

public static final BinaryProtocol.MessageOp MEMBERSHIP_INFO

MEMBERSHIP_INFO_OK

public static final BinaryProtocol.MessageOp MEMBERSHIP_INFO_OK

MEMBERSHIP_INFO_REJECT

public static final BinaryProtocol.MessageOp MEMBERSHIP_INFO_REJECT

SNTP_REQUEST

public static final BinaryProtocol.MessageOp SNTP_REQUEST

SNTP_RESPONSE

public static final BinaryProtocol.MessageOp SNTP_RESPONSE

ENTRY

public static final BinaryProtocol.MessageOp ENTRY

START_STREAM

public static final BinaryProtocol.MessageOp START_STREAM

HEARTBEAT

public static final BinaryProtocol.MessageOp HEARTBEAT

HEARTBEAT_RESPONSE

public static final BinaryProtocol.MessageOp HEARTBEAT_RESPONSE

COMMIT

public static final BinaryProtocol.MessageOp COMMIT

ACK

public static final BinaryProtocol.MessageOp ACK

ENTRY_REQUEST

public static final BinaryProtocol.MessageOp ENTRY_REQUEST

ENTRY_NOTFOUND

public static final BinaryProtocol.MessageOp ENTRY_NOTFOUND

ALT_MATCHPOINT

public static final BinaryProtocol.MessageOp ALT_MATCHPOINT

RESTORE_REQUEST

public static final BinaryProtocol.MessageOp RESTORE_REQUEST

RESTORE_RESPONSE

public static final BinaryProtocol.MessageOp RESTORE_RESPONSE

SHUTDOWN_REQUEST

public static final BinaryProtocol.MessageOp SHUTDOWN_REQUEST

SHUTDOWN_RESPONSE

public static final BinaryProtocol.MessageOp SHUTDOWN_RESPONSE
Method Detail

get

public static Protocol get(RepNode repNode,
                           int version)
Returns a protocol object that supports the specific requested version.


getProtocol

static Protocol getProtocol(RepNode repNode)

getDefaultVersion

public static int getDefaultVersion()

setDefaultVersion

public static void setDefaultVersion(int testVersion)
Parameters:
testVersion - the version to set as the supported default version.


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