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

Method sendTablet

worker/groups.go:460–482  ·  view source on GitHub ↗
(tablet *pb.Tablet)

Source from the content-addressed store, hash-verified

458}
459
460func (g *groupi) sendTablet(tablet *pb.Tablet) (*pb.Tablet, error) {
461 pl := g.connToZeroLeader()
462 zc := pb.NewZeroClient(pl.Get())
463
464 out, err := zc.ShouldServe(g.Ctx(), tablet)
465 if err != nil {
466 glog.Errorf("Error while ShouldServe grpc call %v", err)
467 return nil, err
468 }
469
470 // Do not store tablets with group ID 0, as they are just dummy tablets for
471 // predicates that do no exist.
472 if out.GroupId > 0 {
473 g.Lock()
474 g.tablets[out.GetPredicate()] = out
475 g.Unlock()
476 }
477
478 if out.GroupId == groups().groupId() {
479 glog.Infof("Serving tablet for: %v\n", tablet.GetPredicate())
480 }
481 return out, nil
482}
483
484func (g *groupi) Inform(preds []string) ([]*pb.Tablet, error) {
485 unknownPreds := make([]*pb.Tablet, 0)

Callers 2

TabletMethod · 0.95
ForceTabletMethod · 0.95

Calls 12

connToZeroLeaderMethod · 0.95
ShouldServeMethod · 0.95
CtxMethod · 0.95
NewZeroClientFunction · 0.92
groupsFunction · 0.85
groupIdMethod · 0.80
InfofMethod · 0.80
GetMethod · 0.65
ErrorfMethod · 0.45
LockMethod · 0.45
GetPredicateMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected