(ctx context.Context, in *pb.ExportRequest)
| 987 | } |
| 988 | |
| 989 | func 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. |
| 1009 | func ExportOverNetwork(ctx context.Context, input *pb.ExportRequest) (ExportedFiles, error) { |
no test coverage detected