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

Method DeleteNamespace

worker/multi_tenancy.go:21–32  ·  view source on GitHub ↗
(ctx context.Context, req *pb.DeleteNsRequest)

Source from the content-addressed store, hash-verified

19)
20
21func (w *grpcWorker) DeleteNamespace(ctx context.Context, req *pb.DeleteNsRequest) (*pb.Status, error) {
22 var emptyRes pb.Status
23 if !groups().ServesGroup(req.GroupId) {
24 return &emptyRes, errors.Errorf("The server doesn't serve group id: %v", req.GroupId)
25 }
26
27 if err := groups().Node.proposeAndWait(ctx, &pb.Proposal{DeleteNs: req}); err != nil {
28 return &emptyRes, errors.Wrapf(err, "Delete namespace failed for namespace %d on group %d",
29 req.Namespace, req.GroupId)
30 }
31 return &emptyRes, nil
32}
33
34func ProcessDeleteNsRequest(ctx context.Context, ns uint64) error {
35 // Update the membership state to get the latest mapping of groups to predicates.

Callers

nothing calls this directly

Calls 4

groupsFunction · 0.85
ServesGroupMethod · 0.80
ErrorfMethod · 0.45
proposeAndWaitMethod · 0.45

Tested by

no test coverage detected