MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / Snapshot

Method Snapshot

worker/draft.go:1041–1054  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1039}
1040
1041func (n *node) Snapshot() (*pb.Snapshot, error) {
1042 if n == nil || n.Store == nil {
1043 return nil, conn.ErrNoNode
1044 }
1045 snap, err := n.Store.Snapshot()
1046 if err != nil {
1047 return nil, err
1048 }
1049 res := &pb.Snapshot{}
1050 if err := proto.Unmarshal(snap.Data, res); err != nil {
1051 return nil, err
1052 }
1053 return res, nil
1054}
1055
1056func (n *node) retrieveSnapshot(snap *pb.Snapshot) error {
1057 closer, err := n.startTask(opSnapshot)

Callers 6

RunMethod · 0.95
doSendMembershipMethod · 0.45
applyCommittedMethod · 0.45
checkpointAndCloseMethod · 0.45
calculateSnapshotMethod · 0.45
InitAndStartNodeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected