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

Function NewWriter

db/writer.go:53–65  ·  view source on GitHub ↗

XXX NOTE: we removed the flusher logic as the callee should just put a timeout on the context. We will catch that timeout here and push all records that have been consumed and return the commits of everything that made it up to the timeout. This provides a mechanism for streaming microbatches with

(ctx context.Context, sctx *super.Context, pool *Pool)

Source from the content-addressed store, hash-verified

51// more efficient. This other writer could have different commit triggers
52// to do useful things like paritioning given the context is a rollup.
53func NewWriter(ctx context.Context, sctx *super.Context, pool *Pool) (*Writer, error) {
54 g, ctx := errgroup.WithContext(ctx)
55 ch := make(chan []super.Value, 1)
56 ch <- nil
57 return &Writer{
58 pool: pool,
59 ctx: ctx,
60 sctx: sctx,
61 errgroup: g,
62 buffer: ch,
63 comparator: ImportComparator(sctx, pool),
64 }, nil
65}
66
67func (w *Writer) Objects() []data.Object {
68 return w.objects

Callers 2

LoadMethod · 0.70
DeleteWhereMethod · 0.70

Calls 1

ImportComparatorFunction · 0.85

Tested by

no test coverage detected