MCPcopy Create free account
hub / github.com/brimdata/super / Pull

Method Pull

api/queryio/client.go:43–74  ·  view source on GitHub ↗
(done bool)

Source from the content-addressed store, hash-verified

41}
42
43func (s *scanner) Pull(done bool) (vector.Any, error) {
44again:
45 batch, err := s.scanner.Pull(done)
46 if err == nil {
47 if batch != nil {
48 return &vector.Labeled{Any: sbuf.Dematerialize(s.sctx, batch), Label: s.channel}, nil
49 }
50 return nil, s.closer.Close()
51 }
52 sctrl, ok := err.(*sbuf.Control)
53 if !ok {
54 return nil, err
55 }
56 ctrl, err := marshalControl(sctrl)
57 if err != nil {
58 return nil, err
59 }
60 switch ctrl := ctrl.(type) {
61 case *api.QueryChannelSet:
62 s.channel = ctrl.Channel
63 goto again
64 case *api.QueryChannelEnd:
65 return &vector.Labeled{Label: ctrl.Channel}, nil
66 case *api.QueryStats:
67 s.progress.Add(ctrl.Progress)
68 goto again
69 case *api.QueryError:
70 return nil, errors.New(ctrl.Error)
71 default:
72 return nil, fmt.Errorf("unsupported control message: %T", ctrl)
73 }
74}
75
76func marshalControl(zctrl *sbuf.Control) (any, error) {
77 ctrl, ok := zctrl.Message.(*bsupio.Control)

Callers

nothing calls this directly

Calls 6

DematerializeFunction · 0.92
marshalControlFunction · 0.85
NewMethod · 0.80
PullMethod · 0.65
CloseMethod · 0.65
AddMethod · 0.45

Tested by

no test coverage detected