Pārlūkot izejas kodu

raft: add/remove -> addNode/removeNode

Blake Mizerany 11 gadi atpakaļ
vecāks
revīzija
15a8b46359
2 mainītis faili ar 4 papildinājumiem un 4 dzēšanām
  1. 2 2
      raft/node.go
  2. 2 2
      raft/raft.go

+ 2 - 2
raft/node.go

@@ -93,14 +93,14 @@ func (n *Node) Next() []Entry {
 				golog.Println(err)
 				continue
 			}
-			n.sm.add(c.NodeId)
+			n.sm.addNode(c.NodeId)
 		case configRemove:
 			c := new(config)
 			if err := json.Unmarshal(ents[i].Data, c); err != nil {
 				golog.Println(err)
 				continue
 			}
-			n.sm.remove(c.NodeId)
+			n.sm.removeNode(c.NodeId)
 		default:
 			panic("unexpected entry type")
 		}

+ 2 - 2
raft/raft.go

@@ -357,12 +357,12 @@ func (sm *stateMachine) Step(m Message) (ok bool) {
 	return true
 }
 
-func (sm *stateMachine) add(id int) {
+func (sm *stateMachine) addNode(id int) {
 	sm.ins[id] = &index{next: sm.log.lastIndex() + 1}
 	sm.pendingConf = false
 }
 
-func (sm *stateMachine) remove(id int) {
+func (sm *stateMachine) removeNode(id int) {
 	delete(sm.ins, id)
 	sm.pendingConf = false
 }