remove nitro
parent
5c9cec3f74
commit
1bbbf7ca6a
2
debug.go
2
debug.go
|
@ -1,7 +1,6 @@
|
|||
package raft
|
||||
|
||||
import (
|
||||
"github.com/spf13/nitro"
|
||||
"log"
|
||||
"os"
|
||||
)
|
||||
|
@ -21,7 +20,6 @@ var LogLevel int = 0
|
|||
var logger *log.Logger
|
||||
|
||||
func init() {
|
||||
(*nitro.AnalysisOn) = false
|
||||
logger = log.New(os.Stdout, "", log.Lmicroseconds)
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ import (
|
|||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/spf13/nitro"
|
||||
"hash/crc32"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
@ -38,7 +37,6 @@ const (
|
|||
)
|
||||
|
||||
var stopValue interface{}
|
||||
var nitroTimer *nitro.B
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//
|
||||
|
@ -328,8 +326,6 @@ func (s *Server) Initialize() error {
|
|||
// Update the term to the last term in the log.
|
||||
s.currentTerm = s.log.currentTerm()
|
||||
|
||||
nitroTimer = nitro.Initalize()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -678,8 +674,6 @@ func (s *Server) AppendEntries(req *AppendEntriesRequest) *AppendEntriesResponse
|
|||
// Processes the "append entries" request.
|
||||
func (s *Server) processAppendEntriesRequest(req *AppendEntriesRequest) (*AppendEntriesResponse, bool) {
|
||||
|
||||
nitroTimer.Step("Process AppendEntriesRequest")
|
||||
|
||||
s.traceln("server.ae.process")
|
||||
|
||||
if req.Term < s.currentTerm {
|
||||
|
@ -716,8 +710,6 @@ func (s *Server) processAppendEntriesRequest(req *AppendEntriesRequest) (*Append
|
|||
// states are dropped.
|
||||
func (s *Server) processAppendEntriesResponse(resp *AppendEntriesResponse) {
|
||||
|
||||
nitroTimer.Step("Process processAppendEntriesResponse")
|
||||
|
||||
// If we find a higher term then change to a follower and exit.
|
||||
if resp.Term > s.currentTerm {
|
||||
s.setCurrentTerm(resp.Term, "", false)
|
||||
|
@ -788,7 +780,6 @@ func (s *Server) RequestVote(req *RequestVoteRequest) *RequestVoteResponse {
|
|||
|
||||
// Processes a "request vote" request.
|
||||
func (s *Server) processRequestVoteRequest(req *RequestVoteRequest) (*RequestVoteResponse, bool) {
|
||||
nitroTimer.Step("Process RequestVoteRequest")
|
||||
|
||||
// If the request is coming from an old term then reject it.
|
||||
if req.Term < s.currentTerm {
|
||||
|
|
Loading…
Reference in New Issue