export creates a export of data by exporting it as an RDF gzip.
(ctx context.Context, in *pb.ExportRequest)
| 587 | |
| 588 | // export creates a export of data by exporting it as an RDF gzip. |
| 589 | func export(ctx context.Context, in *pb.ExportRequest) (ExportedFiles, error) { |
| 590 | |
| 591 | if in.GroupId != groups().groupId() { |
| 592 | return nil, errors.Errorf("Export request group mismatch. Mine: %d. Requested: %d", |
| 593 | groups().groupId(), in.GroupId) |
| 594 | } |
| 595 | glog.Infof("Export requested at %d for namespace %d.", in.ReadTs, in.Namespace) |
| 596 | |
| 597 | // Let's wait for this server to catch up to all the updates until this ts. |
| 598 | if err := posting.Oracle().WaitForTs(ctx, in.ReadTs); err != nil { |
| 599 | return nil, err |
| 600 | } |
| 601 | glog.Infof("Running export for group %d at timestamp %d.", in.GroupId, in.ReadTs) |
| 602 | |
| 603 | return exportInternal(ctx, in, pstore, false) |
| 604 | } |
| 605 | |
| 606 | func ToExportKvList(pk x.ParsedKey, pl *posting.List, in *pb.ExportRequest) (*bpb.KVList, error) { |
| 607 | e := &exporter{ |