|
@@ -20,13 +20,13 @@ import (
|
|
|
"sync"
|
|
"sync"
|
|
|
"time"
|
|
"time"
|
|
|
|
|
|
|
|
|
|
+ "github.com/coreos/etcd/etcdserver/api/snap"
|
|
|
stats "github.com/coreos/etcd/etcdserver/api/v2stats"
|
|
stats "github.com/coreos/etcd/etcdserver/api/v2stats"
|
|
|
"github.com/coreos/etcd/pkg/logutil"
|
|
"github.com/coreos/etcd/pkg/logutil"
|
|
|
"github.com/coreos/etcd/pkg/transport"
|
|
"github.com/coreos/etcd/pkg/transport"
|
|
|
"github.com/coreos/etcd/pkg/types"
|
|
"github.com/coreos/etcd/pkg/types"
|
|
|
"github.com/coreos/etcd/raft"
|
|
"github.com/coreos/etcd/raft"
|
|
|
"github.com/coreos/etcd/raft/raftpb"
|
|
"github.com/coreos/etcd/raft/raftpb"
|
|
|
- "github.com/coreos/etcd/raftsnap"
|
|
|
|
|
|
|
|
|
|
"github.com/coreos/pkg/capnslog"
|
|
"github.com/coreos/pkg/capnslog"
|
|
|
"github.com/xiang90/probing"
|
|
"github.com/xiang90/probing"
|
|
@@ -61,7 +61,7 @@ type Transporter interface {
|
|
|
Send(m []raftpb.Message)
|
|
Send(m []raftpb.Message)
|
|
|
// SendSnapshot sends out the given snapshot message to a remote peer.
|
|
// SendSnapshot sends out the given snapshot message to a remote peer.
|
|
|
// The behavior of SendSnapshot is similar to Send.
|
|
// The behavior of SendSnapshot is similar to Send.
|
|
|
- SendSnapshot(m raftsnap.Message)
|
|
|
|
|
|
|
+ SendSnapshot(m snap.Message)
|
|
|
// AddRemote adds a remote with given peer urls into the transport.
|
|
// AddRemote adds a remote with given peer urls into the transport.
|
|
|
// A remote helps newly joined member to catch up the progress of cluster,
|
|
// A remote helps newly joined member to catch up the progress of cluster,
|
|
|
// and will not be used after that.
|
|
// and will not be used after that.
|
|
@@ -112,7 +112,7 @@ type Transport struct {
|
|
|
URLs types.URLs // local peer URLs
|
|
URLs types.URLs // local peer URLs
|
|
|
ClusterID types.ID // raft cluster ID for request validation
|
|
ClusterID types.ID // raft cluster ID for request validation
|
|
|
Raft Raft // raft state machine, to which the Transport forwards received messages and reports status
|
|
Raft Raft // raft state machine, to which the Transport forwards received messages and reports status
|
|
|
- Snapshotter *raftsnap.Snapshotter
|
|
|
|
|
|
|
+ Snapshotter *snap.Snapshotter
|
|
|
ServerStats *stats.ServerStats // used to record general transportation statistics
|
|
ServerStats *stats.ServerStats // used to record general transportation statistics
|
|
|
// used to record transportation statistics with followers when
|
|
// used to record transportation statistics with followers when
|
|
|
// performing as leader in raft protocol
|
|
// performing as leader in raft protocol
|
|
@@ -412,7 +412,7 @@ func (t *Transport) ActiveSince(id types.ID) time.Time {
|
|
|
return time.Time{}
|
|
return time.Time{}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func (t *Transport) SendSnapshot(m raftsnap.Message) {
|
|
|
|
|
|
|
+func (t *Transport) SendSnapshot(m snap.Message) {
|
|
|
t.mu.Lock()
|
|
t.mu.Lock()
|
|
|
defer t.mu.Unlock()
|
|
defer t.mu.Unlock()
|
|
|
p := t.peers[types.ID(m.To)]
|
|
p := t.peers[types.ID(m.To)]
|