MCPcopy Create free account
hub / github.com/dgraph-io/dgraph / StoreExport

Function StoreExport

worker/backup.go:151–168  ·  view source on GitHub ↗
(request *pb.ExportRequest, dir string, key x.Sensitive)

Source from the content-addressed store, hash-verified

149}
150
151func StoreExport(request *pb.ExportRequest, dir string, key x.Sensitive) error {
152 db, err := badger.OpenManaged(badger.DefaultOptions(dir).
153 WithSyncWrites(false).
154 WithValueThreshold(1 << 10).
155 WithNumVersionsToKeep(math.MaxInt32).
156 WithEncryptionKey(key))
157 if err != nil {
158 return err
159 }
160 defer func() {
161 if err := db.Close(); err != nil {
162 glog.Warningf("error closing the DB: %v", err)
163 }
164 }()
165
166 _, err = exportInternal(context.Background(), request, db, true)
167 return errors.Wrapf(err, "cannot export data inside DB at %s", dir)
168}
169
170// Backup handles a request coming from another node.
171func (w *grpcWorker) Backup(ctx context.Context, req *pb.BackupRequest) (*pb.BackupResponse, error) {

Callers

nothing calls this directly

Calls 3

exportInternalFunction · 0.85
WarningfMethod · 0.80
CloseMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…