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)
| 51 | // more efficient. This other writer could have different commit triggers |
| 52 | // to do useful things like paritioning given the context is a rollup. |
| 53 | func 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 | |
| 67 | func (w *Writer) Objects() []data.Object { |
| 68 | return w.objects |
no test coverage detected