From 24b34d0a1e6d2c4b78b8e0567a62964f634e90f7 Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Sun, 22 Sep 2013 01:32:49 -0400 Subject: [PATCH] bump 3rd party --- third_party/github.com/coreos/go-raft/server.go | 5 +++-- .../github.com/coreos/go-raft/snapshot_recovery_request.go | 4 ++-- .../github.com/coreos/go-raft/snapshot_recovery_response.go | 4 ++-- third_party/github.com/coreos/go-raft/snapshot_request.go | 4 ++-- third_party/github.com/coreos/go-raft/snapshot_response.go | 4 ++-- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/third_party/github.com/coreos/go-raft/server.go b/third_party/github.com/coreos/go-raft/server.go index e1a51a908..645a2e4a0 100644 --- a/third_party/github.com/coreos/go-raft/server.go +++ b/third_party/github.com/coreos/go-raft/server.go @@ -98,7 +98,7 @@ type event struct { //------------------------------------------------------------------------------ // Creates a new server with a log at the given path. -func NewServer(name string, path string, transporter Transporter, stateMachine StateMachine, context interface{}, connectiongString string) (*Server, error) { +func NewServer(name string, path string, transporter Transporter, stateMachine StateMachine, context interface{}, connectionString string) (*Server, error) { if name == "" { return nil, errors.New("raft.Server: Name cannot be blank") } @@ -119,7 +119,7 @@ func NewServer(name string, path string, transporter Transporter, stateMachine S electionTimeout: DefaultElectionTimeout, heartbeatTimeout: DefaultHeartbeatTimeout, maxLogEntriesPerRequest: MaxLogEntriesPerRequest, - connectionString: connectiongString, + connectionString: connectionString, } // Setup apply function. @@ -1017,6 +1017,7 @@ func (s *Server) TakeSnapshot() error { i := 0 for _, peer := range s.peers { peers[i] = peer.clone() + i++ } peers[i] = &Peer{ diff --git a/third_party/github.com/coreos/go-raft/snapshot_recovery_request.go b/third_party/github.com/coreos/go-raft/snapshot_recovery_request.go index 57b3e3a88..a05f43108 100644 --- a/third_party/github.com/coreos/go-raft/snapshot_recovery_request.go +++ b/third_party/github.com/coreos/go-raft/snapshot_recovery_request.go @@ -35,7 +35,7 @@ func newSnapshotRecoveryRequest(leaderName string, snapshot *Snapshot) *Snapshot // Encodes the SnapshotRecoveryRequest to a buffer. Returns the number of bytes // written and any error that may have occurred. -func (req *SnapshotRecoveryRequest) encode(w io.Writer) (int, error) { +func (req *SnapshotRecoveryRequest) Encode(w io.Writer) (int, error) { protoPeers := make([]*protobuf.ProtoSnapshotRecoveryRequest_ProtoPeer, len(req.Peers)) @@ -63,7 +63,7 @@ func (req *SnapshotRecoveryRequest) encode(w io.Writer) (int, error) { // Decodes the SnapshotRecoveryRequest from a buffer. Returns the number of bytes read and // any error that occurs. -func (req *SnapshotRecoveryRequest) decode(r io.Reader) (int, error) { +func (req *SnapshotRecoveryRequest) Decode(r io.Reader) (int, error) { data, err := ioutil.ReadAll(r) if err != nil { diff --git a/third_party/github.com/coreos/go-raft/snapshot_recovery_response.go b/third_party/github.com/coreos/go-raft/snapshot_recovery_response.go index 2b2f1cde1..7e4d86ace 100644 --- a/third_party/github.com/coreos/go-raft/snapshot_recovery_response.go +++ b/third_party/github.com/coreos/go-raft/snapshot_recovery_response.go @@ -31,7 +31,7 @@ func newSnapshotRecoveryResponse(term uint64, success bool, commitIndex uint64) // Encodes the SnapshotRecoveryResponse to a buffer. Returns the number of bytes // written and any error that may have occurred. -func (req *SnapshotRecoveryResponse) encode(w io.Writer) (int, error) { +func (req *SnapshotRecoveryResponse) Encode(w io.Writer) (int, error) { pb := &protobuf.ProtoSnapshotRecoveryResponse{ Term: proto.Uint64(req.Term), Success: proto.Bool(req.Success), @@ -47,7 +47,7 @@ func (req *SnapshotRecoveryResponse) encode(w io.Writer) (int, error) { // Decodes the SnapshotRecoveryResponse from a buffer. Returns the number of bytes read and // any error that occurs. -func (req *SnapshotRecoveryResponse) decode(r io.Reader) (int, error) { +func (req *SnapshotRecoveryResponse) Decode(r io.Reader) (int, error) { data, err := ioutil.ReadAll(r) if err != nil { diff --git a/third_party/github.com/coreos/go-raft/snapshot_request.go b/third_party/github.com/coreos/go-raft/snapshot_request.go index c2f2cc768..3d75a52cc 100644 --- a/third_party/github.com/coreos/go-raft/snapshot_request.go +++ b/third_party/github.com/coreos/go-raft/snapshot_request.go @@ -31,7 +31,7 @@ func newSnapshotRequest(leaderName string, snapshot *Snapshot) *SnapshotRequest // Encodes the SnapshotRequest to a buffer. Returns the number of bytes // written and any error that may have occurred. -func (req *SnapshotRequest) encode(w io.Writer) (int, error) { +func (req *SnapshotRequest) Encode(w io.Writer) (int, error) { pb := &protobuf.ProtoSnapshotRequest{ LeaderName: proto.String(req.LeaderName), LastIndex: proto.Uint64(req.LastIndex), @@ -47,7 +47,7 @@ func (req *SnapshotRequest) encode(w io.Writer) (int, error) { // Decodes the SnapshotRequest from a buffer. Returns the number of bytes read and // any error that occurs. -func (req *SnapshotRequest) decode(r io.Reader) (int, error) { +func (req *SnapshotRequest) Decode(r io.Reader) (int, error) { data, err := ioutil.ReadAll(r) if err != nil { diff --git a/third_party/github.com/coreos/go-raft/snapshot_response.go b/third_party/github.com/coreos/go-raft/snapshot_response.go index 2e6c1c518..bd27f67af 100644 --- a/third_party/github.com/coreos/go-raft/snapshot_response.go +++ b/third_party/github.com/coreos/go-raft/snapshot_response.go @@ -27,7 +27,7 @@ func newSnapshotResponse(success bool) *SnapshotResponse { // Encodes the SnapshotResponse to a buffer. Returns the number of bytes // written and any error that may have occurred. -func (resp *SnapshotResponse) encode(w io.Writer) (int, error) { +func (resp *SnapshotResponse) Encode(w io.Writer) (int, error) { pb := &protobuf.ProtoSnapshotResponse{ Success: proto.Bool(resp.Success), } @@ -41,7 +41,7 @@ func (resp *SnapshotResponse) encode(w io.Writer) (int, error) { // Decodes the SnapshotResponse from a buffer. Returns the number of bytes read and // any error that occurs. -func (resp *SnapshotResponse) decode(r io.Reader) (int, error) { +func (resp *SnapshotResponse) Decode(r io.Reader) (int, error) { data, err := ioutil.ReadAll(r) if err != nil {