Do not modify the returned Tablet
(key string)
| 532 | |
| 533 | // Do not modify the returned Tablet |
| 534 | func (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 | |
| 549 | func (g *groupi) ForceTablet(key string) (*pb.Tablet, error) { |
| 550 | return g.sendTablet(&pb.Tablet{GroupId: g.groupId(), Predicate: key, Force: true}) |
no test coverage detected