mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
raft: move raft.nextEnts to tests
This commit is contained in:
parent
c4b6896338
commit
9acb4cf2b0
@ -252,13 +252,6 @@ func (r *raft) maybeCommit() bool {
|
|||||||
return r.raftLog.maybeCommit(mci, r.Term)
|
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) {
|
func (r *raft) reset(term int64) {
|
||||||
r.Term = term
|
r.Term = term
|
||||||
r.lead = none
|
r.lead = none
|
||||||
|
@ -8,6 +8,13 @@ import (
|
|||||||
"testing"
|
"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 {
|
type Interface interface {
|
||||||
Step(m Message) error
|
Step(m Message) error
|
||||||
ReadMessages() []Message
|
ReadMessages() []Message
|
||||||
|
Loading…
x
Reference in New Issue
Block a user