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

Function applySchema

worker/groups.go:237–247  ·  view source on GitHub ↗
(s *pb.SchemaUpdate, ts uint64)

Source from the content-addressed store, hash-verified

235}
236
237func applySchema(s *pb.SchemaUpdate, ts uint64) error {
238 if err := updateSchema(s, ts); err != nil {
239 return err
240 }
241 if servesTablet, err := groups().ServesTablet(s.Predicate); err != nil {
242 return err
243 } else if !servesTablet {
244 return errors.Errorf("group 1 should always serve reserved predicate %s", s.Predicate)
245 }
246 return nil
247}
248
249// No locks are acquired while accessing this function.
250// Don't acquire RW lock during this, otherwise we might deadlock.

Callers 2

applyInitialSchemaMethod · 0.70
applyMutationsMethod · 0.70

Calls 4

groupsFunction · 0.85
ServesTabletMethod · 0.80
updateSchemaFunction · 0.70
ErrorfMethod · 0.45

Tested by

no test coverage detected