Documentation ¶
Index ¶
- Constants
- type NoteVotedArgs
- type Proc
- type Raft
- func (r *Raft) AppendEntries(et common.Entry, reply *bool) error
- func (r *Raft) Do(et common.Entry, reply *common.RetValue) error
- func (r *Raft) Exec(et common.Entry, reply *common.RetValue) error
- func (r *Raft) HeartBeat(args NoteVotedArgs, reply *common.HeartBeatRetVal) error
- func (r *Raft) ImAlived()
- func (r *Raft) InstallSnapShot(args []common.Entry, reply *bool) error
- func (r *Raft) NoteVoted(args RequestVoteArgs, reply *bool) error
- func (r *Raft) RefactorCluster()
- func (r *Raft) RequestVoted(args RequestVoteArgs, reply *bool) error
- func (r *Raft) Restore()
- func (r *Raft) Run()
- func (r *Raft) SendNotice() error
- func (r *Raft) SendVoted() int
- func (r *Raft) SyncEntries(nextIndex int64, reply *[]common.Entry) error
- func (r *Raft) Topology(_ common.Entry, reply *common.RetValue) error
- func (r *Raft) Wait()
- func (r *Raft) WriteEntries(et *common.Entry) error
- type RequestVoteArgs
Constants ¶
View Source
const ( Leader = "leader" Candidate = "candidate" Follower = "follower" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NoteVotedArgs ¶
type Raft ¶
type Raft struct { HttpPort string EntryMu sync.Mutex Address string Leader string Cluster []*rpclib.Node Entries *common.Entries EntryFile *os.File EntryPath string OpLogFile *os.File OpLogPath string Server *rpc.Server // contains filtered or unexported fields }
func (*Raft) HeartBeat ¶
func (r *Raft) HeartBeat(args NoteVotedArgs, reply *common.HeartBeatRetVal) error
func (*Raft) InstallSnapShot ¶
func (*Raft) RefactorCluster ¶
func (r *Raft) RefactorCluster()
func (*Raft) RequestVoted ¶
func (r *Raft) RequestVoted(args RequestVoteArgs, reply *bool) error
func (*Raft) SendNotice ¶
type RequestVoteArgs ¶
Click to show internal directories.
Click to hide internal directories.