[
https://issues.apache.org/jira/browse/BEAM-9919?focusedWorklogId=473513&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-473513
]
ASF GitHub Bot logged work on BEAM-9919:
----------------------------------------
Author: ASF GitHub Bot
Created on: 22/Aug/20 01:16
Start Date: 22/Aug/20 01:16
Worklog Time Spent: 10m
Work Description: pskevin commented on a change in pull request #12632:
URL: https://github.com/apache/beam/pull/12632#discussion_r475028238
##########
File path: sdks/go/pkg/beam/core/graph/edge.go
##########
@@ -283,31 +283,51 @@ func NewFlatten(g *Graph, s *Scope, in []*Node)
(*MultiEdge, error) {
}
// NewCrossLanguage inserts a Cross-langugae External transform.
-func NewCrossLanguage(g *Graph, s *Scope, ext *ExternalTransform) *MultiEdge {
+func NewCrossLanguage(g *Graph, s *Scope, ext *ExternalTransform, ins
[]*Inbound, outs []*Outbound) (*MultiEdge, func(*Node, bool)) {
edge := g.NewEdge(s)
edge.Op = External
edge.External = ext
- for _, n := range ext.Inputs() {
- edge.Input = append(edge.Input, &Inbound{Kind: Main, From: n,
Type: n.Type()})
+ windowingStrategy := inputWindow([]*Node{ins[0].From})
+ for _, o := range outs {
+ o.To.w = windowingStrategy
}
- return edge
+
+ isBoundedUpdater := func(n *Node, bounded bool) {
+ n.bounded = bounded
+ }
+
+ edge.Input = ins
+ edge.Output = outs
+
+ return edge, isBoundedUpdater
+}
+
+func NewNamedInboundLinks(ins map[string]*Node) (map[string]int, []*Inbound) {
+ inputsMap := make(map[string]int)
+ var inboundLinks []*Inbound
+
+ for tag, node := range ins {
+ id := len(inboundLinks)
+ inputsMap[tag] = id
+ inboundLinks = append(inboundLinks, &Inbound{Kind: Main, From:
node, Type: node.Type()})
+ }
+
+ return inputsMap, inboundLinks
}
-// AddOutboundLinks adds Outbound links to existing MultiEdge
-func AddOutboundLinks(g *Graph, e *MultiEdge) {
- windowingStrategy := inputWindow([]*Node{e.Input[0].From})
- outputTypes := e.External.OutputTypes()
- boundedOutputs := e.External.Expanded().BoundedOutputs()
- outputs := make(map[string]*Node)
+func NewNamedOutboundLinks(g *Graph, outs map[string]typex.FullType)
(map[string]int, []*Outbound) {
+ outputsMap := make(map[string]int)
+ var outboundLinks []*Outbound
- for tag, fullType := range outputTypes {
- n := g.NewNode(fullType, windowingStrategy, boundedOutputs[tag])
- outputs[tag] = n
- e.Output = append(e.Output, &Outbound{To: n, Type: fullType})
+ for tag, fullType := range outs {
Review comment:
Addressed and updated in https://github.com/apache/beam/pull/12667.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 473513)
Time Spent: 9h 40m (was: 9.5h)
> Add an External transform API to Go SDK
> ---------------------------------------
>
> Key: BEAM-9919
> URL: https://issues.apache.org/jira/browse/BEAM-9919
> Project: Beam
> Issue Type: Sub-task
> Components: sdk-go
> Reporter: Chamikara Madhusanka Jayalath
> Assignee: Kevin Sijo Puthusseri
> Priority: P2
> Time Spent: 9h 40m
> Remaining Estimate: 0h
>
> This transform will be able to expand cross-language transforms by connecting
> to a remote expansion service through Beam expansion API.
> [https://github.com/apache/beam/blob/master/model/job-management/src/main/proto/beam_expansion_api.proto]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)