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

Method DeletePredsForNs

schema/schema.go:153–172  ·  view source on GitHub ↗

DeletePredsForNs deletes the predicate information for the namespace from the schema.

(delNs uint64)

Source from the content-addressed store, hash-verified

151
152// DeletePredsForNs deletes the predicate information for the namespace from the schema.
153func (s *state) DeletePredsForNs(delNs uint64) {
154 if s == nil {
155 return
156 }
157 s.Lock()
158 defer s.Unlock()
159 for pred := range s.predicate {
160 ns := x.ParseNamespace(pred)
161 if ns == delNs {
162 delete(s.predicate, pred)
163 delete(s.mutSchema, pred)
164 }
165 }
166 for typ := range s.types {
167 ns := x.ParseNamespace(typ)
168 if ns == delNs {
169 delete(s.types, typ)
170 }
171 }
172}
173
174func logUpdate(schema *pb.SchemaUpdate, pred string) string {
175 if schema == nil {

Callers 2

DeleteAllForNsFunction · 0.80
DeleteNamespaceFunction · 0.80

Calls 3

ParseNamespaceFunction · 0.92
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected