(stream api.Dgraph_StreamExtSnapshotServer)
| 2086 | } |
| 2087 | |
| 2088 | func (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. |
| 2108 | func (s *Server) CommitOrAbort(ctx context.Context, tc *api.TxnContext) (*api.TxnContext, error) { |
nothing calls this directly
no test coverage detected