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

Method BatchifyBranchTips

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

Source from the content-addressed store, hash-verified

190}
191
192func (p *Pool) BatchifyBranchTips(ctx context.Context, sctx *super.Context, f expr.Evaluator) ([]super.Value, error) {
193 branches, err := p.ListBranches(ctx)
194 if err != nil {
195 return nil, err
196 }
197 m := sup.NewBSUPMarshalerWithContext(sctx)
198 m.Decorate(sup.StylePackage)
199 recs := make([]super.Value, 0, len(branches))
200 for _, branchRef := range branches {
201 rec, err := m.Marshal(&BranchTip{branchRef.Name, branchRef.Commit})
202 if err != nil {
203 return nil, err
204 }
205 if filter(sctx, rec, f) {
206 recs = append(recs, rec)
207 }
208 }
209 return recs, nil
210}
211
212// XXX this is inefficient but is only meant for interactive queries...?
213func (p *Pool) ObjectExists(ctx context.Context, id ksuid.KSUID) (bool, error) {

Callers 1

NewCommitMetaScannerFunction · 0.80

Calls 5

ListBranchesMethod · 0.95
filterFunction · 0.70
DecorateMethod · 0.45
MarshalMethod · 0.45

Tested by

no test coverage detected