Documentation
¶
Index ¶
- Constants
- Variables
- func Leader(ballot int32, repNum int) int32
- func NextBallotOf(rid, oldBallot int32, repNum int) int32
- type Majority
- type MsgSet
- type MsgSetHandler
- type Quorum
- type QuorumI
- type QuorumSet
- type QuorumSystem
- type QuorumsOfLeader
- type Replica
- func (r *Replica) BeTheLeader(args *defs.BeTheLeaderArgs, reply *defs.BeTheLeaderReply) error
- func (r *Replica) ComputeClosestPeers() []float64
- func (r *Replica) ConnectToPeers()
- func (r *Replica) ConnectToPeersNoListeners()
- func (r *Replica) FastQuorumSize() int
- func (r *Replica) Ping(args *defs.PingArgs, reply *defs.PingReply) error
- func (r *Replica) ReadQuorumSize() int
- func (r *Replica) ReplyBeacon(beacon *defs.GBeacon)
- func (r *Replica) ReplyProposeTS(reply *defs.ProposeReplyTS, w *bufio.Writer, lock *sync.Mutex)
- func (r *Replica) SendBeacon(peerId int32)
- func (r *Replica) SendClientMsg(id int32, code uint8, msg fastrpc.Serializable)
- 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) SlowQuorumSize() int
- func (r *Replica) UpdatePreferredPeerOrder(quorum []int32)
- func (r *Replica) WaitForClientConnections()
- func (r *Replica) WriteQuorumSize() int
- type SendArg
- type SendType
- type Sender
- func (s Sender) SendExcept(q Quorum, msg fastrpc.Serializable, rpc uint8)
- func (s Sender) SendExceptAndFree(q Quorum, msg fastrpc.Serializable, rpc uint8, free func())
- func (s Sender) SendTo(id int32, msg fastrpc.Serializable, rpc uint8)
- func (s Sender) SendToAll(msg fastrpc.Serializable, rpc uint8)
- func (s Sender) SendToAllAndFree(msg fastrpc.Serializable, rpc uint8, free func())
- func (s Sender) SendToAllExecpt(except int32, msg fastrpc.Serializable, rpc uint8)
- func (s Sender) SendToAllExecptAndFree(except int32, msg fastrpc.Serializable, rpc uint8, free func())
- func (s Sender) SendToAndFree(id int32, msg fastrpc.Serializable, rpc uint8, free func())
- func (s Sender) SendToClient(cid int32, msg fastrpc.Serializable, rpc uint8)
- func (s Sender) SendToClientAndFree(cid int32, msg fastrpc.Serializable, rpc uint8, free func())
- func (s Sender) SendToQuorum(q Quorum, msg fastrpc.Serializable, rpc uint8)
- func (s Sender) SendToQuorumAndFree(q Quorum, msg fastrpc.Serializable, rpc uint8, free func())
- type ThreeQuarters
Constants ¶
View Source
const ( SEND_ALL = iota SEND_QUORUM SEND_EXCEPT SEND_SINGLE SEND_CLIENT SEND_ALL_EXCEPT )
View Source
const ARGS_NUM = defs.CHAN_BUFFER_SIZE
Variables ¶
View Source
var ( NO_QUORUM_FILE = errors.New("Quorum file is not provided") THREE_QUARTERS = errors.New("ThreeQuarters") )
Functions ¶
func NextBallotOf ¶
Types ¶
type MsgSet ¶
type MsgSet struct {
// contains filtered or unexported fields
}
func NewMsgSet ¶
func NewMsgSet(q QuorumI, accept func(interface{}, interface{}) bool, freeMsg func(interface{}), handler MsgSetHandler) *MsgSet
func (*MsgSet) ReinitMsgSet ¶
func (ms *MsgSet) ReinitMsgSet(q QuorumI, accept func(interface{}, interface{}) bool, freeMsg func(interface{}), handler MsgSetHandler) *MsgSet
type MsgSetHandler ¶
type MsgSetHandler func(interface{}, []interface{})
type QuorumSystem ¶
type QuorumSystem struct {
// contains filtered or unexported fields
}
func NewQuorumSystem ¶
func NewQuorumSystem(quorumSize int, r *Replica, qfile string) (*QuorumSystem, error)
func (QuorumSystem) AQ ¶
func (sys QuorumSystem) AQ(ballot int32) Quorum
func (*QuorumSystem) BallotAt ¶
func (sys *QuorumSystem) BallotAt(i int) int32
func (*QuorumSystem) SameHigher ¶
func (sys *QuorumSystem) SameHigher(sameAs, higherThan int32) int32
type QuorumsOfLeader ¶
func NewQuorumsOfLeader ¶
func NewQuorumsOfLeader() QuorumsOfLeader
type Replica ¶
type Replica struct { *dlog.Logger M sync.Mutex N int F int Id int32 Alias string PeerAddrList []string Peers []net.Conn PeerReaders []*bufio.Reader PeerWriters []*bufio.Writer ClientWriters map[int32]*bufio.Writer Config *config.Config Alive []bool PreferredPeerOrder []int32 State *state.State RPC *fastrpc.Table StableStore *os.File Stats *defs.Stats Shutdown bool Listener net.Listener ProposeChan chan *defs.GPropose BeaconChan chan *defs.GBeacon Thrifty bool Exec bool LRead bool Dreply bool Beacon bool Durable bool Ewma []float64 Latencies []int64 Dt *defs.LatencyTable }
func (*Replica) BeTheLeader ¶
func (r *Replica) BeTheLeader(args *defs.BeTheLeaderArgs, reply *defs.BeTheLeaderReply) error
func (*Replica) ComputeClosestPeers ¶
func (*Replica) ConnectToPeers ¶
func (r *Replica) ConnectToPeers()
func (*Replica) ConnectToPeersNoListeners ¶
func (r *Replica) ConnectToPeersNoListeners()
func (*Replica) FastQuorumSize ¶
func (*Replica) ReadQuorumSize ¶
func (*Replica) ReplyBeacon ¶
func (*Replica) ReplyProposeTS ¶
func (*Replica) SendBeacon ¶
func (*Replica) SendClientMsg ¶
func (r *Replica) SendClientMsg(id int32, code uint8, msg fastrpc.Serializable)
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) SlowQuorumSize ¶
func (*Replica) UpdatePreferredPeerOrder ¶
func (*Replica) WaitForClientConnections ¶
func (r *Replica) WaitForClientConnections()
func (*Replica) WriteQuorumSize ¶
type Sender ¶
type Sender chan SendArg
func (Sender) SendExcept ¶
func (s Sender) SendExcept(q Quorum, msg fastrpc.Serializable, rpc uint8)
func (Sender) SendExceptAndFree ¶
func (s Sender) SendExceptAndFree(q Quorum, msg fastrpc.Serializable, rpc uint8, free func())
func (Sender) SendToAllAndFree ¶
func (s Sender) SendToAllAndFree(msg fastrpc.Serializable, rpc uint8, free func())
func (Sender) SendToAllExecpt ¶
func (s Sender) SendToAllExecpt(except int32, msg fastrpc.Serializable, rpc uint8)
func (Sender) SendToAllExecptAndFree ¶
func (s Sender) SendToAllExecptAndFree(except int32, msg fastrpc.Serializable, rpc uint8, free func())
func (Sender) SendToAndFree ¶
func (s Sender) SendToAndFree(id int32, msg fastrpc.Serializable, rpc uint8, free func())
func (Sender) SendToClient ¶
func (s Sender) SendToClient(cid int32, msg fastrpc.Serializable, rpc uint8)
func (Sender) SendToClientAndFree ¶
func (s Sender) SendToClientAndFree(cid int32, msg fastrpc.Serializable, rpc uint8, free func())
func (Sender) SendToQuorum ¶
func (s Sender) SendToQuorum(q Quorum, msg fastrpc.Serializable, rpc uint8)
func (Sender) SendToQuorumAndFree ¶
func (s Sender) SendToQuorumAndFree(q Quorum, msg fastrpc.Serializable, rpc uint8, free func())
type ThreeQuarters ¶
type ThreeQuarters int
func NewThreeQuartersOf ¶
func NewThreeQuartersOf(N int) ThreeQuarters
func (ThreeQuarters) Contains ¶
func (m ThreeQuarters) Contains(int32) bool
func (ThreeQuarters) Size ¶
func (m ThreeQuarters) Size() int
Click to show internal directories.
Click to hide internal directories.