Documentation ¶
Index ¶
- Constants
- type Beacon
- type Client
- type Connect
- type Disconnect
- type GetState
- type GetView
- type HasSenderId
- type LockedReader
- type LockedWriter
- type Propose
- type RPCPair
- type RepCommand
- type Replica
- func (r *Replica) BeTheLeader(args *genericsmrproto.BeTheLeaderArgs, reply *genericsmrproto.BeTheLeaderReply) error
- func (r *Replica) BeTheLeader2(args *genericsmrproto.BeTheLeaderArgs, reply *genericsmrproto.BeTheLeaderReply) error
- func (r *Replica) ConnectListenToPeers()
- func (r *Replica) ConnectToPeers()
- func (r *Replica) ConnectToPeersNoListeners()
- func (r *Replica) ConnectToPeersSim(serverId int, simConn *SimConn, reliable bool)
- func (r *Replica) Ping(args *genericsmrproto.PingArgs, reply *genericsmrproto.PingReply) error
- func (r *Replica) RegisterRPC(msgObj fastrpc.Serializable, notify chan fastrpc.Serializable) uint8
- func (r *Replica) ReplyBeacon(beacon *Beacon)
- func (r *Replica) ReplyConnect(reply *genericsmrproto.ConnectReply, w *bufio.Writer)
- func (r *Replica) ReplyDisconnect(reply *genericsmrproto.DisconnectReply, w *bufio.Writer)
- func (r *Replica) ReplyGetState(reply *genericsmrproto.GetStateReply, w *bufio.Writer)
- func (r *Replica) ReplyGetView(reply *genericsmrproto.GetViewReply, w *bufio.Writer)
- func (r *Replica) ReplyPropose(reply *genericsmrproto.ProposeReply, w *bufio.Writer)
- func (r *Replica) ReplyProposeTS(reply *genericsmrproto.ProposeReplyTS, w *bufio.Writer)
- func (r *Replica) ReplyRegisterClientId(reply *genericsmrproto.RegisterClientIdReply, w *bufio.Writer)
- func (r *Replica) ReplySlowdown(reply *genericsmrproto.SlowdownReply, w *bufio.Writer)
- func (r *Replica) SendBeacon(peerId int32)
- func (r *Replica) SendMsg(peerId int32, code uint8, msg fastrpc.Serializable)
- func (r *Replica) SendMsgNoFlush(peerId int32, code uint8, msg fastrpc.Serializable)
- func (r *Replica) UpdatePreferredPeerOrder(quorum []int32)
- func (r *Replica) WaitForClientConnections()
- type SimConn
- type Slowdown
- type Testing
Constants ¶
View Source
const CHAN_BUFFER_SIZE = 200000
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { *genericsmrproto.RegisterClientIdArgs Reply *bufio.Writer }
type Disconnect ¶
type Disconnect struct { *genericsmrproto.Disconnect Reply *bufio.Writer }
type HasSenderId ¶
type HasSenderId interface {
GetSenderId() int32
}
type LockedReader ¶
type LockedWriter ¶
type RPCPair ¶
type RPCPair struct { Obj fastrpc.Serializable Chan chan fastrpc.Serializable }
type RepCommand ¶
type Replica ¶
type Replica struct { N int // total number of replicas Id int32 // the ID of the current replica PeerAddrList []string // array with the IP:port address of every replica Peers []net.Conn // cache of connections to all other replicas PeerReaders []LockedReader PeerWriters []LockedWriter Alive []bool // connection status Listener net.Listener State *state.State ProposeChan chan *Propose // channel for client proposals BeaconChan chan *Beacon // channel for beacons from peer replicas Shutdown bool Thrifty bool // send only as many messages as strictly required? Exec bool // execute commands? Dreply bool // reply to client after command has been executed? Beacon bool // send beacons to detect how fast are the other replicas? Durable bool // log to a stable store? StableStore *os.File // file support for the persistent log PreferredPeerOrder []int32 // replicas in the preferred order of communication Ewma []float64 OnClientConnect chan bool RegisterClientIdChan chan *Client // channel for registering client id GetViewChan chan *GetView GetStateChan chan *GetState SlowdownChan chan *Slowdown ConnectChan chan *Connect DisconnectChan chan *Disconnect TestingState Testing Connected map[int]bool // contains filtered or unexported fields }
func NewReplica ¶
func (*Replica) BeTheLeader ¶
func (r *Replica) BeTheLeader(args *genericsmrproto.BeTheLeaderArgs, reply *genericsmrproto.BeTheLeaderReply) error
func (*Replica) BeTheLeader2 ¶
func (r *Replica) BeTheLeader2(args *genericsmrproto.BeTheLeaderArgs, reply *genericsmrproto.BeTheLeaderReply) error
func (*Replica) ConnectListenToPeers ¶
func (r *Replica) ConnectListenToPeers()
func (*Replica) ConnectToPeers ¶
func (r *Replica) ConnectToPeers()
func (*Replica) ConnectToPeersNoListeners ¶
func (r *Replica) ConnectToPeersNoListeners()
func (*Replica) ConnectToPeersSim ¶
func (*Replica) Ping ¶
func (r *Replica) Ping(args *genericsmrproto.PingArgs, reply *genericsmrproto.PingReply) error
func (*Replica) RegisterRPC ¶
func (r *Replica) RegisterRPC(msgObj fastrpc.Serializable, notify chan fastrpc.Serializable) uint8
func (*Replica) ReplyBeacon ¶
func (*Replica) ReplyConnect ¶
func (r *Replica) ReplyConnect(reply *genericsmrproto.ConnectReply, w *bufio.Writer)
func (*Replica) ReplyDisconnect ¶
func (r *Replica) ReplyDisconnect(reply *genericsmrproto.DisconnectReply, w *bufio.Writer)
func (*Replica) ReplyGetState ¶
func (r *Replica) ReplyGetState(reply *genericsmrproto.GetStateReply, w *bufio.Writer)
func (*Replica) ReplyGetView ¶
func (r *Replica) ReplyGetView(reply *genericsmrproto.GetViewReply, w *bufio.Writer)
func (*Replica) ReplyPropose ¶
func (r *Replica) ReplyPropose(reply *genericsmrproto.ProposeReply, w *bufio.Writer)
func (*Replica) ReplyProposeTS ¶
func (r *Replica) ReplyProposeTS(reply *genericsmrproto.ProposeReplyTS, w *bufio.Writer)
func (*Replica) ReplyRegisterClientId ¶
func (r *Replica) ReplyRegisterClientId(reply *genericsmrproto.RegisterClientIdReply, w *bufio.Writer)
func (*Replica) ReplySlowdown ¶
func (r *Replica) ReplySlowdown(reply *genericsmrproto.SlowdownReply, w *bufio.Writer)
func (*Replica) SendBeacon ¶
func (*Replica) SendMsg ¶
func (r *Replica) SendMsg(peerId int32, code uint8, msg fastrpc.Serializable)
func (*Replica) SendMsgNoFlush ¶
func (r *Replica) SendMsgNoFlush(peerId int32, code uint8, msg fastrpc.Serializable)
func (*Replica) UpdatePreferredPeerOrder ¶
updates the preferred order in which to communicate with peers according to a preferred quorum
func (*Replica) WaitForClientConnections ¶
func (r *Replica) WaitForClientConnections()
Client connections dispatcher
type SimConn ¶
type SimConn struct { *io.PipeReader *io.PipeWriter }
func NewSimConn ¶
func NewSimConn(pr *io.PipeReader, pw *io.PipeWriter) *SimConn
Click to show internal directories.
Click to hide internal directories.