forked from vitessio/vitess
-
Notifications
You must be signed in to change notification settings - Fork 13
/
serving_graph.go
29 lines (22 loc) · 948 Bytes
/
serving_graph.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright 2014, Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package topo
import (
"strings"
"golang.org/x/net/context"
"github.com/youtube/vitess/go/trace"
pb "github.com/youtube/vitess/go/vt/proto/topodata"
)
// UpdateEndPoints is a high level wrapper for TopoServer.UpdateEndPoints.
// It generates trace spans.
func UpdateEndPoints(ctx context.Context, ts Server, cell, keyspace, shard string, tabletType pb.TabletType, addrs *pb.EndPoints, existingVersion int64) error {
span := trace.NewSpanFromContext(ctx)
span.StartClient("TopoServer.UpdateEndPoints")
span.Annotate("cell", cell)
span.Annotate("keyspace", keyspace)
span.Annotate("shard", shard)
span.Annotate("tablet_type", strings.ToLower(tabletType.String()))
defer span.Finish()
return ts.UpdateEndPoints(ctx, cell, keyspace, shard, tabletType, addrs, existingVersion)
}