Export request is used to trigger exports for the request list of groups. If a server receives request to export a group that it doesn't handle, it would automatically relay that request to the server that it thinks should handle the request.
(ctx context.Context, req *pb.ExportRequest)
| 970 | // If a server receives request to export a group that it doesn't handle, it would |
| 971 | // automatically relay that request to the server that it thinks should handle the request. |
| 972 | func (w *grpcWorker) Export(ctx context.Context, req *pb.ExportRequest) (*pb.ExportResponse, error) { |
| 973 | glog.Infof("Received export request via Grpc: %+v\n", req) |
| 974 | if ctx.Err() != nil { |
| 975 | glog.Errorf("Context error during export: %v\n", ctx.Err()) |
| 976 | return nil, ctx.Err() |
| 977 | } |
| 978 | |
| 979 | glog.Infof("Issuing export request...") |
| 980 | files, err := export(ctx, req) |
| 981 | if err != nil { |
| 982 | glog.Errorf("While running export. Request: %+v. Error=%v\n", req, err) |
| 983 | return nil, err |
| 984 | } |
| 985 | glog.Infof("Export request: %+v OK.\n", req) |
| 986 | return &pb.ExportResponse{Msg: "SUCCESS", Files: files}, nil |
| 987 | } |
| 988 | |
| 989 | func handleExportOverNetwork(ctx context.Context, in *pb.ExportRequest) (ExportedFiles, error) { |
| 990 | if in.GroupId == groups().groupId() { |