raft: move raft.nextEnts to tests

release-2.0
Blake Mizerany 2014-08-23 17:56:06 -07:00 committed by Yicheng Qin
parent c4b6896338
commit 9acb4cf2b0
2 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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