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

Function postStreamProcessing

worker/import.go:495–512  ·  view source on GitHub ↗

postStreamProcessing handles the post-stream processing of data received from the buffer into the local BadgerDB. It loads the schema, updates the membership state, informs zero about tablets, resets caches, applies initial schema, applies initial types, and resets the GQL schema store.

(ctx context.Context)

Source from the content-addressed store, hash-verified

493// It loads the schema, updates the membership state, informs zero about tablets, resets caches, applies initial schema,
494// applies initial types, and resets the GQL schema store.
495func postStreamProcessing(ctx context.Context) error {
496 glog.Info("[import:flush] post stream processing")
497 if err := schema.LoadFromDb(ctx); err != nil {
498 return errors.Wrapf(err, "cannot load schema after streaming data")
499 }
500 if err := UpdateMembershipState(ctx); err != nil {
501 return errors.Wrapf(err, "cannot update membership state after streaming data")
502 }
503
504 gr.informZeroAboutTablets()
505 posting.ResetCache()
506 ResetAclCache()
507 groups().applyInitialSchema()
508 groups().applyInitialTypes()
509 ResetGQLSchemaStore()
510 glog.Info("[import:flush] post stream processing done")
511 return nil
512}
513
514// streamInGroup handles the streaming of data within a group.
515// This function is called on both leader and follower nodes with different behaviors:

Callers 2

runLocalSubscriberMethod · 0.85
applyCommittedMethod · 0.85

Calls 10

LoadFromDbFunction · 0.92
ResetCacheFunction · 0.92
UpdateMembershipStateFunction · 0.85
ResetAclCacheFunction · 0.85
groupsFunction · 0.85
ResetGQLSchemaStoreFunction · 0.85
InfoMethod · 0.80
applyInitialSchemaMethod · 0.80
applyInitialTypesMethod · 0.80

Tested by

no test coverage detected