raft: move raft.nextEnts to tests
parent
c4b6896338
commit
9acb4cf2b0
|
@ -252,13 +252,6 @@ func (r *raft) maybeCommit() bool {
|
|||
return r.raftLog.maybeCommit(mci, r.Term)
|
||||
}
|
||||
|
||||
// nextEnts returns the appliable entries and updates the applied index
|
||||
func (r *raft) nextEnts() (ents []Entry) {
|
||||
ents = r.raftLog.nextEnts()
|
||||
r.raftLog.resetNextEnts()
|
||||
return ents
|
||||
}
|
||||
|
||||
func (r *raft) reset(term int64) {
|
||||
r.Term = term
|
||||
r.lead = none
|
||||
|
|
|
@ -8,6 +8,13 @@ import (
|
|||
"testing"
|
||||
)
|
||||
|
||||
// nextEnts returns the appliable entries and updates the applied index
|
||||
func (r *raft) nextEnts() (ents []Entry) {
|
||||
ents = r.raftLog.nextEnts()
|
||||
r.raftLog.resetNextEnts()
|
||||
return ents
|
||||
}
|
||||
|
||||
type Interface interface {
|
||||
Step(m Message) error
|
||||
ReadMessages() []Message
|
||||
|
|
Loading…
Reference in New Issue