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

Function Import

dgraph/cmd/dgraphimport/import_client.go:43–58  ·  view source on GitHub ↗
(ctx context.Context, connectionString string, bulkOutDir string)

Source from the content-addressed store, hash-verified

41}
42
43func Import(ctx context.Context, connectionString string, bulkOutDir string) error {
44 if bulkOutDir == "" {
45 return fmt.Errorf("bulk output directory cannot be empty")
46 }
47
48 dg, err := newClient(connectionString)
49 if err != nil {
50 return err
51 }
52 resp, err := initiateSnapshotStream(ctx, dg)
53 if err != nil {
54 return err
55 }
56
57 return streamSnapshot(ctx, dg, bulkOutDir, resp.Groups)
58}
59
60// isRetryableError returns true for transient errors that may resolve after a brief wait,
61// such as Raft proposal backlogs during membership changes.

Callers 4

TestEmptyConnStrFunction · 0.85
TestEmptyBulkOutDirFunction · 0.85
runImportTestFunction · 0.85
runFunction · 0.85

Calls 4

initiateSnapshotStreamFunction · 0.85
streamSnapshotFunction · 0.85
newClientFunction · 0.70
ErrorfMethod · 0.45

Tested by 3

TestEmptyConnStrFunction · 0.68
TestEmptyBulkOutDirFunction · 0.68
runImportTestFunction · 0.68