Browse Source

raft: move raft.nextEnts to tests

Blake Mizerany 11 years ago
parent
commit
9acb4cf2b0
2 changed files with 7 additions and 7 deletions
  1. 0 7
      raft2/raft.go
  2. 7 0
      raft2/raft_test.go

+ 0 - 7
raft2/raft.go

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

+ 7 - 0
raft2/raft_test.go

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