mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Simplify imports and improve comments.
This commit is contained in:
parent
4e04770bac
commit
c78bf655a7
@ -17,13 +17,13 @@ package v3rpc
|
||||
import (
|
||||
pb "go.etcd.io/etcd/api/v3/etcdserverpb"
|
||||
"go.etcd.io/etcd/server/v3/etcdserver"
|
||||
apply2 "go.etcd.io/etcd/server/v3/etcdserver/apply"
|
||||
"go.etcd.io/etcd/server/v3/etcdserver/apply"
|
||||
)
|
||||
|
||||
type header struct {
|
||||
clusterID int64
|
||||
memberID int64
|
||||
sg apply2.RaftStatusGetter
|
||||
sg apply.RaftStatusGetter
|
||||
rev func() int64
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ import (
|
||||
"go.etcd.io/etcd/api/v3/v3rpc/rpctypes"
|
||||
"go.etcd.io/etcd/server/v3/auth"
|
||||
"go.etcd.io/etcd/server/v3/etcdserver"
|
||||
apply2 "go.etcd.io/etcd/server/v3/etcdserver/apply"
|
||||
"go.etcd.io/etcd/server/v3/etcdserver/apply"
|
||||
"go.etcd.io/etcd/server/v3/storage/mvcc"
|
||||
|
||||
"go.uber.org/zap"
|
||||
@ -42,7 +42,7 @@ type watchServer struct {
|
||||
|
||||
maxRequestBytes int
|
||||
|
||||
sg apply2.RaftStatusGetter
|
||||
sg apply.RaftStatusGetter
|
||||
watchable mvcc.WatchableKV
|
||||
ag AuthGetter
|
||||
}
|
||||
@ -125,7 +125,7 @@ type serverWatchStream struct {
|
||||
|
||||
maxRequestBytes int
|
||||
|
||||
sg apply2.RaftStatusGetter
|
||||
sg apply.RaftStatusGetter
|
||||
watchable mvcc.WatchableKV
|
||||
ag AuthGetter
|
||||
|
||||
|
@ -104,6 +104,8 @@ func (a *UberApplier) RestoreAlarms() {
|
||||
}
|
||||
|
||||
func (a *UberApplier) Apply(r *pb.InternalRaftRequest, shouldApplyV3 membership.ShouldApplyV3) *ApplyResult {
|
||||
// We first execute chain of WrapApply across all objects (e.g. CorruptApplier -> CappedApplier -> Auth -> Quota -> Backend),
|
||||
// than dispatch(), than individual methods wrappers CorruptApplier.Put(CappedApplier.Put(... BackendApplier.Put())))
|
||||
return a.applyV3.WrapApply(context.TODO(), r, shouldApplyV3, a.dispatch)
|
||||
}
|
||||
|
||||
@ -139,7 +141,6 @@ func (a *UberApplier) dispatch(ctx context.Context, r *pb.InternalRaftRequest, s
|
||||
return nil
|
||||
}
|
||||
|
||||
// call into a.s.applyV3.F instead of a.F so upper appliers can check individual calls
|
||||
switch {
|
||||
case r.Range != nil:
|
||||
op = "Range"
|
||||
|
@ -1606,7 +1606,7 @@ func TestUpdateVersion(t *testing.T) {
|
||||
srv := &EtcdServer{
|
||||
lgMu: new(sync.RWMutex),
|
||||
lg: zaptest.NewLogger(t),
|
||||
memberId: 1,
|
||||
memberId: 1,
|
||||
Cfg: config.ServerConfig{Logger: zaptest.NewLogger(t), TickMs: 1, SnapshotCatchUpEntries: DefaultSnapshotCatchUpEntries},
|
||||
r: *newRaftNode(raftNodeConfig{lg: zaptest.NewLogger(t), Node: n}),
|
||||
attributes: membership.Attributes{Name: "node1", ClientURLs: []string{"http://node1.com"}},
|
||||
|
Loading…
x
Reference in New Issue
Block a user