[
https://issues.apache.org/jira/browse/BEAM-13013?focusedWorklogId=664288&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-664288
]
ASF GitHub Bot logged work on BEAM-13013:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 12/Oct/21 19:48
Start Date: 12/Oct/21 19:48
Worklog Time Spent: 10m
Work Description: htyleo commented on a change in pull request #15698:
URL: https://github.com/apache/beam/pull/15698#discussion_r727442013
##########
File path: sdks/go/pkg/beam/core/runtime/xlangx/registry.go
##########
@@ -0,0 +1,317 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package xlangx
+
+import (
+ "context"
+ "fmt"
+ "net/url"
+ "strings"
+ "sync"
+
+ "github.com/apache/beam/sdks/v2/go/pkg/beam/core/graph"
+ "github.com/apache/beam/sdks/v2/go/pkg/beam/core/graph/coder"
+ "github.com/apache/beam/sdks/v2/go/pkg/beam/core/runtime/graphx"
+ "github.com/apache/beam/sdks/v2/go/pkg/beam/core/runtime/pipelinex"
+ "github.com/apache/beam/sdks/v2/go/pkg/beam/core/typex"
+ jobpb
"github.com/apache/beam/sdks/v2/go/pkg/beam/model/jobmanagement_v1"
+ pipepb "github.com/apache/beam/sdks/v2/go/pkg/beam/model/pipeline_v1"
+)
+
+var defaultReg = newRegistry()
+
+// RegisterHandler associates a namespace with a HandlerFunc which can be used
to
+// replace calls to a Beam ExpansionService.
+//
+// Then, expansion addresses of the forms
+// "<namespace>" or
+// "<namespace>:<configuration>"
+// can be used with beam.CrossLanguage. Any configuration after the separator
is
+// provided to the HandlerFunc on call for the handler func to use at it's
leisure.
+func RegisterHandler(namespace string, handler HandlerFunc) {
+ if err := defaultReg.RegisterHandler(namespace, handler); err != nil {
+ panic(err)
+ }
+}
+
+// RegisterExpansionForUrn overrides which expansion address is used to
+// expand a specific transform URN. The expansion address must be a URL
+// or be a namespaced handler registered with RegisterHandler.
+//
+// When the expansion address is for a handler, it may take the forms
+// "<namespace>" or
+// "<namespace>:<configuration>"
+func RegisterOverrideForUrn(urn, expansionAddr string) {
+ if err := defaultReg.RegisterOverrideForUrn(urn, expansionAddr); err !=
nil {
+ panic(err)
+ }
+}
+
+// HandlerParams is the parameter to an expansion service handler.
+type HandlerParams struct {
+ // Additional parameterization string, if any.
+ Config string
+
+ Req *jobpb.ExpansionRequest
+
+ // Additional pipeline graph information for custom handling
+ // Not exported to avoid mutation.
+ edge *graph.MultiEdge
+ ext *graph.ExternalTransform
Review comment:
ar, I see.
--
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 664288)
Time Spent: 1h 50m (was: 1h 40m)
> Extend expansion service handling to allow overrides/conveniences.
> ------------------------------------------------------------------
>
> Key: BEAM-13013
> URL: https://issues.apache.org/jira/browse/BEAM-13013
> Project: Beam
> Issue Type: Sub-task
> Components: sdk-go
> Reporter: Robert Burke
> Assignee: Robert Burke
> Priority: P2
> Time Spent: 1h 50m
> Remaining Estimate: 0h
>
> Described in the BeamSQL for the Go SDK document:
> https://s.apache.org/beam-go-sql-api
--
This message was sent by Atlassian Jira
(v8.3.4#803005)