-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
stats.shims.go
573 lines (458 loc) · 16.4 KB
/
stats.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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
// 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: stats.shims.go
package stats
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.RegisterFunction(countFn)
runtime.RegisterFunction(keyedCountFn)
runtime.RegisterFunction(maxFloat32Fn)
runtime.RegisterFunction(maxFloat64Fn)
runtime.RegisterFunction(maxInt16Fn)
runtime.RegisterFunction(maxInt32Fn)
runtime.RegisterFunction(maxInt64Fn)
runtime.RegisterFunction(maxInt8Fn)
runtime.RegisterFunction(maxIntFn)
runtime.RegisterFunction(maxUint16Fn)
runtime.RegisterFunction(maxUint32Fn)
runtime.RegisterFunction(maxUint64Fn)
runtime.RegisterFunction(maxUint8Fn)
runtime.RegisterFunction(maxUintFn)
runtime.RegisterFunction(minFloat32Fn)
runtime.RegisterFunction(minFloat64Fn)
runtime.RegisterFunction(minInt16Fn)
runtime.RegisterFunction(minInt32Fn)
runtime.RegisterFunction(minInt64Fn)
runtime.RegisterFunction(minInt8Fn)
runtime.RegisterFunction(minIntFn)
runtime.RegisterFunction(minUint16Fn)
runtime.RegisterFunction(minUint32Fn)
runtime.RegisterFunction(minUint64Fn)
runtime.RegisterFunction(minUint8Fn)
runtime.RegisterFunction(minUintFn)
runtime.RegisterFunction(sumFloat32Fn)
runtime.RegisterFunction(sumFloat64Fn)
runtime.RegisterFunction(sumInt16Fn)
runtime.RegisterFunction(sumInt32Fn)
runtime.RegisterFunction(sumInt64Fn)
runtime.RegisterFunction(sumInt8Fn)
runtime.RegisterFunction(sumIntFn)
runtime.RegisterFunction(sumUint16Fn)
runtime.RegisterFunction(sumUint32Fn)
runtime.RegisterFunction(sumUint64Fn)
runtime.RegisterFunction(sumUint8Fn)
runtime.RegisterFunction(sumUintFn)
runtime.RegisterType(reflect.TypeOf((*meanAccum)(nil)).Elem())
schema.RegisterType(reflect.TypeOf((*meanAccum)(nil)).Elem())
runtime.RegisterType(reflect.TypeOf((*meanFn)(nil)).Elem())
schema.RegisterType(reflect.TypeOf((*meanFn)(nil)).Elem())
reflectx.RegisterStructWrapper(reflect.TypeOf((*meanFn)(nil)).Elem(), wrapMakerMeanFn)
reflectx.RegisterFunc(reflect.TypeOf((*func(float32, float32) float32)(nil)).Elem(), funcMakerFloat32Float32ГFloat32)
reflectx.RegisterFunc(reflect.TypeOf((*func(float64, float64) float64)(nil)).Elem(), funcMakerFloat64Float64ГFloat64)
reflectx.RegisterFunc(reflect.TypeOf((*func(int16, int16) int16)(nil)).Elem(), funcMakerInt16Int16ГInt16)
reflectx.RegisterFunc(reflect.TypeOf((*func(int32, int32) int32)(nil)).Elem(), funcMakerInt32Int32ГInt32)
reflectx.RegisterFunc(reflect.TypeOf((*func(int64, int64) int64)(nil)).Elem(), funcMakerInt64Int64ГInt64)
reflectx.RegisterFunc(reflect.TypeOf((*func(int8, int8) int8)(nil)).Elem(), funcMakerInt8Int8ГInt8)
reflectx.RegisterFunc(reflect.TypeOf((*func(int, int) int)(nil)).Elem(), funcMakerIntIntГInt)
reflectx.RegisterFunc(reflect.TypeOf((*func(meanAccum, meanAccum) meanAccum)(nil)).Elem(), funcMakerMeanAccumMeanAccumГMeanAccum)
reflectx.RegisterFunc(reflect.TypeOf((*func(meanAccum, typex.T) meanAccum)(nil)).Elem(), funcMakerMeanAccumTypex۰TГMeanAccum)
reflectx.RegisterFunc(reflect.TypeOf((*func(meanAccum) float64)(nil)).Elem(), funcMakerMeanAccumГFloat64)
reflectx.RegisterFunc(reflect.TypeOf((*func(typex.T) int)(nil)).Elem(), funcMakerTypex۰TГInt)
reflectx.RegisterFunc(reflect.TypeOf((*func(typex.T) (typex.T, int))(nil)).Elem(), funcMakerTypex۰TГTypex۰TInt)
reflectx.RegisterFunc(reflect.TypeOf((*func(uint16, uint16) uint16)(nil)).Elem(), funcMakerUint16Uint16ГUint16)
reflectx.RegisterFunc(reflect.TypeOf((*func(uint32, uint32) uint32)(nil)).Elem(), funcMakerUint32Uint32ГUint32)
reflectx.RegisterFunc(reflect.TypeOf((*func(uint64, uint64) uint64)(nil)).Elem(), funcMakerUint64Uint64ГUint64)
reflectx.RegisterFunc(reflect.TypeOf((*func(uint8, uint8) uint8)(nil)).Elem(), funcMakerUint8Uint8ГUint8)
reflectx.RegisterFunc(reflect.TypeOf((*func(uint, uint) uint)(nil)).Elem(), funcMakerUintUintГUint)
reflectx.RegisterFunc(reflect.TypeOf((*func() meanAccum)(nil)).Elem(), funcMakerГMeanAccum)
}
func wrapMakerMeanFn(fn any) map[string]reflectx.Func {
dfn := fn.(*meanFn)
return map[string]reflectx.Func{
"AddInput": reflectx.MakeFunc(func(a0 meanAccum, a1 typex.T) meanAccum { return dfn.AddInput(a0, a1) }),
"CreateAccumulator": reflectx.MakeFunc(func() meanAccum { return dfn.CreateAccumulator() }),
"ExtractOutput": reflectx.MakeFunc(func(a0 meanAccum) float64 { return dfn.ExtractOutput(a0) }),
"MergeAccumulators": reflectx.MakeFunc(func(a0 meanAccum, a1 meanAccum) meanAccum { return dfn.MergeAccumulators(a0, a1) }),
}
}
type callerFloat32Float32ГFloat32 struct {
fn func(float32, float32) float32
}
func funcMakerFloat32Float32ГFloat32(fn any) reflectx.Func {
f := fn.(func(float32, float32) float32)
return &callerFloat32Float32ГFloat32{fn: f}
}
func (c *callerFloat32Float32ГFloat32) Name() string {
return reflectx.FunctionName(c.fn)
}
func (c *callerFloat32Float32ГFloat32) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
func (c *callerFloat32Float32ГFloat32) Call(args []any) []any {
out0 := c.fn(args[0].(float32), args[1].(float32))
return []any{out0}
}
func (c *callerFloat32Float32ГFloat32) Call2x1(arg0, arg1 any) any {
return c.fn(arg0.(float32), arg1.(float32))
}
type callerFloat64Float64ГFloat64 struct {
fn func(float64, float64) float64
}
func funcMakerFloat64Float64ГFloat64(fn any) reflectx.Func {
f := fn.(func(float64, float64) float64)
return &callerFloat64Float64ГFloat64{fn: f}
}
func (c *callerFloat64Float64ГFloat64) Name() string {
return reflectx.FunctionName(c.fn)
}
func (c *callerFloat64Float64ГFloat64) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
func (c *callerFloat64Float64ГFloat64) Call(args []any) []any {
out0 := c.fn(args[0].(float64), args[1].(float64))
return []any{out0}
}
func (c *callerFloat64Float64ГFloat64) Call2x1(arg0, arg1 any) any {
return c.fn(arg0.(float64), arg1.(float64))
}
type callerInt16Int16ГInt16 struct {
fn func(int16, int16) int16
}
func funcMakerInt16Int16ГInt16(fn any) reflectx.Func {
f := fn.(func(int16, int16) int16)
return &callerInt16Int16ГInt16{fn: f}
}
func (c *callerInt16Int16ГInt16) Name() string {
return reflectx.FunctionName(c.fn)
}
func (c *callerInt16Int16ГInt16) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
func (c *callerInt16Int16ГInt16) Call(args []any) []any {
out0 := c.fn(args[0].(int16), args[1].(int16))
return []any{out0}
}
func (c *callerInt16Int16ГInt16) Call2x1(arg0, arg1 any) any {
return c.fn(arg0.(int16), arg1.(int16))
}
type callerInt32Int32ГInt32 struct {
fn func(int32, int32) int32
}
func funcMakerInt32Int32ГInt32(fn any) reflectx.Func {
f := fn.(func(int32, int32) int32)
return &callerInt32Int32ГInt32{fn: f}
}
func (c *callerInt32Int32ГInt32) Name() string {
return reflectx.FunctionName(c.fn)
}
func (c *callerInt32Int32ГInt32) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
func (c *callerInt32Int32ГInt32) Call(args []any) []any {
out0 := c.fn(args[0].(int32), args[1].(int32))
return []any{out0}
}
func (c *callerInt32Int32ГInt32) Call2x1(arg0, arg1 any) any {
return c.fn(arg0.(int32), arg1.(int32))
}
type callerInt64Int64ГInt64 struct {
fn func(int64, int64) int64
}
func funcMakerInt64Int64ГInt64(fn any) reflectx.Func {
f := fn.(func(int64, int64) int64)
return &callerInt64Int64ГInt64{fn: f}
}
func (c *callerInt64Int64ГInt64) Name() string {
return reflectx.FunctionName(c.fn)
}
func (c *callerInt64Int64ГInt64) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
func (c *callerInt64Int64ГInt64) Call(args []any) []any {
out0 := c.fn(args[0].(int64), args[1].(int64))
return []any{out0}
}
func (c *callerInt64Int64ГInt64) Call2x1(arg0, arg1 any) any {
return c.fn(arg0.(int64), arg1.(int64))
}
type callerInt8Int8ГInt8 struct {
fn func(int8, int8) int8
}
func funcMakerInt8Int8ГInt8(fn any) reflectx.Func {
f := fn.(func(int8, int8) int8)
return &callerInt8Int8ГInt8{fn: f}
}
func (c *callerInt8Int8ГInt8) Name() string {
return reflectx.FunctionName(c.fn)
}
func (c *callerInt8Int8ГInt8) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
func (c *callerInt8Int8ГInt8) Call(args []any) []any {
out0 := c.fn(args[0].(int8), args[1].(int8))
return []any{out0}
}
func (c *callerInt8Int8ГInt8) Call2x1(arg0, arg1 any) any {
return c.fn(arg0.(int8), arg1.(int8))
}
type callerIntIntГInt struct {
fn func(int, int) int
}
func funcMakerIntIntГInt(fn any) reflectx.Func {
f := fn.(func(int, int) int)
return &callerIntIntГInt{fn: f}
}
func (c *callerIntIntГInt) Name() string {
return reflectx.FunctionName(c.fn)
}
func (c *callerIntIntГInt) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
func (c *callerIntIntГInt) Call(args []any) []any {
out0 := c.fn(args[0].(int), args[1].(int))
return []any{out0}
}
func (c *callerIntIntГInt) Call2x1(arg0, arg1 any) any {
return c.fn(arg0.(int), arg1.(int))
}
type callerMeanAccumMeanAccumГMeanAccum struct {
fn func(meanAccum, meanAccum) meanAccum
}
func funcMakerMeanAccumMeanAccumГMeanAccum(fn any) reflectx.Func {
f := fn.(func(meanAccum, meanAccum) meanAccum)
return &callerMeanAccumMeanAccumГMeanAccum{fn: f}
}
func (c *callerMeanAccumMeanAccumГMeanAccum) Name() string {
return reflectx.FunctionName(c.fn)
}
func (c *callerMeanAccumMeanAccumГMeanAccum) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
func (c *callerMeanAccumMeanAccumГMeanAccum) Call(args []any) []any {
out0 := c.fn(args[0].(meanAccum), args[1].(meanAccum))
return []any{out0}
}
func (c *callerMeanAccumMeanAccumГMeanAccum) Call2x1(arg0, arg1 any) any {
return c.fn(arg0.(meanAccum), arg1.(meanAccum))
}
type callerMeanAccumTypex۰TГMeanAccum struct {
fn func(meanAccum, typex.T) meanAccum
}
func funcMakerMeanAccumTypex۰TГMeanAccum(fn any) reflectx.Func {
f := fn.(func(meanAccum, typex.T) meanAccum)
return &callerMeanAccumTypex۰TГMeanAccum{fn: f}
}
func (c *callerMeanAccumTypex۰TГMeanAccum) Name() string {
return reflectx.FunctionName(c.fn)
}
func (c *callerMeanAccumTypex۰TГMeanAccum) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
func (c *callerMeanAccumTypex۰TГMeanAccum) Call(args []any) []any {
out0 := c.fn(args[0].(meanAccum), args[1].(typex.T))
return []any{out0}
}
func (c *callerMeanAccumTypex۰TГMeanAccum) Call2x1(arg0, arg1 any) any {
return c.fn(arg0.(meanAccum), arg1.(typex.T))
}
type callerMeanAccumГFloat64 struct {
fn func(meanAccum) float64
}
func funcMakerMeanAccumГFloat64(fn any) reflectx.Func {
f := fn.(func(meanAccum) float64)
return &callerMeanAccumГFloat64{fn: f}
}
func (c *callerMeanAccumГFloat64) Name() string {
return reflectx.FunctionName(c.fn)
}
func (c *callerMeanAccumГFloat64) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
func (c *callerMeanAccumГFloat64) Call(args []any) []any {
out0 := c.fn(args[0].(meanAccum))
return []any{out0}
}
func (c *callerMeanAccumГFloat64) Call1x1(arg0 any) any {
return c.fn(arg0.(meanAccum))
}
type callerTypex۰TГInt struct {
fn func(typex.T) int
}
func funcMakerTypex۰TГInt(fn any) reflectx.Func {
f := fn.(func(typex.T) int)
return &callerTypex۰TГInt{fn: f}
}
func (c *callerTypex۰TГInt) Name() string {
return reflectx.FunctionName(c.fn)
}
func (c *callerTypex۰TГInt) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
func (c *callerTypex۰TГInt) Call(args []any) []any {
out0 := c.fn(args[0].(typex.T))
return []any{out0}
}
func (c *callerTypex۰TГInt) Call1x1(arg0 any) any {
return c.fn(arg0.(typex.T))
}
type callerTypex۰TГTypex۰TInt struct {
fn func(typex.T) (typex.T, int)
}
func funcMakerTypex۰TГTypex۰TInt(fn any) reflectx.Func {
f := fn.(func(typex.T) (typex.T, int))
return &callerTypex۰TГTypex۰TInt{fn: f}
}
func (c *callerTypex۰TГTypex۰TInt) Name() string {
return reflectx.FunctionName(c.fn)
}
func (c *callerTypex۰TГTypex۰TInt) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
func (c *callerTypex۰TГTypex۰TInt) Call(args []any) []any {
out0, out1 := c.fn(args[0].(typex.T))
return []any{out0, out1}
}
func (c *callerTypex۰TГTypex۰TInt) Call1x2(arg0 any) (any, any) {
return c.fn(arg0.(typex.T))
}
type callerUint16Uint16ГUint16 struct {
fn func(uint16, uint16) uint16
}
func funcMakerUint16Uint16ГUint16(fn any) reflectx.Func {
f := fn.(func(uint16, uint16) uint16)
return &callerUint16Uint16ГUint16{fn: f}
}
func (c *callerUint16Uint16ГUint16) Name() string {
return reflectx.FunctionName(c.fn)
}
func (c *callerUint16Uint16ГUint16) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
func (c *callerUint16Uint16ГUint16) Call(args []any) []any {
out0 := c.fn(args[0].(uint16), args[1].(uint16))
return []any{out0}
}
func (c *callerUint16Uint16ГUint16) Call2x1(arg0, arg1 any) any {
return c.fn(arg0.(uint16), arg1.(uint16))
}
type callerUint32Uint32ГUint32 struct {
fn func(uint32, uint32) uint32
}
func funcMakerUint32Uint32ГUint32(fn any) reflectx.Func {
f := fn.(func(uint32, uint32) uint32)
return &callerUint32Uint32ГUint32{fn: f}
}
func (c *callerUint32Uint32ГUint32) Name() string {
return reflectx.FunctionName(c.fn)
}
func (c *callerUint32Uint32ГUint32) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
func (c *callerUint32Uint32ГUint32) Call(args []any) []any {
out0 := c.fn(args[0].(uint32), args[1].(uint32))
return []any{out0}
}
func (c *callerUint32Uint32ГUint32) Call2x1(arg0, arg1 any) any {
return c.fn(arg0.(uint32), arg1.(uint32))
}
type callerUint64Uint64ГUint64 struct {
fn func(uint64, uint64) uint64
}
func funcMakerUint64Uint64ГUint64(fn any) reflectx.Func {
f := fn.(func(uint64, uint64) uint64)
return &callerUint64Uint64ГUint64{fn: f}
}
func (c *callerUint64Uint64ГUint64) Name() string {
return reflectx.FunctionName(c.fn)
}
func (c *callerUint64Uint64ГUint64) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
func (c *callerUint64Uint64ГUint64) Call(args []any) []any {
out0 := c.fn(args[0].(uint64), args[1].(uint64))
return []any{out0}
}
func (c *callerUint64Uint64ГUint64) Call2x1(arg0, arg1 any) any {
return c.fn(arg0.(uint64), arg1.(uint64))
}
type callerUint8Uint8ГUint8 struct {
fn func(uint8, uint8) uint8
}
func funcMakerUint8Uint8ГUint8(fn any) reflectx.Func {
f := fn.(func(uint8, uint8) uint8)
return &callerUint8Uint8ГUint8{fn: f}
}
func (c *callerUint8Uint8ГUint8) Name() string {
return reflectx.FunctionName(c.fn)
}
func (c *callerUint8Uint8ГUint8) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
func (c *callerUint8Uint8ГUint8) Call(args []any) []any {
out0 := c.fn(args[0].(uint8), args[1].(uint8))
return []any{out0}
}
func (c *callerUint8Uint8ГUint8) Call2x1(arg0, arg1 any) any {
return c.fn(arg0.(uint8), arg1.(uint8))
}
type callerUintUintГUint struct {
fn func(uint, uint) uint
}
func funcMakerUintUintГUint(fn any) reflectx.Func {
f := fn.(func(uint, uint) uint)
return &callerUintUintГUint{fn: f}
}
func (c *callerUintUintГUint) Name() string {
return reflectx.FunctionName(c.fn)
}
func (c *callerUintUintГUint) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
func (c *callerUintUintГUint) Call(args []any) []any {
out0 := c.fn(args[0].(uint), args[1].(uint))
return []any{out0}
}
func (c *callerUintUintГUint) Call2x1(arg0, arg1 any) any {
return c.fn(arg0.(uint), arg1.(uint))
}
type callerГMeanAccum struct {
fn func() meanAccum
}
func funcMakerГMeanAccum(fn any) reflectx.Func {
f := fn.(func() meanAccum)
return &callerГMeanAccum{fn: f}
}
func (c *callerГMeanAccum) Name() string {
return reflectx.FunctionName(c.fn)
}
func (c *callerГMeanAccum) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
func (c *callerГMeanAccum) Call(args []any) []any {
out0 := c.fn()
return []any{out0}
}
func (c *callerГMeanAccum) Call0x1() any {
return c.fn()
}
// DO NOT MODIFY: GENERATED CODE