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

Method BatchifyBranches

db/root.go:205–229  ·  view source on GitHub ↗
(ctx context.Context, sctx *super.Context, f expr.Evaluator)

Source from the content-addressed store, hash-verified

203}
204
205func (r *Root) BatchifyBranches(ctx context.Context, sctx *super.Context, f expr.Evaluator) ([]super.Value, error) {
206 m := sup.NewBSUPMarshalerWithContext(sctx)
207 m.Decorate(sup.StylePackage)
208 poolRefs, err := r.ListPools(ctx)
209 if err != nil {
210 return nil, err
211 }
212 var vals []super.Value
213 for k := range poolRefs {
214 pool, err := r.openPool(ctx, &poolRefs[k])
215 if err != nil {
216 // We could have race here because a pool got deleted
217 // while we looped so we check and continue.
218 if errors.Is(err, pools.ErrNotFound) {
219 continue
220 }
221 return nil, err
222 }
223 vals, err = pool.BatchifyBranches(ctx, sctx, vals, m, f)
224 if err != nil {
225 return nil, err
226 }
227 }
228 return vals, nil
229}
230
231type BranchMeta struct {
232 Pool pools.Config `super:"pool"`

Callers

nothing calls this directly

Calls 5

ListPoolsMethod · 0.95
openPoolMethod · 0.95
IsMethod · 0.80
DecorateMethod · 0.45

Tested by

no test coverage detected