MCPcopy
hub / github.com/dgraph-io/dgraph / resolveMoveTablet

Function resolveMoveTablet

graphql/admin/moveTablet.go:26–46  ·  view source on GitHub ↗
(ctx context.Context, m schema.Mutation)

Source from the content-addressed store, hash-verified

24}
25
26func resolveMoveTablet(ctx context.Context, m schema.Mutation) (*resolve.Resolved, bool) {
27 input, err := getMoveTabletInput(m)
28 if err != nil {
29 return resolve.EmptyResult(m, err), false
30 }
31
32 // gRPC call returns a nil status if the error is non-nil
33 status, err := worker.MoveTabletOverNetwork(ctx, &pb.MoveTabletRequest{
34 Namespace: input.Namespace,
35 Tablet: input.Tablet,
36 DstGroup: input.GroupId,
37 })
38 if err != nil {
39 return resolve.EmptyResult(m, err), false
40 }
41
42 return resolve.DataResult(m,
43 map[string]interface{}{m.Name(): response("Success", status.GetMsg())},
44 nil,
45 ), true
46}
47
48func getMoveTabletInput(m schema.Mutation) (*moveTabletInput, error) {
49 inputArg, ok := m.ArgValue(schema.InputArgName).(map[string]interface{})

Callers

nothing calls this directly

Calls 7

EmptyResultFunction · 0.92
MoveTabletOverNetworkFunction · 0.92
DataResultFunction · 0.92
getMoveTabletInputFunction · 0.85
responseFunction · 0.85
NameMethod · 0.65
GetMsgMethod · 0.45

Tested by

no test coverage detected