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

Method Tablet

worker/groups.go:534–547  ·  view source on GitHub ↗

Do not modify the returned Tablet

(key string)

Source from the content-addressed store, hash-verified

532
533// Do not modify the returned Tablet
534func (g *groupi) Tablet(key string) (*pb.Tablet, error) {
535 // TODO: Remove all this later, create a membership state and apply it
536 g.RLock()
537 tablet, ok := g.tablets[key]
538 g.RUnlock()
539 if ok {
540 return tablet, nil
541 }
542
543 // We don't know about this tablet.
544 // Check with dgraphzero if we can serve it.
545 tablet = &pb.Tablet{GroupId: g.groupId(), Predicate: key}
546 return g.sendTablet(tablet)
547}
548
549func (g *groupi) ForceTablet(key string) (*pb.Tablet, error) {
550 return g.sendTablet(&pb.Tablet{GroupId: g.groupId(), Predicate: key, Force: true})

Callers 4

BelongsToMethod · 0.95
ServesTabletMethod · 0.95
proposeAndWaitMethod · 0.80
runSchemaMutationFunction · 0.80

Calls 4

groupIdMethod · 0.95
sendTabletMethod · 0.95
RLockMethod · 0.80
RUnlockMethod · 0.80

Tested by

no test coverage detected