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

Method StreamExtSnapshot

edgraph/server.go:2088–2105  ·  view source on GitHub ↗
(stream api.Dgraph_StreamExtSnapshotServer)

Source from the content-addressed store, hash-verified

2086}
2087
2088func (s *Server) StreamExtSnapshot(stream api.Dgraph_StreamExtSnapshotServer) error {
2089 defer x.ExtSnapshotStreamingState(false)
2090
2091 // Authorize at stream start, before any data is consumed. Stream auth metadata rides on the
2092 // stream's context, so the same gates used for the unary entry point apply here.
2093 if err := AuthorizeGuardians(stream.Context()); err != nil {
2094 return err
2095 }
2096 if err := hasPoormansAuth(stream.Context()); err != nil {
2097 return err
2098 }
2099
2100 if err := worker.InStream(stream); err != nil {
2101 glog.Errorf("[import] failed to stream external snapshot: %v", err)
2102 return err
2103 }
2104 return nil
2105}
2106
2107// CommitOrAbort commits or aborts a transaction.
2108func (s *Server) CommitOrAbort(ctx context.Context, tc *api.TxnContext) (*api.TxnContext, error) {

Callers

nothing calls this directly

Calls 5

InStreamFunction · 0.92
AuthorizeGuardiansFunction · 0.85
hasPoormansAuthFunction · 0.70
ErrorfMethod · 0.45

Tested by

no test coverage detected