[ https://issues.apache.org/jira/browse/BEAM-14347?focusedWorklogId=767617&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-767617 ]
ASF GitHub Bot logged work on BEAM-14347: ----------------------------------------- Author: ASF GitHub Bot Created on: 07/May/22 21:38 Start Date: 07/May/22 21:38 Worklog Time Spent: 10m Work Description: damccorm commented on code in PR #17574: URL: https://github.com/apache/beam/pull/17574#discussion_r867397491 ########## sdks/go/pkg/beam/registration/emitterIterRegistration.go: ########## @@ -0,0 +1,298 @@ +// 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 registration + +import ( + "context" + "fmt" + "io" + "reflect" + + "github.com/apache/beam/sdks/v2/go/pkg/beam/core/runtime/exec" + "github.com/apache/beam/sdks/v2/go/pkg/beam/core/typex" +) + +type emitNative1[T any] struct { + n exec.ElementProcessor + fn interface{} + + ctx context.Context + ws []typex.Window + et typex.EventTime + value exec.FullValue +} + +func (e *emitNative1[T]) Init(ctx context.Context, ws []typex.Window, et typex.EventTime) error { + e.ctx = ctx + e.ws = ws + e.et = et + return nil +} + +func (e *emitNative1[T]) Value() interface{} { + return e.fn Review Comment: Yeah, that's a good point - done. I also went ahead and dropped the native piece since its not really descriptive ########## sdks/go/pkg/beam/registration/emitterIterRegistration.go: ########## @@ -0,0 +1,298 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more Review Comment: Yeah, that's a good call. Issue Time Tracking ------------------- Worklog Id: (was: 767617) Time Spent: 9h 10m (was: 9h) > [Go SDK] Allow users to optimize DoFns with a single generic registration > function > ---------------------------------------------------------------------------------- > > Key: BEAM-14347 > URL: https://issues.apache.org/jira/browse/BEAM-14347 > Project: Beam > Issue Type: New Feature > Components: sdk-go > Reporter: Danny McCormick > Assignee: Danny McCormick > Priority: P2 > Time Spent: 9h 10m > Remaining Estimate: 0h > > Right now, to optimize DoFn execution, users have to use the code generator. > This updates to allow them to use generics instead. -- This message was sent by Atlassian Jira (v8.20.7#820007)