/
top.shims.go
185 lines (148 loc) · 5.47 KB
/
top.shims.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
// 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.
// Code generated by starcgen. DO NOT EDIT.
// File: top.shims.go
package top
import (
"reflect"
// Library imports
"github.com/apache/beam/sdks/v2/go/pkg/beam/core/runtime"
"github.com/apache/beam/sdks/v2/go/pkg/beam/core/runtime/graphx/schema"
"github.com/apache/beam/sdks/v2/go/pkg/beam/core/typex"
"github.com/apache/beam/sdks/v2/go/pkg/beam/core/util/reflectx"
)
func init() {
runtime.RegisterType(reflect.TypeOf((*accum)(nil)).Elem())
schema.RegisterType(reflect.TypeOf((*accum)(nil)).Elem())
runtime.RegisterType(reflect.TypeOf((*combineFn)(nil)).Elem())
schema.RegisterType(reflect.TypeOf((*combineFn)(nil)).Elem())
reflectx.RegisterStructWrapper(reflect.TypeOf((*combineFn)(nil)).Elem(), wrapMakerCombineFn)
reflectx.RegisterFunc(reflect.TypeOf((*func(accum, accum) accum)(nil)).Elem(), funcMakerAccumAccumГAccum)
reflectx.RegisterFunc(reflect.TypeOf((*func(accum, typex.T) accum)(nil)).Elem(), funcMakerAccumTypex۰TГAccum)
reflectx.RegisterFunc(reflect.TypeOf((*func(accum) []typex.T)(nil)).Elem(), funcMakerAccumГSliceOfTypex۰T)
reflectx.RegisterFunc(reflect.TypeOf((*func())(nil)).Elem(), funcMakerГ)
reflectx.RegisterFunc(reflect.TypeOf((*func() accum)(nil)).Elem(), funcMakerГAccum)
}
func wrapMakerCombineFn(fn interface{}) map[string]reflectx.Func {
dfn := fn.(*combineFn)
return map[string]reflectx.Func{
"AddInput": reflectx.MakeFunc(func(a0 accum, a1 typex.T) accum { return dfn.AddInput(a0, a1) }),
"CreateAccumulator": reflectx.MakeFunc(func() accum { return dfn.CreateAccumulator() }),
"ExtractOutput": reflectx.MakeFunc(func(a0 accum) []typex.T { return dfn.ExtractOutput(a0) }),
"MergeAccumulators": reflectx.MakeFunc(func(a0 accum, a1 accum) accum { return dfn.MergeAccumulators(a0, a1) }),
"Setup": reflectx.MakeFunc(func() { dfn.Setup() }),
}
}
type callerAccumAccumГAccum struct {
fn func(accum, accum) accum
}
func funcMakerAccumAccumГAccum(fn interface{}) reflectx.Func {
f := fn.(func(accum, accum) accum)
return &callerAccumAccumГAccum{fn: f}
}
func (c *callerAccumAccumГAccum) Name() string {
return reflectx.FunctionName(c.fn)
}
func (c *callerAccumAccumГAccum) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
func (c *callerAccumAccumГAccum) Call(args []interface{}) []interface{} {
out0 := c.fn(args[0].(accum), args[1].(accum))
return []interface{}{out0}
}
func (c *callerAccumAccumГAccum) Call2x1(arg0, arg1 interface{}) interface{} {
return c.fn(arg0.(accum), arg1.(accum))
}
type callerAccumTypex۰TГAccum struct {
fn func(accum, typex.T) accum
}
func funcMakerAccumTypex۰TГAccum(fn interface{}) reflectx.Func {
f := fn.(func(accum, typex.T) accum)
return &callerAccumTypex۰TГAccum{fn: f}
}
func (c *callerAccumTypex۰TГAccum) Name() string {
return reflectx.FunctionName(c.fn)
}
func (c *callerAccumTypex۰TГAccum) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
func (c *callerAccumTypex۰TГAccum) Call(args []interface{}) []interface{} {
out0 := c.fn(args[0].(accum), args[1].(typex.T))
return []interface{}{out0}
}
func (c *callerAccumTypex۰TГAccum) Call2x1(arg0, arg1 interface{}) interface{} {
return c.fn(arg0.(accum), arg1.(typex.T))
}
type callerAccumГSliceOfTypex۰T struct {
fn func(accum) []typex.T
}
func funcMakerAccumГSliceOfTypex۰T(fn interface{}) reflectx.Func {
f := fn.(func(accum) []typex.T)
return &callerAccumГSliceOfTypex۰T{fn: f}
}
func (c *callerAccumГSliceOfTypex۰T) Name() string {
return reflectx.FunctionName(c.fn)
}
func (c *callerAccumГSliceOfTypex۰T) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
func (c *callerAccumГSliceOfTypex۰T) Call(args []interface{}) []interface{} {
out0 := c.fn(args[0].(accum))
return []interface{}{out0}
}
func (c *callerAccumГSliceOfTypex۰T) Call1x1(arg0 interface{}) interface{} {
return c.fn(arg0.(accum))
}
type callerГ struct {
fn func()
}
func funcMakerГ(fn interface{}) reflectx.Func {
f := fn.(func())
return &callerГ{fn: f}
}
func (c *callerГ) Name() string {
return reflectx.FunctionName(c.fn)
}
func (c *callerГ) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
func (c *callerГ) Call(args []interface{}) []interface{} {
c.fn()
return []interface{}{}
}
func (c *callerГ) Call0x0() {
c.fn()
}
type callerГAccum struct {
fn func() accum
}
func funcMakerГAccum(fn interface{}) reflectx.Func {
f := fn.(func() accum)
return &callerГAccum{fn: f}
}
func (c *callerГAccum) Name() string {
return reflectx.FunctionName(c.fn)
}
func (c *callerГAccum) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
func (c *callerГAccum) Call(args []interface{}) []interface{} {
out0 := c.fn()
return []interface{}{out0}
}
func (c *callerГAccum) Call0x1() interface{} {
return c.fn()
}
// DO NOT MODIFY: GENERATED CODE