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

Function handleExportOverNetwork

worker/export.go:989–1006  ·  view source on GitHub ↗
(ctx context.Context, in *pb.ExportRequest)

Source from the content-addressed store, hash-verified

987}
988
989func handleExportOverNetwork(ctx context.Context, in *pb.ExportRequest) (ExportedFiles, error) {
990 if in.GroupId == groups().groupId() {
991 return export(ctx, in)
992 }
993
994 pl := groups().Leader(in.GroupId)
995 if pl == nil {
996 return nil, errors.Errorf("Unable to find leader of group: %d\n", in.GroupId)
997 }
998
999 glog.Infof("Sending export request to group: %d, addr: %s\n", in.GroupId, pl.Addr)
1000 c := pb.NewWorkerClient(pl.Get())
1001 _, err := c.Export(ctx, in)
1002 if err != nil {
1003 glog.Errorf("Export error received from group: %d. Error: %v\n", in.GroupId, err)
1004 }
1005 return nil, err
1006}
1007
1008// ExportOverNetwork sends export requests to all the known groups.
1009func ExportOverNetwork(ctx context.Context, input *pb.ExportRequest) (ExportedFiles, error) {

Callers 1

ExportOverNetworkFunction · 0.85

Calls 9

ExportMethod · 0.95
NewWorkerClientFunction · 0.92
groupsFunction · 0.85
exportFunction · 0.85
groupIdMethod · 0.80
InfofMethod · 0.80
GetMethod · 0.65
LeaderMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected