[ https://issues.apache.org/jira/browse/BEAM-3303?focusedWorklogId=93518&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-93518 ]
ASF GitHub Bot logged work on BEAM-3303: ---------------------------------------- Author: ASF GitHub Bot Created on: 21/Apr/18 01:15 Start Date: 21/Apr/18 01:15 Worklog Time Spent: 10m Work Description: herohde commented on a change in pull request #5179: [BEAM-3303] Add Go Windowing support URL: https://github.com/apache/beam/pull/5179#discussion_r183195159 ########## File path: sdks/go/pkg/beam/core/runtime/exec/combine.go ########## @@ -93,51 +79,38 @@ func (n *Combine) ProcessElement(ctx context.Context, value FullValue, values .. return fmt.Errorf("invalid status for combine %v: %v", n.UID, n.status) } - if n.IsPerKey { - // For per-key combine, all processing can be done here. Note that - // we do not explicitly call merge, although it may be called implicitly - // when adding input. + // Note that we do not explicitly call merge, although it may + // be called implicitly when adding input. - a, err := n.newAccum(ctx, value.Elm) - if err != nil { - return n.fail(err) - } - first := true - - stream := values[0].Open() - for { - v, err := stream.Read() - if err != nil { - if err == io.EOF { - break - } - return n.fail(err) - } + a, err := n.newAccum(ctx, value.Elm) + if err != nil { + return n.fail(err) + } + first := true - a, err = n.addInput(ctx, a, value.Elm, v.Elm, value.Timestamp, first) - if err != nil { - return n.fail(err) + stream := values[0].Open() + for { + v, err := stream.Read() + if err != nil { + if err == io.EOF { + break } - first = false + return n.fail(err) } - stream.Close() - out, err := n.extract(ctx, a) + a, err = n.addInput(ctx, a, value.Elm, v.Elm, value.Timestamp, first) if err != nil { return n.fail(err) } - return n.Out.ProcessElement(ctx, FullValue{Elm: value.Elm, Elm2: out, Timestamp: value.Timestamp}) + first = false } + stream.Close() Review comment: Done The defer cost is not a concern. I think the idea was to not hold the steam open while processing the continuation. We can tighten it up if it becomes an issue. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 93518) Time Spent: 2h 50m (was: 2h 40m) > Go windowing support > -------------------- > > Key: BEAM-3303 > URL: https://issues.apache.org/jira/browse/BEAM-3303 > Project: Beam > Issue Type: Improvement > Components: sdk-go > Reporter: Henning Rohde > Assignee: Henning Rohde > Priority: Major > Time Spent: 2h 50m > Remaining Estimate: 0h > > Add support for Window.into and windowing strategies on Node. Implement the > various windowing strategies Beam has: GlobalWindow, FixedWindows, etc. -- This message was sent by Atlassian JIRA (v7.6.3#76005)