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

Function export

worker/export.go:589–604  ·  view source on GitHub ↗

export creates a export of data by exporting it as an RDF gzip.

(ctx context.Context, in *pb.ExportRequest)

Source from the content-addressed store, hash-verified

587
588// export creates a export of data by exporting it as an RDF gzip.
589func 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
606func ToExportKvList(pk x.ParsedKey, pl *posting.List, in *pb.ExportRequest) (*bpb.KVList, error) {
607 e := &exporter{

Callers 4

ExportMethod · 0.85
handleExportOverNetworkFunction · 0.85
TestExportRdfFunction · 0.85
TestExportJsonFunction · 0.85

Calls 7

OracleFunction · 0.92
groupsFunction · 0.85
exportInternalFunction · 0.85
groupIdMethod · 0.80
InfofMethod · 0.80
WaitForTsMethod · 0.80
ErrorfMethod · 0.45

Tested by 2

TestExportRdfFunction · 0.68
TestExportJsonFunction · 0.68