From 9461ed83af207fed7f497f10890ac8fc29a031e4 Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Tue, 8 Mar 2022 14:39:58 -0500 Subject: [PATCH 1/7] [BEAM-10976] Bundle finalization: E2E support --- sdks/go/pkg/beam/core/funcx/fn.go | 53 +++++- sdks/go/pkg/beam/core/runtime/exec/fn.go | 8 +- .../go/pkg/beam/core/runtime/exec/fn_arity.go | 24 +++ .../pkg/beam/core/runtime/exec/fn_arity.tmpl | 2 +- .../pkg/beam/core/runtime/graphx/serialize.go | 4 + .../pkg/beam/core/runtime/graphx/translate.go | 4 + .../pkg/beam/core/runtime/graphx/v1/v1.pb.go | 25 +-- sdks/go/pkg/beam/core/typex/class.go | 1 + sdks/go/pkg/beam/core/typex/special.go | 13 +- sdks/go/pkg/beam/core/util/reflectx/calls.go | 164 ++++++++++++++++++ .../go/pkg/beam/core/util/reflectx/calls.tmpl | 2 +- sdks/go/pkg/beam/forward.go | 4 + 12 files changed, 274 insertions(+), 30 deletions(-) diff --git a/sdks/go/pkg/beam/core/funcx/fn.go b/sdks/go/pkg/beam/core/funcx/fn.go index c1bbea5f8595..1d04d02667d1 100644 --- a/sdks/go/pkg/beam/core/funcx/fn.go +++ b/sdks/go/pkg/beam/core/funcx/fn.go @@ -78,6 +78,8 @@ const ( FnMultiMap FnParamKind = 0x200 // FnPane indicates a function input parameter that is a PaneInfo FnPane FnParamKind = 0x400 + // FnBundleFinalization indicates a function input parameter that implements typex.BundleFinalization. + FnBundleFinalization FnParamKind = 0x800 ) func (k FnParamKind) String() string { @@ -104,6 +106,8 @@ func (k FnParamKind) String() string { return "MultiMap" case FnPane: return "Pane" + case FnBundleFinalization: + return "BundleFinalization" default: return fmt.Sprintf("%v", int(k)) } @@ -267,6 +271,16 @@ func (u *Fn) RTracker() (pos int, exists bool) { return -1, false } +// RTracker returns (index, true) iff the function expects an sdf.RTracker. +func (u *Fn) BundleFinalization() (pos int, exists bool) { + for i, p := range u.Param { + if p.Kind == FnBundleFinalization { + return i, true + } + } + return -1, false +} + // Error returns (index, true) iff the function returns an error. func (u *Fn) Error() (pos int, exists bool) { for i, p := range u.Ret { @@ -329,6 +343,8 @@ func New(fn reflectx.Func) (*Fn, error) { kind = FnEventTime case t.Implements(typex.WindowType): kind = FnWindow + case t == typex.BundleFinalizationType: + kind = FnBundleFinalization case t == reflectx.Type: kind = FnType case t.Implements(reflect.TypeOf((*sdf.RTracker)(nil)).Elem()): @@ -415,7 +431,7 @@ func SubReturns(list []ReturnParam, indices ...int) []ReturnParam { } // The order of present parameters and return values must be as follows: -// func(FnContext?, FnPane?, FnWindow?, FnEventTime?, FnType?, FnRTracker?, (FnValue, SideInput*)?, FnEmit*) (RetEventTime?, RetOutput?, RetError?) +// func(FnContext?, FnPane?, FnWindow?, FnEventTime?, FnType?, FnRTracker?, FnBundleFinalization?, (FnValue, SideInput*)?, FnEmit*) (RetEventTime?, RetOutput?, RetError?) // where ? indicates 0 or 1, and * indicates any number. // and a SideInput is one of FnValue or FnIter or FnReIter // Note: Fns with inputs must have at least one FnValue as the main input. @@ -439,13 +455,14 @@ func validateOrder(u *Fn) error { } var ( - errContextParam = errors.New("may only have a single context.Context parameter and it must be the first parameter") - errPaneParamPrecedence = errors.New("may only have a single PaneInfo parameter and it must precede the WindowParam, EventTime and main input parameter") - errWindowParamPrecedence = errors.New("may only have a single Window parameter and it must precede the EventTime and main input parameter") - errEventTimeParamPrecedence = errors.New("may only have a single beam.EventTime parameter and it must precede the main input parameter") - errReflectTypePrecedence = errors.New("may only have a single reflect.Type parameter and it must precede the main input parameter") - errRTrackerPrecedence = errors.New("may only have a single sdf.RTracker parameter and it must precede the main input parameter") - errInputPrecedence = errors.New("inputs parameters must precede emit function parameters") + errContextParam = errors.New("may only have a single context.Context parameter and it must be the first parameter") + errPaneParamPrecedence = errors.New("may only have a single PaneInfo parameter and it must precede the WindowParam, EventTime and main input parameter") + errWindowParamPrecedence = errors.New("may only have a single Window parameter and it must precede the EventTime and main input parameter") + errEventTimeParamPrecedence = errors.New("may only have a single beam.EventTime parameter and it must precede the main input parameter") + errReflectTypePrecedence = errors.New("may only have a single reflect.Type parameter and it must precede the main input parameter") + errRTrackerPrecedence = errors.New("may only have a single sdf.RTracker parameter and it must precede the main input parameter") + errBundleFinalizationPrecedence = errors.New("may only have a single BundleFinalization parameter and it must precede the main input parameter") + errInputPrecedence = errors.New("inputs parameters must precede emit function parameters") ) type paramState int @@ -460,6 +477,7 @@ const ( psInput psOutput psRTracker + psBundleFinalization ) func nextParamState(cur paramState, transition FnParamKind) (paramState, error) { @@ -478,6 +496,8 @@ func nextParamState(cur paramState, transition FnParamKind) (paramState, error) return psType, nil case FnRTracker: return psRTracker, nil + case FnBundleFinalization: + return psBundleFinalization, nil } case psContext: switch transition { @@ -491,6 +511,8 @@ func nextParamState(cur paramState, transition FnParamKind) (paramState, error) return psType, nil case FnRTracker: return psRTracker, nil + case FnBundleFinalization: + return psBundleFinalization, nil } case psPane: switch transition { @@ -502,6 +524,8 @@ func nextParamState(cur paramState, transition FnParamKind) (paramState, error) return psType, nil case FnRTracker: return psRTracker, nil + case FnBundleFinalization: + return psBundleFinalization, nil } case psWindow: switch transition { @@ -511,6 +535,8 @@ func nextParamState(cur paramState, transition FnParamKind) (paramState, error) return psType, nil case FnRTracker: return psRTracker, nil + case FnBundleFinalization: + return psBundleFinalization, nil } case psEventTime: switch transition { @@ -518,13 +544,22 @@ func nextParamState(cur paramState, transition FnParamKind) (paramState, error) return psType, nil case FnRTracker: return psRTracker, nil + case FnBundleFinalization: + return psBundleFinalization, nil } case psType: switch transition { case FnRTracker: return psRTracker, nil + case FnBundleFinalization: + return psBundleFinalization, nil } case psRTracker: + switch transition { + case FnBundleFinalization: + return psBundleFinalization, nil + } + case psBundleFinalization: // Completely handled by the default clause case psInput: switch transition { @@ -551,6 +586,8 @@ func nextParamState(cur paramState, transition FnParamKind) (paramState, error) return -1, errReflectTypePrecedence case FnRTracker: return -1, errRTrackerPrecedence + case FnBundleFinalization: + return -1, errBundleFinalizationPrecedence case FnIter, FnReIter, FnValue, FnMultiMap: return psInput, nil case FnEmit: diff --git a/sdks/go/pkg/beam/core/runtime/exec/fn.go b/sdks/go/pkg/beam/core/runtime/exec/fn.go index 5f90bdf1d774..2cbcaa484266 100644 --- a/sdks/go/pkg/beam/core/runtime/exec/fn.go +++ b/sdks/go/pkg/beam/core/runtime/exec/fn.go @@ -124,11 +124,9 @@ func newInvoker(fn *funcx.Fn) *invoker { if n.outErrIdx, ok = fn.Error(); !ok { n.outErrIdx = -1 } - // TODO(BEAM-10976) - add this back in once BundleFinalization is implemented - // if n.bfIdx, ok = fn.BundleFinalization(); !ok { - // n.bfIdx = -1 - // } - n.bfIdx = -1 + if n.bfIdx, ok = fn.BundleFinalization(); !ok { + n.bfIdx = -1 + } n.initCall() diff --git a/sdks/go/pkg/beam/core/runtime/exec/fn_arity.go b/sdks/go/pkg/beam/core/runtime/exec/fn_arity.go index 960edffff9cc..a070273cfb52 100644 --- a/sdks/go/pkg/beam/core/runtime/exec/fn_arity.go +++ b/sdks/go/pkg/beam/core/runtime/exec/fn_arity.go @@ -80,6 +80,12 @@ func (n *invoker) initCall() { return nil, nil } + case reflectx.Func8x0: + n.call = func(pn typex.PaneInfo, ws []typex.Window, ts typex.EventTime) (*FullValue, error) { + fn.Call8x0(n.args[0], n.args[1], n.args[2], n.args[3], n.args[4], n.args[5], n.args[6], n.args[7]) + return nil, nil + } + case reflectx.Func0x1: n.call = func(pn typex.PaneInfo, ws []typex.Window, ts typex.EventTime) (*FullValue, error) { r0 := fn.Call0x1() @@ -128,6 +134,12 @@ func (n *invoker) initCall() { return n.ret1(pn, ws, ts, r0) } + case reflectx.Func8x1: + n.call = func(pn typex.PaneInfo, ws []typex.Window, ts typex.EventTime) (*FullValue, error) { + r0 := fn.Call8x1(n.args[0], n.args[1], n.args[2], n.args[3], n.args[4], n.args[5], n.args[6], n.args[7]) + return n.ret1(pn, ws, ts, r0) + } + case reflectx.Func0x2: n.call = func(pn typex.PaneInfo, ws []typex.Window, ts typex.EventTime) (*FullValue, error) { r0, r1 := fn.Call0x2() @@ -176,6 +188,12 @@ func (n *invoker) initCall() { return n.ret2(pn, ws, ts, r0, r1) } + case reflectx.Func8x2: + n.call = func(pn typex.PaneInfo, ws []typex.Window, ts typex.EventTime) (*FullValue, error) { + r0, r1 := fn.Call8x2(n.args[0], n.args[1], n.args[2], n.args[3], n.args[4], n.args[5], n.args[6], n.args[7]) + return n.ret2(pn, ws, ts, r0, r1) + } + case reflectx.Func0x3: n.call = func(pn typex.PaneInfo, ws []typex.Window, ts typex.EventTime) (*FullValue, error) { r0, r1, r2 := fn.Call0x3() @@ -224,6 +242,12 @@ func (n *invoker) initCall() { return n.ret3(pn, ws, ts, r0, r1, r2) } + case reflectx.Func8x3: + n.call = func(pn typex.PaneInfo, ws []typex.Window, ts typex.EventTime) (*FullValue, error) { + r0, r1, r2 := fn.Call8x3(n.args[0], n.args[1], n.args[2], n.args[3], n.args[4], n.args[5], n.args[6], n.args[7]) + return n.ret3(pn, ws, ts, r0, r1, r2) + } + default: n.call = func(pn typex.PaneInfo, ws []typex.Window, ts typex.EventTime) (*FullValue, error) { ret := n.fn.Fn.Call(n.args) diff --git a/sdks/go/pkg/beam/core/runtime/exec/fn_arity.tmpl b/sdks/go/pkg/beam/core/runtime/exec/fn_arity.tmpl index 29bee7feaa5d..e9da23630f72 100644 --- a/sdks/go/pkg/beam/core/runtime/exec/fn_arity.tmpl +++ b/sdks/go/pkg/beam/core/runtime/exec/fn_arity.tmpl @@ -30,7 +30,7 @@ import ( func (n *invoker) initCall() { switch fn := n.fn.Fn.(type) { {{range $out := upto 4}} -{{range $in := upto 8}} +{{range $in := upto 9}} case reflectx.Func{{$in}}x{{$out}}: n.call = func(pn typex.PaneInfo, ws []typex.Window, ts typex.EventTime) (*FullValue, error) { {{if $out}}{{mktuplef $out "r%v"}} := {{end}}fn.Call{{$in}}x{{$out}}({{mktuplef $in "n.args[%v]"}}) diff --git a/sdks/go/pkg/beam/core/runtime/graphx/serialize.go b/sdks/go/pkg/beam/core/runtime/graphx/serialize.go index 417a759b71a4..75ee58484fd1 100644 --- a/sdks/go/pkg/beam/core/runtime/graphx/serialize.go +++ b/sdks/go/pkg/beam/core/runtime/graphx/serialize.go @@ -515,6 +515,8 @@ func tryEncodeSpecial(t reflect.Type) (v1pb.Type_Special, bool) { return v1pb.Type_EVENTTIME, true case typex.WindowType: return v1pb.Type_WINDOW, true + case typex.BundleFinalizationType: + return v1pb.Type_BUNDLEFINALIZATION, true case typex.KVType: return v1pb.Type_KV, true case typex.CoGBKType: @@ -677,6 +679,8 @@ func decodeSpecial(s v1pb.Type_Special) (reflect.Type, error) { return typex.EventTimeType, nil case v1pb.Type_WINDOW: return typex.WindowType, nil + case v1pb.Type_BUNDLEFINALIZATION: + return typex.BundleFinalizationType, nil case v1pb.Type_KV: return typex.KVType, nil case v1pb.Type_COGBK: diff --git a/sdks/go/pkg/beam/core/runtime/graphx/translate.go b/sdks/go/pkg/beam/core/runtime/graphx/translate.go index 76ce93592d10..b1c3977490e4 100644 --- a/sdks/go/pkg/beam/core/runtime/graphx/translate.go +++ b/sdks/go/pkg/beam/core/runtime/graphx/translate.go @@ -66,6 +66,7 @@ const ( URNMultiCore = "beam:protocol:multi_core_bundle_processing:v1" URNRequiresSplittableDoFn = "beam:requirement:pardo:splittable_dofn:v1" + URNRequiresBundleFinalization = "beam:requirement:pardo:finalization:v1" // Deprecated: Determine worker binary based on GoWorkerBinary Role instead. URNArtifactGoWorker = "beam:artifact:type:go_worker_binary:v1" @@ -445,6 +446,9 @@ func (m *marshaller) addMultiEdge(edge NamedEdge) ([]string, error) { payload.RestrictionCoderId = coderId m.requirements[URNRequiresSplittableDoFn] = true } + if _, ok := edge.Edge.DoFn.ProcessElementFn().BundleFinalization(); ok { + m.requirements[URNRequiresBundleFinalization] = true + } spec = &pipepb.FunctionSpec{Urn: URNParDo, Payload: protox.MustEncode(payload)} annotations = edge.Edge.DoFn.Annotations() diff --git a/sdks/go/pkg/beam/core/runtime/graphx/v1/v1.pb.go b/sdks/go/pkg/beam/core/runtime/graphx/v1/v1.pb.go index 8b23ff469907..67c95694da9a 100644 --- a/sdks/go/pkg/beam/core/runtime/graphx/v1/v1.pb.go +++ b/sdks/go/pkg/beam/core/runtime/graphx/v1/v1.pb.go @@ -212,18 +212,19 @@ const ( Type_CONTEXT Type_Special = 2 Type_TYPE Type_Special = 3 // Beam - Type_EVENTTIME Type_Special = 10 - Type_WINDOW Type_Special = 22 - Type_KV Type_Special = 11 - Type_COGBK Type_Special = 13 - Type_WINDOWEDVALUE Type_Special = 14 - Type_T Type_Special = 15 - Type_U Type_Special = 16 - Type_V Type_Special = 17 - Type_W Type_Special = 18 - Type_X Type_Special = 19 - Type_Y Type_Special = 20 - Type_Z Type_Special = 21 + Type_EVENTTIME Type_Special = 10 + Type_WINDOW Type_Special = 22 + Type_KV Type_Special = 11 + Type_COGBK Type_Special = 13 + Type_WINDOWEDVALUE Type_Special = 14 + Type_BUNDLEFINALIZATION Type_Special = 23 + Type_T Type_Special = 15 + Type_U Type_Special = 16 + Type_V Type_Special = 17 + Type_W Type_Special = 18 + Type_X Type_Special = 19 + Type_Y Type_Special = 20 + Type_Z Type_Special = 21 ) // Enum value maps for Type_Special. diff --git a/sdks/go/pkg/beam/core/typex/class.go b/sdks/go/pkg/beam/core/typex/class.go index 486532aa4a6d..028e8a2db910 100644 --- a/sdks/go/pkg/beam/core/typex/class.go +++ b/sdks/go/pkg/beam/core/typex/class.go @@ -120,6 +120,7 @@ func isConcrete(t reflect.Type, visited map[uintptr]bool) error { t == EventTimeType || t.Implements(WindowType) || t == PaneInfoType || + t == BundleFinalizationType || t == reflectx.Error || t == reflectx.Context || IsUniversal(t) { diff --git a/sdks/go/pkg/beam/core/typex/special.go b/sdks/go/pkg/beam/core/typex/special.go index dd4199c5628e..d13aab562a9a 100644 --- a/sdks/go/pkg/beam/core/typex/special.go +++ b/sdks/go/pkg/beam/core/typex/special.go @@ -17,6 +17,7 @@ package typex import ( "reflect" + "time" "github.com/apache/beam/sdks/v2/go/pkg/beam/core/graph/mtime" ) @@ -37,9 +38,10 @@ var ( WindowType = reflect.TypeOf((*Window)(nil)).Elem() PaneInfoType = reflect.TypeOf((*PaneInfo)(nil)).Elem() - KVType = reflect.TypeOf((*KV)(nil)).Elem() - CoGBKType = reflect.TypeOf((*CoGBK)(nil)).Elem() - WindowedValueType = reflect.TypeOf((*WindowedValue)(nil)).Elem() + KVType = reflect.TypeOf((*KV)(nil)).Elem() + CoGBKType = reflect.TypeOf((*CoGBK)(nil)).Elem() + WindowedValueType = reflect.TypeOf((*WindowedValue)(nil)).Elem() + BundleFinalizationType = reflect.TypeOf((*BundleFinalization)(nil)).Elem() ) // T, U, V, W, X, Y, Z are universal types. They play the role of generic @@ -65,6 +67,11 @@ type Window interface { Equals(o Window) bool } +// BundleFinalization allows registering callbacks to be performed after the runner durably persists bundle results. +type BundleFinalization interface { + RegisterCallback(time.Duration, func() error) +} + type PaneTiming byte const ( diff --git a/sdks/go/pkg/beam/core/util/reflectx/calls.go b/sdks/go/pkg/beam/core/util/reflectx/calls.go index 3297a49b57c9..d781ea6d7db9 100644 --- a/sdks/go/pkg/beam/core/util/reflectx/calls.go +++ b/sdks/go/pkg/beam/core/util/reflectx/calls.go @@ -1342,3 +1342,167 @@ func ToFunc7x3(c Func) Func7x3 { func MakeFunc7x3(fn interface{}) Func7x3 { return ToFunc7x3(MakeFunc(fn)) } + +type Func8x0 interface { + Func + Call8x0(interface{}, interface{}, interface{}, interface{}, interface{}, interface{}, interface{}, interface{}) +} + +type shimFunc8x0 struct { + inner Func +} + +func (c *shimFunc8x0) Name() string { + return c.inner.Name() +} + +func (c *shimFunc8x0) Type() reflect.Type { + return c.inner.Type() +} + +func (c *shimFunc8x0) Call(args []interface{}) []interface{} { + return c.inner.Call(args) +} + +func (c *shimFunc8x0) Call8x0(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 interface{}) { + ret := c.inner.Call([]interface{}{arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7}) + _ = ret + return +} + +func ToFunc8x0(c Func) Func8x0 { + if c.Type().NumIn() != 8 || c.Type().NumOut() != 0 { + panic(fmt.Sprintf("Incompatible func type: got func %v with %v inputs and %v outputs, want 8 inputs and 0 outputs", c.Type(), c.Type().NumIn(), c.Type().NumOut())) + } + if sc, ok := c.(Func8x0); ok { + return sc + } + return &shimFunc8x0{inner: c} +} + +func MakeFunc8x0(fn interface{}) Func8x0 { + return ToFunc8x0(MakeFunc(fn)) +} + +type Func8x1 interface { + Func + Call8x1(interface{}, interface{}, interface{}, interface{}, interface{}, interface{}, interface{}, interface{}) interface{} +} + +type shimFunc8x1 struct { + inner Func +} + +func (c *shimFunc8x1) Name() string { + return c.inner.Name() +} + +func (c *shimFunc8x1) Type() reflect.Type { + return c.inner.Type() +} + +func (c *shimFunc8x1) Call(args []interface{}) []interface{} { + return c.inner.Call(args) +} + +func (c *shimFunc8x1) Call8x1(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 interface{}) interface{} { + ret := c.inner.Call([]interface{}{arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7}) + _ = ret + return ret[0] +} + +func ToFunc8x1(c Func) Func8x1 { + if c.Type().NumIn() != 8 || c.Type().NumOut() != 1 { + panic(fmt.Sprintf("Incompatible func type: got func %v with %v inputs and %v outputs, want 8 inputs and 1 outputs", c.Type(), c.Type().NumIn(), c.Type().NumOut())) + } + if sc, ok := c.(Func8x1); ok { + return sc + } + return &shimFunc8x1{inner: c} +} + +func MakeFunc8x1(fn interface{}) Func8x1 { + return ToFunc8x1(MakeFunc(fn)) +} + +type Func8x2 interface { + Func + Call8x2(interface{}, interface{}, interface{}, interface{}, interface{}, interface{}, interface{}, interface{}) (interface{}, interface{}) +} + +type shimFunc8x2 struct { + inner Func +} + +func (c *shimFunc8x2) Name() string { + return c.inner.Name() +} + +func (c *shimFunc8x2) Type() reflect.Type { + return c.inner.Type() +} + +func (c *shimFunc8x2) Call(args []interface{}) []interface{} { + return c.inner.Call(args) +} + +func (c *shimFunc8x2) Call8x2(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 interface{}) (interface{}, interface{}) { + ret := c.inner.Call([]interface{}{arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7}) + _ = ret + return ret[0], ret[1] +} + +func ToFunc8x2(c Func) Func8x2 { + if c.Type().NumIn() != 8 || c.Type().NumOut() != 2 { + panic(fmt.Sprintf("Incompatible func type: got func %v with %v inputs and %v outputs, want 8 inputs and 2 outputs", c.Type(), c.Type().NumIn(), c.Type().NumOut())) + } + if sc, ok := c.(Func8x2); ok { + return sc + } + return &shimFunc8x2{inner: c} +} + +func MakeFunc8x2(fn interface{}) Func8x2 { + return ToFunc8x2(MakeFunc(fn)) +} + +type Func8x3 interface { + Func + Call8x3(interface{}, interface{}, interface{}, interface{}, interface{}, interface{}, interface{}, interface{}) (interface{}, interface{}, interface{}) +} + +type shimFunc8x3 struct { + inner Func +} + +func (c *shimFunc8x3) Name() string { + return c.inner.Name() +} + +func (c *shimFunc8x3) Type() reflect.Type { + return c.inner.Type() +} + +func (c *shimFunc8x3) Call(args []interface{}) []interface{} { + return c.inner.Call(args) +} + +func (c *shimFunc8x3) Call8x3(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 interface{}) (interface{}, interface{}, interface{}) { + ret := c.inner.Call([]interface{}{arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7}) + _ = ret + return ret[0], ret[1], ret[2] +} + +func ToFunc8x3(c Func) Func8x3 { + if c.Type().NumIn() != 8 || c.Type().NumOut() != 3 { + panic(fmt.Sprintf("Incompatible func type: got func %v with %v inputs and %v outputs, want 8 inputs and 3 outputs", c.Type(), c.Type().NumIn(), c.Type().NumOut())) + } + if sc, ok := c.(Func8x3); ok { + return sc + } + return &shimFunc8x3{inner: c} +} + +func MakeFunc8x3(fn interface{}) Func8x3 { + return ToFunc8x3(MakeFunc(fn)) +} diff --git a/sdks/go/pkg/beam/core/util/reflectx/calls.tmpl b/sdks/go/pkg/beam/core/util/reflectx/calls.tmpl index 75b80e27305d..260086b8bdb5 100644 --- a/sdks/go/pkg/beam/core/util/reflectx/calls.tmpl +++ b/sdks/go/pkg/beam/core/util/reflectx/calls.tmpl @@ -29,7 +29,7 @@ import ( // also allows more specific intermediate interfaces, such as Func2xbool, to be added // later. -{{range $in := upto 8}} +{{range $in := upto 9}} {{range $out := upto 4}} type Func{{$in}}x{{$out}} interface { Func diff --git a/sdks/go/pkg/beam/forward.go b/sdks/go/pkg/beam/forward.go index d368279f9cc1..2cb4e6234fcf 100644 --- a/sdks/go/pkg/beam/forward.go +++ b/sdks/go/pkg/beam/forward.go @@ -202,6 +202,10 @@ type EventTime = typex.EventTime // be a part of multiple windows, based on the element's event time. type Window = typex.Window +// BundleFinalization represents the parameter used to register callbacks to +// be run once the runner has durably persisted output for a bundle. +type BundleFinalization = typex.BundleFinalization + // These are the reflect.Type instances of the universal types, which are used // when binding actual types to "generic" DoFns that use Universal Types. var ( From 65d54907f15e26f1df59de7f91af5333c00866ac Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Tue, 8 Mar 2022 15:09:45 -0500 Subject: [PATCH 2/7] Unit tests --- sdks/go/pkg/beam/core/funcx/fn.go | 3 +- sdks/go/pkg/beam/core/funcx/fn_test.go | 59 +++++++++++++++++++++++ sdks/go/pkg/beam/core/typex/class_test.go | 2 + 3 files changed, 63 insertions(+), 1 deletion(-) diff --git a/sdks/go/pkg/beam/core/funcx/fn.go b/sdks/go/pkg/beam/core/funcx/fn.go index 1d04d02667d1..74b3df15bd0a 100644 --- a/sdks/go/pkg/beam/core/funcx/fn.go +++ b/sdks/go/pkg/beam/core/funcx/fn.go @@ -271,7 +271,8 @@ func (u *Fn) RTracker() (pos int, exists bool) { return -1, false } -// RTracker returns (index, true) iff the function expects an sdf.RTracker. +// BundleFinalization returns (index, true) iff the function expects a +// parameter that implements typex.BundleFinalization. func (u *Fn) BundleFinalization() (pos int, exists bool) { for i, p := range u.Param { if p.Kind == FnBundleFinalization { diff --git a/sdks/go/pkg/beam/core/funcx/fn_test.go b/sdks/go/pkg/beam/core/funcx/fn_test.go index 78fd3a182496..39580f24ff54 100644 --- a/sdks/go/pkg/beam/core/funcx/fn_test.go +++ b/sdks/go/pkg/beam/core/funcx/fn_test.go @@ -95,6 +95,11 @@ func TestNew(t *testing.T) { Fn: func(typex.PaneInfo, typex.Window, typex.EventTime, reflect.Type, []byte) {}, Param: []FnParamKind{FnPane, FnWindow, FnEventTime, FnType, FnValue}, }, + { + Name: "good8", + Fn: func(typex.PaneInfo, typex.Window, typex.EventTime, reflect.Type, typex.BundleFinalization, []byte) {}, + Param: []FnParamKind{FnPane, FnWindow, FnEventTime, FnType, FnBundleFinalization, FnValue}, + }, { Name: "good-method", Fn: foo{1}.Do, @@ -172,6 +177,11 @@ func TestNew(t *testing.T) { }, Err: errReflectTypePrecedence, }, + { + Name: "errReflectTypePrecedence: after bundle finalizer", + Fn: func(typex.PaneInfo, typex.Window, typex.EventTime, typex.BundleFinalization, reflect.Type, []byte) {}, + Err: errReflectTypePrecedence, + }, { Name: "errInputPrecedence- Iter before after output", Fn: func(int, func(int), func(*int) bool, func(*int, *string) bool) {}, @@ -201,6 +211,11 @@ func TestNew(t *testing.T) { }, Err: errErrorPrecedence, }, + { + Name: "errBundleFinalizationPrecedence", + Fn: func(typex.PaneInfo, typex.Window, typex.EventTime, reflect.Type, []byte, typex.BundleFinalization) {}, + Err: errBundleFinalizationPrecedence, + }, { Name: "errEventTimeRetPrecedence", Fn: func() (string, typex.EventTime) { @@ -437,6 +452,50 @@ func TestWindow(t *testing.T) { } } +func TestBundleFinalization(t *testing.T) { + tests := []struct { + Name string + Params []FnParamKind + Pos int + Exists bool + }{ + { + Name: "bundleFinalization input", + Params: []FnParamKind{FnContext, FnBundleFinalization}, + Pos: 1, + Exists: true, + }, + { + Name: "no bundleFinalization input", + Params: []FnParamKind{FnContext, FnEventTime}, + Pos: -1, + Exists: false, + }, + } + + for _, test := range tests { + test := test + t.Run(test.Name, func(t *testing.T) { + // Create a Fn with a filled params list. + params := make([]FnParam, len(test.Params)) + for i, kind := range test.Params { + params[i].Kind = kind + params[i].T = nil + } + fn := &Fn{Param: params} + + // Validate we get expected results for pane function. + pos, exists := fn.BundleFinalization() + if exists != test.Exists { + t.Errorf("BundleFinalization(%v) - exists: got %v, want %v", params, exists, test.Exists) + } + if pos != test.Pos { + t.Errorf("BundleFinalization(%v) - pos: got %v, want %v", params, pos, test.Pos) + } + }) + } +} + func TestInputs(t *testing.T) { tests := []struct { Name string diff --git a/sdks/go/pkg/beam/core/typex/class_test.go b/sdks/go/pkg/beam/core/typex/class_test.go index 4521554f644c..44b1c7f103fc 100644 --- a/sdks/go/pkg/beam/core/typex/class_test.go +++ b/sdks/go/pkg/beam/core/typex/class_test.go @@ -92,6 +92,7 @@ func TestClassOf(t *testing.T) { {EventTimeType, Invalid}, // special {WindowType, Invalid}, // special + {BundleFinalizationType, Invalid}, // special {reflectx.Context, Invalid}, // special {reflectx.Error, Invalid}, // special {reflect.TypeOf((*ConcreteTestWindow)(nil)).Elem(), Invalid}, // special @@ -160,6 +161,7 @@ func TestIsConcrete(t *testing.T) { {reflect.TypeOf([][][]uint16{}), true}, {reflect.TypeOf([]Y{}), false}, {reflect.TypeOf([][][]Z{}), false}, + {BundleFinalizationType, false}, } for _, test := range tests { From 5cfff1ac54b7446b0627f58a1e9cd5f9472d64c2 Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Tue, 8 Mar 2022 15:51:31 -0500 Subject: [PATCH 3/7] go fmt --- sdks/go/pkg/beam/core/funcx/fn.go | 14 +++++------ sdks/go/pkg/beam/core/funcx/fn_test.go | 8 +++---- .../pkg/beam/core/runtime/graphx/translate.go | 2 +- .../pkg/beam/core/runtime/graphx/v1/v1.pb.go | 24 +++++++++---------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/sdks/go/pkg/beam/core/funcx/fn.go b/sdks/go/pkg/beam/core/funcx/fn.go index 74b3df15bd0a..f9315bd9c7b4 100644 --- a/sdks/go/pkg/beam/core/funcx/fn.go +++ b/sdks/go/pkg/beam/core/funcx/fn.go @@ -456,14 +456,14 @@ func validateOrder(u *Fn) error { } var ( - errContextParam = errors.New("may only have a single context.Context parameter and it must be the first parameter") - errPaneParamPrecedence = errors.New("may only have a single PaneInfo parameter and it must precede the WindowParam, EventTime and main input parameter") - errWindowParamPrecedence = errors.New("may only have a single Window parameter and it must precede the EventTime and main input parameter") - errEventTimeParamPrecedence = errors.New("may only have a single beam.EventTime parameter and it must precede the main input parameter") - errReflectTypePrecedence = errors.New("may only have a single reflect.Type parameter and it must precede the main input parameter") - errRTrackerPrecedence = errors.New("may only have a single sdf.RTracker parameter and it must precede the main input parameter") + errContextParam = errors.New("may only have a single context.Context parameter and it must be the first parameter") + errPaneParamPrecedence = errors.New("may only have a single PaneInfo parameter and it must precede the WindowParam, EventTime and main input parameter") + errWindowParamPrecedence = errors.New("may only have a single Window parameter and it must precede the EventTime and main input parameter") + errEventTimeParamPrecedence = errors.New("may only have a single beam.EventTime parameter and it must precede the main input parameter") + errReflectTypePrecedence = errors.New("may only have a single reflect.Type parameter and it must precede the main input parameter") + errRTrackerPrecedence = errors.New("may only have a single sdf.RTracker parameter and it must precede the main input parameter") errBundleFinalizationPrecedence = errors.New("may only have a single BundleFinalization parameter and it must precede the main input parameter") - errInputPrecedence = errors.New("inputs parameters must precede emit function parameters") + errInputPrecedence = errors.New("inputs parameters must precede emit function parameters") ) type paramState int diff --git a/sdks/go/pkg/beam/core/funcx/fn_test.go b/sdks/go/pkg/beam/core/funcx/fn_test.go index 39580f24ff54..6616796af8e6 100644 --- a/sdks/go/pkg/beam/core/funcx/fn_test.go +++ b/sdks/go/pkg/beam/core/funcx/fn_test.go @@ -179,8 +179,8 @@ func TestNew(t *testing.T) { }, { Name: "errReflectTypePrecedence: after bundle finalizer", - Fn: func(typex.PaneInfo, typex.Window, typex.EventTime, typex.BundleFinalization, reflect.Type, []byte) {}, - Err: errReflectTypePrecedence, + Fn: func(typex.PaneInfo, typex.Window, typex.EventTime, typex.BundleFinalization, reflect.Type, []byte) {}, + Err: errReflectTypePrecedence, }, { Name: "errInputPrecedence- Iter before after output", @@ -213,8 +213,8 @@ func TestNew(t *testing.T) { }, { Name: "errBundleFinalizationPrecedence", - Fn: func(typex.PaneInfo, typex.Window, typex.EventTime, reflect.Type, []byte, typex.BundleFinalization) {}, - Err: errBundleFinalizationPrecedence, + Fn: func(typex.PaneInfo, typex.Window, typex.EventTime, reflect.Type, []byte, typex.BundleFinalization) {}, + Err: errBundleFinalizationPrecedence, }, { Name: "errEventTimeRetPrecedence", diff --git a/sdks/go/pkg/beam/core/runtime/graphx/translate.go b/sdks/go/pkg/beam/core/runtime/graphx/translate.go index b1c3977490e4..b95b94d71a25 100644 --- a/sdks/go/pkg/beam/core/runtime/graphx/translate.go +++ b/sdks/go/pkg/beam/core/runtime/graphx/translate.go @@ -65,7 +65,7 @@ const ( URNLegacyProgressReporting = "beam:protocol:progress_reporting:v0" URNMultiCore = "beam:protocol:multi_core_bundle_processing:v1" - URNRequiresSplittableDoFn = "beam:requirement:pardo:splittable_dofn:v1" + URNRequiresSplittableDoFn = "beam:requirement:pardo:splittable_dofn:v1" URNRequiresBundleFinalization = "beam:requirement:pardo:finalization:v1" // Deprecated: Determine worker binary based on GoWorkerBinary Role instead. diff --git a/sdks/go/pkg/beam/core/runtime/graphx/v1/v1.pb.go b/sdks/go/pkg/beam/core/runtime/graphx/v1/v1.pb.go index 67c95694da9a..97219630aaf4 100644 --- a/sdks/go/pkg/beam/core/runtime/graphx/v1/v1.pb.go +++ b/sdks/go/pkg/beam/core/runtime/graphx/v1/v1.pb.go @@ -212,19 +212,19 @@ const ( Type_CONTEXT Type_Special = 2 Type_TYPE Type_Special = 3 // Beam - Type_EVENTTIME Type_Special = 10 - Type_WINDOW Type_Special = 22 - Type_KV Type_Special = 11 - Type_COGBK Type_Special = 13 - Type_WINDOWEDVALUE Type_Special = 14 + Type_EVENTTIME Type_Special = 10 + Type_WINDOW Type_Special = 22 + Type_KV Type_Special = 11 + Type_COGBK Type_Special = 13 + Type_WINDOWEDVALUE Type_Special = 14 Type_BUNDLEFINALIZATION Type_Special = 23 - Type_T Type_Special = 15 - Type_U Type_Special = 16 - Type_V Type_Special = 17 - Type_W Type_Special = 18 - Type_X Type_Special = 19 - Type_Y Type_Special = 20 - Type_Z Type_Special = 21 + Type_T Type_Special = 15 + Type_U Type_Special = 16 + Type_V Type_Special = 17 + Type_W Type_Special = 18 + Type_X Type_Special = 19 + Type_Y Type_Special = 20 + Type_Z Type_Special = 21 ) // Enum value maps for Type_Special. From d9c15db7c715fcde57a095dadb7b58f484bb044f Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Mon, 21 Mar 2022 13:19:31 -0400 Subject: [PATCH 4/7] Generate proto --- .../pkg/beam/core/runtime/graphx/v1/v1.pb.go | 314 +++++++++--------- .../pkg/beam/core/runtime/graphx/v1/v1.proto | 2 + 2 files changed, 161 insertions(+), 155 deletions(-) diff --git a/sdks/go/pkg/beam/core/runtime/graphx/v1/v1.pb.go b/sdks/go/pkg/beam/core/runtime/graphx/v1/v1.pb.go index 97219630aaf4..22fceace16de 100644 --- a/sdks/go/pkg/beam/core/runtime/graphx/v1/v1.pb.go +++ b/sdks/go/pkg/beam/core/runtime/graphx/v1/v1.pb.go @@ -23,8 +23,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.13.0 +// protoc-gen-go v1.27.1 +// protoc v3.14.0 // source: v1.proto package v1 @@ -239,6 +239,7 @@ var ( 11: "KV", 13: "COGBK", 14: "WINDOWEDVALUE", + 23: "BUNDLEFINALIZATION", 15: "T", 16: "U", 17: "V", @@ -248,22 +249,23 @@ var ( 21: "Z", } Type_Special_value = map[string]int32{ - "ILLEGAL": 0, - "ERROR": 1, - "CONTEXT": 2, - "TYPE": 3, - "EVENTTIME": 10, - "WINDOW": 22, - "KV": 11, - "COGBK": 13, - "WINDOWEDVALUE": 14, - "T": 15, - "U": 16, - "V": 17, - "W": 18, - "X": 19, - "Y": 20, - "Z": 21, + "ILLEGAL": 0, + "ERROR": 1, + "CONTEXT": 2, + "TYPE": 3, + "EVENTTIME": 10, + "WINDOW": 22, + "KV": 11, + "COGBK": 13, + "WINDOWEDVALUE": 14, + "BUNDLEFINALIZATION": 23, + "T": 15, + "U": 16, + "V": 17, + "W": 18, + "X": 19, + "Y": 20, + "Z": 21, } ) @@ -1302,7 +1304,7 @@ var file_v1_proto_rawDesc = []byte{ 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x73, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x78, - 0x2e, 0x76, 0x31, 0x22, 0xb3, 0x0b, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x56, 0x0a, 0x04, + 0x2e, 0x76, 0x31, 0x22, 0xcb, 0x0b, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x56, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x42, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x73, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x63, 0x6f, @@ -1382,7 +1384,7 @@ var file_v1_proto_rawDesc = []byte{ 0x49, 0x41, 0x4c, 0x10, 0x19, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x58, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x10, 0x1a, 0x22, 0x27, 0x0a, 0x07, 0x43, 0x68, 0x61, 0x6e, 0x44, 0x69, 0x72, 0x12, 0x08, 0x0a, 0x04, 0x52, 0x45, 0x43, 0x56, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x45, 0x4e, 0x44, - 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x4f, 0x54, 0x48, 0x10, 0x02, 0x22, 0xaa, 0x01, 0x0a, + 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x4f, 0x54, 0x48, 0x10, 0x02, 0x22, 0xc2, 0x01, 0x0a, 0x07, 0x53, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4c, 0x4c, 0x45, 0x47, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x4f, 0x4e, 0x54, 0x45, 0x58, 0x54, 0x10, 0x02, 0x12, 0x08, 0x0a, @@ -1390,153 +1392,155 @@ var file_v1_proto_rawDesc = []byte{ 0x54, 0x49, 0x4d, 0x45, 0x10, 0x0a, 0x12, 0x0a, 0x0a, 0x06, 0x57, 0x49, 0x4e, 0x44, 0x4f, 0x57, 0x10, 0x16, 0x12, 0x06, 0x0a, 0x02, 0x4b, 0x56, 0x10, 0x0b, 0x12, 0x09, 0x0a, 0x05, 0x43, 0x4f, 0x47, 0x42, 0x4b, 0x10, 0x0d, 0x12, 0x11, 0x0a, 0x0d, 0x57, 0x49, 0x4e, 0x44, 0x4f, 0x57, 0x45, - 0x44, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x10, 0x0e, 0x12, 0x05, 0x0a, 0x01, 0x54, 0x10, 0x0f, 0x12, - 0x05, 0x0a, 0x01, 0x55, 0x10, 0x10, 0x12, 0x05, 0x0a, 0x01, 0x56, 0x10, 0x11, 0x12, 0x05, 0x0a, - 0x01, 0x57, 0x10, 0x12, 0x12, 0x05, 0x0a, 0x01, 0x58, 0x10, 0x13, 0x12, 0x05, 0x0a, 0x01, 0x59, - 0x10, 0x14, 0x12, 0x05, 0x0a, 0x01, 0x5a, 0x10, 0x15, 0x22, 0xc0, 0x01, 0x0a, 0x08, 0x46, 0x75, - 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x51, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, - 0x65, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x73, 0x2e, 0x67, 0x6f, 0x2e, 0x70, - 0x6b, 0x67, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x72, 0x75, 0x6e, - 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x54, - 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x61, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, - 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, - 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, - 0x73, 0x64, 0x6b, 0x73, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x65, 0x61, 0x6d, - 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x67, 0x72, - 0x61, 0x70, 0x68, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x75, 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, - 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x6f, 0x0a, 0x06, - 0x55, 0x73, 0x65, 0x72, 0x46, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x51, 0x0a, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, - 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x73, 0x2e, - 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x78, 0x2e, - 0x76, 0x31, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x94, 0x01, - 0x0a, 0x05, 0x44, 0x79, 0x6e, 0x46, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x51, 0x0a, 0x04, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x6f, 0x72, 0x67, 0x2e, - 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x73, - 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x78, - 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, - 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x67, 0x65, 0x6e, 0x22, 0x90, 0x02, 0x0a, 0x02, 0x46, 0x6e, 0x12, 0x4f, 0x0a, 0x02, 0x66, - 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, - 0x61, 0x63, 0x68, 0x65, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x73, 0x2e, 0x67, - 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, - 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x78, 0x2e, 0x76, - 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x46, 0x6e, 0x52, 0x02, 0x66, 0x6e, 0x12, 0x51, 0x0a, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x6f, 0x72, 0x67, - 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x73, 0x64, 0x6b, - 0x73, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, - 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, - 0x10, 0x0a, 0x03, 0x6f, 0x70, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6f, 0x70, - 0x74, 0x12, 0x54, 0x0a, 0x05, 0x64, 0x79, 0x6e, 0x66, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x3e, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x62, 0x65, + 0x44, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x10, 0x0e, 0x12, 0x16, 0x0a, 0x12, 0x42, 0x55, 0x4e, 0x44, + 0x4c, 0x45, 0x46, 0x49, 0x4e, 0x41, 0x4c, 0x49, 0x5a, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x17, + 0x12, 0x05, 0x0a, 0x01, 0x54, 0x10, 0x0f, 0x12, 0x05, 0x0a, 0x01, 0x55, 0x10, 0x10, 0x12, 0x05, + 0x0a, 0x01, 0x56, 0x10, 0x11, 0x12, 0x05, 0x0a, 0x01, 0x57, 0x10, 0x12, 0x12, 0x05, 0x0a, 0x01, + 0x58, 0x10, 0x13, 0x12, 0x05, 0x0a, 0x01, 0x59, 0x10, 0x14, 0x12, 0x05, 0x0a, 0x01, 0x5a, 0x10, + 0x15, 0x22, 0xc0, 0x01, 0x0a, 0x08, 0x46, 0x75, 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x51, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x6f, + 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x73, + 0x64, 0x6b, 0x73, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x67, 0x72, 0x61, + 0x70, 0x68, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x12, 0x61, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, + 0x68, 0x65, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x73, 0x2e, 0x67, 0x6f, 0x2e, + 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x72, 0x75, + 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x78, 0x2e, 0x76, 0x31, 0x2e, + 0x46, 0x75, 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, + 0x65, 0x6e, 0x74, 0x73, 0x22, 0x6f, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x46, 0x6e, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x51, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x3d, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x73, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, - 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x79, 0x6e, 0x46, 0x6e, - 0x52, 0x05, 0x64, 0x79, 0x6e, 0x66, 0x6e, 0x22, 0x6b, 0x0a, 0x08, 0x57, 0x69, 0x6e, 0x64, 0x6f, - 0x77, 0x46, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x69, 0x7a, 0x65, 0x5f, - 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x69, 0x7a, 0x65, 0x4d, 0x73, - 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x5f, 0x6d, 0x73, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x4d, 0x73, 0x12, 0x15, 0x0a, - 0x06, 0x67, 0x61, 0x70, 0x5f, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x67, - 0x61, 0x70, 0x4d, 0x73, 0x22, 0x9a, 0x02, 0x0a, 0x0b, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, - 0x6f, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x51, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, - 0x63, 0x68, 0x65, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x73, 0x2e, 0x67, 0x6f, - 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x72, - 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x78, 0x2e, 0x76, 0x31, - 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x51, 0x0a, 0x03, 0x65, - 0x6e, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, + 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x94, 0x01, 0x0a, 0x05, 0x44, 0x79, 0x6e, 0x46, 0x6e, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x51, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x3d, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x62, + 0x65, 0x61, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x73, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, + 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, + 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x79, 0x70, 0x65, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x65, + 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x67, 0x65, 0x6e, 0x22, 0x90, 0x02, 0x0a, + 0x02, 0x46, 0x6e, 0x12, 0x4f, 0x0a, 0x02, 0x66, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x3f, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x62, 0x65, 0x61, + 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x73, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x65, + 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, + 0x67, 0x72, 0x61, 0x70, 0x68, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x46, 0x6e, + 0x52, 0x02, 0x66, 0x6e, 0x12, 0x51, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, + 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x73, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, + 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, + 0x6d, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x79, 0x70, + 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x70, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6f, 0x70, 0x74, 0x12, 0x54, 0x0a, 0x05, 0x64, 0x79, 0x6e, + 0x66, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x73, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x78, 0x2e, - 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x46, 0x6e, 0x52, 0x03, 0x65, 0x6e, 0x63, 0x12, 0x51, - 0x0a, 0x03, 0x64, 0x65, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x6f, 0x72, - 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x73, 0x64, - 0x6b, 0x73, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, - 0x68, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x46, 0x6e, 0x52, 0x03, 0x64, 0x65, - 0x63, 0x22, 0xba, 0x06, 0x0a, 0x09, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x45, 0x64, 0x67, 0x65, 0x12, - 0x4b, 0x0a, 0x02, 0x66, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x6f, 0x72, - 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x73, 0x64, - 0x6b, 0x73, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, - 0x68, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x6e, 0x52, 0x02, 0x66, 0x6e, 0x12, 0x16, 0x0a, 0x06, - 0x6f, 0x70, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x70, - 0x63, 0x6f, 0x64, 0x65, 0x12, 0x5e, 0x0a, 0x09, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x66, - 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, - 0x61, 0x63, 0x68, 0x65, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x73, 0x2e, 0x67, - 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, - 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x78, 0x2e, 0x76, - 0x31, 0x2e, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x46, 0x6e, 0x52, 0x08, 0x77, 0x69, 0x6e, 0x64, - 0x6f, 0x77, 0x46, 0x6e, 0x12, 0x64, 0x0a, 0x07, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4a, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, - 0x68, 0x65, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x73, 0x2e, 0x67, 0x6f, 0x2e, - 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x72, 0x75, - 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x78, 0x2e, 0x76, 0x31, 0x2e, - 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x45, 0x64, 0x67, 0x65, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, - 0x64, 0x52, 0x07, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x67, 0x0a, 0x08, 0x6f, 0x75, - 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4b, 0x2e, 0x6f, - 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x73, - 0x64, 0x6b, 0x73, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x67, 0x72, 0x61, - 0x70, 0x68, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x45, 0x64, 0x67, 0x65, - 0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x08, 0x6f, 0x75, 0x74, 0x62, 0x6f, - 0x75, 0x6e, 0x64, 0x1a, 0xb5, 0x02, 0x0a, 0x07, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, - 0x68, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x54, 0x2e, + 0x76, 0x31, 0x2e, 0x44, 0x79, 0x6e, 0x46, 0x6e, 0x52, 0x05, 0x64, 0x79, 0x6e, 0x66, 0x6e, 0x22, + 0x6b, 0x0a, 0x08, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x46, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6b, + 0x69, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, + 0x17, 0x0a, 0x07, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x06, 0x73, 0x69, 0x7a, 0x65, 0x4d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x65, 0x72, 0x69, + 0x6f, 0x64, 0x5f, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x65, 0x72, + 0x69, 0x6f, 0x64, 0x4d, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x67, 0x61, 0x70, 0x5f, 0x6d, 0x73, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x67, 0x61, 0x70, 0x4d, 0x73, 0x22, 0x9a, 0x02, 0x0a, + 0x0b, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6f, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x51, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3d, + 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x62, 0x65, 0x61, 0x6d, + 0x2e, 0x73, 0x64, 0x6b, 0x73, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x65, 0x61, + 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x67, + 0x72, 0x61, 0x70, 0x68, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x12, 0x51, 0x0a, 0x03, 0x65, 0x6e, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x3f, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x62, 0x65, + 0x61, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x73, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x62, + 0x65, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, + 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x46, + 0x6e, 0x52, 0x03, 0x65, 0x6e, 0x63, 0x12, 0x51, 0x0a, 0x03, 0x64, 0x65, 0x63, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, + 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x73, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, + 0x67, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x74, + 0x69, 0x6d, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, + 0x65, 0x72, 0x46, 0x6e, 0x52, 0x03, 0x64, 0x65, 0x63, 0x22, 0xba, 0x06, 0x0a, 0x09, 0x4d, 0x75, + 0x6c, 0x74, 0x69, 0x45, 0x64, 0x67, 0x65, 0x12, 0x4b, 0x0a, 0x02, 0x66, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, + 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x73, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, + 0x67, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x74, + 0x69, 0x6d, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x6e, + 0x52, 0x02, 0x66, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x70, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x70, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x5e, 0x0a, 0x09, + 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x66, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x41, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x62, 0x65, 0x61, + 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x73, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x65, + 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, + 0x67, 0x72, 0x61, 0x70, 0x68, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, + 0x46, 0x6e, 0x52, 0x08, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x46, 0x6e, 0x12, 0x64, 0x0a, 0x07, + 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4a, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x73, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x45, 0x64, 0x67, - 0x65, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x4b, - 0x69, 0x6e, 0x64, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x55, 0x0a, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, - 0x61, 0x63, 0x68, 0x65, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x73, 0x2e, 0x67, - 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, - 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x78, 0x2e, 0x76, - 0x31, 0x2e, 0x46, 0x75, 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x22, 0x69, 0x0a, 0x09, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x0b, 0x0a, - 0x07, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4d, 0x41, - 0x49, 0x4e, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x49, 0x4e, 0x47, 0x4c, 0x45, 0x54, 0x4f, - 0x4e, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x4c, 0x49, 0x43, 0x45, 0x10, 0x03, 0x12, 0x07, - 0x0a, 0x03, 0x4d, 0x41, 0x50, 0x10, 0x04, 0x12, 0x0c, 0x0a, 0x08, 0x4d, 0x55, 0x4c, 0x54, 0x49, - 0x4d, 0x41, 0x50, 0x10, 0x05, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x54, 0x45, 0x52, 0x10, 0x06, 0x12, - 0x0a, 0x0a, 0x06, 0x52, 0x45, 0x49, 0x54, 0x45, 0x52, 0x10, 0x07, 0x1a, 0x61, 0x0a, 0x08, 0x4f, - 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x55, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, + 0x65, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x07, 0x69, 0x6e, 0x62, 0x6f, 0x75, + 0x6e, 0x64, 0x12, 0x67, 0x0a, 0x08, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4b, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, + 0x65, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x73, 0x2e, 0x67, 0x6f, 0x2e, 0x70, + 0x6b, 0x67, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x72, 0x75, 0x6e, + 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x75, 0x6c, 0x74, 0x69, 0x45, 0x64, 0x67, 0x65, 0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, + 0x64, 0x52, 0x08, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x1a, 0xb5, 0x02, 0x0a, 0x07, + 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x68, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x54, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x73, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x78, 0x2e, 0x76, 0x31, 0x2e, - 0x46, 0x75, 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x1d, - 0x0a, 0x0d, 0x49, 0x6e, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, - 0x0c, 0x0a, 0x01, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x01, 0x6e, 0x22, 0xdc, 0x01, - 0x0a, 0x10, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x50, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x75, 0x72, 0x6e, 0x12, 0x56, 0x0a, 0x04, 0x65, 0x64, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x42, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, - 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x73, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, - 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, - 0x6d, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x75, 0x6c, - 0x74, 0x69, 0x45, 0x64, 0x67, 0x65, 0x52, 0x04, 0x65, 0x64, 0x67, 0x65, 0x12, 0x5e, 0x0a, 0x06, - 0x69, 0x6e, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x46, 0x2e, 0x6f, - 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x73, - 0x64, 0x6b, 0x73, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x67, 0x72, 0x61, - 0x70, 0x68, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x06, 0x69, 0x6e, 0x6a, 0x65, 0x63, 0x74, 0x42, 0x43, 0x5a, 0x41, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x61, 0x63, 0x68, - 0x65, 0x2f, 0x62, 0x65, 0x61, 0x6d, 0x2f, 0x73, 0x64, 0x6b, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x70, - 0x6b, 0x67, 0x2f, 0x62, 0x65, 0x61, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x72, 0x75, 0x6e, - 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x78, 0x2f, 0x76, 0x31, 0x3b, 0x76, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x45, 0x64, 0x67, 0x65, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, + 0x64, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x04, 0x6b, 0x69, 0x6e, + 0x64, 0x12, 0x55, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x41, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x62, 0x65, 0x61, + 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x73, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x65, + 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, + 0x67, 0x72, 0x61, 0x70, 0x68, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x75, 0x6c, 0x6c, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x69, 0x0a, 0x09, 0x49, 0x6e, 0x70, 0x75, + 0x74, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, + 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4d, 0x41, 0x49, 0x4e, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, + 0x53, 0x49, 0x4e, 0x47, 0x4c, 0x45, 0x54, 0x4f, 0x4e, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x53, + 0x4c, 0x49, 0x43, 0x45, 0x10, 0x03, 0x12, 0x07, 0x0a, 0x03, 0x4d, 0x41, 0x50, 0x10, 0x04, 0x12, + 0x0c, 0x0a, 0x08, 0x4d, 0x55, 0x4c, 0x54, 0x49, 0x4d, 0x41, 0x50, 0x10, 0x05, 0x12, 0x08, 0x0a, + 0x04, 0x49, 0x54, 0x45, 0x52, 0x10, 0x06, 0x12, 0x0a, 0x0a, 0x06, 0x52, 0x45, 0x49, 0x54, 0x45, + 0x52, 0x10, 0x07, 0x1a, 0x61, 0x0a, 0x08, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, + 0x55, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x41, 0x2e, + 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, + 0x73, 0x64, 0x6b, 0x73, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x65, 0x61, 0x6d, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x67, 0x72, + 0x61, 0x70, 0x68, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x75, 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x1d, 0x0a, 0x0d, 0x49, 0x6e, 0x6a, 0x65, 0x63, 0x74, + 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x0c, 0x0a, 0x01, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x01, 0x6e, 0x22, 0xdc, 0x01, 0x0a, 0x10, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, + 0x6f, 0x72, 0x6d, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6e, 0x12, 0x56, 0x0a, 0x04, + 0x65, 0x64, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x42, 0x2e, 0x6f, 0x72, 0x67, + 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x73, 0x64, 0x6b, + 0x73, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, + 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x45, 0x64, 0x67, 0x65, 0x52, 0x04, + 0x65, 0x64, 0x67, 0x65, 0x12, 0x5e, 0x0a, 0x06, 0x69, 0x6e, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x46, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, + 0x65, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x73, 0x2e, 0x67, 0x6f, 0x2e, 0x70, + 0x6b, 0x67, 0x2e, 0x62, 0x65, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x72, 0x75, 0x6e, + 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x49, + 0x6e, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x06, 0x69, 0x6e, + 0x6a, 0x65, 0x63, 0x74, 0x42, 0x46, 0x5a, 0x44, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x62, 0x65, 0x61, 0x6d, 0x2f, 0x73, + 0x64, 0x6b, 0x73, 0x2f, 0x76, 0x32, 0x2f, 0x67, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x62, 0x65, + 0x61, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2f, + 0x67, 0x72, 0x61, 0x70, 0x68, 0x78, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/sdks/go/pkg/beam/core/runtime/graphx/v1/v1.proto b/sdks/go/pkg/beam/core/runtime/graphx/v1/v1.proto index 6c21a618054a..c1ed7aefe5e5 100644 --- a/sdks/go/pkg/beam/core/runtime/graphx/v1/v1.proto +++ b/sdks/go/pkg/beam/core/runtime/graphx/v1/v1.proto @@ -112,6 +112,8 @@ message Type { COGBK = 13; WINDOWEDVALUE = 14; + BUNDLEFINALIZATION = 23; + T = 15; U = 16; V = 17; From cea05075dfd5a98f4fe013ed33e57538b635d1dd Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Mon, 21 Mar 2022 13:24:21 -0400 Subject: [PATCH 5/7] indentation --- sdks/go/pkg/beam/core/runtime/graphx/v1/v1.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdks/go/pkg/beam/core/runtime/graphx/v1/v1.proto b/sdks/go/pkg/beam/core/runtime/graphx/v1/v1.proto index c1ed7aefe5e5..2349a20922c3 100644 --- a/sdks/go/pkg/beam/core/runtime/graphx/v1/v1.proto +++ b/sdks/go/pkg/beam/core/runtime/graphx/v1/v1.proto @@ -112,7 +112,7 @@ message Type { COGBK = 13; WINDOWEDVALUE = 14; - BUNDLEFINALIZATION = 23; + BUNDLEFINALIZATION = 23; T = 15; U = 16; From 35490f37bf17510b7516591c191045b77a567d21 Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Mon, 21 Mar 2022 13:30:54 -0400 Subject: [PATCH 6/7] Move bundle finalizer ahead of rtracker --- sdks/go/pkg/beam/core/funcx/fn.go | 38 +++++++++++++++---------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/sdks/go/pkg/beam/core/funcx/fn.go b/sdks/go/pkg/beam/core/funcx/fn.go index f9315bd9c7b4..b2f31cc1d180 100644 --- a/sdks/go/pkg/beam/core/funcx/fn.go +++ b/sdks/go/pkg/beam/core/funcx/fn.go @@ -432,7 +432,7 @@ func SubReturns(list []ReturnParam, indices ...int) []ReturnParam { } // The order of present parameters and return values must be as follows: -// func(FnContext?, FnPane?, FnWindow?, FnEventTime?, FnType?, FnRTracker?, FnBundleFinalization?, (FnValue, SideInput*)?, FnEmit*) (RetEventTime?, RetOutput?, RetError?) +// func(FnContext?, FnPane?, FnWindow?, FnEventTime?, FnType?, FnBundleFinalization?, FnRTracker?, (FnValue, SideInput*)?, FnEmit*) (RetEventTime?, RetOutput?, RetError?) // where ? indicates 0 or 1, and * indicates any number. // and a SideInput is one of FnValue or FnIter or FnReIter // Note: Fns with inputs must have at least one FnValue as the main input. @@ -495,10 +495,10 @@ func nextParamState(cur paramState, transition FnParamKind) (paramState, error) return psEventTime, nil case FnType: return psType, nil - case FnRTracker: - return psRTracker, nil case FnBundleFinalization: return psBundleFinalization, nil + case FnRTracker: + return psRTracker, nil } case psContext: switch transition { @@ -510,10 +510,10 @@ func nextParamState(cur paramState, transition FnParamKind) (paramState, error) return psEventTime, nil case FnType: return psType, nil - case FnRTracker: - return psRTracker, nil case FnBundleFinalization: return psBundleFinalization, nil + case FnRTracker: + return psRTracker, nil } case psPane: switch transition { @@ -523,10 +523,10 @@ func nextParamState(cur paramState, transition FnParamKind) (paramState, error) return psEventTime, nil case FnType: return psType, nil - case FnRTracker: - return psRTracker, nil case FnBundleFinalization: return psBundleFinalization, nil + case FnRTracker: + return psRTracker, nil } case psWindow: switch transition { @@ -534,33 +534,33 @@ func nextParamState(cur paramState, transition FnParamKind) (paramState, error) return psEventTime, nil case FnType: return psType, nil - case FnRTracker: - return psRTracker, nil case FnBundleFinalization: return psBundleFinalization, nil + case FnRTracker: + return psRTracker, nil } case psEventTime: switch transition { case FnType: return psType, nil - case FnRTracker: - return psRTracker, nil case FnBundleFinalization: return psBundleFinalization, nil - } - case psType: - switch transition { case FnRTracker: return psRTracker, nil - case FnBundleFinalization: - return psBundleFinalization, nil } - case psRTracker: + case psType: switch transition { case FnBundleFinalization: return psBundleFinalization, nil + case FnRTracker: + return psRTracker, nil } case psBundleFinalization: + switch transition { + case FnRTracker: + return psRTracker, nil + } + case psRTracker: // Completely handled by the default clause case psInput: switch transition { @@ -585,10 +585,10 @@ func nextParamState(cur paramState, transition FnParamKind) (paramState, error) return -1, errEventTimeParamPrecedence case FnType: return -1, errReflectTypePrecedence - case FnRTracker: - return -1, errRTrackerPrecedence case FnBundleFinalization: return -1, errBundleFinalizationPrecedence + case FnRTracker: + return -1, errRTrackerPrecedence case FnIter, FnReIter, FnValue, FnMultiMap: return psInput, nil case FnEmit: From 7fd583e8bda2913b37245a83eb7c8c78a34b1d78 Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Wed, 30 Mar 2022 12:29:06 -0400 Subject: [PATCH 7/7] Sort requirement urns --- sdks/go/pkg/beam/core/runtime/graphx/translate.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdks/go/pkg/beam/core/runtime/graphx/translate.go b/sdks/go/pkg/beam/core/runtime/graphx/translate.go index b95b94d71a25..f456f2a0b6da 100644 --- a/sdks/go/pkg/beam/core/runtime/graphx/translate.go +++ b/sdks/go/pkg/beam/core/runtime/graphx/translate.go @@ -18,6 +18,7 @@ package graphx import ( "context" "fmt" + "sort" "github.com/apache/beam/sdks/v2/go/pkg/beam/core/graph" "github.com/apache/beam/sdks/v2/go/pkg/beam/core/graph/coder" @@ -222,6 +223,7 @@ func (m *marshaller) getRequirements() []string { reqs = append(reqs, req) } } + sort.Strings(reqs) return reqs }