lostluck commented on a change in pull request #16671:
URL: https://github.com/apache/beam/pull/16671#discussion_r798123253
##########
File path: sdks/go/pkg/beam/core/runtime/xlangx/expand.go
##########
@@ -140,3 +142,67 @@ func QueryExpansionService(ctx context.Context, p
*HandlerParams) (*jobpb.Expans
}
return res, nil
}
+
+func startAutomatedExpansionService(gradleTarget string) (func() error,
string, error) {
+ jarPath, err := expansionx.GetBeamJar(gradleTarget, "2.35.0")
+ if err != nil {
+ return nil, "", err
+ }
+ serviceRunner, err := expansionx.NewExpansionServiceRunner(jarPath, "")
+ if err != nil {
+ return nil, "", err
+ }
+ err = serviceRunner.StartService()
+ if err != nil {
+ return nil, "", err
+ }
+ return serviceRunner.StopService, serviceRunner.Endpoint(), nil
+}
+
+// QueryAutomatedExpansionService submits an external transform to be expanded
by the
+// expansion service and then eagerly materializes the artifacts for staging.
The given
+// transform should be the external transform, and the components are any
additional
+// components necessary for the pipeline snippet.
+//
+// The address to be queried is determined by the Config field of the
HandlerParams after
+// the prefix tag indicating the automated service is in use.
+func QueryAutomatedExpansionService(ctx context.Context, p *HandlerParams)
(*jobpb.ExpansionResponse, error) {
+ // Strip auto: tag to get Gradle target
+ tag, target := parseAddr(p.Config)
Review comment:
What if we assume that "Config" only contains the Gradle target at this
point?
Wouldn't we be able to remove this parse and just populate the
autoJavaNamespace with this handler in the newRegistry() call then?
Then combined with a "Materialized" bit, we can then avoid even needing the
tag here.
I think we can do this in a next PR though, since these are just impl
details and I don't want to drag the scope for this much wider.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]