Skip to content

Commit

Permalink
Revert "init"
Browse files Browse the repository at this point in the history
This reverts commit f04aa9b
  • Loading branch information
cheng.li01 committed Jul 8, 2020
1 parent f04aa9b commit b8f3fb6
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion append_entries.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"io"
"io/ioutil"

"github.com/chrislusf/raft/protobuf"
"github.com/golang/protobuf/proto"
"github.com/robin1900/raft/protobuf"
)

// The request sent to a server to append entries to the log.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/robin1900/raft
module github.com/chrislusf/raft

go 1.14

Expand Down
2 changes: 1 addition & 1 deletion grpc_transporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package raft
import (
context2 "context"
"fmt"
"github.com/robin1900/raft/protobuf"
"github.com/chrislusf/raft/protobuf"
"google.golang.org/grpc"
"google.golang.org/grpc/keepalive"
"sync"
Expand Down
2 changes: 1 addition & 1 deletion log.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"os"
"sync"

"github.com/robin1900/raft/protobuf"
"github.com/chrislusf/raft/protobuf"
)

//------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion log_entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"fmt"
"io"

"github.com/chrislusf/raft/protobuf"
"github.com/golang/protobuf/proto"
"github.com/robin1900/raft/protobuf"
)

// A log entry stores a single item in the log.
Expand Down
2 changes: 1 addition & 1 deletion protobuf/seaweed_raft.proto
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
syntax = "proto3";

package protobuf;
option go_package = "github.com/robin1900/raft/protobuf";
option go_package = "github.com/chrislusf/raft/protobuf";

message LogEntry {
uint64 Index = 1;
Expand Down
2 changes: 1 addition & 1 deletion request_vote.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"io"
"io/ioutil"

"github.com/chrislusf/raft/protobuf"
"github.com/golang/protobuf/proto"
"github.com/robin1900/raft/protobuf"
)

// The request sent to a server to vote for a candidate to become a leader.
Expand Down
5 changes: 0 additions & 5 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -988,12 +988,7 @@ func (s *server) processAppendEntriesRequest(req *AppendEntriesRequest) (*Append

// discover new leader when candidate
// save leader name when follower
prevLeader := s.leader
s.leader = req.LeaderName
if prevLeader != s.leader {
s.DispatchEvent(newEvent(LeaderChangeEventType, s.leader, prevLeader))
}

} else {
// Update term and leader.
s.updateCurrentTerm(req.Term, req.LeaderName)
Expand Down
5 changes: 3 additions & 2 deletions snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package raft
import (
"encoding/json"
"fmt"
"github.com/golang/protobuf/proto"
"github.com/robin1900/raft/protobuf"
"hash/crc32"
"io"
"io/ioutil"
"os"

"github.com/chrislusf/raft/protobuf"
"github.com/golang/protobuf/proto"
)

// Snapshot represents an in-memory representation of the current state of the system.
Expand Down

0 comments on commit b8f3fb6

Please sign in to comment.