lostluck commented on code in PR #17613:
URL: https://github.com/apache/beam/pull/17613#discussion_r870594841
##########
sdks/go/pkg/beam/register/register_test.go:
##########
@@ -672,3 +675,133 @@ func (fn *PartialCombiner2) AddInput(i int, c CustomType)
int {
func (fn *PartialCombiner2) MergeAccumulators(i1 int, i2 int) int {
return i1 + i2
}
+
+// Foo is a struct with a method for measuring method invocation
+// overhead for StructuralDoFns.
+type Foo struct {
+ A int
+}
+
+// ProcessElement is a method for measuring a baseline of structural dofn
overhead.
+func (f *Foo) ProcessElement(b CustomType) int {
+ return f.A + b.val
+}
+
+func MakeMultiEdge(f *graph.DoFn) graph.MultiEdge {
+ return graph.MultiEdge{
+ DoFn: f,
+ }
+}
+
+type callerCustomTypeŠint struct {
Review Comment:
Correct, as a rule, one can but *shouldn't* use such characters in one's Go
identifiers.
So I picked symbols that were hard to type, to emphasize that one shouldn't
be using any of these directly.
The generic approach avoids this entirely, since anything generated is
already inaccessible to the user, since we don't expose those types to them at
all. This allows us to changes things fairly freely, as long as the user
interface doesn't change.
--
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]