From db604a6fc9f2087cf181508f17abe5061c5d3ae4 Mon Sep 17 00:00:00 2001 From: James DeFelice Date: Thu, 24 Sep 2015 21:33:30 +0000 Subject: [PATCH] updated mesos-go and dep libs: zk and gogo/protobuf --- Godeps/Godeps.json | 29 +- .../github.com/gogo/protobuf/proto/Makefile | 5 +- .../gogo/protobuf/proto/all_test.go | 203 +- .../github.com/gogo/protobuf/proto/clone.go | 61 +- .../gogo/protobuf/proto/clone_test.go | 67 +- .../github.com/gogo/protobuf/proto/decode.go | 154 +- .../gogo/protobuf/proto/decode_gogo.go | 45 - .../github.com/gogo/protobuf/proto/encode.go | 300 +- .../gogo/protobuf/proto/encode_gogo.go | 77 +- .../github.com/gogo/protobuf/proto/equal.go | 26 + .../gogo/protobuf/proto/equal_test.go | 45 +- .../gogo/protobuf/proto/extensions.go | 49 +- .../gogo/protobuf/proto/extensions_test.go | 200 +- .../src/github.com/gogo/protobuf/proto/lib.go | 653 +- .../gogo/protobuf/proto/pointer_reflect.go | 97 +- .../gogo/protobuf/proto/pointer_unsafe.go | 50 +- .../protobuf/proto/pointer_unsafe_gogo.go | 58 - .../gogo/protobuf/proto/properties.go | 217 +- .../gogo/protobuf/proto/properties_gogo.go | 47 - .../protobuf/proto/proto3_proto/proto3.pb.go | 126 + .../protobuf/proto/proto3_proto/proto3.proto | 68 + .../gogo/protobuf/proto/proto3_test.go | 125 + .../gogo/protobuf/proto/size_test.go | 29 +- .../gogo/protobuf/proto/skip_gogo.go | 8 +- .../gogo/protobuf/proto/testdata/Makefile | 14 +- .../gogo/protobuf/proto/testdata/test.pb.go | 654 +- .../gogo/protobuf/proto/testdata/test.proto | 66 + .../github.com/gogo/protobuf/proto/text.go | 151 +- .../gogo/protobuf/proto/text_parser.go | 159 +- .../gogo/protobuf/proto/text_parser_test.go | 59 +- .../gogo/protobuf/proto/text_test.go | 68 +- .../mesos/mesos-go/auth/sasl/authenticatee.go | 4 +- .../mesos-go/auth/sasl/authenticatee_test.go | 11 +- .../mesos/mesos-go/detector/zoo/client.go | 444 - .../mesos/mesos-go/detector/zoo/client2.go | 88 + .../mesos-go/detector/zoo/client_test.go | 342 - .../mesos/mesos-go/detector/zoo/detect.go | 214 +- .../mesos-go/detector/zoo/detect_test.go | 552 +- .../mesos-go/detector/zoo/mocked_detect.go | 88 - .../mesos/mesos-go/detector/zoo/types.go | 6 - .../mesos/mesos-go/executor/executor.go | 261 +- .../mesos-go/executor/executor_intgr_test.go | 108 +- .../mesos/mesos-go/executor/executor_test.go | 96 +- .../mesos-go/mesosproto/authentication.pb.go | 255 + .../mesos-go/mesosproto/authentication.proto | 53 + .../mesos-go/mesosproto/containerizer.pb.go | 31 +- .../mesos-go/mesosproto/containerizer.proto | 2 + .../mesos/mesos-go/mesosproto/internal.pb.go | 7 +- .../mesos/mesos-go/mesosproto/log.pb.go | 6760 +-- .../mesos/mesos-go/mesosproto/logpb_test.go | 2675 +- .../mesos/mesos-go/mesosproto/mesos.pb.go | 43782 ++++++++++------ .../mesos/mesos-go/mesosproto/mesos.proto | 461 +- .../mesos/mesos-go/mesosproto/mesospb_test.go | 15069 ++++-- .../mesos/mesos-go/mesosproto/messages.pb.go | 383 +- .../mesos/mesos-go/mesosproto/messages.proto | 136 +- .../mesos/mesos-go/mesosproto/registry.pb.go | 7 +- .../mesos/mesos-go/mesosproto/scheduler.pb.go | 508 +- .../mesos/mesos-go/mesosproto/scheduler.proto | 246 +- .../mesos/mesos-go/mesosproto/state.pb.go | 2417 +- .../mesos/mesos-go/mesosproto/statepb_test.go | 975 +- .../mesos/mesos-go/mesosutil/constants.go | 2 +- .../mesos/mesos-go/messenger/decoder.go | 615 + .../mesos-go/messenger/http_transporter.go | 370 +- .../messenger/http_transporter_test.go | 142 +- .../mesos/mesos-go/messenger/messenger.go | 127 +- .../mesos-go/messenger/messenger_test.go | 174 +- .../mesos-go/messenger/mocked_messenger.go | 4 +- .../mesos/mesos-go/messenger/transporter.go | 4 +- .../mesos/mesos-go/scheduler/scheduler.go | 679 +- .../scheduler/scheduler_intgr_test.go | 44 +- .../mesos-go/scheduler/scheduler_unit_test.go | 446 +- .../github.com/mesos/mesos-go/upid/upid.go | 5 +- .../github.com/samuel/go-zookeeper/zk/conn.go | 42 +- .../samuel/go-zookeeper/zk/constants.go | 2 - .../github.com/samuel/go-zookeeper/zk/flw.go | 6 +- .../github.com/samuel/go-zookeeper/zk/lock.go | 13 +- .../samuel/go-zookeeper/zk/structs.go | 7 + .../samuel/go-zookeeper/zk/structs_test.go | 11 + 78 files changed, 50830 insertions(+), 31754 deletions(-) create mode 100644 Godeps/_workspace/src/github.com/gogo/protobuf/proto/proto3_proto/proto3.pb.go create mode 100644 Godeps/_workspace/src/github.com/gogo/protobuf/proto/proto3_proto/proto3.proto create mode 100644 Godeps/_workspace/src/github.com/gogo/protobuf/proto/proto3_test.go delete mode 100644 Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/client.go create mode 100644 Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/client2.go delete mode 100644 Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/client_test.go delete mode 100644 Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/mocked_detect.go create mode 100644 Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/authentication.pb.go create mode 100644 Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/authentication.proto create mode 100644 Godeps/_workspace/src/github.com/mesos/mesos-go/messenger/decoder.go diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 8e4a67f9562ce..90cb5c3f718b8 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -245,7 +245,8 @@ }, { "ImportPath": "github.com/gogo/protobuf/proto", - "Rev": "ab6cea4a44ef42b748cd88d2d372047b75806e0c" + "Comment": "v0.1-55-g2093b57", + "Rev": "2093b57e5ca2ccbee4626814100bc1aada691b18" }, { "ImportPath": "github.com/golang/glog", @@ -402,35 +403,43 @@ }, { "ImportPath": "github.com/mesos/mesos-go/auth", - "Rev": "65cb9ffec50a76f4ed9fe4808405b66b3bb7010d" + "Comment": "mesos-0.24.0-20-gb164c06", + "Rev": "b164c06f346af1e93aecb6502f83d31dbacdbb91" }, { "ImportPath": "github.com/mesos/mesos-go/detector", - "Rev": "65cb9ffec50a76f4ed9fe4808405b66b3bb7010d" + "Comment": "mesos-0.24.0-20-gb164c06", + "Rev": "b164c06f346af1e93aecb6502f83d31dbacdbb91" }, { "ImportPath": "github.com/mesos/mesos-go/executor", - "Rev": "65cb9ffec50a76f4ed9fe4808405b66b3bb7010d" + "Comment": "mesos-0.24.0-20-gb164c06", + "Rev": "b164c06f346af1e93aecb6502f83d31dbacdbb91" }, { "ImportPath": "github.com/mesos/mesos-go/mesosproto", - "Rev": "65cb9ffec50a76f4ed9fe4808405b66b3bb7010d" + "Comment": "mesos-0.24.0-20-gb164c06", + "Rev": "b164c06f346af1e93aecb6502f83d31dbacdbb91" }, { "ImportPath": "github.com/mesos/mesos-go/mesosutil", - "Rev": "65cb9ffec50a76f4ed9fe4808405b66b3bb7010d" + "Comment": "mesos-0.24.0-20-gb164c06", + "Rev": "b164c06f346af1e93aecb6502f83d31dbacdbb91" }, { "ImportPath": "github.com/mesos/mesos-go/messenger", - "Rev": "65cb9ffec50a76f4ed9fe4808405b66b3bb7010d" + "Comment": "mesos-0.24.0-20-gb164c06", + "Rev": "b164c06f346af1e93aecb6502f83d31dbacdbb91" }, { "ImportPath": "github.com/mesos/mesos-go/scheduler", - "Rev": "65cb9ffec50a76f4ed9fe4808405b66b3bb7010d" + "Comment": "mesos-0.24.0-20-gb164c06", + "Rev": "b164c06f346af1e93aecb6502f83d31dbacdbb91" }, { "ImportPath": "github.com/mesos/mesos-go/upid", - "Rev": "65cb9ffec50a76f4ed9fe4808405b66b3bb7010d" + "Comment": "mesos-0.24.0-20-gb164c06", + "Rev": "b164c06f346af1e93aecb6502f83d31dbacdbb91" }, { "ImportPath": "github.com/miekg/dns", @@ -499,7 +508,7 @@ }, { "ImportPath": "github.com/samuel/go-zookeeper/zk", - "Rev": "d0e0d8e11f318e000a8cc434616d69e329edc374" + "Rev": "177002e16a0061912f02377e2dd8951a8b3551bc" }, { "ImportPath": "github.com/scalingdata/gcfg", diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/Makefile b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/Makefile index 66bd2f29943c1..23a6b17344088 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/Makefile +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/Makefile @@ -37,4 +37,7 @@ test: install generate-test-pbs generate-test-pbs: - make install && cd testdata && make + make install + make -C testdata + protoc-min-version --version="3.0.0" --proto_path=.:../../../../ --gogo_out=. proto3_proto/proto3.proto + make diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/all_test.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/all_test.go index bb03a9bea9cff..5f27645ec0728 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/all_test.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/all_test.go @@ -44,8 +44,8 @@ import ( "testing" "time" - . "./testdata" . "github.com/gogo/protobuf/proto" + . "github.com/gogo/protobuf/proto/testdata" ) var globalO *Buffer @@ -401,17 +401,18 @@ type fakeMarshaler struct { err error } -func (f fakeMarshaler) Marshal() ([]byte, error) { - return f.b, f.err -} +func (f *fakeMarshaler) Marshal() ([]byte, error) { return f.b, f.err } +func (f *fakeMarshaler) String() string { return fmt.Sprintf("Bytes: %v Error: %v", f.b, f.err) } +func (f *fakeMarshaler) ProtoMessage() {} +func (f *fakeMarshaler) Reset() {} -func (f fakeMarshaler) String() string { - return fmt.Sprintf("Bytes: %v Error: %v", f.b, f.err) +type msgWithFakeMarshaler struct { + M *fakeMarshaler `protobuf:"bytes,1,opt,name=fake"` } -func (f fakeMarshaler) ProtoMessage() {} - -func (f fakeMarshaler) Reset() {} +func (m *msgWithFakeMarshaler) String() string { return CompactTextString(m) } +func (m *msgWithFakeMarshaler) ProtoMessage() {} +func (m *msgWithFakeMarshaler) Reset() {} // Simple tests for proto messages that implement the Marshaler interface. func TestMarshalerEncoding(t *testing.T) { @@ -423,7 +424,7 @@ func TestMarshalerEncoding(t *testing.T) { }{ { name: "Marshaler that fails", - m: fakeMarshaler{ + m: &fakeMarshaler{ err: errors.New("some marshal err"), b: []byte{5, 6, 7}, }, @@ -431,9 +432,25 @@ func TestMarshalerEncoding(t *testing.T) { want: nil, wantErr: errors.New("some marshal err"), }, + { + name: "Marshaler that fails with RequiredNotSetError", + m: &msgWithFakeMarshaler{ + M: &fakeMarshaler{ + err: &RequiredNotSetError{}, + b: []byte{5, 6, 7}, + }, + }, + // Since there's an error that can be continued after, + // the buffer should be written. + want: []byte{ + 10, 3, // for &msgWithFakeMarshaler + 5, 6, 7, // for &fakeMarshaler + }, + wantErr: &RequiredNotSetError{}, + }, { name: "Marshaler that succeeds", - m: fakeMarshaler{ + m: &fakeMarshaler{ b: []byte{0, 1, 2, 3, 4, 127, 255}, }, want: []byte{0, 1, 2, 3, 4, 127, 255}, @@ -443,6 +460,10 @@ func TestMarshalerEncoding(t *testing.T) { for _, test := range tests { b := NewBuffer(nil) err := b.Marshal(test.m) + if _, ok := err.(*RequiredNotSetError); ok { + // We're not in package proto, so we can only assert the type in this case. + err = &RequiredNotSetError{} + } if !reflect.DeepEqual(test.wantErr, err) { t.Errorf("%s: got err %v wanted %v", test.name, err, test.wantErr) } @@ -1252,7 +1273,8 @@ func TestProto1RepeatedGroup(t *testing.T) { } o := old() - if err := o.Marshal(pb); err != ErrRepeatedHasNil { + err := o.Marshal(pb) + if err == nil || !strings.Contains(err.Error(), "repeated field Message has nil") { t.Fatalf("unexpected or no error when marshaling: %v", err) } } @@ -1280,7 +1302,7 @@ func TestEnum(t *testing.T) { // We don't care what the value actually is, just as long as it doesn't crash. func TestPrintingNilEnumFields(t *testing.T) { pb := new(GoEnum) - fmt.Sprintf("%+v", pb) + _ = fmt.Sprintf("%+v", pb) } // Verify that absent required fields cause Marshal/Unmarshal to return errors. @@ -1441,6 +1463,17 @@ func TestSetDefaultsWithRepeatedSubMessage(t *testing.T) { } } +func TestSetDefaultWithRepeatedNonMessage(t *testing.T) { + m := &MyMessage{ + Pet: []string{"turtle", "wombat"}, + } + expected := Clone(m) + SetDefaults(m) + if !Equal(m, expected) { + t.Errorf("\n got %v\nwant %v", m, expected) + } +} + func TestMaximumTagNumber(t *testing.T) { m := &MaxTag{ LastField: String("natural goat essence"), @@ -1833,6 +1866,150 @@ func fuzzUnmarshal(t *testing.T, data []byte) { Unmarshal(data, pb) } +func TestMapFieldMarshal(t *testing.T) { + m := &MessageWithMap{ + NameMapping: map[int32]string{ + 1: "Rob", + 4: "Ian", + 8: "Dave", + }, + } + b, err := Marshal(m) + if err != nil { + t.Fatalf("Marshal: %v", err) + } + + // b should be the concatenation of these three byte sequences in some order. + parts := []string{ + "\n\a\b\x01\x12\x03Rob", + "\n\a\b\x04\x12\x03Ian", + "\n\b\b\x08\x12\x04Dave", + } + ok := false + for i := range parts { + for j := range parts { + if j == i { + continue + } + for k := range parts { + if k == i || k == j { + continue + } + try := parts[i] + parts[j] + parts[k] + if bytes.Equal(b, []byte(try)) { + ok = true + break + } + } + } + } + if !ok { + t.Fatalf("Incorrect Marshal output.\n got %q\nwant %q (or a permutation of that)", b, parts[0]+parts[1]+parts[2]) + } + t.Logf("FYI b: %q", b) + + (new(Buffer)).DebugPrint("Dump of b", b) +} + +func TestMapFieldRoundTrips(t *testing.T) { + m := &MessageWithMap{ + NameMapping: map[int32]string{ + 1: "Rob", + 4: "Ian", + 8: "Dave", + }, + MsgMapping: map[int64]*FloatingPoint{ + 0x7001: {F: Float64(2.0)}, + }, + ByteMapping: map[bool][]byte{ + false: []byte("that's not right!"), + true: []byte("aye, 'tis true!"), + }, + } + b, err := Marshal(m) + if err != nil { + t.Fatalf("Marshal: %v", err) + } + t.Logf("FYI b: %q", b) + m2 := new(MessageWithMap) + if err := Unmarshal(b, m2); err != nil { + t.Fatalf("Unmarshal: %v", err) + } + for _, pair := range [][2]interface{}{ + {m.NameMapping, m2.NameMapping}, + {m.MsgMapping, m2.MsgMapping}, + {m.ByteMapping, m2.ByteMapping}, + } { + if !reflect.DeepEqual(pair[0], pair[1]) { + t.Errorf("Map did not survive a round trip.\ninitial: %v\n final: %v", pair[0], pair[1]) + } + } +} + +func TestMapFieldWithNil(t *testing.T) { + m := &MessageWithMap{ + MsgMapping: map[int64]*FloatingPoint{ + 1: nil, + }, + } + b, err := Marshal(m) + if err == nil { + t.Fatalf("Marshal of bad map should have failed, got these bytes: %v", b) + } +} + +func TestOneof(t *testing.T) { + m := &Communique{} + b, err := Marshal(m) + if err != nil { + t.Fatalf("Marshal of empty message with oneof: %v", err) + } + if len(b) != 0 { + t.Errorf("Marshal of empty message yielded too many bytes: %v", b) + } + + m = &Communique{ + Union: &Communique_Name{"Barry"}, + } + + // Round-trip. + b, err = Marshal(m) + if err != nil { + t.Fatalf("Marshal of message with oneof: %v", err) + } + if len(b) != 7 { // name tag/wire (1) + name len (1) + name (5) + t.Errorf("Incorrect marshal of message with oneof: %v", b) + } + m.Reset() + if err := Unmarshal(b, m); err != nil { + t.Fatalf("Unmarshal of message with oneof: %v", err) + } + if x, ok := m.Union.(*Communique_Name); !ok || x.Name != "Barry" { + t.Errorf("After round trip, Union = %+v", m.Union) + } + if name := m.GetName(); name != "Barry" { + t.Errorf("After round trip, GetName = %q, want %q", name, "Barry") + } + + // Let's try with a message in the oneof. + m.Union = &Communique_Msg{&Strings{StringField: String("deep deep string")}} + b, err = Marshal(m) + if err != nil { + t.Fatalf("Marshal of message with oneof set to message: %v", err) + } + if len(b) != 20 { // msg tag/wire (1) + msg len (1) + msg (1 + 1 + 16) + t.Errorf("Incorrect marshal of message with oneof set to message: %v", b) + } + m.Reset() + if err := Unmarshal(b, m); err != nil { + t.Fatalf("Unmarshal of message with oneof set to message: %v", err) + } + ss, ok := m.Union.(*Communique_Msg) + if !ok || ss.Msg.GetStringField() != "deep deep string" { + t.Errorf("After round trip with oneof set to message, Union = %+v", m.Union) + } +} + // Benchmarks func testMsg() *GoTest { diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/clone.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/clone.go index 8f9de86f70179..4ff1ff59e7148 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/clone.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/clone.go @@ -29,7 +29,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Protocol buffer deep copy. +// Protocol buffer deep copy and merge. // TODO: MessageSet and RawMessage. package proto @@ -75,12 +75,13 @@ func Merge(dst, src Message) { } func mergeStruct(out, in reflect.Value) { + sprop := GetProperties(in.Type()) for i := 0; i < in.NumField(); i++ { f := in.Type().Field(i) if strings.HasPrefix(f.Name, "XXX_") { continue } - mergeAny(out.Field(i), in.Field(i)) + mergeAny(out.Field(i), in.Field(i), false, sprop.Prop[i]) } if emIn, ok := in.Addr().Interface().(extensionsMap); ok { @@ -103,7 +104,10 @@ func mergeStruct(out, in reflect.Value) { } } -func mergeAny(out, in reflect.Value) { +// mergeAny performs a merge between two values of the same type. +// viaPtr indicates whether the values were indirected through a pointer (implying proto2). +// prop is set if this is a struct field (it may be nil). +func mergeAny(out, in reflect.Value, viaPtr bool, prop *Properties) { if in.Type() == protoMessageType { if !in.IsNil() { if out.IsNil() { @@ -117,7 +121,44 @@ func mergeAny(out, in reflect.Value) { switch in.Kind() { case reflect.Bool, reflect.Float32, reflect.Float64, reflect.Int32, reflect.Int64, reflect.String, reflect.Uint32, reflect.Uint64: + if !viaPtr && isProto3Zero(in) { + return + } out.Set(in) + case reflect.Interface: + // Probably a oneof field; copy non-nil values. + if in.IsNil() { + return + } + // Allocate destination if it is not set, or set to a different type. + // Otherwise we will merge as normal. + if out.IsNil() || out.Elem().Type() != in.Elem().Type() { + out.Set(reflect.New(in.Elem().Elem().Type())) // interface -> *T -> T -> new(T) + } + mergeAny(out.Elem(), in.Elem(), false, nil) + case reflect.Map: + if in.Len() == 0 { + return + } + if out.IsNil() { + out.Set(reflect.MakeMap(in.Type())) + } + // For maps with value types of *T or []byte we need to deep copy each value. + elemKind := in.Type().Elem().Kind() + for _, key := range in.MapKeys() { + var val reflect.Value + switch elemKind { + case reflect.Ptr: + val = reflect.New(in.Type().Elem().Elem()) + mergeAny(val, in.MapIndex(key), false, nil) + case reflect.Slice: + val = in.MapIndex(key) + val = reflect.ValueOf(append([]byte{}, val.Bytes()...)) + default: + val = in.MapIndex(key) + } + out.SetMapIndex(key, val) + } case reflect.Ptr: if in.IsNil() { return @@ -125,13 +166,21 @@ func mergeAny(out, in reflect.Value) { if out.IsNil() { out.Set(reflect.New(in.Elem().Type())) } - mergeAny(out.Elem(), in.Elem()) + mergeAny(out.Elem(), in.Elem(), true, nil) case reflect.Slice: if in.IsNil() { return } if in.Type().Elem().Kind() == reflect.Uint8 { // []byte is a scalar bytes field, not a repeated field. + + // Edge case: if this is in a proto3 message, a zero length + // bytes field is considered the zero value, and should not + // be merged. + if prop != nil && prop.proto3 && in.Len() == 0 { + return + } + // Make a deep copy. // Append to []byte{} instead of []byte(nil) so that we never end up // with a nil result. @@ -149,7 +198,7 @@ func mergeAny(out, in reflect.Value) { default: for i := 0; i < n; i++ { x := reflect.Indirect(reflect.New(in.Type().Elem())) - mergeAny(x, in.Index(i)) + mergeAny(x, in.Index(i), false, nil) out.Set(reflect.Append(out, x)) } } @@ -166,7 +215,7 @@ func mergeExtension(out, in map[int32]Extension) { eOut := Extension{desc: eIn.desc} if eIn.value != nil { v := reflect.New(reflect.TypeOf(eIn.value)).Elem() - mergeAny(v, reflect.ValueOf(eIn.value)) + mergeAny(v, reflect.ValueOf(eIn.value), false, nil) eOut.value = v.Interface() } if eIn.enc != nil { diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/clone_test.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/clone_test.go index d304bae33363b..f065210b89418 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/clone_test.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/clone_test.go @@ -36,7 +36,8 @@ import ( "github.com/gogo/protobuf/proto" - pb "./testdata" + proto3pb "github.com/gogo/protobuf/proto/proto3_proto" + pb "github.com/gogo/protobuf/proto/testdata" ) var cloneTestMessage = &pb.MyMessage{ @@ -189,6 +190,70 @@ var mergeTests = []struct { dst: &pb.OtherMessage{Value: []byte("bar")}, want: &pb.OtherMessage{Value: []byte("foo")}, }, + { + src: &pb.MessageWithMap{ + NameMapping: map[int32]string{6: "Nigel"}, + MsgMapping: map[int64]*pb.FloatingPoint{ + 0x4001: {F: proto.Float64(2.0)}, + }, + ByteMapping: map[bool][]byte{true: []byte("wowsa")}, + }, + dst: &pb.MessageWithMap{ + NameMapping: map[int32]string{ + 6: "Bruce", // should be overwritten + 7: "Andrew", + }, + }, + want: &pb.MessageWithMap{ + NameMapping: map[int32]string{ + 6: "Nigel", + 7: "Andrew", + }, + MsgMapping: map[int64]*pb.FloatingPoint{ + 0x4001: {F: proto.Float64(2.0)}, + }, + ByteMapping: map[bool][]byte{true: []byte("wowsa")}, + }, + }, + // proto3 shouldn't merge zero values, + // in the same way that proto2 shouldn't merge nils. + { + src: &proto3pb.Message{ + Name: "Aaron", + Data: []byte(""), // zero value, but not nil + }, + dst: &proto3pb.Message{ + HeightInCm: 176, + Data: []byte("texas!"), + }, + want: &proto3pb.Message{ + Name: "Aaron", + HeightInCm: 176, + Data: []byte("texas!"), + }, + }, + // Oneof fields should merge by assignment. + { + src: &pb.Communique{ + Union: &pb.Communique_Number{Number: 41}, + }, + dst: &pb.Communique{ + Union: &pb.Communique_Name{Name: "Bobby Tables"}, + }, + want: &pb.Communique{ + Union: &pb.Communique_Number{Number: 41}, + }, + }, + // Oneof nil is the same as not set. + { + src: &pb.Communique{}, + dst: &pb.Communique{ + Union: &pb.Communique_Name{Name: "Bobby Tables"}, + }, + want: &pb.Communique{ + Union: &pb.Communique_Name{Name: "Bobby Tables"}, + }, + }, } func TestMerge(t *testing.T) { diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/decode.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/decode.go index ac0ea333b84d1..34258942aeee1 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/decode.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/decode.go @@ -46,6 +46,10 @@ import ( // errOverflow is returned when an integer is too large to be represented. var errOverflow = errors.New("proto: integer overflow") +// ErrInternalBadWireType is returned by generated code when an incorrect +// wire type is encountered. It does not get returned to user code. +var ErrInternalBadWireType = errors.New("proto: internal error: bad wiretype for oneof") + // The fundamental decoders that interpret bytes on the wire. // Those that take integer types all return uint64 and are // therefore of type valueDecoder. @@ -178,7 +182,7 @@ func (p *Buffer) DecodeZigzag32() (x uint64, err error) { func (p *Buffer) DecodeRawBytes(alloc bool) (buf []byte, err error) { n, err := p.DecodeVarint() if err != nil { - return + return nil, err } nb := int(n) @@ -314,6 +318,24 @@ func UnmarshalMerge(buf []byte, pb Message) error { return NewBuffer(buf).Unmarshal(pb) } +// DecodeMessage reads a count-delimited message from the Buffer. +func (p *Buffer) DecodeMessage(pb Message) error { + enc, err := p.DecodeRawBytes(false) + if err != nil { + return err + } + return NewBuffer(enc).Unmarshal(pb) +} + +// DecodeGroup reads a tag-delimited group from the Buffer. +func (p *Buffer) DecodeGroup(pb Message) error { + typ, base, err := getbase(pb) + if err != nil { + return err + } + return p.unmarshalType(typ.Elem(), GetProperties(typ.Elem()), true, base) +} + // Unmarshal parses the protocol buffer representation in the // Buffer and places the decoded result in pb. If the struct // underlying pb does not match the data in the buffer, the results can be @@ -370,11 +392,11 @@ func (o *Buffer) unmarshalType(st reflect.Type, prop *StructProperties, is_group if prop.extendable { if e := structPointer_Interface(base, st).(extendableProto); isExtensionField(e, int32(tag)) { if err = o.skip(st, tag, wire); err == nil { - if ee, ok := e.(extensionsMap); ok { + if ee, eok := e.(extensionsMap); eok { ext := ee.ExtensionMap()[int32(tag)] // may be missing ext.enc = append(ext.enc, o.buf[oi:o.index]...) ee.ExtensionMap()[int32(tag)] = ext - } else if ee, ok := e.(extensionsBytes); ok { + } else if ee, eok := e.(extensionsBytes); eok { ext := ee.GetExtensions() *ext = append(*ext, o.buf[oi:o.index]...) } @@ -382,6 +404,20 @@ func (o *Buffer) unmarshalType(st reflect.Type, prop *StructProperties, is_group continue } } + // Maybe it's a oneof? + if prop.oneofUnmarshaler != nil { + m := structPointer_Interface(base, st).(Message) + // First return value indicates whether tag is a oneof field. + ok, err = prop.oneofUnmarshaler(m, tag, wire, o) + if err == ErrInternalBadWireType { + // Map the error to something more descriptive. + // Do the formatting here to save generated code space. + err = fmt.Errorf("bad wiretype for oneof field in %T", m) + } + if ok { + continue + } + } err = o.skipAndSave(st, tag, wire, base, prop.unrecField) continue } @@ -470,6 +506,15 @@ func (o *Buffer) dec_bool(p *Properties, base structPointer) error { return nil } +func (o *Buffer) dec_proto3_bool(p *Properties, base structPointer) error { + u, err := p.valDec(o) + if err != nil { + return err + } + *structPointer_BoolVal(base, p.field) = u != 0 + return nil +} + // Decode an int32. func (o *Buffer) dec_int32(p *Properties, base structPointer) error { u, err := p.valDec(o) @@ -480,6 +525,15 @@ func (o *Buffer) dec_int32(p *Properties, base structPointer) error { return nil } +func (o *Buffer) dec_proto3_int32(p *Properties, base structPointer) error { + u, err := p.valDec(o) + if err != nil { + return err + } + word32Val_Set(structPointer_Word32Val(base, p.field), uint32(u)) + return nil +} + // Decode an int64. func (o *Buffer) dec_int64(p *Properties, base structPointer) error { u, err := p.valDec(o) @@ -490,15 +544,31 @@ func (o *Buffer) dec_int64(p *Properties, base structPointer) error { return nil } +func (o *Buffer) dec_proto3_int64(p *Properties, base structPointer) error { + u, err := p.valDec(o) + if err != nil { + return err + } + word64Val_Set(structPointer_Word64Val(base, p.field), o, u) + return nil +} + // Decode a string. func (o *Buffer) dec_string(p *Properties, base structPointer) error { s, err := o.DecodeStringBytes() if err != nil { return err } - sp := new(string) - *sp = s - *structPointer_String(base, p.field) = sp + *structPointer_String(base, p.field) = &s + return nil +} + +func (o *Buffer) dec_proto3_string(p *Properties, base structPointer) error { + s, err := o.DecodeStringBytes() + if err != nil { + return err + } + *structPointer_StringVal(base, p.field) = s return nil } @@ -637,6 +707,78 @@ func (o *Buffer) dec_slice_slice_byte(p *Properties, base structPointer) error { return nil } +// Decode a map field. +func (o *Buffer) dec_new_map(p *Properties, base structPointer) error { + raw, err := o.DecodeRawBytes(false) + if err != nil { + return err + } + oi := o.index // index at the end of this map entry + o.index -= len(raw) // move buffer back to start of map entry + + mptr := structPointer_NewAt(base, p.field, p.mtype) // *map[K]V + if mptr.Elem().IsNil() { + mptr.Elem().Set(reflect.MakeMap(mptr.Type().Elem())) + } + v := mptr.Elem() // map[K]V + + // Prepare addressable doubly-indirect placeholders for the key and value types. + // See enc_new_map for why. + keyptr := reflect.New(reflect.PtrTo(p.mtype.Key())).Elem() // addressable *K + keybase := toStructPointer(keyptr.Addr()) // **K + + var valbase structPointer + var valptr reflect.Value + switch p.mtype.Elem().Kind() { + case reflect.Slice: + // []byte + var dummy []byte + valptr = reflect.ValueOf(&dummy) // *[]byte + valbase = toStructPointer(valptr) // *[]byte + case reflect.Ptr: + // message; valptr is **Msg; need to allocate the intermediate pointer + valptr = reflect.New(reflect.PtrTo(p.mtype.Elem())).Elem() // addressable *V + valptr.Set(reflect.New(valptr.Type().Elem())) + valbase = toStructPointer(valptr) + default: + // everything else + valptr = reflect.New(reflect.PtrTo(p.mtype.Elem())).Elem() // addressable *V + valbase = toStructPointer(valptr.Addr()) // **V + } + + // Decode. + // This parses a restricted wire format, namely the encoding of a message + // with two fields. See enc_new_map for the format. + for o.index < oi { + // tagcode for key and value properties are always a single byte + // because they have tags 1 and 2. + tagcode := o.buf[o.index] + o.index++ + switch tagcode { + case p.mkeyprop.tagcode[0]: + if err := p.mkeyprop.dec(o, p.mkeyprop, keybase); err != nil { + return err + } + case p.mvalprop.tagcode[0]: + if err := p.mvalprop.dec(o, p.mvalprop, valbase); err != nil { + return err + } + default: + // TODO: Should we silently skip this instead? + return fmt.Errorf("proto: bad map data tag %d", raw[0]) + } + } + keyelem, valelem := keyptr.Elem(), valptr.Elem() + if !keyelem.IsValid() || !valelem.IsValid() { + // We did not decode the key or the value in the map entry. + // Either way, it's an invalid map entry. + return fmt.Errorf("proto: bad map data: missing key/val") + } + + v.SetMapIndex(keyelem, valelem) + return nil +} + // Decode a group. func (o *Buffer) dec_struct_group(p *Properties, base structPointer) error { bas := structPointer_GetStructPointer(base, p.field) diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/decode_gogo.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/decode_gogo.go index 96161adbe89a1..6a77aad7661a7 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/decode_gogo.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/decode_gogo.go @@ -30,51 +30,6 @@ import ( "reflect" ) -// Decode a reference to a bool pointer. -func (o *Buffer) dec_ref_bool(p *Properties, base structPointer) error { - u, err := p.valDec(o) - if err != nil { - return err - } - if len(o.bools) == 0 { - o.bools = make([]bool, boolPoolSize) - } - o.bools[0] = u != 0 - *structPointer_RefBool(base, p.field) = o.bools[0] - o.bools = o.bools[1:] - return nil -} - -// Decode a reference to an int32 pointer. -func (o *Buffer) dec_ref_int32(p *Properties, base structPointer) error { - u, err := p.valDec(o) - if err != nil { - return err - } - refWord32_Set(structPointer_RefWord32(base, p.field), o, uint32(u)) - return nil -} - -// Decode a reference to an int64 pointer. -func (o *Buffer) dec_ref_int64(p *Properties, base structPointer) error { - u, err := p.valDec(o) - if err != nil { - return err - } - refWord64_Set(structPointer_RefWord64(base, p.field), o, u) - return nil -} - -// Decode a reference to a string pointer. -func (o *Buffer) dec_ref_string(p *Properties, base structPointer) error { - s, err := o.DecodeStringBytes() - if err != nil { - return err - } - *structPointer_RefString(base, p.field) = s - return nil -} - // Decode a reference to a struct pointer. func (o *Buffer) dec_ref_struct_message(p *Properties, base structPointer) (err error) { raw, e := o.DecodeRawBytes(false) diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/encode.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/encode.go index cbe4242e0071e..89d0caa8268f5 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/encode.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/encode.go @@ -60,9 +60,9 @@ func (e *RequiredNotSetError) Error() string { } var ( - // ErrRepeatedHasNil is the error returned if Marshal is called with + // errRepeatedHasNil is the error returned if Marshal is called with // a struct with a repeated field containing a nil element. - ErrRepeatedHasNil = errors.New("proto: repeated field has nil element") + errRepeatedHasNil = errors.New("proto: repeated field has nil element") // ErrNil is the error returned if Marshal is called with nil. ErrNil = errors.New("proto: Marshal called with nil") @@ -228,6 +228,20 @@ func Marshal(pb Message) ([]byte, error) { return p.buf, err } +// EncodeMessage writes the protocol buffer to the Buffer, +// prefixed by a varint-encoded length. +func (p *Buffer) EncodeMessage(pb Message) error { + t, base, err := getbase(pb) + if structPointer_IsNil(base) { + return ErrNil + } + if err == nil { + var state errorState + err = p.enc_len_struct(GetProperties(t.Elem()), base, &state) + } + return err +} + // Marshal takes the protocol buffer // and encodes it into the wire format, writing the result to the // Buffer. @@ -298,6 +312,16 @@ func (o *Buffer) enc_bool(p *Properties, base structPointer) error { return nil } +func (o *Buffer) enc_proto3_bool(p *Properties, base structPointer) error { + v := *structPointer_BoolVal(base, p.field) + if !v { + return ErrNil + } + o.buf = append(o.buf, p.tagcode...) + p.valEnc(o, 1) + return nil +} + func size_bool(p *Properties, base structPointer) int { v := *structPointer_Bool(base, p.field) if v == nil { @@ -306,6 +330,14 @@ func size_bool(p *Properties, base structPointer) int { return len(p.tagcode) + 1 // each bool takes exactly one byte } +func size_proto3_bool(p *Properties, base structPointer) int { + v := *structPointer_BoolVal(base, p.field) + if !v && !p.oneof { + return 0 + } + return len(p.tagcode) + 1 // each bool takes exactly one byte +} + // Encode an int32. func (o *Buffer) enc_int32(p *Properties, base structPointer) error { v := structPointer_Word32(base, p.field) @@ -318,6 +350,17 @@ func (o *Buffer) enc_int32(p *Properties, base structPointer) error { return nil } +func (o *Buffer) enc_proto3_int32(p *Properties, base structPointer) error { + v := structPointer_Word32Val(base, p.field) + x := int32(word32Val_Get(v)) // permit sign extension to use full 64-bit range + if x == 0 { + return ErrNil + } + o.buf = append(o.buf, p.tagcode...) + p.valEnc(o, uint64(x)) + return nil +} + func size_int32(p *Properties, base structPointer) (n int) { v := structPointer_Word32(base, p.field) if word32_IsNil(v) { @@ -329,6 +372,17 @@ func size_int32(p *Properties, base structPointer) (n int) { return } +func size_proto3_int32(p *Properties, base structPointer) (n int) { + v := structPointer_Word32Val(base, p.field) + x := int32(word32Val_Get(v)) // permit sign extension to use full 64-bit range + if x == 0 && !p.oneof { + return 0 + } + n += len(p.tagcode) + n += p.valSize(uint64(x)) + return +} + // Encode a uint32. // Exactly the same as int32, except for no sign extension. func (o *Buffer) enc_uint32(p *Properties, base structPointer) error { @@ -342,6 +396,17 @@ func (o *Buffer) enc_uint32(p *Properties, base structPointer) error { return nil } +func (o *Buffer) enc_proto3_uint32(p *Properties, base structPointer) error { + v := structPointer_Word32Val(base, p.field) + x := word32Val_Get(v) + if x == 0 { + return ErrNil + } + o.buf = append(o.buf, p.tagcode...) + p.valEnc(o, uint64(x)) + return nil +} + func size_uint32(p *Properties, base structPointer) (n int) { v := structPointer_Word32(base, p.field) if word32_IsNil(v) { @@ -353,6 +418,17 @@ func size_uint32(p *Properties, base structPointer) (n int) { return } +func size_proto3_uint32(p *Properties, base structPointer) (n int) { + v := structPointer_Word32Val(base, p.field) + x := word32Val_Get(v) + if x == 0 && !p.oneof { + return 0 + } + n += len(p.tagcode) + n += p.valSize(uint64(x)) + return +} + // Encode an int64. func (o *Buffer) enc_int64(p *Properties, base structPointer) error { v := structPointer_Word64(base, p.field) @@ -365,6 +441,17 @@ func (o *Buffer) enc_int64(p *Properties, base structPointer) error { return nil } +func (o *Buffer) enc_proto3_int64(p *Properties, base structPointer) error { + v := structPointer_Word64Val(base, p.field) + x := word64Val_Get(v) + if x == 0 { + return ErrNil + } + o.buf = append(o.buf, p.tagcode...) + p.valEnc(o, x) + return nil +} + func size_int64(p *Properties, base structPointer) (n int) { v := structPointer_Word64(base, p.field) if word64_IsNil(v) { @@ -376,6 +463,17 @@ func size_int64(p *Properties, base structPointer) (n int) { return } +func size_proto3_int64(p *Properties, base structPointer) (n int) { + v := structPointer_Word64Val(base, p.field) + x := word64Val_Get(v) + if x == 0 && !p.oneof { + return 0 + } + n += len(p.tagcode) + n += p.valSize(x) + return +} + // Encode a string. func (o *Buffer) enc_string(p *Properties, base structPointer) error { v := *structPointer_String(base, p.field) @@ -388,6 +486,16 @@ func (o *Buffer) enc_string(p *Properties, base structPointer) error { return nil } +func (o *Buffer) enc_proto3_string(p *Properties, base structPointer) error { + v := *structPointer_StringVal(base, p.field) + if v == "" { + return ErrNil + } + o.buf = append(o.buf, p.tagcode...) + o.EncodeStringBytes(v) + return nil +} + func size_string(p *Properties, base structPointer) (n int) { v := *structPointer_String(base, p.field) if v == nil { @@ -399,6 +507,16 @@ func size_string(p *Properties, base structPointer) (n int) { return } +func size_proto3_string(p *Properties, base structPointer) (n int) { + v := *structPointer_StringVal(base, p.field) + if v == "" && !p.oneof { + return 0 + } + n += len(p.tagcode) + n += sizeStringBytes(v) + return +} + // All protocol buffer fields are nillable, but be careful. func isNil(v reflect.Value) bool { switch v.Kind() { @@ -425,7 +543,7 @@ func (o *Buffer) enc_struct_message(p *Properties, base structPointer) error { } o.buf = append(o.buf, p.tagcode...) o.EncodeRawBytes(data) - return nil + return state.err } o.buf = append(o.buf, p.tagcode...) @@ -551,9 +669,29 @@ func (o *Buffer) enc_slice_byte(p *Properties, base structPointer) error { return nil } +func (o *Buffer) enc_proto3_slice_byte(p *Properties, base structPointer) error { + s := *structPointer_Bytes(base, p.field) + if len(s) == 0 { + return ErrNil + } + o.buf = append(o.buf, p.tagcode...) + o.EncodeRawBytes(s) + return nil +} + func size_slice_byte(p *Properties, base structPointer) (n int) { s := *structPointer_Bytes(base, p.field) - if s == nil { + if s == nil && !p.oneof { + return 0 + } + n += len(p.tagcode) + n += sizeRawBytes(s) + return +} + +func size_proto3_slice_byte(p *Properties, base structPointer) (n int) { + s := *structPointer_Bytes(base, p.field) + if len(s) == 0 && !p.oneof { return 0 } n += len(p.tagcode) @@ -815,7 +953,7 @@ func (o *Buffer) enc_slice_struct_message(p *Properties, base structPointer) err for i := 0; i < l; i++ { structp := s.Index(i) if structPointer_IsNil(structp) { - return ErrRepeatedHasNil + return errRepeatedHasNil } // Can the object marshal itself? @@ -834,7 +972,7 @@ func (o *Buffer) enc_slice_struct_message(p *Properties, base structPointer) err err := o.enc_len_struct(p.sprop, structp, &state) if err != nil && !state.shouldContinue(err, nil) { if err == ErrNil { - return ErrRepeatedHasNil + return errRepeatedHasNil } return err } @@ -877,7 +1015,7 @@ func (o *Buffer) enc_slice_struct_group(p *Properties, base structPointer) error for i := 0; i < l; i++ { b := s.Index(i) if structPointer_IsNil(b) { - return ErrRepeatedHasNil + return errRepeatedHasNil } o.EncodeVarint(uint64((p.Tag << 3) | WireStartGroup)) @@ -886,7 +1024,7 @@ func (o *Buffer) enc_slice_struct_group(p *Properties, base structPointer) error if err != nil && !state.shouldContinue(err, nil) { if err == ErrNil { - return ErrRepeatedHasNil + return errRepeatedHasNil } return err } @@ -945,6 +1083,113 @@ func size_map(p *Properties, base structPointer) int { return sizeExtensionMap(v) } +// Encode a map field. +func (o *Buffer) enc_new_map(p *Properties, base structPointer) error { + var state errorState // XXX: or do we need to plumb this through? + + /* + A map defined as + map map_field = N; + is encoded in the same way as + message MapFieldEntry { + key_type key = 1; + value_type value = 2; + } + repeated MapFieldEntry map_field = N; + */ + + v := structPointer_NewAt(base, p.field, p.mtype).Elem() // map[K]V + if v.Len() == 0 { + return nil + } + + keycopy, valcopy, keybase, valbase := mapEncodeScratch(p.mtype) + + enc := func() error { + if err := p.mkeyprop.enc(o, p.mkeyprop, keybase); err != nil { + return err + } + if err := p.mvalprop.enc(o, p.mvalprop, valbase); err != nil { + return err + } + return nil + } + + keys := v.MapKeys() + sort.Sort(mapKeys(keys)) + for _, key := range keys { + val := v.MapIndex(key) + + // The only illegal map entry values are nil message pointers. + if val.Kind() == reflect.Ptr && val.IsNil() { + return errors.New("proto: map has nil element") + } + + keycopy.Set(key) + valcopy.Set(val) + + o.buf = append(o.buf, p.tagcode...) + if err := o.enc_len_thing(enc, &state); err != nil { + return err + } + } + return nil +} + +func size_new_map(p *Properties, base structPointer) int { + v := structPointer_NewAt(base, p.field, p.mtype).Elem() // map[K]V + + keycopy, valcopy, keybase, valbase := mapEncodeScratch(p.mtype) + + n := 0 + for _, key := range v.MapKeys() { + val := v.MapIndex(key) + keycopy.Set(key) + valcopy.Set(val) + + // Tag codes for key and val are the responsibility of the sub-sizer. + keysize := p.mkeyprop.size(p.mkeyprop, keybase) + valsize := p.mvalprop.size(p.mvalprop, valbase) + entry := keysize + valsize + // Add on tag code and length of map entry itself. + n += len(p.tagcode) + sizeVarint(uint64(entry)) + entry + } + return n +} + +// mapEncodeScratch returns a new reflect.Value matching the map's value type, +// and a structPointer suitable for passing to an encoder or sizer. +func mapEncodeScratch(mapType reflect.Type) (keycopy, valcopy reflect.Value, keybase, valbase structPointer) { + // Prepare addressable doubly-indirect placeholders for the key and value types. + // This is needed because the element-type encoders expect **T, but the map iteration produces T. + + keycopy = reflect.New(mapType.Key()).Elem() // addressable K + keyptr := reflect.New(reflect.PtrTo(keycopy.Type())).Elem() // addressable *K + keyptr.Set(keycopy.Addr()) // + keybase = toStructPointer(keyptr.Addr()) // **K + + // Value types are more varied and require special handling. + switch mapType.Elem().Kind() { + case reflect.Slice: + // []byte + var dummy []byte + valcopy = reflect.ValueOf(&dummy).Elem() // addressable []byte + valbase = toStructPointer(valcopy.Addr()) + case reflect.Ptr: + // message; the generated field type is map[K]*Msg (so V is *Msg), + // so we only need one level of indirection. + valcopy = reflect.New(mapType.Elem()).Elem() // addressable V + valbase = toStructPointer(valcopy.Addr()) + default: + // everything else + valcopy = reflect.New(mapType.Elem()).Elem() // addressable V + valptr := reflect.New(reflect.PtrTo(valcopy.Type())).Elem() // addressable *V + valptr.Set(valcopy.Addr()) // + valbase = toStructPointer(valptr.Addr()) // **V + } + return +} + // Encode a struct. func (o *Buffer) enc_struct(prop *StructProperties, base structPointer) error { var state errorState @@ -960,6 +1205,9 @@ func (o *Buffer) enc_struct(prop *StructProperties, base structPointer) error { if p.Required && state.err == nil { state.err = &RequiredNotSetError{p.Name} } + } else if err == errRepeatedHasNil { + // Give more context to nil values in repeated fields. + return errors.New("repeated field " + p.OrigName + " has nil element") } else if !state.shouldContinue(err, p) { return err } @@ -967,6 +1215,14 @@ func (o *Buffer) enc_struct(prop *StructProperties, base structPointer) error { } } + // Do oneof fields. + if prop.oneofMarshaler != nil { + m := structPointer_Interface(base, prop.stype).(Message) + if err := prop.oneofMarshaler(m, o); err != nil { + return err + } + } + // Add unrecognized fields at the end. if prop.unrecField.IsValid() { v := *structPointer_Bytes(base, prop.unrecField) @@ -992,6 +1248,27 @@ func size_struct(prop *StructProperties, base structPointer) (n int) { n += len(v) } + // Factor in any oneof fields. + // TODO: This could be faster and use less reflection. + if prop.oneofMarshaler != nil { + sv := reflect.ValueOf(structPointer_Interface(base, prop.stype)).Elem() + for i := 0; i < prop.stype.NumField(); i++ { + fv := sv.Field(i) + if fv.Kind() != reflect.Interface || fv.IsNil() { + continue + } + if prop.stype.Field(i).Tag.Get("protobuf_oneof") == "" { + continue + } + spv := fv.Elem() // interface -> *T + sv := spv.Elem() // *T -> T + sf := sv.Type().Field(0) // StructField inside T + var prop Properties + prop.Init(sf.Type, "whatever", sf.Tag.Get("protobuf"), &sf) + n += prop.size(&prop, toStructPointer(spv)) + } + } + return } @@ -999,10 +1276,15 @@ var zeroes [20]byte // longer than any conceivable sizeVarint // Encode a struct, preceded by its encoded length (as a varint). func (o *Buffer) enc_len_struct(prop *StructProperties, base structPointer, state *errorState) error { + return o.enc_len_thing(func() error { return o.enc_struct(prop, base) }, state) +} + +// Encode something, preceded by its encoded length (as a varint). +func (o *Buffer) enc_len_thing(enc func() error, state *errorState) error { iLen := len(o.buf) o.buf = append(o.buf, 0, 0, 0, 0) // reserve four bytes for length iMsg := len(o.buf) - err := o.enc_struct(prop, base) + err := enc() if err != nil && !state.shouldContinue(err, nil) { return err } diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/encode_gogo.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/encode_gogo.go index 66bc0bd535e09..f77cfb1eea4db 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/encode_gogo.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/encode_gogo.go @@ -40,6 +40,10 @@ import ( "reflect" ) +func NewRequiredNotSetError(field string) *RequiredNotSetError { + return &RequiredNotSetError{field} +} + type Sizer interface { Size() int } @@ -64,12 +68,9 @@ func size_ext_slice_byte(p *Properties, base structPointer) (n int) { // Encode a reference to bool pointer. func (o *Buffer) enc_ref_bool(p *Properties, base structPointer) error { - v := structPointer_RefBool(base, p.field) - if v == nil { - return ErrNil - } + v := *structPointer_BoolVal(base, p.field) x := 0 - if *v { + if v { x = 1 } o.buf = append(o.buf, p.tagcode...) @@ -78,53 +79,37 @@ func (o *Buffer) enc_ref_bool(p *Properties, base structPointer) error { } func size_ref_bool(p *Properties, base structPointer) int { - v := structPointer_RefBool(base, p.field) - if v == nil { - return 0 - } return len(p.tagcode) + 1 // each bool takes exactly one byte } // Encode a reference to int32 pointer. func (o *Buffer) enc_ref_int32(p *Properties, base structPointer) error { - v := structPointer_RefWord32(base, p.field) - if refWord32_IsNil(v) { - return ErrNil - } - x := int32(refWord32_Get(v)) + v := structPointer_Word32Val(base, p.field) + x := int32(word32Val_Get(v)) o.buf = append(o.buf, p.tagcode...) p.valEnc(o, uint64(x)) return nil } func size_ref_int32(p *Properties, base structPointer) (n int) { - v := structPointer_RefWord32(base, p.field) - if refWord32_IsNil(v) { - return 0 - } - x := int32(refWord32_Get(v)) + v := structPointer_Word32Val(base, p.field) + x := int32(word32Val_Get(v)) n += len(p.tagcode) n += p.valSize(uint64(x)) return } func (o *Buffer) enc_ref_uint32(p *Properties, base structPointer) error { - v := structPointer_RefWord32(base, p.field) - if refWord32_IsNil(v) { - return ErrNil - } - x := refWord32_Get(v) + v := structPointer_Word32Val(base, p.field) + x := word32Val_Get(v) o.buf = append(o.buf, p.tagcode...) p.valEnc(o, uint64(x)) return nil } func size_ref_uint32(p *Properties, base structPointer) (n int) { - v := structPointer_RefWord32(base, p.field) - if refWord32_IsNil(v) { - return 0 - } - x := refWord32_Get(v) + v := structPointer_Word32Val(base, p.field) + x := word32Val_Get(v) n += len(p.tagcode) n += p.valSize(uint64(x)) return @@ -132,22 +117,16 @@ func size_ref_uint32(p *Properties, base structPointer) (n int) { // Encode a reference to an int64 pointer. func (o *Buffer) enc_ref_int64(p *Properties, base structPointer) error { - v := structPointer_RefWord64(base, p.field) - if refWord64_IsNil(v) { - return ErrNil - } - x := refWord64_Get(v) + v := structPointer_Word64Val(base, p.field) + x := word64Val_Get(v) o.buf = append(o.buf, p.tagcode...) p.valEnc(o, x) return nil } func size_ref_int64(p *Properties, base structPointer) (n int) { - v := structPointer_RefWord64(base, p.field) - if refWord64_IsNil(v) { - return 0 - } - x := refWord64_Get(v) + v := structPointer_Word64Val(base, p.field) + x := word64Val_Get(v) n += len(p.tagcode) n += p.valSize(x) return @@ -155,24 +134,16 @@ func size_ref_int64(p *Properties, base structPointer) (n int) { // Encode a reference to a string pointer. func (o *Buffer) enc_ref_string(p *Properties, base structPointer) error { - v := structPointer_RefString(base, p.field) - if v == nil { - return ErrNil - } - x := *v + v := *structPointer_StringVal(base, p.field) o.buf = append(o.buf, p.tagcode...) - o.EncodeStringBytes(x) + o.EncodeStringBytes(v) return nil } func size_ref_string(p *Properties, base structPointer) (n int) { - v := structPointer_RefString(base, p.field) - if v == nil { - return 0 - } - x := *v + v := *structPointer_StringVal(base, p.field) n += len(p.tagcode) - n += sizeStringBytes(x) + n += sizeStringBytes(v) return } @@ -232,7 +203,7 @@ func (o *Buffer) enc_slice_ref_struct_message(p *Properties, base structPointer) for i := 0; i < l; i++ { structp := structPointer_Add(ss1, field(uintptr(i)*size)) if structPointer_IsNil(structp) { - return ErrRepeatedHasNil + return errRepeatedHasNil } // Can the object marshal itself? @@ -251,7 +222,7 @@ func (o *Buffer) enc_slice_ref_struct_message(p *Properties, base structPointer) err := o.enc_len_struct(p.sprop, structp, &state) if err != nil && !state.shouldContinue(err, nil) { if err == ErrNil { - return ErrRepeatedHasNil + return errRepeatedHasNil } return err } diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/equal.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/equal.go index ebdfdcaf7439e..5475c3d9596f4 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/equal.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/equal.go @@ -154,6 +154,32 @@ func equalAny(v1, v2 reflect.Value) bool { return v1.Float() == v2.Float() case reflect.Int32, reflect.Int64: return v1.Int() == v2.Int() + case reflect.Interface: + // Probably a oneof field; compare the inner values. + n1, n2 := v1.IsNil(), v2.IsNil() + if n1 || n2 { + return n1 == n2 + } + e1, e2 := v1.Elem(), v2.Elem() + if e1.Type() != e2.Type() { + return false + } + return equalAny(e1, e2) + case reflect.Map: + if v1.Len() != v2.Len() { + return false + } + for _, key := range v1.MapKeys() { + val2 := v2.MapIndex(key) + if !val2.IsValid() { + // This key was not found in the second map. + return false + } + if !equalAny(v1.MapIndex(key), val2) { + return false + } + } + return true case reflect.Ptr: return equalAny(v1.Elem(), v2.Elem()) case reflect.Slice: diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/equal_test.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/equal_test.go index b6e8964edc8b4..7cb36d3785d8b 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/equal_test.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/equal_test.go @@ -34,8 +34,8 @@ package proto_test import ( "testing" - pb "./testdata" . "github.com/gogo/protobuf/proto" + pb "github.com/gogo/protobuf/proto/testdata" ) // Four identical base messages. @@ -155,6 +155,49 @@ var EqualTests = []struct { }, true, }, + + { + "map same", + &pb.MessageWithMap{NameMapping: map[int32]string{1: "Ken"}}, + &pb.MessageWithMap{NameMapping: map[int32]string{1: "Ken"}}, + true, + }, + { + "map different entry", + &pb.MessageWithMap{NameMapping: map[int32]string{1: "Ken"}}, + &pb.MessageWithMap{NameMapping: map[int32]string{2: "Rob"}}, + false, + }, + { + "map different key only", + &pb.MessageWithMap{NameMapping: map[int32]string{1: "Ken"}}, + &pb.MessageWithMap{NameMapping: map[int32]string{2: "Ken"}}, + false, + }, + { + "map different value only", + &pb.MessageWithMap{NameMapping: map[int32]string{1: "Ken"}}, + &pb.MessageWithMap{NameMapping: map[int32]string{1: "Rob"}}, + false, + }, + { + "oneof same", + &pb.Communique{Union: &pb.Communique_Number{Number: 41}}, + &pb.Communique{Union: &pb.Communique_Number{Number: 41}}, + true, + }, + { + "oneof one nil", + &pb.Communique{Union: &pb.Communique_Number{Number: 41}}, + &pb.Communique{}, + false, + }, + { + "oneof different", + &pb.Communique{Union: &pb.Communique_Number{Number: 41}}, + &pb.Communique{Union: &pb.Communique_Name{Name: "Bobby Tables"}}, + false, + }, } func TestEqual(t *testing.T) { diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/extensions.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/extensions.go index fa1b98450e619..9a6374fdbdec4 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/extensions.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/extensions.go @@ -37,6 +37,7 @@ package proto import ( "errors" + "fmt" "reflect" "strconv" "sync" @@ -310,7 +311,9 @@ func GetExtension(pb extendableProto, extension *ExtensionDesc) (interface{}, er emap := epb.ExtensionMap() e, ok := emap[extension.Field] if !ok { - return nil, ErrMissingExtension + // defaultExtensionValue returns the default value or + // ErrMissingExtension if there is no default. + return defaultExtensionValue(extension) } if e.value != nil { // Already decoded. Check the descriptor, though. @@ -355,10 +358,46 @@ func GetExtension(pb extendableProto, extension *ExtensionDesc) (interface{}, er } o += n + l } + return defaultExtensionValue(extension) } panic("unreachable") } +// defaultExtensionValue returns the default value for extension. +// If no default for an extension is defined ErrMissingExtension is returned. +func defaultExtensionValue(extension *ExtensionDesc) (interface{}, error) { + t := reflect.TypeOf(extension.ExtensionType) + props := extensionProperties(extension) + + sf, _, err := fieldDefault(t, props) + if err != nil { + return nil, err + } + + if sf == nil || sf.value == nil { + // There is no default value. + return nil, ErrMissingExtension + } + + if t.Kind() != reflect.Ptr { + // We do not need to return a Ptr, we can directly return sf.value. + return sf.value, nil + } + + // We need to return an interface{} that is a pointer to sf.value. + value := reflect.New(t).Elem() + value.Set(reflect.New(value.Type().Elem())) + if sf.kind == reflect.Int32 { + // We may have an int32 or an enum, but the underlying data is int32. + // Since we can't set an int32 into a non int32 reflect.value directly + // set it as a int32. + value.Elem().SetInt(int64(sf.value.(int32))) + } else { + value.Elem().Set(reflect.ValueOf(sf.value)) + } + return value.Interface(), nil +} + // decodeExtension decodes an extension encoded in b. func decodeExtension(b []byte, extension *ExtensionDesc) (interface{}, error) { o := NewBuffer(b) @@ -423,6 +462,14 @@ func SetExtension(pb extendableProto, extension *ExtensionDesc, value interface{ if typ != reflect.TypeOf(value) { return errors.New("proto: bad extension value type") } + // nil extension values need to be caught early, because the + // encoder can't distinguish an ErrNil due to a nil extension + // from an ErrNil due to a missing field. Extensions are + // always optional, so the encoder would just swallow the error + // and drop all the extensions from the encoded message. + if reflect.ValueOf(value).IsNil() { + return fmt.Errorf("proto: SetExtension called with nil value of type %T", value) + } return setExtension(pb, extension, value) } diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/extensions_test.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/extensions_test.go index 353f17dcfbfad..86e3006d73982 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/extensions_test.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/extensions_test.go @@ -32,10 +32,12 @@ package proto_test import ( + "fmt" + "reflect" "testing" - pb "./testdata" "github.com/gogo/protobuf/proto" + pb "github.com/gogo/protobuf/proto/testdata" ) func TestGetExtensionsWithMissingExtensions(t *testing.T) { @@ -92,3 +94,199 @@ func TestGetExtensionStability(t *testing.T) { t.Errorf("GetExtension() not stable after unmarshaling") } } + +func TestGetExtensionDefaults(t *testing.T) { + var setFloat64 float64 = 1 + var setFloat32 float32 = 2 + var setInt32 int32 = 3 + var setInt64 int64 = 4 + var setUint32 uint32 = 5 + var setUint64 uint64 = 6 + var setBool = true + var setBool2 = false + var setString = "Goodnight string" + var setBytes = []byte("Goodnight bytes") + var setEnum = pb.DefaultsMessage_TWO + + type testcase struct { + ext *proto.ExtensionDesc // Extension we are testing. + want interface{} // Expected value of extension, or nil (meaning that GetExtension will fail). + def interface{} // Expected value of extension after ClearExtension(). + } + tests := []testcase{ + {pb.E_NoDefaultDouble, setFloat64, nil}, + {pb.E_NoDefaultFloat, setFloat32, nil}, + {pb.E_NoDefaultInt32, setInt32, nil}, + {pb.E_NoDefaultInt64, setInt64, nil}, + {pb.E_NoDefaultUint32, setUint32, nil}, + {pb.E_NoDefaultUint64, setUint64, nil}, + {pb.E_NoDefaultSint32, setInt32, nil}, + {pb.E_NoDefaultSint64, setInt64, nil}, + {pb.E_NoDefaultFixed32, setUint32, nil}, + {pb.E_NoDefaultFixed64, setUint64, nil}, + {pb.E_NoDefaultSfixed32, setInt32, nil}, + {pb.E_NoDefaultSfixed64, setInt64, nil}, + {pb.E_NoDefaultBool, setBool, nil}, + {pb.E_NoDefaultBool, setBool2, nil}, + {pb.E_NoDefaultString, setString, nil}, + {pb.E_NoDefaultBytes, setBytes, nil}, + {pb.E_NoDefaultEnum, setEnum, nil}, + {pb.E_DefaultDouble, setFloat64, float64(3.1415)}, + {pb.E_DefaultFloat, setFloat32, float32(3.14)}, + {pb.E_DefaultInt32, setInt32, int32(42)}, + {pb.E_DefaultInt64, setInt64, int64(43)}, + {pb.E_DefaultUint32, setUint32, uint32(44)}, + {pb.E_DefaultUint64, setUint64, uint64(45)}, + {pb.E_DefaultSint32, setInt32, int32(46)}, + {pb.E_DefaultSint64, setInt64, int64(47)}, + {pb.E_DefaultFixed32, setUint32, uint32(48)}, + {pb.E_DefaultFixed64, setUint64, uint64(49)}, + {pb.E_DefaultSfixed32, setInt32, int32(50)}, + {pb.E_DefaultSfixed64, setInt64, int64(51)}, + {pb.E_DefaultBool, setBool, true}, + {pb.E_DefaultBool, setBool2, true}, + {pb.E_DefaultString, setString, "Hello, string"}, + {pb.E_DefaultBytes, setBytes, []byte("Hello, bytes")}, + {pb.E_DefaultEnum, setEnum, pb.DefaultsMessage_ONE}, + } + + checkVal := func(test testcase, msg *pb.DefaultsMessage, valWant interface{}) error { + val, err := proto.GetExtension(msg, test.ext) + if err != nil { + if valWant != nil { + return fmt.Errorf("GetExtension(): %s", err) + } + if want := proto.ErrMissingExtension; err != want { + return fmt.Errorf("Unexpected error: got %v, want %v", err, want) + } + return nil + } + + // All proto2 extension values are either a pointer to a value or a slice of values. + ty := reflect.TypeOf(val) + tyWant := reflect.TypeOf(test.ext.ExtensionType) + if got, want := ty, tyWant; got != want { + return fmt.Errorf("unexpected reflect.TypeOf(): got %v want %v", got, want) + } + tye := ty.Elem() + tyeWant := tyWant.Elem() + if got, want := tye, tyeWant; got != want { + return fmt.Errorf("unexpected reflect.TypeOf().Elem(): got %v want %v", got, want) + } + + // Check the name of the type of the value. + // If it is an enum it will be type int32 with the name of the enum. + if got, want := tye.Name(), tye.Name(); got != want { + return fmt.Errorf("unexpected reflect.TypeOf().Elem().Name(): got %v want %v", got, want) + } + + // Check that value is what we expect. + // If we have a pointer in val, get the value it points to. + valExp := val + if ty.Kind() == reflect.Ptr { + valExp = reflect.ValueOf(val).Elem().Interface() + } + if got, want := valExp, valWant; !reflect.DeepEqual(got, want) { + return fmt.Errorf("unexpected reflect.DeepEqual(): got %v want %v", got, want) + } + + return nil + } + + setTo := func(test testcase) interface{} { + setTo := reflect.ValueOf(test.want) + if typ := reflect.TypeOf(test.ext.ExtensionType); typ.Kind() == reflect.Ptr { + setTo = reflect.New(typ).Elem() + setTo.Set(reflect.New(setTo.Type().Elem())) + setTo.Elem().Set(reflect.ValueOf(test.want)) + } + return setTo.Interface() + } + + for _, test := range tests { + msg := &pb.DefaultsMessage{} + name := test.ext.Name + + // Check the initial value. + if err := checkVal(test, msg, test.def); err != nil { + t.Errorf("%s: %v", name, err) + } + + // Set the per-type value and check value. + name = fmt.Sprintf("%s (set to %T %v)", name, test.want, test.want) + if err := proto.SetExtension(msg, test.ext, setTo(test)); err != nil { + t.Errorf("%s: SetExtension(): %v", name, err) + continue + } + if err := checkVal(test, msg, test.want); err != nil { + t.Errorf("%s: %v", name, err) + continue + } + + // Set and check the value. + name += " (cleared)" + proto.ClearExtension(msg, test.ext) + if err := checkVal(test, msg, test.def); err != nil { + t.Errorf("%s: %v", name, err) + } + } +} + +func TestExtensionsRoundTrip(t *testing.T) { + msg := &pb.MyMessage{} + ext1 := &pb.Ext{ + Data: proto.String("hi"), + } + ext2 := &pb.Ext{ + Data: proto.String("there"), + } + exists := proto.HasExtension(msg, pb.E_Ext_More) + if exists { + t.Error("Extension More present unexpectedly") + } + if err := proto.SetExtension(msg, pb.E_Ext_More, ext1); err != nil { + t.Error(err) + } + if err := proto.SetExtension(msg, pb.E_Ext_More, ext2); err != nil { + t.Error(err) + } + e, err := proto.GetExtension(msg, pb.E_Ext_More) + if err != nil { + t.Error(err) + } + x, ok := e.(*pb.Ext) + if !ok { + t.Errorf("e has type %T, expected testdata.Ext", e) + } else if *x.Data != "there" { + t.Errorf("SetExtension failed to overwrite, got %+v, not 'there'", x) + } + proto.ClearExtension(msg, pb.E_Ext_More) + if _, err = proto.GetExtension(msg, pb.E_Ext_More); err != proto.ErrMissingExtension { + t.Errorf("got %v, expected ErrMissingExtension", e) + } + if _, err := proto.GetExtension(msg, pb.E_X215); err == nil { + t.Error("expected bad extension error, got nil") + } + if err := proto.SetExtension(msg, pb.E_X215, 12); err == nil { + t.Error("expected extension err") + } + if err := proto.SetExtension(msg, pb.E_Ext_More, 12); err == nil { + t.Error("expected some sort of type mismatch error, got nil") + } +} + +func TestNilExtension(t *testing.T) { + msg := &pb.MyMessage{ + Count: proto.Int32(1), + } + if err := proto.SetExtension(msg, pb.E_Ext_Text, proto.String("hello")); err != nil { + t.Fatal(err) + } + if err := proto.SetExtension(msg, pb.E_Ext_More, (*pb.Ext)(nil)); err == nil { + t.Error("expected SetExtension to fail due to a nil extension") + } else if want := "proto: SetExtension called with nil value of type *testdata.Ext"; err.Error() != want { + t.Errorf("expected error %v, got %v", want, err) + } + // Note: if the behavior of Marshal is ever changed to ignore nil extensions, update + // this test to verify that E_Ext_Text is properly propagated through marshal->unmarshal. +} diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/lib.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/lib.go index 11dfccf6ec786..b964734c7728f 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/lib.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/lib.go @@ -30,171 +30,230 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* - Package proto converts data structures to and from the wire format of - protocol buffers. It works in concert with the Go source code generated - for .proto files by the protocol compiler. - - A summary of the properties of the protocol buffer interface - for a protocol buffer variable v: - - - Names are turned from camel_case to CamelCase for export. - - There are no methods on v to set fields; just treat - them as structure fields. - - There are getters that return a field's value if set, - and return the field's default value if unset. - The getters work even if the receiver is a nil message. - - The zero value for a struct is its correct initialization state. - All desired fields must be set before marshaling. - - A Reset() method will restore a protobuf struct to its zero state. - - Non-repeated fields are pointers to the values; nil means unset. - That is, optional or required field int32 f becomes F *int32. - - Repeated fields are slices. - - Helper functions are available to aid the setting of fields. - Helpers for getting values are superseded by the - GetFoo methods and their use is deprecated. - msg.Foo = proto.String("hello") // set field - - Constants are defined to hold the default values of all fields that - have them. They have the form Default_StructName_FieldName. - Because the getter methods handle defaulted values, - direct use of these constants should be rare. - - Enums are given type names and maps from names to values. - Enum values are prefixed with the enum's type name. Enum types have - a String method, and a Enum method to assist in message construction. - - Nested groups and enums have type names prefixed with the name of - the surrounding message type. - - Extensions are given descriptor names that start with E_, - followed by an underscore-delimited list of the nested messages - that contain it (if any) followed by the CamelCased name of the - extension field itself. HasExtension, ClearExtension, GetExtension - and SetExtension are functions for manipulating extensions. - - Marshal and Unmarshal are functions to encode and decode the wire format. - - The simplest way to describe this is to see an example. - Given file test.proto, containing - - package example; - - enum FOO { X = 17; }; - - message Test { - required string label = 1; - optional int32 type = 2 [default=77]; - repeated int64 reps = 3; - optional group OptionalGroup = 4 { - required string RequiredField = 5; - } - } - - The resulting file, test.pb.go, is: - - package example - - import "github.com/gogo/protobuf/proto" - - type FOO int32 - const ( - FOO_X FOO = 17 - ) - var FOO_name = map[int32]string{ - 17: "X", - } - var FOO_value = map[string]int32{ - "X": 17, - } - - func (x FOO) Enum() *FOO { - p := new(FOO) - *p = x - return p - } - func (x FOO) String() string { - return proto.EnumName(FOO_name, int32(x)) - } - - type Test struct { - Label *string `protobuf:"bytes,1,req,name=label" json:"label,omitempty"` - Type *int32 `protobuf:"varint,2,opt,name=type,def=77" json:"type,omitempty"` - Reps []int64 `protobuf:"varint,3,rep,name=reps" json:"reps,omitempty"` - Optionalgroup *Test_OptionalGroup `protobuf:"group,4,opt,name=OptionalGroup" json:"optionalgroup,omitempty"` - XXX_unrecognized []byte `json:"-"` - } - func (this *Test) Reset() { *this = Test{} } - func (this *Test) String() string { return proto.CompactTextString(this) } - const Default_Test_Type int32 = 77 - - func (this *Test) GetLabel() string { - if this != nil && this.Label != nil { - return *this.Label - } - return "" +Package proto converts data structures to and from the wire format of +protocol buffers. It works in concert with the Go source code generated +for .proto files by the protocol compiler. + +A summary of the properties of the protocol buffer interface +for a protocol buffer variable v: + + - Names are turned from camel_case to CamelCase for export. + - There are no methods on v to set fields; just treat + them as structure fields. + - There are getters that return a field's value if set, + and return the field's default value if unset. + The getters work even if the receiver is a nil message. + - The zero value for a struct is its correct initialization state. + All desired fields must be set before marshaling. + - A Reset() method will restore a protobuf struct to its zero state. + - Non-repeated fields are pointers to the values; nil means unset. + That is, optional or required field int32 f becomes F *int32. + - Repeated fields are slices. + - Helper functions are available to aid the setting of fields. + msg.Foo = proto.String("hello") // set field + - Constants are defined to hold the default values of all fields that + have them. They have the form Default_StructName_FieldName. + Because the getter methods handle defaulted values, + direct use of these constants should be rare. + - Enums are given type names and maps from names to values. + Enum values are prefixed by the enclosing message's name, or by the + enum's type name if it is a top-level enum. Enum types have a String + method, and a Enum method to assist in message construction. + - Nested messages, groups and enums have type names prefixed with the name of + the surrounding message type. + - Extensions are given descriptor names that start with E_, + followed by an underscore-delimited list of the nested messages + that contain it (if any) followed by the CamelCased name of the + extension field itself. HasExtension, ClearExtension, GetExtension + and SetExtension are functions for manipulating extensions. + - Oneof field sets are given a single field in their message, + with distinguished wrapper types for each possible field value. + - Marshal and Unmarshal are functions to encode and decode the wire format. + +The simplest way to describe this is to see an example. +Given file test.proto, containing + + package example; + + enum FOO { X = 17; } + + message Test { + required string label = 1; + optional int32 type = 2 [default=77]; + repeated int64 reps = 3; + optional group OptionalGroup = 4 { + required string RequiredField = 5; + } + oneof union { + int32 number = 6; + string name = 7; + } + } + +The resulting file, test.pb.go, is: + + package example + + import proto "github.com/gogo/protobuf/proto" + import math "math" + + type FOO int32 + const ( + FOO_X FOO = 17 + ) + var FOO_name = map[int32]string{ + 17: "X", + } + var FOO_value = map[string]int32{ + "X": 17, + } + + func (x FOO) Enum() *FOO { + p := new(FOO) + *p = x + return p + } + func (x FOO) String() string { + return proto.EnumName(FOO_name, int32(x)) + } + func (x *FOO) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(FOO_value, data) + if err != nil { + return err } + *x = FOO(value) + return nil + } - func (this *Test) GetType() int32 { - if this != nil && this.Type != nil { - return *this.Type - } - return Default_Test_Type + type Test struct { + Label *string `protobuf:"bytes,1,req,name=label" json:"label,omitempty"` + Type *int32 `protobuf:"varint,2,opt,name=type,def=77" json:"type,omitempty"` + Reps []int64 `protobuf:"varint,3,rep,name=reps" json:"reps,omitempty"` + Optionalgroup *Test_OptionalGroup `protobuf:"group,4,opt,name=OptionalGroup" json:"optionalgroup,omitempty"` + // Types that are valid to be assigned to Union: + // *Test_Number + // *Test_Name + Union isTest_Union `protobuf_oneof:"union"` + XXX_unrecognized []byte `json:"-"` + } + func (m *Test) Reset() { *m = Test{} } + func (m *Test) String() string { return proto.CompactTextString(m) } + func (*Test) ProtoMessage() {} + + type isTest_Union interface { + isTest_Union() + } + + type Test_Number struct { + Number int32 `protobuf:"varint,6,opt,name=number"` + } + type Test_Name struct { + Name string `protobuf:"bytes,7,opt,name=name"` + } + + func (*Test_Number) isTest_Union() {} + func (*Test_Name) isTest_Union() {} + + func (m *Test) GetUnion() isTest_Union { + if m != nil { + return m.Union } + return nil + } + const Default_Test_Type int32 = 77 - func (this *Test) GetOptionalgroup() *Test_OptionalGroup { - if this != nil { - return this.Optionalgroup - } - return nil + func (m *Test) GetLabel() string { + if m != nil && m.Label != nil { + return *m.Label } + return "" + } - type Test_OptionalGroup struct { - RequiredField *string `protobuf:"bytes,5,req" json:"RequiredField,omitempty"` - XXX_unrecognized []byte `json:"-"` + func (m *Test) GetType() int32 { + if m != nil && m.Type != nil { + return *m.Type } - func (this *Test_OptionalGroup) Reset() { *this = Test_OptionalGroup{} } - func (this *Test_OptionalGroup) String() string { return proto.CompactTextString(this) } + return Default_Test_Type + } - func (this *Test_OptionalGroup) GetRequiredField() string { - if this != nil && this.RequiredField != nil { - return *this.RequiredField - } - return "" + func (m *Test) GetOptionalgroup() *Test_OptionalGroup { + if m != nil { + return m.Optionalgroup } + return nil + } + + type Test_OptionalGroup struct { + RequiredField *string `protobuf:"bytes,5,req" json:"RequiredField,omitempty"` + } + func (m *Test_OptionalGroup) Reset() { *m = Test_OptionalGroup{} } + func (m *Test_OptionalGroup) String() string { return proto.CompactTextString(m) } - func init() { - proto.RegisterEnum("example.FOO", FOO_name, FOO_value) + func (m *Test_OptionalGroup) GetRequiredField() string { + if m != nil && m.RequiredField != nil { + return *m.RequiredField } + return "" + } - To create and play with a Test object: + func (m *Test) GetNumber() int32 { + if x, ok := m.GetUnion().(*Test_Number); ok { + return x.Number + } + return 0 + } - package main + func (m *Test) GetName() string { + if x, ok := m.GetUnion().(*Test_Name); ok { + return x.Name + } + return "" + } - import ( - "log" + func init() { + proto.RegisterEnum("example.FOO", FOO_name, FOO_value) + } - "github.com/gogo/protobuf/proto" - "./example.pb" - ) +To create and play with a Test object: - func main() { - test := &example.Test{ - Label: proto.String("hello"), - Type: proto.Int32(17), - Optionalgroup: &example.Test_OptionalGroup{ - RequiredField: proto.String("good bye"), - }, - } - data, err := proto.Marshal(test) - if err != nil { - log.Fatal("marshaling error: ", err) - } - newTest := new(example.Test) - err = proto.Unmarshal(data, newTest) - if err != nil { - log.Fatal("unmarshaling error: ", err) - } - // Now test and newTest contain the same data. - if test.GetLabel() != newTest.GetLabel() { - log.Fatalf("data mismatch %q != %q", test.GetLabel(), newTest.GetLabel()) - } - // etc. +package main + + import ( + "log" + + "github.com/gogo/protobuf/proto" + pb "./example.pb" + ) + + func main() { + test := &pb.Test{ + Label: proto.String("hello"), + Type: proto.Int32(17), + Optionalgroup: &pb.Test_OptionalGroup{ + RequiredField: proto.String("good bye"), + }, + Union: &pb.Test_Name{"fred"}, + } + data, err := proto.Marshal(test) + if err != nil { + log.Fatal("marshaling error: ", err) + } + newTest := &pb.Test{} + err = proto.Unmarshal(data, newTest) + if err != nil { + log.Fatal("unmarshaling error: ", err) } + // Now test and newTest contain the same data. + if test.GetLabel() != newTest.GetLabel() { + log.Fatalf("data mismatch %q != %q", test.GetLabel(), newTest.GetLabel()) + } + // Use a type switch to determine which oneof was set. + switch u := test.Union.(type) { + case *pb.Test_Number: // u.Number contains the number. + case *pb.Test_Name: // u.Name contains the string. + } + // etc. + } */ package proto @@ -203,6 +262,7 @@ import ( "fmt" "log" "reflect" + "sort" "strconv" "sync" ) @@ -323,9 +383,7 @@ func Float64(v float64) *float64 { // Uint32 is a helper routine that allocates a new uint32 value // to store v and returns a pointer to it. func Uint32(v uint32) *uint32 { - p := new(uint32) - *p = v - return p + return &v } // Uint64 is a helper routine that allocates a new uint64 value @@ -379,13 +437,13 @@ func UnmarshalJSONEnum(m map[string]int32, data []byte, enumName string) (int32, // DebugPrint dumps the encoded data in b in a debugging format with a header // including the string s. Used in testing but made available for general debugging. -func (o *Buffer) DebugPrint(s string, b []byte) { +func (p *Buffer) DebugPrint(s string, b []byte) { var u uint64 - obuf := o.buf - index := o.index - o.buf = b - o.index = 0 + obuf := p.buf + index := p.index + p.buf = b + p.index = 0 depth := 0 fmt.Printf("\n--- %s ---\n", s) @@ -396,12 +454,12 @@ out: fmt.Print(" ") } - index := o.index - if index == len(o.buf) { + index := p.index + if index == len(p.buf) { break } - op, err := o.DecodeVarint() + op, err := p.DecodeVarint() if err != nil { fmt.Printf("%3d: fetching op err %v\n", index, err) break out @@ -418,7 +476,7 @@ out: case WireBytes: var r []byte - r, err = o.DecodeRawBytes(false) + r, err = p.DecodeRawBytes(false) if err != nil { break out } @@ -439,7 +497,7 @@ out: fmt.Printf("\n") case WireFixed32: - u, err = o.DecodeFixed32() + u, err = p.DecodeFixed32() if err != nil { fmt.Printf("%3d: t=%3d fix32 err %v\n", index, tag, err) break out @@ -447,16 +505,15 @@ out: fmt.Printf("%3d: t=%3d fix32 %d\n", index, tag, u) case WireFixed64: - u, err = o.DecodeFixed64() + u, err = p.DecodeFixed64() if err != nil { fmt.Printf("%3d: t=%3d fix64 err %v\n", index, tag, err) break out } fmt.Printf("%3d: t=%3d fix64 %d\n", index, tag, u) - break case WireVarint: - u, err = o.DecodeVarint() + u, err = p.DecodeVarint() if err != nil { fmt.Printf("%3d: t=%3d varint err %v\n", index, tag, err) break out @@ -464,30 +521,22 @@ out: fmt.Printf("%3d: t=%3d varint %d\n", index, tag, u) case WireStartGroup: - if err != nil { - fmt.Printf("%3d: t=%3d start err %v\n", index, tag, err) - break out - } fmt.Printf("%3d: t=%3d start\n", index, tag) depth++ case WireEndGroup: depth-- - if err != nil { - fmt.Printf("%3d: t=%3d end err %v\n", index, tag, err) - break out - } fmt.Printf("%3d: t=%3d end\n", index, tag) } } if depth != 0 { - fmt.Printf("%3d: start-end not balanced %d\n", o.index, depth) + fmt.Printf("%3d: start-end not balanced %d\n", p.index, depth) } fmt.Printf("\n") - o.buf = obuf - o.index = index + p.buf = obuf + p.index = index } // SetDefaults sets unset protocol buffer fields to their default values. @@ -601,13 +650,15 @@ func setDefaults(v reflect.Value, recur, zeros bool) { for _, ni := range dm.nested { f := v.Field(ni) - if f.IsNil() { - continue - } - // f is *T or []*T - if f.Kind() == reflect.Ptr { + // f is *T or []*T or map[T]*T + switch f.Kind() { + case reflect.Ptr: + if f.IsNil() { + continue + } setDefaults(f, recur, zeros) - } else { + + case reflect.Slice: for i := 0; i < f.Len(); i++ { e := f.Index(i) if e.IsNil() { @@ -615,6 +666,15 @@ func setDefaults(v reflect.Value, recur, zeros bool) { } setDefaults(e, recur, zeros) } + + case reflect.Map: + for _, k := range f.MapKeys() { + e := f.MapIndex(k) + if e.IsNil() { + continue + } + setDefaults(e, recur, zeros) + } } } } @@ -640,10 +700,6 @@ type scalarField struct { value interface{} // the proto-declared default value, or nil } -func ptrToStruct(t reflect.Type) bool { - return t.Kind() == reflect.Ptr && t.Elem().Kind() == reflect.Struct -} - // t is a struct type. func buildDefaultMessage(t reflect.Type) (dm defaultMessage) { sprop := GetProperties(t) @@ -655,86 +711,173 @@ func buildDefaultMessage(t reflect.Type) (dm defaultMessage) { } ft := t.Field(fi).Type - // nested messages - if ptrToStruct(ft) || (ft.Kind() == reflect.Slice && ptrToStruct(ft.Elem())) { + sf, nested, err := fieldDefault(ft, prop) + switch { + case err != nil: + log.Print(err) + case nested: dm.nested = append(dm.nested, fi) - continue + case sf != nil: + sf.index = fi + dm.scalars = append(dm.scalars, *sf) } + } - sf := scalarField{ - index: fi, - kind: ft.Elem().Kind(), - } + return dm +} - // scalar fields without defaults - if !prop.HasDefault { - dm.scalars = append(dm.scalars, sf) - continue +// fieldDefault returns the scalarField for field type ft. +// sf will be nil if the field can not have a default. +// nestedMessage will be true if this is a nested message. +// Note that sf.index is not set on return. +func fieldDefault(ft reflect.Type, prop *Properties) (sf *scalarField, nestedMessage bool, err error) { + var canHaveDefault bool + switch ft.Kind() { + case reflect.Ptr: + if ft.Elem().Kind() == reflect.Struct { + nestedMessage = true + } else { + canHaveDefault = true // proto2 scalar field } - // a scalar field: either *T or []byte + case reflect.Slice: switch ft.Elem().Kind() { - case reflect.Bool: - x, err := strconv.ParseBool(prop.Default) - if err != nil { - log.Printf("proto: bad default bool %q: %v", prop.Default, err) - continue - } - sf.value = x - case reflect.Float32: - x, err := strconv.ParseFloat(prop.Default, 32) - if err != nil { - log.Printf("proto: bad default float32 %q: %v", prop.Default, err) - continue - } - sf.value = float32(x) - case reflect.Float64: - x, err := strconv.ParseFloat(prop.Default, 64) - if err != nil { - log.Printf("proto: bad default float64 %q: %v", prop.Default, err) - continue - } - sf.value = x - case reflect.Int32: - x, err := strconv.ParseInt(prop.Default, 10, 32) - if err != nil { - log.Printf("proto: bad default int32 %q: %v", prop.Default, err) - continue - } - sf.value = int32(x) - case reflect.Int64: - x, err := strconv.ParseInt(prop.Default, 10, 64) - if err != nil { - log.Printf("proto: bad default int64 %q: %v", prop.Default, err) - continue - } - sf.value = x - case reflect.String: - sf.value = prop.Default + case reflect.Ptr: + nestedMessage = true // repeated message case reflect.Uint8: - // []byte (not *uint8) - sf.value = []byte(prop.Default) - case reflect.Uint32: - x, err := strconv.ParseUint(prop.Default, 10, 32) - if err != nil { - log.Printf("proto: bad default uint32 %q: %v", prop.Default, err) - continue - } - sf.value = uint32(x) - case reflect.Uint64: - x, err := strconv.ParseUint(prop.Default, 10, 64) - if err != nil { - log.Printf("proto: bad default uint64 %q: %v", prop.Default, err) - continue - } - sf.value = x - default: - log.Printf("proto: unhandled def kind %v", ft.Elem().Kind()) - continue + canHaveDefault = true // bytes field + } + + case reflect.Map: + if ft.Elem().Kind() == reflect.Ptr { + nestedMessage = true // map with message values } + } - dm.scalars = append(dm.scalars, sf) + if !canHaveDefault { + if nestedMessage { + return nil, true, nil + } + return nil, false, nil } - return dm + // We now know that ft is a pointer or slice. + sf = &scalarField{kind: ft.Elem().Kind()} + + // scalar fields without defaults + if !prop.HasDefault { + return sf, false, nil + } + + // a scalar field: either *T or []byte + switch ft.Elem().Kind() { + case reflect.Bool: + x, err := strconv.ParseBool(prop.Default) + if err != nil { + return nil, false, fmt.Errorf("proto: bad default bool %q: %v", prop.Default, err) + } + sf.value = x + case reflect.Float32: + x, err := strconv.ParseFloat(prop.Default, 32) + if err != nil { + return nil, false, fmt.Errorf("proto: bad default float32 %q: %v", prop.Default, err) + } + sf.value = float32(x) + case reflect.Float64: + x, err := strconv.ParseFloat(prop.Default, 64) + if err != nil { + return nil, false, fmt.Errorf("proto: bad default float64 %q: %v", prop.Default, err) + } + sf.value = x + case reflect.Int32: + x, err := strconv.ParseInt(prop.Default, 10, 32) + if err != nil { + return nil, false, fmt.Errorf("proto: bad default int32 %q: %v", prop.Default, err) + } + sf.value = int32(x) + case reflect.Int64: + x, err := strconv.ParseInt(prop.Default, 10, 64) + if err != nil { + return nil, false, fmt.Errorf("proto: bad default int64 %q: %v", prop.Default, err) + } + sf.value = x + case reflect.String: + sf.value = prop.Default + case reflect.Uint8: + // []byte (not *uint8) + sf.value = []byte(prop.Default) + case reflect.Uint32: + x, err := strconv.ParseUint(prop.Default, 10, 32) + if err != nil { + return nil, false, fmt.Errorf("proto: bad default uint32 %q: %v", prop.Default, err) + } + sf.value = uint32(x) + case reflect.Uint64: + x, err := strconv.ParseUint(prop.Default, 10, 64) + if err != nil { + return nil, false, fmt.Errorf("proto: bad default uint64 %q: %v", prop.Default, err) + } + sf.value = x + default: + return nil, false, fmt.Errorf("proto: unhandled def kind %v", ft.Elem().Kind()) + } + + return sf, false, nil +} + +// Map fields may have key types of non-float scalars, strings and enums. +// The easiest way to sort them in some deterministic order is to use fmt. +// If this turns out to be inefficient we can always consider other options, +// such as doing a Schwartzian transform. + +func mapKeys(vs []reflect.Value) sort.Interface { + s := mapKeySorter{ + vs: vs, + // default Less function: textual comparison + less: func(a, b reflect.Value) bool { + return fmt.Sprint(a.Interface()) < fmt.Sprint(b.Interface()) + }, + } + + // Type specialization per https://developers.google.com/protocol-buffers/docs/proto#maps; + // numeric keys are sorted numerically. + if len(vs) == 0 { + return s + } + switch vs[0].Kind() { + case reflect.Int32, reflect.Int64: + s.less = func(a, b reflect.Value) bool { return a.Int() < b.Int() } + case reflect.Uint32, reflect.Uint64: + s.less = func(a, b reflect.Value) bool { return a.Uint() < b.Uint() } + } + + return s +} + +type mapKeySorter struct { + vs []reflect.Value + less func(a, b reflect.Value) bool +} + +func (s mapKeySorter) Len() int { return len(s.vs) } +func (s mapKeySorter) Swap(i, j int) { s.vs[i], s.vs[j] = s.vs[j], s.vs[i] } +func (s mapKeySorter) Less(i, j int) bool { + return s.less(s.vs[i], s.vs[j]) +} + +// isProto3Zero reports whether v is a zero proto3 value. +func isProto3Zero(v reflect.Value) bool { + switch v.Kind() { + case reflect.Bool: + return !v.Bool() + case reflect.Int32, reflect.Int64: + return v.Int() == 0 + case reflect.Uint32, reflect.Uint64: + return v.Uint() == 0 + case reflect.Float32, reflect.Float64: + return v.Float() == 0 + case reflect.String: + return v.String() == "" + } + return false } diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/pointer_reflect.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/pointer_reflect.go index 0c53417f05f40..749919d250a1a 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/pointer_reflect.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/pointer_reflect.go @@ -29,7 +29,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// +build appengine,!appenginevm +// +build appengine // This file contains an implementation of proto field accesses using package reflect. // It is slower than the code in pointer_unsafe.go but it avoids package unsafe and can @@ -114,6 +114,11 @@ func structPointer_Bool(p structPointer, f field) **bool { return structPointer_ifield(p, f).(**bool) } +// BoolVal returns the address of a bool field in the struct. +func structPointer_BoolVal(p structPointer, f field) *bool { + return structPointer_ifield(p, f).(*bool) +} + // BoolSlice returns the address of a []bool field in the struct. func structPointer_BoolSlice(p structPointer, f field) *[]bool { return structPointer_ifield(p, f).(*[]bool) @@ -124,6 +129,11 @@ func structPointer_String(p structPointer, f field) **string { return structPointer_ifield(p, f).(**string) } +// StringVal returns the address of a string field in the struct. +func structPointer_StringVal(p structPointer, f field) *string { + return structPointer_ifield(p, f).(*string) +} + // StringSlice returns the address of a []string field in the struct. func structPointer_StringSlice(p structPointer, f field) *[]string { return structPointer_ifield(p, f).(*[]string) @@ -134,6 +144,11 @@ func structPointer_ExtMap(p structPointer, f field) *map[int32]Extension { return structPointer_ifield(p, f).(*map[int32]Extension) } +// NewAt returns the reflect.Value for a pointer to a field in the struct. +func structPointer_NewAt(p structPointer, f field, typ reflect.Type) reflect.Value { + return structPointer_field(p, f).Addr() +} + // SetStructPointer writes a *struct field in the struct. func structPointer_SetStructPointer(p structPointer, f field, q structPointer) { structPointer_field(p, f).Set(q.v) @@ -235,6 +250,49 @@ func structPointer_Word32(p structPointer, f field) word32 { return word32{structPointer_field(p, f)} } +// A word32Val represents a field of type int32, uint32, float32, or enum. +// That is, v.Type() is int32, uint32, float32, or enum and v is assignable. +type word32Val struct { + v reflect.Value +} + +// Set sets *p to x. +func word32Val_Set(p word32Val, x uint32) { + switch p.v.Type() { + case int32Type: + p.v.SetInt(int64(x)) + return + case uint32Type: + p.v.SetUint(uint64(x)) + return + case float32Type: + p.v.SetFloat(float64(math.Float32frombits(x))) + return + } + + // must be enum + p.v.SetInt(int64(int32(x))) +} + +// Get gets the bits pointed at by p, as a uint32. +func word32Val_Get(p word32Val) uint32 { + elem := p.v + switch elem.Kind() { + case reflect.Int32: + return uint32(elem.Int()) + case reflect.Uint32: + return uint32(elem.Uint()) + case reflect.Float32: + return math.Float32bits(float32(elem.Float())) + } + panic("unreachable") +} + +// Word32Val returns a reference to a int32, uint32, float32, or enum field in the struct. +func structPointer_Word32Val(p structPointer, f field) word32Val { + return word32Val{structPointer_field(p, f)} +} + // A word32Slice is a slice of 32-bit values. // That is, v.Type() is []int32, []uint32, []float32, or []enum. type word32Slice struct { @@ -339,6 +397,43 @@ func structPointer_Word64(p structPointer, f field) word64 { return word64{structPointer_field(p, f)} } +// word64Val is like word32Val but for 64-bit values. +type word64Val struct { + v reflect.Value +} + +func word64Val_Set(p word64Val, o *Buffer, x uint64) { + switch p.v.Type() { + case int64Type: + p.v.SetInt(int64(x)) + return + case uint64Type: + p.v.SetUint(x) + return + case float64Type: + p.v.SetFloat(math.Float64frombits(x)) + return + } + panic("unreachable") +} + +func word64Val_Get(p word64Val) uint64 { + elem := p.v + switch elem.Kind() { + case reflect.Int64: + return uint64(elem.Int()) + case reflect.Uint64: + return elem.Uint() + case reflect.Float64: + return math.Float64bits(elem.Float()) + } + panic("unreachable") +} + +func structPointer_Word64Val(p structPointer, f field) word64Val { + return word64Val{structPointer_field(p, f)} +} + type word64Slice struct { v reflect.Value } diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/pointer_unsafe.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/pointer_unsafe.go index 7f3473e2f354b..e9be0fe92ee70 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/pointer_unsafe.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/pointer_unsafe.go @@ -29,7 +29,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// +build !appengine appenginevm +// +build !appengine // This file contains the implementation of the proto field accesses using package unsafe. @@ -100,6 +100,11 @@ func structPointer_Bool(p structPointer, f field) **bool { return (**bool)(unsafe.Pointer(uintptr(p) + uintptr(f))) } +// BoolVal returns the address of a bool field in the struct. +func structPointer_BoolVal(p structPointer, f field) *bool { + return (*bool)(unsafe.Pointer(uintptr(p) + uintptr(f))) +} + // BoolSlice returns the address of a []bool field in the struct. func structPointer_BoolSlice(p structPointer, f field) *[]bool { return (*[]bool)(unsafe.Pointer(uintptr(p) + uintptr(f))) @@ -110,6 +115,11 @@ func structPointer_String(p structPointer, f field) **string { return (**string)(unsafe.Pointer(uintptr(p) + uintptr(f))) } +// StringVal returns the address of a string field in the struct. +func structPointer_StringVal(p structPointer, f field) *string { + return (*string)(unsafe.Pointer(uintptr(p) + uintptr(f))) +} + // StringSlice returns the address of a []string field in the struct. func structPointer_StringSlice(p structPointer, f field) *[]string { return (*[]string)(unsafe.Pointer(uintptr(p) + uintptr(f))) @@ -120,6 +130,11 @@ func structPointer_ExtMap(p structPointer, f field) *map[int32]Extension { return (*map[int32]Extension)(unsafe.Pointer(uintptr(p) + uintptr(f))) } +// NewAt returns the reflect.Value for a pointer to a field in the struct. +func structPointer_NewAt(p structPointer, f field, typ reflect.Type) reflect.Value { + return reflect.NewAt(typ, unsafe.Pointer(uintptr(p)+uintptr(f))) +} + // SetStructPointer writes a *struct field in the struct. func structPointer_SetStructPointer(p structPointer, f field, q structPointer) { *(*structPointer)(unsafe.Pointer(uintptr(p) + uintptr(f))) = q @@ -170,6 +185,24 @@ func structPointer_Word32(p structPointer, f field) word32 { return word32((**uint32)(unsafe.Pointer(uintptr(p) + uintptr(f)))) } +// A word32Val is the address of a 32-bit value field. +type word32Val *uint32 + +// Set sets *p to x. +func word32Val_Set(p word32Val, x uint32) { + *p = x +} + +// Get gets the value pointed at by p. +func word32Val_Get(p word32Val) uint32 { + return *p +} + +// Word32Val returns the address of a *int32, *uint32, *float32, or *enum field in the struct. +func structPointer_Word32Val(p structPointer, f field) word32Val { + return word32Val((*uint32)(unsafe.Pointer(uintptr(p) + uintptr(f)))) +} + // A word32Slice is a slice of 32-bit values. type word32Slice []uint32 @@ -206,6 +239,21 @@ func structPointer_Word64(p structPointer, f field) word64 { return word64((**uint64)(unsafe.Pointer(uintptr(p) + uintptr(f)))) } +// word64Val is like word32Val but for 64-bit values. +type word64Val *uint64 + +func word64Val_Set(p word64Val, o *Buffer, x uint64) { + *p = x +} + +func word64Val_Get(p word64Val) uint64 { + return *p +} + +func structPointer_Word64Val(p structPointer, f field) word64Val { + return word64Val((*uint64)(unsafe.Pointer(uintptr(p) + uintptr(f)))) +} + // word64Slice is like word32Slice but for 64-bit values. type word64Slice []uint64 diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/pointer_unsafe_gogo.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/pointer_unsafe_gogo.go index 797a6118f6df9..6bc85fa9873f4 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/pointer_unsafe_gogo.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/pointer_unsafe_gogo.go @@ -87,16 +87,6 @@ func appendStructPointer(base structPointer, f field, typ reflect.Type) structPo return structPointer(unsafe.Pointer(uintptr(unsafe.Pointer(bas)) + uintptr(uintptr(newLen-1)*size))) } -// RefBool returns a *bool field in the struct. -func structPointer_RefBool(p structPointer, f field) *bool { - return (*bool)(unsafe.Pointer(uintptr(p) + uintptr(f))) -} - -// RefString returns the address of a string field in the struct. -func structPointer_RefString(p structPointer, f field) *string { - return (*string)(unsafe.Pointer(uintptr(p) + uintptr(f))) -} - func structPointer_FieldPointer(p structPointer, f field) structPointer { return structPointer(unsafe.Pointer(uintptr(p) + uintptr(f))) } @@ -116,51 +106,3 @@ func structPointer_Add(p structPointer, size field) structPointer { func structPointer_Len(p structPointer, f field) int { return len(*(*[]interface{})(unsafe.Pointer(structPointer_GetRefStructPointer(p, f)))) } - -// refWord32 is the address of a 32-bit value field. -type refWord32 *uint32 - -func refWord32_IsNil(p refWord32) bool { - return p == nil -} - -func refWord32_Set(p refWord32, o *Buffer, x uint32) { - if len(o.uint32s) == 0 { - o.uint32s = make([]uint32, uint32PoolSize) - } - o.uint32s[0] = x - *p = o.uint32s[0] - o.uint32s = o.uint32s[1:] -} - -func refWord32_Get(p refWord32) uint32 { - return *p -} - -func structPointer_RefWord32(p structPointer, f field) refWord32 { - return refWord32((*uint32)(unsafe.Pointer(uintptr(p) + uintptr(f)))) -} - -// refWord64 is like refWord32 but for 32-bit values. -type refWord64 *uint64 - -func refWord64_Set(p refWord64, o *Buffer, x uint64) { - if len(o.uint64s) == 0 { - o.uint64s = make([]uint64, uint64PoolSize) - } - o.uint64s[0] = x - *p = o.uint64s[0] - o.uint64s = o.uint64s[1:] -} - -func refWord64_IsNil(p refWord64) bool { - return p == nil -} - -func refWord64_Get(p refWord64) uint64 { - return *p -} - -func structPointer_RefWord64(p structPointer, f field) refWord64 { - return refWord64((*uint64)(unsafe.Pointer(uintptr(p) + uintptr(f)))) -} diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/properties.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/properties.go index f5a2a8b0bc35e..1bb17a26abb14 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/properties.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/properties.go @@ -89,6 +89,12 @@ type decoder func(p *Buffer, prop *Properties, base structPointer) error // A valueDecoder decodes a single integer in a particular encoding. type valueDecoder func(o *Buffer) (x uint64, err error) +// A oneofMarshaler does the marshaling for all oneof fields in a message. +type oneofMarshaler func(Message, *Buffer) error + +// A oneofUnmarshaler does the unmarshaling for a oneof field in a message. +type oneofUnmarshaler func(Message, int, int, *Buffer) (bool, error) + // tagMap is an optimization over map[int]int for typical protocol buffer // use-cases. Encoded protocol buffers are often in tag order with small tag // numbers. @@ -137,6 +143,21 @@ type StructProperties struct { order []int // list of struct field numbers in tag order unrecField field // field id of the XXX_unrecognized []byte field extendable bool // is this an extendable proto + + oneofMarshaler oneofMarshaler + oneofUnmarshaler oneofUnmarshaler + stype reflect.Type + + // OneofTypes contains information about the oneof fields in this message. + // It is keyed by the original name of a field. + OneofTypes map[string]*OneofProperties +} + +// OneofProperties represents information about a specific field in a oneof. +type OneofProperties struct { + Type reflect.Type // pointer to generated struct type for this oneof field + Field int // struct field number of the containing oneof in the message + Prop *Properties } // Implement the sorting interface so we can sort the fields in tag order, as recommended by the spec. @@ -160,6 +181,8 @@ type Properties struct { Repeated bool Packed bool // relevant for repeated primitives only Enum string // set for enum types only + proto3 bool // whether this is known to be a proto3 field; set for []byte only + oneof bool // whether this is a oneof field Default string // default value HasDefault bool // whether an explicit default was provided @@ -178,6 +201,10 @@ type Properties struct { isMarshaler bool isUnmarshaler bool + mtype reflect.Type // set for map types only + mkeyprop *Properties // set for map types only + mvalprop *Properties // set for map types only + size sizer valSize valueSizer // set for bool and numeric types only @@ -208,6 +235,12 @@ func (p *Properties) String() string { if p.OrigName != p.Name { s += ",name=" + p.OrigName } + if p.proto3 { + s += ",proto3" + } + if p.oneof { + s += ",oneof" + } if len(p.Enum) > 0 { s += ",enum=" + p.Enum } @@ -282,6 +315,10 @@ func (p *Properties) Parse(s string) { p.OrigName = f[5:] case strings.HasPrefix(f, "enum="): p.Enum = f[5:] + case f == "proto3": + p.proto3 = true + case f == "oneof": + p.oneof = true case strings.HasPrefix(f, "def="): p.HasDefault = true p.Default = f[4:] // rest of string @@ -305,7 +342,7 @@ func logNoSliceEnc(t1, t2 reflect.Type) { var protoMessageType = reflect.TypeOf((*Message)(nil)).Elem() // Initialize the fields for encoding and decoding. -func (p *Properties) setEncAndDec(typ reflect.Type, lockGetProp bool) { +func (p *Properties) setEncAndDec(typ reflect.Type, f *reflect.StructField, lockGetProp bool) { p.enc = nil p.dec = nil p.size = nil @@ -316,13 +353,96 @@ func (p *Properties) setEncAndDec(typ reflect.Type, lockGetProp bool) { } switch t1 := typ; t1.Kind() { default: - if !p.setNonNullableEncAndDec(t1) { - fmt.Fprintf(os.Stderr, "proto: no coders for %v\n", t1) + fmt.Fprintf(os.Stderr, "proto: no coders for %v\n", t1) + + // proto3 scalar types + + case reflect.Bool: + if p.proto3 { + p.enc = (*Buffer).enc_proto3_bool + p.dec = (*Buffer).dec_proto3_bool + p.size = size_proto3_bool + } else { + p.enc = (*Buffer).enc_ref_bool + p.dec = (*Buffer).dec_proto3_bool + p.size = size_ref_bool } + case reflect.Int32: + if p.proto3 { + p.enc = (*Buffer).enc_proto3_int32 + p.dec = (*Buffer).dec_proto3_int32 + p.size = size_proto3_int32 + } else { + p.enc = (*Buffer).enc_ref_int32 + p.dec = (*Buffer).dec_proto3_int32 + p.size = size_ref_int32 + } + case reflect.Uint32: + if p.proto3 { + p.enc = (*Buffer).enc_proto3_uint32 + p.dec = (*Buffer).dec_proto3_int32 // can reuse + p.size = size_proto3_uint32 + } else { + p.enc = (*Buffer).enc_ref_uint32 + p.dec = (*Buffer).dec_proto3_int32 // can reuse + p.size = size_ref_uint32 + } + case reflect.Int64, reflect.Uint64: + if p.proto3 { + p.enc = (*Buffer).enc_proto3_int64 + p.dec = (*Buffer).dec_proto3_int64 + p.size = size_proto3_int64 + } else { + p.enc = (*Buffer).enc_ref_int64 + p.dec = (*Buffer).dec_proto3_int64 + p.size = size_ref_int64 + } + case reflect.Float32: + if p.proto3 { + p.enc = (*Buffer).enc_proto3_uint32 // can just treat them as bits + p.dec = (*Buffer).dec_proto3_int32 + p.size = size_proto3_uint32 + } else { + p.enc = (*Buffer).enc_ref_uint32 // can just treat them as bits + p.dec = (*Buffer).dec_proto3_int32 + p.size = size_ref_uint32 + } + case reflect.Float64: + if p.proto3 { + p.enc = (*Buffer).enc_proto3_int64 // can just treat them as bits + p.dec = (*Buffer).dec_proto3_int64 + p.size = size_proto3_int64 + } else { + p.enc = (*Buffer).enc_ref_int64 // can just treat them as bits + p.dec = (*Buffer).dec_proto3_int64 + p.size = size_ref_int64 + } + case reflect.String: + if p.proto3 { + p.enc = (*Buffer).enc_proto3_string + p.dec = (*Buffer).dec_proto3_string + p.size = size_proto3_string + } else { + p.enc = (*Buffer).enc_ref_string + p.dec = (*Buffer).dec_proto3_string + p.size = size_ref_string + } + case reflect.Struct: + p.stype = typ + p.isMarshaler = isMarshaler(typ) + p.isUnmarshaler = isUnmarshaler(typ) + if p.Wire == "bytes" { + p.enc = (*Buffer).enc_ref_struct_message + p.dec = (*Buffer).dec_ref_struct_message + p.size = size_ref_struct_message + } else { + fmt.Fprintf(os.Stderr, "proto: no coders for struct %T\n", typ) + } + case reflect.Ptr: switch t2 := t1.Elem(); t2.Kind() { default: - fmt.Fprintf(os.Stderr, "proto: no encoder function for %T -> %T\n", t1, t2) + fmt.Fprintf(os.Stderr, "proto: no encoder function for %v -> %v\n", t1, t2) break case reflect.Bool: p.enc = (*Buffer).enc_bool @@ -416,6 +536,15 @@ func (p *Properties) setEncAndDec(typ reflect.Type, lockGetProp bool) { p.enc = (*Buffer).enc_slice_byte p.dec = (*Buffer).dec_slice_byte p.size = size_slice_byte + // This is a []byte, which is either a bytes field, + // or the value of a map field. In the latter case, + // we always encode an empty []byte, so we should not + // use the proto3 enc/size funcs. + // f == nil iff this is the key/value of a map field. + if p.proto3 && f != nil { + p.enc = (*Buffer).enc_proto3_slice_byte + p.size = size_proto3_slice_byte + } case reflect.Float32, reflect.Float64: switch t2.Bits() { case 32: @@ -480,6 +609,23 @@ func (p *Properties) setEncAndDec(typ reflect.Type, lockGetProp bool) { case reflect.Struct: p.setSliceOfNonPointerStructs(t1) } + + case reflect.Map: + p.enc = (*Buffer).enc_new_map + p.dec = (*Buffer).dec_new_map + p.size = size_new_map + + p.mtype = t1 + p.mkeyprop = &Properties{} + p.mkeyprop.init(reflect.PtrTo(p.mtype.Key()), "Key", f.Tag.Get("protobuf_key"), nil, lockGetProp) + p.mvalprop = &Properties{} + vtype := p.mtype.Elem() + if vtype.Kind() != reflect.Ptr && vtype.Kind() != reflect.Slice { + // The value type is not a message (*T) or bytes ([]byte), + // so we need encoders for the pointer to this type. + vtype = reflect.PtrTo(vtype) + } + p.mvalprop.init(vtype, "Value", f.Tag.Get("protobuf_val"), nil, lockGetProp) } p.setTag(lockGetProp) } @@ -539,11 +685,11 @@ func (p *Properties) init(typ reflect.Type, name, tag string, f *reflect.StructF return } p.Parse(tag) - p.setEncAndDec(typ, lockGetProp) + p.setEncAndDec(typ, f, lockGetProp) } var ( - mutex sync.Mutex + propertiesMu sync.RWMutex propertiesMap = make(map[reflect.Type]*StructProperties) ) @@ -553,13 +699,26 @@ func GetProperties(t reflect.Type) *StructProperties { if t.Kind() != reflect.Struct { panic("proto: type must have kind struct") } - mutex.Lock() - sprop := getPropertiesLocked(t) - mutex.Unlock() + + // Most calls to GetProperties in a long-running program will be + // retrieving details for types we have seen before. + propertiesMu.RLock() + sprop, ok := propertiesMap[t] + propertiesMu.RUnlock() + if ok { + if collectStats { + stats.Chit++ + } + return sprop + } + + propertiesMu.Lock() + sprop = getPropertiesLocked(t) + propertiesMu.Unlock() return sprop } -// getPropertiesLocked requires that mutex is held. +// getPropertiesLocked requires that propertiesMu is held. func getPropertiesLocked(t reflect.Type) *StructProperties { if prop, ok := propertiesMap[t]; ok { if collectStats { @@ -601,6 +760,7 @@ func getPropertiesLocked(t reflect.Type) *StructProperties { if f.Name == "XXX_unrecognized" { // special case prop.unrecField = toField(&f) } + oneof := f.Tag.Get("protobuf_oneof") != "" // special case prop.Prop[i] = p prop.order[i] = i if debug { @@ -610,7 +770,7 @@ func getPropertiesLocked(t reflect.Type) *StructProperties { } print("\n") } - if p.enc == nil && !strings.HasPrefix(f.Name, "XXX_") { + if p.enc == nil && !strings.HasPrefix(f.Name, "XXX_") && !oneof { fmt.Fprintln(os.Stderr, "proto: no encoder for", f.Name, f.Type.String(), "[GetProperties]") } } @@ -618,6 +778,41 @@ func getPropertiesLocked(t reflect.Type) *StructProperties { // Re-order prop.order. sort.Sort(prop) + type oneofMessage interface { + XXX_OneofFuncs() (func(Message, *Buffer) error, func(Message, int, int, *Buffer) (bool, error), []interface{}) + } + if om, ok := reflect.Zero(reflect.PtrTo(t)).Interface().(oneofMessage); ok { + var oots []interface{} + prop.oneofMarshaler, prop.oneofUnmarshaler, oots = om.XXX_OneofFuncs() + prop.stype = t + + // Interpret oneof metadata. + prop.OneofTypes = make(map[string]*OneofProperties) + for _, oot := range oots { + oop := &OneofProperties{ + Type: reflect.ValueOf(oot).Type(), // *T + Prop: new(Properties), + } + sft := oop.Type.Elem().Field(0) + oop.Prop.Name = sft.Name + oop.Prop.Parse(sft.Tag.Get("protobuf")) + // There will be exactly one interface field that + // this new value is assignable to. + for i := 0; i < t.NumField(); i++ { + f := t.Field(i) + if f.Type.Kind() != reflect.Interface { + continue + } + if !oop.Type.AssignableTo(f.Type) { + continue + } + oop.Field = i + break + } + prop.OneofTypes[oop.Prop.OrigName] = oop + } + } + // build required counts // build tags reqCount := 0 diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/properties_gogo.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/properties_gogo.go index 3518b77834e35..8daf9f7768c25 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/properties_gogo.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/properties_gogo.go @@ -49,53 +49,6 @@ func (p *Properties) setCustomEncAndDec(typ reflect.Type) { } } -func (p *Properties) setNonNullableEncAndDec(typ reflect.Type) bool { - switch typ.Kind() { - case reflect.Bool: - p.enc = (*Buffer).enc_ref_bool - p.dec = (*Buffer).dec_ref_bool - p.size = size_ref_bool - case reflect.Int32: - p.enc = (*Buffer).enc_ref_int32 - p.dec = (*Buffer).dec_ref_int32 - p.size = size_ref_int32 - case reflect.Uint32: - p.enc = (*Buffer).enc_ref_uint32 - p.dec = (*Buffer).dec_ref_int32 - p.size = size_ref_uint32 - case reflect.Int64, reflect.Uint64: - p.enc = (*Buffer).enc_ref_int64 - p.dec = (*Buffer).dec_ref_int64 - p.size = size_ref_int64 - case reflect.Float32: - p.enc = (*Buffer).enc_ref_uint32 // can just treat them as bits - p.dec = (*Buffer).dec_ref_int32 - p.size = size_ref_uint32 - case reflect.Float64: - p.enc = (*Buffer).enc_ref_int64 // can just treat them as bits - p.dec = (*Buffer).dec_ref_int64 - p.size = size_ref_int64 - case reflect.String: - p.dec = (*Buffer).dec_ref_string - p.enc = (*Buffer).enc_ref_string - p.size = size_ref_string - case reflect.Struct: - p.stype = typ - p.isMarshaler = isMarshaler(typ) - p.isUnmarshaler = isUnmarshaler(typ) - if p.Wire == "bytes" { - p.enc = (*Buffer).enc_ref_struct_message - p.dec = (*Buffer).dec_ref_struct_message - p.size = size_ref_struct_message - } else { - fmt.Fprintf(os.Stderr, "proto: no coders for struct %T\n", typ) - } - default: - return false - } - return true -} - func (p *Properties) setSliceOfNonPointerStructs(typ reflect.Type) { t2 := typ.Elem() p.sstype = typ diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/proto3_proto/proto3.pb.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/proto3_proto/proto3.pb.go new file mode 100644 index 0000000000000..b48227622f6fe --- /dev/null +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/proto3_proto/proto3.pb.go @@ -0,0 +1,126 @@ +// Code generated by protoc-gen-gogo. +// source: proto3_proto/proto3.proto +// DO NOT EDIT! + +/* +Package proto3_proto is a generated protocol buffer package. + +It is generated from these files: + proto3_proto/proto3.proto + +It has these top-level messages: + Message + Nested + MessageWithMap +*/ +package proto3_proto + +import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" +import math "math" +import testdata "github.com/gogo/protobuf/proto/testdata" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +type Message_Humour int32 + +const ( + Message_UNKNOWN Message_Humour = 0 + Message_PUNS Message_Humour = 1 + Message_SLAPSTICK Message_Humour = 2 + Message_BILL_BAILEY Message_Humour = 3 +) + +var Message_Humour_name = map[int32]string{ + 0: "UNKNOWN", + 1: "PUNS", + 2: "SLAPSTICK", + 3: "BILL_BAILEY", +} +var Message_Humour_value = map[string]int32{ + "UNKNOWN": 0, + "PUNS": 1, + "SLAPSTICK": 2, + "BILL_BAILEY": 3, +} + +func (x Message_Humour) String() string { + return proto.EnumName(Message_Humour_name, int32(x)) +} + +type Message struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Hilarity Message_Humour `protobuf:"varint,2,opt,name=hilarity,proto3,enum=proto3_proto.Message_Humour" json:"hilarity,omitempty"` + HeightInCm uint32 `protobuf:"varint,3,opt,name=height_in_cm,proto3" json:"height_in_cm,omitempty"` + Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` + ResultCount int64 `protobuf:"varint,7,opt,name=result_count,proto3" json:"result_count,omitempty"` + TrueScotsman bool `protobuf:"varint,8,opt,name=true_scotsman,proto3" json:"true_scotsman,omitempty"` + Score float32 `protobuf:"fixed32,9,opt,name=score,proto3" json:"score,omitempty"` + Key []uint64 `protobuf:"varint,5,rep,name=key" json:"key,omitempty"` + Nested *Nested `protobuf:"bytes,6,opt,name=nested" json:"nested,omitempty"` + Terrain map[string]*Nested `protobuf:"bytes,10,rep,name=terrain" json:"terrain,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value"` + Proto2Field *testdata.SubDefaults `protobuf:"bytes,11,opt,name=proto2_field" json:"proto2_field,omitempty"` + Proto2Value map[string]*testdata.SubDefaults `protobuf:"bytes,13,rep,name=proto2_value" json:"proto2_value,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *Message) Reset() { *m = Message{} } +func (m *Message) String() string { return proto.CompactTextString(m) } +func (*Message) ProtoMessage() {} + +func (m *Message) GetNested() *Nested { + if m != nil { + return m.Nested + } + return nil +} + +func (m *Message) GetTerrain() map[string]*Nested { + if m != nil { + return m.Terrain + } + return nil +} + +func (m *Message) GetProto2Field() *testdata.SubDefaults { + if m != nil { + return m.Proto2Field + } + return nil +} + +func (m *Message) GetProto2Value() map[string]*testdata.SubDefaults { + if m != nil { + return m.Proto2Value + } + return nil +} + +type Nested struct { + Bunny string `protobuf:"bytes,1,opt,name=bunny,proto3" json:"bunny,omitempty"` +} + +func (m *Nested) Reset() { *m = Nested{} } +func (m *Nested) String() string { return proto.CompactTextString(m) } +func (*Nested) ProtoMessage() {} + +type MessageWithMap struct { + ByteMapping map[bool][]byte `protobuf:"bytes,1,rep,name=byte_mapping" json:"byte_mapping,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (m *MessageWithMap) Reset() { *m = MessageWithMap{} } +func (m *MessageWithMap) String() string { return proto.CompactTextString(m) } +func (*MessageWithMap) ProtoMessage() {} + +func (m *MessageWithMap) GetByteMapping() map[bool][]byte { + if m != nil { + return m.ByteMapping + } + return nil +} + +func init() { + proto.RegisterEnum("proto3_proto.Message_Humour", Message_Humour_name, Message_Humour_value) +} diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/proto3_proto/proto3.proto b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/proto3_proto/proto3.proto new file mode 100644 index 0000000000000..ca670015a2636 --- /dev/null +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/proto3_proto/proto3.proto @@ -0,0 +1,68 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2014 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package proto3_proto; + +import "github.com/gogo/protobuf/proto/testdata/test.proto"; + +message Message { + enum Humour { + UNKNOWN = 0; + PUNS = 1; + SLAPSTICK = 2; + BILL_BAILEY = 3; + } + + string name = 1; + Humour hilarity = 2; + uint32 height_in_cm = 3; + bytes data = 4; + int64 result_count = 7; + bool true_scotsman = 8; + float score = 9; + + repeated uint64 key = 5; + Nested nested = 6; + + map terrain = 10; + testdata.SubDefaults proto2_field = 11; + map proto2_value = 13; +} + +message Nested { + string bunny = 1; +} + +message MessageWithMap { + map byte_mapping = 1; +} diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/proto3_test.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/proto3_test.go new file mode 100644 index 0000000000000..6f9cddc3fa9a8 --- /dev/null +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/proto3_test.go @@ -0,0 +1,125 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2014 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package proto_test + +import ( + "testing" + + "github.com/gogo/protobuf/proto" + pb "github.com/gogo/protobuf/proto/proto3_proto" + tpb "github.com/gogo/protobuf/proto/testdata" +) + +func TestProto3ZeroValues(t *testing.T) { + tests := []struct { + desc string + m proto.Message + }{ + {"zero message", &pb.Message{}}, + {"empty bytes field", &pb.Message{Data: []byte{}}}, + } + for _, test := range tests { + b, err := proto.Marshal(test.m) + if err != nil { + t.Errorf("%s: proto.Marshal: %v", test.desc, err) + continue + } + if len(b) > 0 { + t.Errorf("%s: Encoding is non-empty: %q", test.desc, b) + } + } +} + +func TestRoundTripProto3(t *testing.T) { + m := &pb.Message{ + Name: "David", // (2 | 1<<3): 0x0a 0x05 "David" + Hilarity: pb.Message_PUNS, // (0 | 2<<3): 0x10 0x01 + HeightInCm: 178, // (0 | 3<<3): 0x18 0xb2 0x01 + Data: []byte("roboto"), // (2 | 4<<3): 0x20 0x06 "roboto" + ResultCount: 47, // (0 | 7<<3): 0x38 0x2f + TrueScotsman: true, // (0 | 8<<3): 0x40 0x01 + Score: 8.1, // (5 | 9<<3): 0x4d <8.1> + + Key: []uint64{1, 0xdeadbeef}, + Nested: &pb.Nested{ + Bunny: "Monty", + }, + } + t.Logf(" m: %v", m) + + b, err := proto.Marshal(m) + if err != nil { + t.Fatalf("proto.Marshal: %v", err) + } + t.Logf(" b: %q", b) + + m2 := new(pb.Message) + if err := proto.Unmarshal(b, m2); err != nil { + t.Fatalf("proto.Unmarshal: %v", err) + } + t.Logf("m2: %v", m2) + + if !proto.Equal(m, m2) { + t.Errorf("proto.Equal returned false:\n m: %v\nm2: %v", m, m2) + } +} + +func TestProto3SetDefaults(t *testing.T) { + in := &pb.Message{ + Terrain: map[string]*pb.Nested{ + "meadow": new(pb.Nested), + }, + Proto2Field: new(tpb.SubDefaults), + Proto2Value: map[string]*tpb.SubDefaults{ + "badlands": new(tpb.SubDefaults), + }, + } + + got := proto.Clone(in).(*pb.Message) + proto.SetDefaults(got) + + // There are no defaults in proto3. Everything should be the zero value, but + // we need to remember to set defaults for nested proto2 messages. + want := &pb.Message{ + Terrain: map[string]*pb.Nested{ + "meadow": new(pb.Nested), + }, + Proto2Field: &tpb.SubDefaults{N: proto.Int64(7)}, + Proto2Value: map[string]*tpb.SubDefaults{ + "badlands": {N: proto.Int64(7)}, + }, + } + + if !proto.Equal(got, want) { + t.Errorf("with in = %v\nproto.SetDefaults(in) =>\ngot %v\nwant %v", in, got, want) + } +} diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/size_test.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/size_test.go index 078c7b9897260..f4b8b8e3a0a51 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/size_test.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/size_test.go @@ -33,10 +33,12 @@ package proto_test import ( "log" + "strings" "testing" - pb "./testdata" . "github.com/gogo/protobuf/proto" + proto3pb "github.com/gogo/protobuf/proto/proto3_proto" + pb "github.com/gogo/protobuf/proto/testdata" ) var messageWithExtension1 = &pb.MyMessage{Count: Int32(7)} @@ -102,6 +104,31 @@ var SizeTests = []struct { {"unrecognized", &pb.MoreRepeated{XXX_unrecognized: []byte{13<<3 | 0, 4}}}, {"extension (unencoded)", messageWithExtension1}, {"extension (encoded)", messageWithExtension3}, + // proto3 message + {"proto3 empty", &proto3pb.Message{}}, + {"proto3 bool", &proto3pb.Message{TrueScotsman: true}}, + {"proto3 int64", &proto3pb.Message{ResultCount: 1}}, + {"proto3 uint32", &proto3pb.Message{HeightInCm: 123}}, + {"proto3 float", &proto3pb.Message{Score: 12.6}}, + {"proto3 string", &proto3pb.Message{Name: "Snezana"}}, + {"proto3 bytes", &proto3pb.Message{Data: []byte("wowsa")}}, + {"proto3 bytes, empty", &proto3pb.Message{Data: []byte{}}}, + {"proto3 enum", &proto3pb.Message{Hilarity: proto3pb.Message_PUNS}}, + {"proto3 map field with empty bytes", &proto3pb.MessageWithMap{ByteMapping: map[bool][]byte{false: {}}}}, + + {"map field", &pb.MessageWithMap{NameMapping: map[int32]string{1: "Rob", 7: "Andrew"}}}, + {"map field with message", &pb.MessageWithMap{MsgMapping: map[int64]*pb.FloatingPoint{0x7001: {F: Float64(2.0)}}}}, + {"map field with bytes", &pb.MessageWithMap{ByteMapping: map[bool][]byte{true: []byte("this time for sure")}}}, + {"map field with empty bytes", &pb.MessageWithMap{ByteMapping: map[bool][]byte{true: {}}}}, + + {"map field with big entry", &pb.MessageWithMap{NameMapping: map[int32]string{8: strings.Repeat("x", 125)}}}, + {"map field with big key and val", &pb.MessageWithMap{StrToStr: map[string]string{strings.Repeat("x", 70): strings.Repeat("y", 70)}}}, + {"map field with big numeric key", &pb.MessageWithMap{NameMapping: map[int32]string{0xf00d: "om nom nom"}}}, + + {"oneof not set", &pb.Communique{}}, + {"oneof zero int32", &pb.Communique{Union: &pb.Communique_Number{Number: 0}}}, + {"oneof int32", &pb.Communique{Union: &pb.Communique_Number{Number: 3}}}, + {"oneof string", &pb.Communique{Union: &pb.Communique_Name{Name: "Rhythmic Fman"}}}, } func TestSize(t *testing.T) { diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/skip_gogo.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/skip_gogo.go index d8683c8edf480..4fe7e0815c9f3 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/skip_gogo.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/skip_gogo.go @@ -80,7 +80,7 @@ func Skip(data []byte) (n int, err error) { return index, nil case 3: for { - var wire uint64 + var innerWire uint64 var start int = index for shift := uint(0); ; shift += 7 { if index >= l { @@ -88,13 +88,13 @@ func Skip(data []byte) (n int, err error) { } b := data[index] index++ - wire |= (uint64(b) & 0x7F) << shift + innerWire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - wireType := int(wire & 0x7) - if wireType == 4 { + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { break } next, err := Skip(data[start:]) diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/testdata/Makefile b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/testdata/Makefile index beb438e3e70df..31d83277ccf15 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/testdata/Makefile +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/testdata/Makefile @@ -32,16 +32,6 @@ all: regenerate regenerate: - rm -f test.pb.go - protoc --gogo_out=. test.proto + go install github.com/gogo/protobuf/protoc-min-version + protoc-min-version --version="3.0.0" --gogo_out=. test.proto -# The following rules are just aids to development. Not needed for typical testing. - -diff: regenerate - hg diff test.pb.go - -restore: - cp test.pb.go.golden test.pb.go - -preserve: - cp test.pb.go test.pb.go.golden diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/testdata/test.pb.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/testdata/test.pb.go index dffbcccd461a3..0c200f6a41c03 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/testdata/test.pb.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/testdata/test.pb.go @@ -22,6 +22,7 @@ It has these top-level messages: OtherMessage MyMessage Ext + DefaultsMessage MyMessageSet Empty MessageList @@ -33,14 +34,18 @@ It has these top-level messages: GroupOld GroupNew FloatingPoint + MessageWithMap + Communique */ package testdata import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" import math "math" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal +var _ = fmt.Errorf var _ = math.Inf type FOO int32 @@ -180,6 +185,42 @@ func (x *MyMessage_Color) UnmarshalJSON(data []byte) error { return nil } +type DefaultsMessage_DefaultsEnum int32 + +const ( + DefaultsMessage_ZERO DefaultsMessage_DefaultsEnum = 0 + DefaultsMessage_ONE DefaultsMessage_DefaultsEnum = 1 + DefaultsMessage_TWO DefaultsMessage_DefaultsEnum = 2 +) + +var DefaultsMessage_DefaultsEnum_name = map[int32]string{ + 0: "ZERO", + 1: "ONE", + 2: "TWO", +} +var DefaultsMessage_DefaultsEnum_value = map[string]int32{ + "ZERO": 0, + "ONE": 1, + "TWO": 2, +} + +func (x DefaultsMessage_DefaultsEnum) Enum() *DefaultsMessage_DefaultsEnum { + p := new(DefaultsMessage_DefaultsEnum) + *p = x + return p +} +func (x DefaultsMessage_DefaultsEnum) String() string { + return proto.EnumName(DefaultsMessage_DefaultsEnum_name, int32(x)) +} +func (x *DefaultsMessage_DefaultsEnum) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(DefaultsMessage_DefaultsEnum_value, data, "DefaultsMessage_DefaultsEnum") + if err != nil { + return err + } + *x = DefaultsMessage_DefaultsEnum(value) + return nil +} + type Defaults_Color int32 const ( @@ -263,8 +304,8 @@ func (m *GoEnum) GetFoo() FOO { } type GoTestField struct { - Label *string `protobuf:"bytes,1,req" json:"Label,omitempty"` - Type *string `protobuf:"bytes,2,req" json:"Type,omitempty"` + Label *string `protobuf:"bytes,1,req,name=Label" json:"Label,omitempty"` + Type *string `protobuf:"bytes,2,req,name=Type" json:"Type,omitempty"` XXX_unrecognized []byte `json:"-"` } @@ -288,13 +329,13 @@ func (m *GoTestField) GetType() string { type GoTest struct { // Some typical parameters - Kind *GoTest_KIND `protobuf:"varint,1,req,enum=testdata.GoTest_KIND" json:"Kind,omitempty"` - Table *string `protobuf:"bytes,2,opt" json:"Table,omitempty"` - Param *int32 `protobuf:"varint,3,opt" json:"Param,omitempty"` + Kind *GoTest_KIND `protobuf:"varint,1,req,name=Kind,enum=testdata.GoTest_KIND" json:"Kind,omitempty"` + Table *string `protobuf:"bytes,2,opt,name=Table" json:"Table,omitempty"` + Param *int32 `protobuf:"varint,3,opt,name=Param" json:"Param,omitempty"` // Required, repeated and optional foreign fields. - RequiredField *GoTestField `protobuf:"bytes,4,req" json:"RequiredField,omitempty"` - RepeatedField []*GoTestField `protobuf:"bytes,5,rep" json:"RepeatedField,omitempty"` - OptionalField *GoTestField `protobuf:"bytes,6,opt" json:"OptionalField,omitempty"` + RequiredField *GoTestField `protobuf:"bytes,4,req,name=RequiredField" json:"RequiredField,omitempty"` + RepeatedField []*GoTestField `protobuf:"bytes,5,rep,name=RepeatedField" json:"RepeatedField,omitempty"` + OptionalField *GoTestField `protobuf:"bytes,6,opt,name=OptionalField" json:"OptionalField,omitempty"` // Required fields of all basic types F_BoolRequired *bool `protobuf:"varint,10,req,name=F_Bool_required" json:"F_Bool_required,omitempty"` F_Int32Required *int32 `protobuf:"varint,11,req,name=F_Int32_required" json:"F_Int32_required,omitempty"` @@ -895,7 +936,7 @@ func (m *GoTest) GetOptionalgroup() *GoTest_OptionalGroup { // Required, repeated, and optional groups. type GoTest_RequiredGroup struct { - RequiredField *string `protobuf:"bytes,71,req" json:"RequiredField,omitempty"` + RequiredField *string `protobuf:"bytes,71,req,name=RequiredField" json:"RequiredField,omitempty"` XXX_unrecognized []byte `json:"-"` } @@ -911,7 +952,7 @@ func (m *GoTest_RequiredGroup) GetRequiredField() string { } type GoTest_RepeatedGroup struct { - RequiredField *string `protobuf:"bytes,81,req" json:"RequiredField,omitempty"` + RequiredField *string `protobuf:"bytes,81,req,name=RequiredField" json:"RequiredField,omitempty"` XXX_unrecognized []byte `json:"-"` } @@ -927,7 +968,7 @@ func (m *GoTest_RepeatedGroup) GetRequiredField() string { } type GoTest_OptionalGroup struct { - RequiredField *string `protobuf:"bytes,91,req" json:"RequiredField,omitempty"` + RequiredField *string `protobuf:"bytes,91,req,name=RequiredField" json:"RequiredField,omitempty"` XXX_unrecognized []byte `json:"-"` } @@ -1401,6 +1442,29 @@ var E_Ext_Number = &proto.ExtensionDesc{ Tag: "varint,105,opt,name=number", } +type DefaultsMessage struct { + XXX_extensions map[int32]proto.Extension `json:"-"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *DefaultsMessage) Reset() { *m = DefaultsMessage{} } +func (m *DefaultsMessage) String() string { return proto.CompactTextString(m) } +func (*DefaultsMessage) ProtoMessage() {} + +var extRange_DefaultsMessage = []proto.ExtensionRange{ + {100, 536870911}, +} + +func (*DefaultsMessage) ExtensionRangeArray() []proto.ExtensionRange { + return extRange_DefaultsMessage +} +func (m *DefaultsMessage) ExtensionMap() map[int32]proto.Extension { + if m.XXX_extensions == nil { + m.XXX_extensions = make(map[int32]proto.Extension) + } + return m.XXX_extensions +} + type MyMessageSet struct { XXX_extensions map[int32]proto.Extension `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -1450,7 +1514,7 @@ func (m *Empty) String() string { return proto.CompactTextString(m) } func (*Empty) ProtoMessage() {} type MessageList struct { - Message []*MessageList_Message `protobuf:"group,1,rep" json:"message,omitempty"` + Message []*MessageList_Message `protobuf:"group,1,rep,name=Message" json:"message,omitempty"` XXX_unrecognized []byte `json:"-"` } @@ -1516,24 +1580,24 @@ func (m *Strings) GetBytesField() []byte { type Defaults struct { // Default-valued fields of all basic types. // Same as GoTest, but copied here to make testing easier. - F_Bool *bool `protobuf:"varint,1,opt,def=1" json:"F_Bool,omitempty"` - F_Int32 *int32 `protobuf:"varint,2,opt,def=32" json:"F_Int32,omitempty"` - F_Int64 *int64 `protobuf:"varint,3,opt,def=64" json:"F_Int64,omitempty"` - F_Fixed32 *uint32 `protobuf:"fixed32,4,opt,def=320" json:"F_Fixed32,omitempty"` - F_Fixed64 *uint64 `protobuf:"fixed64,5,opt,def=640" json:"F_Fixed64,omitempty"` - F_Uint32 *uint32 `protobuf:"varint,6,opt,def=3200" json:"F_Uint32,omitempty"` - F_Uint64 *uint64 `protobuf:"varint,7,opt,def=6400" json:"F_Uint64,omitempty"` - F_Float *float32 `protobuf:"fixed32,8,opt,def=314159" json:"F_Float,omitempty"` - F_Double *float64 `protobuf:"fixed64,9,opt,def=271828" json:"F_Double,omitempty"` - F_String *string `protobuf:"bytes,10,opt,def=hello, \"world!\"\n" json:"F_String,omitempty"` - F_Bytes []byte `protobuf:"bytes,11,opt,def=Bignose" json:"F_Bytes,omitempty"` - F_Sint32 *int32 `protobuf:"zigzag32,12,opt,def=-32" json:"F_Sint32,omitempty"` - F_Sint64 *int64 `protobuf:"zigzag64,13,opt,def=-64" json:"F_Sint64,omitempty"` - F_Enum *Defaults_Color `protobuf:"varint,14,opt,enum=testdata.Defaults_Color,def=1" json:"F_Enum,omitempty"` + F_Bool *bool `protobuf:"varint,1,opt,name=F_Bool,def=1" json:"F_Bool,omitempty"` + F_Int32 *int32 `protobuf:"varint,2,opt,name=F_Int32,def=32" json:"F_Int32,omitempty"` + F_Int64 *int64 `protobuf:"varint,3,opt,name=F_Int64,def=64" json:"F_Int64,omitempty"` + F_Fixed32 *uint32 `protobuf:"fixed32,4,opt,name=F_Fixed32,def=320" json:"F_Fixed32,omitempty"` + F_Fixed64 *uint64 `protobuf:"fixed64,5,opt,name=F_Fixed64,def=640" json:"F_Fixed64,omitempty"` + F_Uint32 *uint32 `protobuf:"varint,6,opt,name=F_Uint32,def=3200" json:"F_Uint32,omitempty"` + F_Uint64 *uint64 `protobuf:"varint,7,opt,name=F_Uint64,def=6400" json:"F_Uint64,omitempty"` + F_Float *float32 `protobuf:"fixed32,8,opt,name=F_Float,def=314159" json:"F_Float,omitempty"` + F_Double *float64 `protobuf:"fixed64,9,opt,name=F_Double,def=271828" json:"F_Double,omitempty"` + F_String *string `protobuf:"bytes,10,opt,name=F_String,def=hello, \"world!\"\n" json:"F_String,omitempty"` + F_Bytes []byte `protobuf:"bytes,11,opt,name=F_Bytes,def=Bignose" json:"F_Bytes,omitempty"` + F_Sint32 *int32 `protobuf:"zigzag32,12,opt,name=F_Sint32,def=-32" json:"F_Sint32,omitempty"` + F_Sint64 *int64 `protobuf:"zigzag64,13,opt,name=F_Sint64,def=-64" json:"F_Sint64,omitempty"` + F_Enum *Defaults_Color `protobuf:"varint,14,opt,name=F_Enum,enum=testdata.Defaults_Color,def=1" json:"F_Enum,omitempty"` // More fields with crazy defaults. - F_Pinf *float32 `protobuf:"fixed32,15,opt,def=inf" json:"F_Pinf,omitempty"` - F_Ninf *float32 `protobuf:"fixed32,16,opt,def=-inf" json:"F_Ninf,omitempty"` - F_Nan *float32 `protobuf:"fixed32,17,opt,def=nan" json:"F_Nan,omitempty"` + F_Pinf *float32 `protobuf:"fixed32,15,opt,name=F_Pinf,def=inf" json:"F_Pinf,omitempty"` + F_Ninf *float32 `protobuf:"fixed32,16,opt,name=F_Ninf,def=-inf" json:"F_Ninf,omitempty"` + F_Nan *float32 `protobuf:"fixed32,17,opt,name=F_Nan,def=nan" json:"F_Nan,omitempty"` // Sub-message. Sub *SubDefaults `protobuf:"bytes,18,opt,name=sub" json:"sub,omitempty"` // Redundant but explicit defaults. @@ -1798,7 +1862,7 @@ func (m *MoreRepeated) GetFixeds() []uint32 { } type GroupOld struct { - G *GroupOld_G `protobuf:"group,101,opt" json:"g,omitempty"` + G *GroupOld_G `protobuf:"group,101,opt,name=G" json:"g,omitempty"` XXX_unrecognized []byte `json:"-"` } @@ -1830,7 +1894,7 @@ func (m *GroupOld_G) GetX() int32 { } type GroupNew struct { - G *GroupNew_G `protobuf:"group,101,opt" json:"g,omitempty"` + G *GroupNew_G `protobuf:"group,101,opt,name=G" json:"g,omitempty"` XXX_unrecognized []byte `json:"-"` } @@ -1885,6 +1949,245 @@ func (m *FloatingPoint) GetF() float64 { return 0 } +type MessageWithMap struct { + NameMapping map[int32]string `protobuf:"bytes,1,rep,name=name_mapping" json:"name_mapping,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + MsgMapping map[int64]*FloatingPoint `protobuf:"bytes,2,rep,name=msg_mapping" json:"msg_mapping,omitempty" protobuf_key:"zigzag64,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + ByteMapping map[bool][]byte `protobuf:"bytes,3,rep,name=byte_mapping" json:"byte_mapping,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + StrToStr map[string]string `protobuf:"bytes,4,rep,name=str_to_str" json:"str_to_str,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *MessageWithMap) Reset() { *m = MessageWithMap{} } +func (m *MessageWithMap) String() string { return proto.CompactTextString(m) } +func (*MessageWithMap) ProtoMessage() {} + +func (m *MessageWithMap) GetNameMapping() map[int32]string { + if m != nil { + return m.NameMapping + } + return nil +} + +func (m *MessageWithMap) GetMsgMapping() map[int64]*FloatingPoint { + if m != nil { + return m.MsgMapping + } + return nil +} + +func (m *MessageWithMap) GetByteMapping() map[bool][]byte { + if m != nil { + return m.ByteMapping + } + return nil +} + +func (m *MessageWithMap) GetStrToStr() map[string]string { + if m != nil { + return m.StrToStr + } + return nil +} + +type Communique struct { + MakeMeCry *bool `protobuf:"varint,1,opt,name=make_me_cry" json:"make_me_cry,omitempty"` + // This is a oneof, called "union". + // + // Types that are valid to be assigned to Union: + // *Communique_Number + // *Communique_Name + // *Communique_Data + // *Communique_TempC + // *Communique_Col + // *Communique_Msg + Union isCommunique_Union `protobuf_oneof:"union"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Communique) Reset() { *m = Communique{} } +func (m *Communique) String() string { return proto.CompactTextString(m) } +func (*Communique) ProtoMessage() {} + +type isCommunique_Union interface { + isCommunique_Union() +} + +type Communique_Number struct { + Number int32 `protobuf:"varint,5,opt,name=number,oneof"` +} +type Communique_Name struct { + Name string `protobuf:"bytes,6,opt,name=name,oneof"` +} +type Communique_Data struct { + Data []byte `protobuf:"bytes,7,opt,name=data,oneof"` +} +type Communique_TempC struct { + TempC float64 `protobuf:"fixed64,8,opt,name=temp_c,oneof"` +} +type Communique_Col struct { + Col MyMessage_Color `protobuf:"varint,9,opt,name=col,enum=testdata.MyMessage_Color,oneof"` +} +type Communique_Msg struct { + Msg *Strings `protobuf:"bytes,10,opt,name=msg,oneof"` +} + +func (*Communique_Number) isCommunique_Union() {} +func (*Communique_Name) isCommunique_Union() {} +func (*Communique_Data) isCommunique_Union() {} +func (*Communique_TempC) isCommunique_Union() {} +func (*Communique_Col) isCommunique_Union() {} +func (*Communique_Msg) isCommunique_Union() {} + +func (m *Communique) GetUnion() isCommunique_Union { + if m != nil { + return m.Union + } + return nil +} + +func (m *Communique) GetMakeMeCry() bool { + if m != nil && m.MakeMeCry != nil { + return *m.MakeMeCry + } + return false +} + +func (m *Communique) GetNumber() int32 { + if x, ok := m.GetUnion().(*Communique_Number); ok { + return x.Number + } + return 0 +} + +func (m *Communique) GetName() string { + if x, ok := m.GetUnion().(*Communique_Name); ok { + return x.Name + } + return "" +} + +func (m *Communique) GetData() []byte { + if x, ok := m.GetUnion().(*Communique_Data); ok { + return x.Data + } + return nil +} + +func (m *Communique) GetTempC() float64 { + if x, ok := m.GetUnion().(*Communique_TempC); ok { + return x.TempC + } + return 0 +} + +func (m *Communique) GetCol() MyMessage_Color { + if x, ok := m.GetUnion().(*Communique_Col); ok { + return x.Col + } + return MyMessage_RED +} + +func (m *Communique) GetMsg() *Strings { + if x, ok := m.GetUnion().(*Communique_Msg); ok { + return x.Msg + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Communique) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), []interface{}) { + return _Communique_OneofMarshaler, _Communique_OneofUnmarshaler, []interface{}{ + (*Communique_Number)(nil), + (*Communique_Name)(nil), + (*Communique_Data)(nil), + (*Communique_TempC)(nil), + (*Communique_Col)(nil), + (*Communique_Msg)(nil), + } +} + +func _Communique_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Communique) + // union + switch x := m.Union.(type) { + case *Communique_Number: + _ = b.EncodeVarint(5<<3 | proto.WireVarint) + _ = b.EncodeVarint(uint64(x.Number)) + case *Communique_Name: + _ = b.EncodeVarint(6<<3 | proto.WireBytes) + _ = b.EncodeStringBytes(x.Name) + case *Communique_Data: + _ = b.EncodeVarint(7<<3 | proto.WireBytes) + _ = b.EncodeRawBytes(x.Data) + case *Communique_TempC: + _ = b.EncodeVarint(8<<3 | proto.WireFixed64) + _ = b.EncodeFixed64(math.Float64bits(x.TempC)) + case *Communique_Col: + _ = b.EncodeVarint(9<<3 | proto.WireVarint) + _ = b.EncodeVarint(uint64(x.Col)) + case *Communique_Msg: + _ = b.EncodeVarint(10<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Msg); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Communique.Union has unexpected type %T", x) + } + return nil +} + +func _Communique_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Communique) + switch tag { + case 5: // union.number + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Union = &Communique_Number{int32(x)} + return true, err + case 6: // union.name + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Union = &Communique_Name{x} + return true, err + case 7: // union.data + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.Union = &Communique_Data{x} + return true, err + case 8: // union.temp_c + if wire != proto.WireFixed64 { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeFixed64() + m.Union = &Communique_TempC{math.Float64frombits(x)} + return true, err + case 9: // union.col + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Union = &Communique_Col{MyMessage_Color(x)} + return true, err + case 10: // union.msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Strings) + err := b.DecodeMessage(msg) + m.Union = &Communique_Msg{msg} + return true, err + default: + return false, nil + } +} + var E_Greeting = &proto.ExtensionDesc{ ExtendedType: (*MyMessage)(nil), ExtensionType: ([]string)(nil), @@ -1893,6 +2196,262 @@ var E_Greeting = &proto.ExtensionDesc{ Tag: "bytes,106,rep,name=greeting", } +var E_NoDefaultDouble = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*float64)(nil), + Field: 101, + Name: "testdata.no_default_double", + Tag: "fixed64,101,opt,name=no_default_double", +} + +var E_NoDefaultFloat = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*float32)(nil), + Field: 102, + Name: "testdata.no_default_float", + Tag: "fixed32,102,opt,name=no_default_float", +} + +var E_NoDefaultInt32 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*int32)(nil), + Field: 103, + Name: "testdata.no_default_int32", + Tag: "varint,103,opt,name=no_default_int32", +} + +var E_NoDefaultInt64 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*int64)(nil), + Field: 104, + Name: "testdata.no_default_int64", + Tag: "varint,104,opt,name=no_default_int64", +} + +var E_NoDefaultUint32 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*uint32)(nil), + Field: 105, + Name: "testdata.no_default_uint32", + Tag: "varint,105,opt,name=no_default_uint32", +} + +var E_NoDefaultUint64 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*uint64)(nil), + Field: 106, + Name: "testdata.no_default_uint64", + Tag: "varint,106,opt,name=no_default_uint64", +} + +var E_NoDefaultSint32 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*int32)(nil), + Field: 107, + Name: "testdata.no_default_sint32", + Tag: "zigzag32,107,opt,name=no_default_sint32", +} + +var E_NoDefaultSint64 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*int64)(nil), + Field: 108, + Name: "testdata.no_default_sint64", + Tag: "zigzag64,108,opt,name=no_default_sint64", +} + +var E_NoDefaultFixed32 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*uint32)(nil), + Field: 109, + Name: "testdata.no_default_fixed32", + Tag: "fixed32,109,opt,name=no_default_fixed32", +} + +var E_NoDefaultFixed64 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*uint64)(nil), + Field: 110, + Name: "testdata.no_default_fixed64", + Tag: "fixed64,110,opt,name=no_default_fixed64", +} + +var E_NoDefaultSfixed32 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*int32)(nil), + Field: 111, + Name: "testdata.no_default_sfixed32", + Tag: "fixed32,111,opt,name=no_default_sfixed32", +} + +var E_NoDefaultSfixed64 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*int64)(nil), + Field: 112, + Name: "testdata.no_default_sfixed64", + Tag: "fixed64,112,opt,name=no_default_sfixed64", +} + +var E_NoDefaultBool = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*bool)(nil), + Field: 113, + Name: "testdata.no_default_bool", + Tag: "varint,113,opt,name=no_default_bool", +} + +var E_NoDefaultString = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*string)(nil), + Field: 114, + Name: "testdata.no_default_string", + Tag: "bytes,114,opt,name=no_default_string", +} + +var E_NoDefaultBytes = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: ([]byte)(nil), + Field: 115, + Name: "testdata.no_default_bytes", + Tag: "bytes,115,opt,name=no_default_bytes", +} + +var E_NoDefaultEnum = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*DefaultsMessage_DefaultsEnum)(nil), + Field: 116, + Name: "testdata.no_default_enum", + Tag: "varint,116,opt,name=no_default_enum,enum=testdata.DefaultsMessage_DefaultsEnum", +} + +var E_DefaultDouble = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*float64)(nil), + Field: 201, + Name: "testdata.default_double", + Tag: "fixed64,201,opt,name=default_double,def=3.1415", +} + +var E_DefaultFloat = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*float32)(nil), + Field: 202, + Name: "testdata.default_float", + Tag: "fixed32,202,opt,name=default_float,def=3.14", +} + +var E_DefaultInt32 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*int32)(nil), + Field: 203, + Name: "testdata.default_int32", + Tag: "varint,203,opt,name=default_int32,def=42", +} + +var E_DefaultInt64 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*int64)(nil), + Field: 204, + Name: "testdata.default_int64", + Tag: "varint,204,opt,name=default_int64,def=43", +} + +var E_DefaultUint32 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*uint32)(nil), + Field: 205, + Name: "testdata.default_uint32", + Tag: "varint,205,opt,name=default_uint32,def=44", +} + +var E_DefaultUint64 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*uint64)(nil), + Field: 206, + Name: "testdata.default_uint64", + Tag: "varint,206,opt,name=default_uint64,def=45", +} + +var E_DefaultSint32 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*int32)(nil), + Field: 207, + Name: "testdata.default_sint32", + Tag: "zigzag32,207,opt,name=default_sint32,def=46", +} + +var E_DefaultSint64 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*int64)(nil), + Field: 208, + Name: "testdata.default_sint64", + Tag: "zigzag64,208,opt,name=default_sint64,def=47", +} + +var E_DefaultFixed32 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*uint32)(nil), + Field: 209, + Name: "testdata.default_fixed32", + Tag: "fixed32,209,opt,name=default_fixed32,def=48", +} + +var E_DefaultFixed64 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*uint64)(nil), + Field: 210, + Name: "testdata.default_fixed64", + Tag: "fixed64,210,opt,name=default_fixed64,def=49", +} + +var E_DefaultSfixed32 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*int32)(nil), + Field: 211, + Name: "testdata.default_sfixed32", + Tag: "fixed32,211,opt,name=default_sfixed32,def=50", +} + +var E_DefaultSfixed64 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*int64)(nil), + Field: 212, + Name: "testdata.default_sfixed64", + Tag: "fixed64,212,opt,name=default_sfixed64,def=51", +} + +var E_DefaultBool = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*bool)(nil), + Field: 213, + Name: "testdata.default_bool", + Tag: "varint,213,opt,name=default_bool,def=1", +} + +var E_DefaultString = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*string)(nil), + Field: 214, + Name: "testdata.default_string", + Tag: "bytes,214,opt,name=default_string,def=Hello, string", +} + +var E_DefaultBytes = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: ([]byte)(nil), + Field: 215, + Name: "testdata.default_bytes", + Tag: "bytes,215,opt,name=default_bytes,def=Hello, bytes", +} + +var E_DefaultEnum = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*DefaultsMessage_DefaultsEnum)(nil), + Field: 216, + Name: "testdata.default_enum", + Tag: "varint,216,opt,name=default_enum,enum=testdata.DefaultsMessage_DefaultsEnum,def=1", +} + var E_X201 = &proto.ExtensionDesc{ ExtendedType: (*MyMessageSet)(nil), ExtensionType: (*Empty)(nil), @@ -2297,12 +2856,45 @@ func init() { proto.RegisterEnum("testdata.FOO", FOO_name, FOO_value) proto.RegisterEnum("testdata.GoTest_KIND", GoTest_KIND_name, GoTest_KIND_value) proto.RegisterEnum("testdata.MyMessage_Color", MyMessage_Color_name, MyMessage_Color_value) + proto.RegisterEnum("testdata.DefaultsMessage_DefaultsEnum", DefaultsMessage_DefaultsEnum_name, DefaultsMessage_DefaultsEnum_value) proto.RegisterEnum("testdata.Defaults_Color", Defaults_Color_name, Defaults_Color_value) proto.RegisterEnum("testdata.RepeatedEnum_Color", RepeatedEnum_Color_name, RepeatedEnum_Color_value) proto.RegisterExtension(E_Ext_More) proto.RegisterExtension(E_Ext_Text) proto.RegisterExtension(E_Ext_Number) proto.RegisterExtension(E_Greeting) + proto.RegisterExtension(E_NoDefaultDouble) + proto.RegisterExtension(E_NoDefaultFloat) + proto.RegisterExtension(E_NoDefaultInt32) + proto.RegisterExtension(E_NoDefaultInt64) + proto.RegisterExtension(E_NoDefaultUint32) + proto.RegisterExtension(E_NoDefaultUint64) + proto.RegisterExtension(E_NoDefaultSint32) + proto.RegisterExtension(E_NoDefaultSint64) + proto.RegisterExtension(E_NoDefaultFixed32) + proto.RegisterExtension(E_NoDefaultFixed64) + proto.RegisterExtension(E_NoDefaultSfixed32) + proto.RegisterExtension(E_NoDefaultSfixed64) + proto.RegisterExtension(E_NoDefaultBool) + proto.RegisterExtension(E_NoDefaultString) + proto.RegisterExtension(E_NoDefaultBytes) + proto.RegisterExtension(E_NoDefaultEnum) + proto.RegisterExtension(E_DefaultDouble) + proto.RegisterExtension(E_DefaultFloat) + proto.RegisterExtension(E_DefaultInt32) + proto.RegisterExtension(E_DefaultInt64) + proto.RegisterExtension(E_DefaultUint32) + proto.RegisterExtension(E_DefaultUint64) + proto.RegisterExtension(E_DefaultSint32) + proto.RegisterExtension(E_DefaultSint64) + proto.RegisterExtension(E_DefaultFixed32) + proto.RegisterExtension(E_DefaultFixed64) + proto.RegisterExtension(E_DefaultSfixed32) + proto.RegisterExtension(E_DefaultSfixed64) + proto.RegisterExtension(E_DefaultBool) + proto.RegisterExtension(E_DefaultString) + proto.RegisterExtension(E_DefaultBytes) + proto.RegisterExtension(E_DefaultEnum) proto.RegisterExtension(E_X201) proto.RegisterExtension(E_X202) proto.RegisterExtension(E_X203) diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/testdata/test.proto b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/testdata/test.proto index ac9542abc01e6..3d1cbb675d505 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/testdata/test.proto +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/testdata/test.proto @@ -277,6 +277,51 @@ extend MyMessage { repeated string greeting = 106; } +message DefaultsMessage { + enum DefaultsEnum { + ZERO = 0; + ONE = 1; + TWO = 2; + }; + extensions 100 to max; +} + +extend DefaultsMessage { + optional double no_default_double = 101; + optional float no_default_float = 102; + optional int32 no_default_int32 = 103; + optional int64 no_default_int64 = 104; + optional uint32 no_default_uint32 = 105; + optional uint64 no_default_uint64 = 106; + optional sint32 no_default_sint32 = 107; + optional sint64 no_default_sint64 = 108; + optional fixed32 no_default_fixed32 = 109; + optional fixed64 no_default_fixed64 = 110; + optional sfixed32 no_default_sfixed32 = 111; + optional sfixed64 no_default_sfixed64 = 112; + optional bool no_default_bool = 113; + optional string no_default_string = 114; + optional bytes no_default_bytes = 115; + optional DefaultsMessage.DefaultsEnum no_default_enum = 116; + + optional double default_double = 201 [default = 3.1415]; + optional float default_float = 202 [default = 3.14]; + optional int32 default_int32 = 203 [default = 42]; + optional int64 default_int64 = 204 [default = 43]; + optional uint32 default_uint32 = 205 [default = 44]; + optional uint64 default_uint64 = 206 [default = 45]; + optional sint32 default_sint32 = 207 [default = 46]; + optional sint64 default_sint64 = 208 [default = 47]; + optional fixed32 default_fixed32 = 209 [default = 48]; + optional fixed64 default_fixed64 = 210 [default = 49]; + optional sfixed32 default_sfixed32 = 211 [default = 50]; + optional sfixed64 default_sfixed64 = 212 [default = 51]; + optional bool default_bool = 213 [default = true]; + optional string default_string = 214 [default = "Hello, string"]; + optional bytes default_bytes = 215 [default = "Hello, bytes"]; + optional DefaultsMessage.DefaultsEnum default_enum = 216 [default = ONE]; +} + message MyMessageSet { option message_set_wire_format = true; extensions 100 to max; @@ -426,3 +471,24 @@ message GroupNew { message FloatingPoint { required double f = 1; } + +message MessageWithMap { + map name_mapping = 1; + map msg_mapping = 2; + map byte_mapping = 3; + map str_to_str = 4; +} + +message Communique { + optional bool make_me_cry = 1; + + // This is a oneof, called "union". + oneof union { + int32 number = 5; + string name = 6; + bytes data = 7; + double temp_c = 8; + MyMessage.Color col = 9; + Strings msg = 10; + } +} diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text.go index af6178989dcca..c12caecafb992 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text.go @@ -42,11 +42,11 @@ import ( "bufio" "bytes" "encoding" + "errors" "fmt" "io" "log" "math" - "os" "reflect" "sort" "strings" @@ -253,6 +253,110 @@ func writeStruct(w *textWriter, sv reflect.Value) error { } continue } + if fv.Kind() == reflect.Map { + // Map fields are rendered as a repeated struct with key/value fields. + keys := fv.MapKeys() + sort.Sort(mapKeys(keys)) + for _, key := range keys { + val := fv.MapIndex(key) + if err := writeName(w, props); err != nil { + return err + } + if !w.compact { + if err := w.WriteByte(' '); err != nil { + return err + } + } + // open struct + if err := w.WriteByte('<'); err != nil { + return err + } + if !w.compact { + if err := w.WriteByte('\n'); err != nil { + return err + } + } + w.indent() + // key + if _, err := w.WriteString("key:"); err != nil { + return err + } + if !w.compact { + if err := w.WriteByte(' '); err != nil { + return err + } + } + if err := writeAny(w, key, props.mkeyprop); err != nil { + return err + } + if err := w.WriteByte('\n'); err != nil { + return err + } + // nil values aren't legal, but we can avoid panicking because of them. + if val.Kind() != reflect.Ptr || !val.IsNil() { + // value + if _, err := w.WriteString("value:"); err != nil { + return err + } + if !w.compact { + if err := w.WriteByte(' '); err != nil { + return err + } + } + if err := writeAny(w, val, props.mvalprop); err != nil { + return err + } + if err := w.WriteByte('\n'); err != nil { + return err + } + } + // close struct + w.unindent() + if err := w.WriteByte('>'); err != nil { + return err + } + if err := w.WriteByte('\n'); err != nil { + return err + } + } + continue + } + if props.proto3 && fv.Kind() == reflect.Slice && fv.Len() == 0 { + // empty bytes field + continue + } + if props.proto3 && fv.Kind() != reflect.Ptr && fv.Kind() != reflect.Slice { + // proto3 non-repeated scalar field; skip if zero value + if isProto3Zero(fv) { + continue + } + } + + if fv.Kind() == reflect.Interface { + // Check if it is a oneof. + if st.Field(i).Tag.Get("protobuf_oneof") != "" { + // fv is nil, or holds a pointer to generated struct. + // That generated struct has exactly one field, + // which has a protobuf struct tag. + if fv.IsNil() { + continue + } + inner := fv.Elem().Elem() // interface -> *T -> T + tag := inner.Type().Field(0).Tag.Get("protobuf") + props.Parse(tag) // Overwrite the outer props. + // Write the value in the oneof, not the oneof itself. + fv = inner.Field(0) + + // Special case to cope with malformed messages gracefully: + // If the value in the oneof is a nil pointer, don't panic + // in writeAny. + if fv.Kind() == reflect.Ptr && fv.IsNil() { + // Use errors.New so writeAny won't render quotes. + msg := errors.New("/* nil */") + fv = reflect.ValueOf(&msg).Elem() + } + } + } if err := writeName(w, props); err != nil { return err @@ -319,15 +423,17 @@ func writeAny(w *textWriter, v reflect.Value, props *Properties) error { v = reflect.Indirect(v) if props != nil && len(props.CustomType) > 0 { - var custom Marshaler = v.Interface().(Marshaler) - data, err := custom.Marshal() - if err != nil { - return err - } - if err := writeString(w, string(data)); err != nil { - return err + custom, ok := v.Interface().(Marshaler) + if ok { + data, err := custom.Marshal() + if err != nil { + return err + } + if err := writeString(w, string(data)); err != nil { + return err + } + return nil } - return nil } // Floats have special cases. @@ -354,7 +460,7 @@ func writeAny(w *textWriter, v reflect.Value, props *Properties) error { switch v.Kind() { case reflect.Slice: // Should only be a []byte; repeated fields are handled in writeStruct. - if err := writeString(w, string(v.Interface().([]byte))); err != nil { + if err := writeString(w, string(v.Bytes())); err != nil { return err } case reflect.String: @@ -456,8 +562,8 @@ func writeMessageSet(w *textWriter, ms *MessageSet) error { pb := reflect.New(msd.t.Elem()) if err := Unmarshal(item.Message, pb.Interface().(Message)); err != nil { - if _, err := fmt.Fprintf(w, "/* bad message: %v */\n", err); err != nil { - return err + if _, ferr := fmt.Fprintf(w, "/* bad message: %v */\n", err); ferr != nil { + return ferr } } else { if err := writeStruct(w, pb.Elem()); err != nil { @@ -482,7 +588,7 @@ func writeMessageSet(w *textWriter, ms *MessageSet) error { return nil } -func writeUnknownStruct(w *textWriter, data []byte) (err error) { +func writeUnknownStruct(w *textWriter, data []byte) error { if !w.compact { if _, err := fmt.Fprintf(w, "/* %d unknown bytes */\n", len(data)); err != nil { return err @@ -492,19 +598,19 @@ func writeUnknownStruct(w *textWriter, data []byte) (err error) { for b.index < len(b.buf) { x, err := b.DecodeVarint() if err != nil { - _, err := fmt.Fprintf(w, "/* %v */\n", err) - return err + _, ferr := fmt.Fprintf(w, "/* %v */\n", err) + return ferr } wire, tag := x&7, x>>3 if wire == WireEndGroup { w.unindent() - if _, err := w.Write(endBraceNewline); err != nil { - return err + if _, werr := w.Write(endBraceNewline); werr != nil { + return werr } continue } - if _, err := fmt.Fprint(w, tag); err != nil { - return err + if _, ferr := fmt.Fprint(w, tag); ferr != nil { + return ferr } if wire != WireStartGroup { if err := w.WriteByte(':'); err != nil { @@ -542,7 +648,7 @@ func writeUnknownStruct(w *textWriter, data []byte) (err error) { if err != nil { return err } - if err = w.WriteByte('\n'); err != nil { + if err := w.WriteByte('\n'); err != nil { return err } } @@ -607,10 +713,7 @@ func writeExtensions(w *textWriter, pv reflect.Value) error { pb, err := GetExtension(ep, desc) if err != nil { - if _, err := fmt.Fprintln(os.Stderr, "proto: failed getting extension: ", err); err != nil { - return err - } - continue + return fmt.Errorf("failed getting extension: %v", err) } // Repeated extensions will appear as a slice. diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text_parser.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text_parser.go index 151bf73ea2272..acc001fd27803 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text_parser.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text_parser.go @@ -179,7 +179,7 @@ func (p *textParser) advance() { } unq, err := unquoteC(p.s[1:i], rune(p.s[0])) if err != nil { - p.errorf("invalid quoted string %v", p.s[0:i+1]) + p.errorf("invalid quoted string %s: %v", p.s[0:i+1], err) return } p.cur.value, p.s = p.s[0:i+1], p.s[i+1:len(p.s)] @@ -360,6 +360,18 @@ func (p *textParser) next() *token { return &p.cur } +func (p *textParser) consumeToken(s string) error { + tok := p.next() + if tok.err != nil { + return tok.err + } + if tok.value != s { + p.back() + return p.errorf("expected %q, found %q", s, tok.value) + } + return nil +} + // Return a RequiredNotSetError indicating which required field was not set. func (p *textParser) missingRequiredFieldError(sv reflect.Value) *RequiredNotSetError { st := sv.Type() @@ -378,8 +390,7 @@ func (p *textParser) missingRequiredFieldError(sv reflect.Value) *RequiredNotSet } // Returns the index in the struct for the named field, as well as the parsed tag properties. -func structFieldByName(st reflect.Type, name string) (int, *Properties, bool) { - sprops := GetProperties(st) +func structFieldByName(sprops *StructProperties, name string) (int, *Properties, bool) { i, ok := sprops.decoderOrigNames[name] if ok { return i, sprops.Prop[i], true @@ -414,6 +425,10 @@ func (p *textParser) checkForColon(props *Properties, typ reflect.Type) *ParseEr if typ.Elem().Kind() != reflect.Ptr { break } + } else if typ.Kind() == reflect.String { + // The proto3 exception is for a string field, + // which requires a colon. + break } needColon = false } @@ -427,7 +442,8 @@ func (p *textParser) checkForColon(props *Properties, typ reflect.Type) *ParseEr func (p *textParser) readStruct(sv reflect.Value, terminator string) error { st := sv.Type() - reqCount := GetProperties(st).reqCount + sprops := GetProperties(st) + reqCount := sprops.reqCount var reqFieldErr error fieldSet := make(map[string]bool) // A struct is a sequence of "name: value", terminated by one of @@ -509,45 +525,113 @@ func (p *textParser) readStruct(sv reflect.Value, terminator string) error { sl = reflect.Append(sl, ext) SetExtension(ep, desc, sl.Interface()) } - } else { - // This is a normal, non-extension field. - name := tok.value - fi, props, ok := structFieldByName(st, name) - if !ok { - return p.errorf("unknown field name %q in %v", name, st) + if err := p.consumeOptionalSeparator(); err != nil { + return err } + continue + } - dst := sv.Field(fi) + // This is a normal, non-extension field. + name := tok.value + var dst reflect.Value + fi, props, ok := structFieldByName(sprops, name) + if ok { + dst = sv.Field(fi) + } else if oop, ok := sprops.OneofTypes[name]; ok { + // It is a oneof. + props = oop.Prop + nv := reflect.New(oop.Type.Elem()) + dst = nv.Elem().Field(0) + sv.Field(oop.Field).Set(nv) + } + if !dst.IsValid() { + return p.errorf("unknown field name %q in %v", name, st) + } - // Check that it's not already set if it's not a repeated field. - if !props.Repeated && fieldSet[name] { - return p.errorf("non-repeated field %q was repeated", name) + if dst.Kind() == reflect.Map { + // Consume any colon. + if err := p.checkForColon(props, dst.Type()); err != nil { + return err } - if err := p.checkForColon(props, st.Field(fi).Type); err != nil { + // Construct the map if it doesn't already exist. + if dst.IsNil() { + dst.Set(reflect.MakeMap(dst.Type())) + } + key := reflect.New(dst.Type().Key()).Elem() + val := reflect.New(dst.Type().Elem()).Elem() + + // The map entry should be this sequence of tokens: + // < key : KEY value : VALUE > + // Technically the "key" and "value" could come in any order, + // but in practice they won't. + + tok := p.next() + var terminator string + switch tok.value { + case "<": + terminator = ">" + case "{": + terminator = "}" + default: + return p.errorf("expected '{' or '<', found %q", tok.value) + } + if err := p.consumeToken("key"); err != nil { return err } - - // Parse into the field. - fieldSet[name] = true - if err := p.readAny(dst, props); err != nil { - if _, ok := err.(*RequiredNotSetError); !ok { - return err - } - reqFieldErr = err - } else if props.Required { - reqCount-- + if err := p.consumeToken(":"); err != nil { + return err + } + if err := p.readAny(key, props.mkeyprop); err != nil { + return err + } + if err := p.consumeOptionalSeparator(); err != nil { + return err } + if err := p.consumeToken("value"); err != nil { + return err + } + if err := p.checkForColon(props.mvalprop, dst.Type().Elem()); err != nil { + return err + } + if err := p.readAny(val, props.mvalprop); err != nil { + return err + } + if err := p.consumeOptionalSeparator(); err != nil { + return err + } + if err := p.consumeToken(terminator); err != nil { + return err + } + + dst.SetMapIndex(key, val) + continue } - // For backward compatibility, permit a semicolon or comma after a field. - tok = p.next() - if tok.err != nil { - return tok.err + // Check that it's not already set if it's not a repeated field. + if !props.Repeated && fieldSet[name] { + return p.errorf("non-repeated field %q was repeated", name) } - if tok.value != ";" && tok.value != "," { - p.back() + + if err := p.checkForColon(props, dst.Type()); err != nil { + return err } + + // Parse into the field. + fieldSet[name] = true + if err := p.readAny(dst, props); err != nil { + if _, ok := err.(*RequiredNotSetError); !ok { + return err + } + reqFieldErr = err + } else if props.Required { + reqCount-- + } + + if err := p.consumeOptionalSeparator(); err != nil { + return err + } + } if reqCount > 0 { @@ -556,6 +640,19 @@ func (p *textParser) readStruct(sv reflect.Value, terminator string) error { return reqFieldErr } +// consumeOptionalSeparator consumes an optional semicolon or comma. +// It is used in readStruct to provide backward compatibility. +func (p *textParser) consumeOptionalSeparator() error { + tok := p.next() + if tok.err != nil { + return tok.err + } + if tok.value != ";" && tok.value != "," { + p.back() + } + return nil +} + func (p *textParser) readAny(v reflect.Value, props *Properties) error { tok := p.next() if tok.err != nil { diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text_parser_test.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text_parser_test.go index ebf744a1b2fdc..0ac8a51c5e98f 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text_parser_test.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text_parser_test.go @@ -36,8 +36,9 @@ import ( "reflect" "testing" - . "./testdata" . "github.com/gogo/protobuf/proto" + proto3pb "github.com/gogo/protobuf/proto/proto3_proto" + . "github.com/gogo/protobuf/proto/testdata" ) type UnmarshalTextTest struct { @@ -151,7 +152,7 @@ var unMarshalTextTests = []UnmarshalTextTest{ // Bad quoted string { in: `inner: < host: "\0" >` + "\n", - err: `line 1.15: invalid quoted string "\0"`, + err: `line 1.15: invalid quoted string "\0": \0 requires 2 following digits`, }, // Number too large for int64 @@ -443,6 +444,60 @@ func TestRepeatedEnum(t *testing.T) { } } +func TestProto3TextParsing(t *testing.T) { + m := new(proto3pb.Message) + const in = `name: "Wallace" true_scotsman: true` + want := &proto3pb.Message{ + Name: "Wallace", + TrueScotsman: true, + } + if err := UnmarshalText(in, m); err != nil { + t.Fatal(err) + } + if !Equal(m, want) { + t.Errorf("\n got %v\nwant %v", m, want) + } +} + +func TestMapParsing(t *testing.T) { + m := new(MessageWithMap) + const in = `name_mapping: name_mapping:` + + `msg_mapping:,>` + // separating commas are okay + `msg_mapping>` + // no colon after "value" + `byte_mapping:` + want := &MessageWithMap{ + NameMapping: map[int32]string{ + 1: "Beatles", + 1234: "Feist", + }, + MsgMapping: map[int64]*FloatingPoint{ + -4: {F: Float64(2.0)}, + -2: {F: Float64(4.0)}, + }, + ByteMapping: map[bool][]byte{ + true: []byte("so be it"), + }, + } + if err := UnmarshalText(in, m); err != nil { + t.Fatal(err) + } + if !Equal(m, want) { + t.Errorf("\n got %v\nwant %v", m, want) + } +} + +func TestOneofParsing(t *testing.T) { + const in = `name:"Shrek"` + m := new(Communique) + want := &Communique{Union: &Communique_Name{"Shrek"}} + if err := UnmarshalText(in, m); err != nil { + t.Fatal(err) + } + if !Equal(m, want) { + t.Errorf("\n got %v\nwant %v", m, want) + } +} + var benchInput string func init() { diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text_test.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text_test.go index b1d6157d6e840..6524048428f0e 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text_test.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text_test.go @@ -41,7 +41,8 @@ import ( "github.com/gogo/protobuf/proto" - pb "./testdata" + proto3pb "github.com/gogo/protobuf/proto/proto3_proto" + pb "github.com/gogo/protobuf/proto/testdata" ) // textMessage implements the methods that allow it to marshal and unmarshal @@ -207,6 +208,30 @@ func TestMarshalTextUnknownEnum(t *testing.T) { } } +func TestTextOneof(t *testing.T) { + tests := []struct { + m proto.Message + want string + }{ + // zero message + {&pb.Communique{}, ``}, + // scalar field + {&pb.Communique{Union: &pb.Communique_Number{Number: 4}}, `number:4`}, + // message field + {&pb.Communique{Union: &pb.Communique_Msg{ + Msg: &pb.Strings{StringField: proto.String("why hello!")}, + }}, `msg:`}, + // bad oneof (should not panic) + {&pb.Communique{Union: &pb.Communique_Msg{Msg: nil}}, `msg:/* nil */`}, + } + for _, test := range tests { + got := strings.TrimSpace(test.m.String()) + if got != test.want { + t.Errorf("\n got %s\nwant %s", got, test.want) + } + } +} + func BenchmarkMarshalTextBuffered(b *testing.B) { buf := new(bytes.Buffer) m := newTestMessage() @@ -406,3 +431,44 @@ Message t.Errorf(" got: %s\nwant: %s", s, want) } } + +func TestProto3Text(t *testing.T) { + tests := []struct { + m proto.Message + want string + }{ + // zero message + {&proto3pb.Message{}, ``}, + // zero message except for an empty byte slice + {&proto3pb.Message{Data: []byte{}}, ``}, + // trivial case + {&proto3pb.Message{Name: "Rob", HeightInCm: 175}, `name:"Rob" height_in_cm:175`}, + // empty map + {&pb.MessageWithMap{}, ``}, + // non-empty map; map format is the same as a repeated struct, + // and they are sorted by key (numerically for numeric keys). + { + &pb.MessageWithMap{NameMapping: map[int32]string{ + -1: "Negatory", + 7: "Lucky", + 1234: "Feist", + 6345789: "Otis", + }}, + `name_mapping: ` + + `name_mapping: ` + + `name_mapping: ` + + `name_mapping:`, + }, + // map with nil value; not well-defined, but we shouldn't crash + { + &pb.MessageWithMap{MsgMapping: map[int64]*pb.FloatingPoint{7: nil}}, + `msg_mapping:`, + }, + } + for _, test := range tests { + got := strings.TrimSpace(test.m.String()) + if got != test.want { + t.Errorf("\n got %s\nwant %s", got, test.want) + } + } +} diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/auth/sasl/authenticatee.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/auth/sasl/authenticatee.go index 3d60bdb814acb..2b9477a6df82c 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/auth/sasl/authenticatee.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/auth/sasl/authenticatee.go @@ -77,7 +77,7 @@ func init() { log.Fatal("expected to have a parent UPID in context") } process := process.New("sasl_authenticatee") - tpid := &upid.UPID{ + tpid := upid.UPID{ ID: process.Label(), Host: parent.Host, } @@ -285,7 +285,7 @@ func (self *authenticateeProcess) mechanisms(ctx context.Context, from *upid.UPI message := &mesos.AuthenticationStartMessage{ Mechanism: proto.String(selectedMech), - Data: proto.String(string(data)), // may be nil, depends on init step + Data: data, // may be nil, depends on init step } if err := self.transport.Send(ctx, from, message); err != nil { diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/auth/sasl/authenticatee_test.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/auth/sasl/authenticatee_test.go index 2a4d587321246..366e1de77da00 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/auth/sasl/authenticatee_test.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/auth/sasl/authenticatee_test.go @@ -60,12 +60,17 @@ func TestAuthticatee_validLogin(t *testing.T) { factory := transportFactoryFunc(func() messenger.Messenger { transport = &MockTransport{messenger.NewMockedMessenger()} transport.On("Install").Return(nil) - transport.On("UPID").Return(&tpid) + transport.On("UPID").Return(tpid) transport.On("Start").Return(nil) transport.On("Stop").Return(nil) + + mechMsg := make(chan struct{}) + stepMsg := make(chan struct{}) + transport.On("Send", mock.Anything, &server, &mesos.AuthenticateMessage{ Pid: proto.String(client.String()), }).Return(nil).Run(func(_ mock.Arguments) { + defer close(mechMsg) transport.Recv(&server, &mesos.AuthenticationMechanismsMessage{ Mechanisms: []string{crammd5.Name}, }) @@ -73,8 +78,9 @@ func TestAuthticatee_validLogin(t *testing.T) { transport.On("Send", mock.Anything, &server, &mesos.AuthenticationStartMessage{ Mechanism: proto.String(crammd5.Name), - Data: proto.String(""), // may be nil, depends on init step }).Return(nil).Run(func(_ mock.Arguments) { + defer close(stepMsg) + <-mechMsg transport.Recv(&server, &mesos.AuthenticationStepMessage{ Data: []byte(`lsd;lfkgjs;dlfkgjs;dfklg`), }) @@ -83,6 +89,7 @@ func TestAuthticatee_validLogin(t *testing.T) { transport.On("Send", mock.Anything, &server, &mesos.AuthenticationStepMessage{ Data: []byte(`foo cc7fd96cd80123ea844a7dba29a594ed`), }).Return(nil).Run(func(_ mock.Arguments) { + <-stepMsg transport.Recv(&server, &mesos.AuthenticationCompletedMessage{}) }).Once() diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/client.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/client.go deleted file mode 100644 index 3e42c2d7c4488..0000000000000 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/client.go +++ /dev/null @@ -1,444 +0,0 @@ -package zoo - -import ( - "errors" - "fmt" - "sync" - "sync/atomic" - "time" - - log "github.com/golang/glog" - "github.com/samuel/go-zookeeper/zk" -) - -const ( - defaultSessionTimeout = 60 * time.Second - defaultReconnectTimeout = 5 * time.Second - currentPath = "." - defaultRewatchDelay = 200 * time.Millisecond -) - -type stateType int32 - -const ( - disconnectedState stateType = iota - connectionRequestedState - connectionAttemptState - connectedState -) - -func (s stateType) String() string { - switch s { - case disconnectedState: - return "DISCONNECTED" - case connectionRequestedState: - return "REQUESTED" - case connectionAttemptState: - return "ATTEMPT" - case connectedState: - return "CONNECTED" - default: - panic(fmt.Sprintf("unrecognized state: %d", int32(s))) - } -} - -type Client struct { - conn Connector - defaultFactory Factory - factory Factory // must never be nil, use setFactory to update - state stateType - reconnCount uint64 - reconnDelay time.Duration - rootPath string - errorHandler ErrorHandler // must never be nil - connectOnce sync.Once - stopOnce sync.Once - shouldStop chan struct{} // signal chan - shouldReconn chan struct{} // message chan - connLock sync.Mutex - hasConnected chan struct{} // message chan - rewatchDelay time.Duration -} - -func newClient(hosts []string, path string) (*Client, error) { - zkc := &Client{ - reconnDelay: defaultReconnectTimeout, - rewatchDelay: defaultRewatchDelay, - rootPath: path, - shouldStop: make(chan struct{}), - shouldReconn: make(chan struct{}, 1), - hasConnected: make(chan struct{}, 1), - errorHandler: ErrorHandler(func(*Client, error) {}), - defaultFactory: asFactory(func() (Connector, <-chan zk.Event, error) { - return zk.Connect(hosts, defaultSessionTimeout) - }), - } - zkc.setFactory(zkc.defaultFactory) - // TODO(vlad): validate URIs - return zkc, nil -} - -func (zkc *Client) setFactory(f Factory) { - if f == nil { - f = zkc.defaultFactory - } - zkc.factory = asFactory(func() (c Connector, ch <-chan zk.Event, err error) { - select { - case <-zkc.shouldStop: - err = errors.New("client stopping") - default: - zkc.connLock.Lock() - defer zkc.connLock.Unlock() - if zkc.conn != nil { - zkc.conn.Close() - } - c, ch, err = f.create() - zkc.conn = c - } - return - }) -} - -// return true only if the client's state was changed from `from` to `to` -func (zkc *Client) stateChange(from, to stateType) (result bool) { - defer func() { - log.V(3).Infof("stateChange: from=%v to=%v result=%v", from, to, result) - }() - result = atomic.CompareAndSwapInt32((*int32)(&zkc.state), int32(from), int32(to)) - return -} - -// connect to zookeeper, blocks on the initial call to doConnect() -func (zkc *Client) connect() { - select { - case <-zkc.shouldStop: - return - default: - zkc.connectOnce.Do(func() { - if zkc.stateChange(disconnectedState, connectionRequestedState) { - if err := zkc.doConnect(); err != nil { - log.Error(err) - zkc.errorHandler(zkc, err) - } - } - go func() { - for { - select { - case <-zkc.shouldStop: - zkc.connLock.Lock() - defer zkc.connLock.Unlock() - if zkc.conn != nil { - zkc.conn.Close() - } - return - case <-zkc.shouldReconn: - if err := zkc.reconnect(); err != nil { - log.Error(err) - zkc.errorHandler(zkc, err) - } - } - } - }() - }) - } - return -} - -// attempt to reconnect to zookeeper. will ignore attempts to reconnect -// if not disconnected. if reconnection is attempted then this func will block -// for at least reconnDelay before actually attempting to connect to zookeeper. -func (zkc *Client) reconnect() error { - if !zkc.stateChange(disconnectedState, connectionRequestedState) { - log.V(4).Infoln("Ignoring reconnect, currently connected/connecting.") - return nil - } - - defer func() { zkc.reconnCount++ }() - - log.V(4).Infoln("Delaying reconnection for ", zkc.reconnDelay) - <-time.After(zkc.reconnDelay) - - return zkc.doConnect() -} - -func (zkc *Client) doConnect() error { - if !zkc.stateChange(connectionRequestedState, connectionAttemptState) { - log.V(4).Infoln("aborting doConnect, connection attempt already in progress or else disconnected") - return nil - } - - // if we're not connected by the time we return then we failed. - defer func() { - zkc.stateChange(connectionAttemptState, disconnectedState) - }() - - // create Connector instance - conn, sessionEvents, err := zkc.factory.create() - if err != nil { - // once the factory stops producing connectors, it's time to stop - zkc.stop() - return err - } - - zkc.connLock.Lock() - zkc.conn = conn - zkc.connLock.Unlock() - - log.V(4).Infof("Created connection object of type %T\n", conn) - connected := make(chan struct{}) - sessionExpired := make(chan struct{}) - go func() { - defer close(sessionExpired) - zkc.monitorSession(sessionEvents, connected) - }() - - // wait for connected confirmation - select { - case <-connected: - if !zkc.stateChange(connectionAttemptState, connectedState) { - log.V(4).Infoln("failed to transition to connected state") - // we could be: - // - disconnected ... reconnect() will try to connect again, otherwise; - // - connected ... another goroutine already established a connection - // - connectionRequested ... another goroutine is already trying to connect - zkc.requestReconnect() - } - log.Infoln("zookeeper client connected") - case <-sessionExpired: - // connection was disconnected before it was ever really 'connected' - if !zkc.stateChange(connectionAttemptState, disconnectedState) { - //programming error - panic("failed to transition from connection-attempt to disconnected state") - } - zkc.requestReconnect() - case <-zkc.shouldStop: - // noop - } - return nil -} - -// signal for reconnect unless we're shutting down -func (zkc *Client) requestReconnect() { - select { - case <-zkc.shouldStop: - // abort reconnect request, client is shutting down - default: - select { - case zkc.shouldReconn <- struct{}{}: - // reconnect request successful - default: - // reconnect chan is full: reconnect has already - // been requested. move on. - } - } -} - -// monitor a zookeeper session event channel, closes the 'connected' channel once -// a zookeeper connection has been established. errors are forwarded to the client's -// errorHandler. the closing of the sessionEvents chan triggers a call to client.onDisconnected. -// this func blocks until either the client's shouldStop or sessionEvents chan are closed. -func (zkc *Client) monitorSession(sessionEvents <-chan zk.Event, connected chan struct{}) { - firstConnected := true - for { - select { - case <-zkc.shouldStop: - return - case e, ok := <-sessionEvents: - if !ok { - // once sessionEvents is closed, the embedded ZK client will - // no longer attempt to reconnect. - zkc.onDisconnected() - return - } else if e.Err != nil { - log.Errorf("received state error: %s", e.Err.Error()) - zkc.errorHandler(zkc, e.Err) - } - switch e.State { - case zk.StateConnecting: - log.Infoln("connecting to zookeeper..") - - case zk.StateConnected: - log.V(2).Infoln("received StateConnected") - if firstConnected { - close(connected) // signal session listener - firstConnected = false - } - // let any listeners know about the change - select { - case <-zkc.shouldStop: // noop - case zkc.hasConnected <- struct{}{}: // noop - default: // message buf full, this becomes a non-blocking noop - } - - case zk.StateDisconnected: - log.Infoln("zookeeper client disconnected") - - case zk.StateExpired: - log.Infoln("zookeeper client session expired") - } - } - } -} - -// watch the child nodes for changes, at the specified path. -// callers that specify a path of `currentPath` will watch the currently set rootPath, -// otherwise the watchedPath is calculated as rootPath+path. -// this func spawns a go routine to actually do the watching, and so returns immediately. -// in the absense of errors a signalling channel is returned that will close -// upon the termination of the watch (e.g. due to disconnection). -func (zkc *Client) watchChildren(path string, watcher ChildWatcher) (<-chan struct{}, error) { - watchPath := zkc.rootPath - if path != "" && path != currentPath { - watchPath = watchPath + path - } - - log.V(2).Infoln("Watching children for path", watchPath) - watchEnded := make(chan struct{}) - go func() { - defer close(watchEnded) - zkc._watchChildren(watchPath, watcher) - }() - return watchEnded, nil -} - -// continuation of watchChildren. blocks until either underlying zk connector terminates, or else this -// client is shut down. continuously renews child watches. -func (zkc *Client) _watchChildren(watchPath string, watcher ChildWatcher) { - watcher(zkc, watchPath) // prime the listener - var zkevents <-chan zk.Event - var err error - first := true - for { - // we really only expect this to happen when zk session has expired, - // give the connection a little time to re-establish itself - for { - //TODO(jdef) it would be better if we could listen for broadcast Connection/Disconnection events, - //emitted whenever the embedded client cycles (read: when the connection state of this client changes). - //As it currently stands, if the embedded client cycles fast enough, we may actually not notice it here - //and keep on watching like nothing bad happened. - if !zkc.isConnected() { - log.Warningf("no longer connected to server, exiting child watch") - return - } - if first { - first = false - } else { - select { - case <-zkc.shouldStop: - return - case <-time.After(zkc.rewatchDelay): - } - } - _, _, zkevents, err = zkc.conn.ChildrenW(watchPath) - if err == nil { - log.V(2).Infoln("rewatching children for path", watchPath) - break - } - log.V(1).Infof("unable to watch children for path %s: %s", watchPath, err.Error()) - zkc.errorHandler(zkc, err) - } - // zkevents is (at most) a one-trick channel - // (a) a child event happens (no error) - // (b) the embedded client is shutting down (zk.ErrClosing) - // (c) the zk session expires (zk.ErrSessionExpired) - select { - case <-zkc.shouldStop: - return - case e, ok := <-zkevents: - if !ok { - log.Warningf("expected a single zk event before channel close") - break // the select - } - switch e.Type { - //TODO(jdef) should we not also watch for EventNode{Created,Deleted,DataChanged}? - case zk.EventNodeChildrenChanged: - log.V(2).Infoln("Handling: zk.EventNodeChildrenChanged") - watcher(zkc, e.Path) - continue - default: - if e.Err != nil { - zkc.errorHandler(zkc, e.Err) - if e.Type == zk.EventNotWatching && e.State == zk.StateDisconnected { - if e.Err == zk.ErrClosing { - log.V(1).Infof("watch invalidated, embedded client terminating") - return - } - log.V(1).Infof("watch invalidated, attempting to watch again: %v", e.Err) - } else { - log.Warningf("received error while watching path %s: %s", watchPath, e.Err.Error()) - } - } - } - } - } -} - -func (zkc *Client) onDisconnected() { - if st := zkc.getState(); st == connectedState && zkc.stateChange(st, disconnectedState) { - log.Infoln("disconnected from the server, reconnecting...") - zkc.requestReconnect() - return - } -} - -// return a channel that gets an empty struct every time a connection happens -func (zkc *Client) connections() <-chan struct{} { - return zkc.hasConnected -} - -func (zkc *Client) getState() stateType { - return stateType(atomic.LoadInt32((*int32)(&zkc.state))) -} - -// convenience function -func (zkc *Client) isConnected() bool { - return zkc.getState() == connectedState -} - -// convenience function -func (zkc *Client) isConnecting() bool { - state := zkc.getState() - return state == connectionRequestedState || state == connectionAttemptState -} - -// convenience function -func (zkc *Client) isDisconnected() bool { - return zkc.getState() == disconnectedState -} - -func (zkc *Client) list(path string) ([]string, error) { - if !zkc.isConnected() { - return nil, errors.New("Unable to list children, client not connected.") - } - - children, _, err := zkc.conn.Children(path) - if err != nil { - return nil, err - } - - return children, nil -} - -func (zkc *Client) data(path string) ([]byte, error) { - if !zkc.isConnected() { - return nil, errors.New("Unable to retrieve node data, client not connected.") - } - - data, _, err := zkc.conn.Get(path) - if err != nil { - return nil, err - } - - return data, nil -} - -func (zkc *Client) stop() { - zkc.stopOnce.Do(func() { - close(zkc.shouldStop) - }) -} - -// when this channel is closed the client is either stopping, or has stopped -func (zkc *Client) stopped() <-chan struct{} { - return zkc.shouldStop -} diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/client2.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/client2.go new file mode 100644 index 0000000000000..8d3799a081399 --- /dev/null +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/client2.go @@ -0,0 +1,88 @@ +package zoo + +import ( + "sync" + "time" + + "github.com/samuel/go-zookeeper/zk" +) + +const ( + defaultSessionTimeout = 60 * time.Second + currentPath = "." +) + +var zkSessionTimeout = defaultSessionTimeout + +type client2 struct { + *zk.Conn + path string + done chan struct{} // signal chan, closes when the underlying connection terminates + stopOnce sync.Once +} + +func connect2(hosts []string, path string) (*client2, error) { + c, ev, err := zk.Connect(hosts, zkSessionTimeout) + if err != nil { + return nil, err + } + done := make(chan struct{}) + go func() { + // close the 'done' chan when the zk event chan closes (signals termination of zk connection) + defer close(done) + for { + if _, ok := <-ev; !ok { + return + } + } + }() + return &client2{ + Conn: c, + path: path, + done: done, + }, nil +} + +func (c *client2) stopped() <-chan struct{} { + return c.done +} + +func (c *client2) stop() { + c.stopOnce.Do(c.Close) +} + +func (c *client2) data(path string) (data []byte, err error) { + data, _, err = c.Get(path) + return +} + +func (c *client2) watchChildren(path string) (string, <-chan []string, <-chan error) { + errCh := make(chan error, 1) + snap := make(chan []string) + + watchPath := c.path + if path != "" && path != currentPath { + watchPath = watchPath + path + } + go func() { + defer close(errCh) + for { + children, _, ev, err := c.ChildrenW(watchPath) + if err != nil { + errCh <- err + return + } + select { + case snap <- children: + case <-c.done: + return + } + e := <-ev // wait for the next watch-related event + if e.Err != nil { + errCh <- e.Err + return + } + } + }() + return watchPath, snap, errCh +} diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/client_test.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/client_test.go deleted file mode 100644 index 1ebca734b36e4..0000000000000 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/client_test.go +++ /dev/null @@ -1,342 +0,0 @@ -package zoo - -import ( - "errors" - "fmt" - "os" - "strings" - "sync/atomic" - "testing" - "time" - - "github.com/gogo/protobuf/proto" - log "github.com/golang/glog" - util "github.com/mesos/mesos-go/mesosutil" - "github.com/samuel/go-zookeeper/zk" - "github.com/stretchr/testify/assert" -) - -var test_zk_hosts = []string{"localhost:2181"} - -const ( - test_zk_path = "/test" -) - -func TestClientNew(t *testing.T) { - path := "/mesos" - chEvent := make(chan zk.Event) - connector := makeMockConnector(path, chEvent) - - c, err := newClient(test_zk_hosts, path) - assert.NoError(t, err) - assert.NotNil(t, c) - assert.False(t, c.isConnected()) - c.conn = connector - -} - -// This test requires zookeeper to be running. -// You must also set env variable ZK_HOSTS to point to zk hosts. -// The zk package does not offer a way to mock its connection function. -func TestClientConnectIntegration(t *testing.T) { - if os.Getenv("ZK_HOSTS") == "" { - t.Skip("Skipping zk-server connection test: missing env ZK_HOSTS.") - } - hosts := strings.Split(os.Getenv("ZK_HOSTS"), ",") - c, err := newClient(hosts, "/mesos") - assert.NoError(t, err) - c.errorHandler = ErrorHandler(func(c *Client, e error) { - err = e - }) - c.connect() - assert.NoError(t, err) - - c.connect() - assert.NoError(t, err) - assert.True(t, c.isConnected()) -} - -func TestClientConnect(t *testing.T) { - c, err := makeClient() - assert.NoError(t, err) - assert.False(t, c.isConnected()) - c.connect() - assert.True(t, c.isConnected()) - assert.False(t, c.isConnecting()) -} - -func TestClient_FlappingConnection(t *testing.T) { - c, err := newClient(test_zk_hosts, test_zk_path) - c.reconnDelay = 10 * time.Millisecond // we don't want this test to take forever - defer c.stop() - - assert.NoError(t, err) - - attempts := 0 - c.setFactory(asFactory(func() (Connector, <-chan zk.Event, error) { - log.V(2).Infof("**** Using zk.Conn adapter ****") - ch0 := make(chan zk.Event, 10) // session chan - ch1 := make(chan zk.Event) // watch chan - go func() { - if attempts > 1 { - t.Fatalf("only one connector instance is expected") - } - attempts++ - for i := 0; i < 4; i++ { - ch0 <- zk.Event{ - Type: zk.EventSession, - State: zk.StateConnecting, - Path: test_zk_path, - } - ch0 <- zk.Event{ - Type: zk.EventSession, - State: zk.StateConnected, - Path: test_zk_path, - } - time.Sleep(200 * time.Millisecond) - ch0 <- zk.Event{ - Type: zk.EventSession, - State: zk.StateDisconnected, - Path: test_zk_path, - } - } - }() - connector := makeMockConnector(test_zk_path, ch1) - return connector, ch0, nil - })) - - go c.connect() - time.Sleep(2 * time.Second) - assert.True(t, c.isConnected()) - assert.Equal(t, 1, attempts) -} - -func TestClientWatchChildren(t *testing.T) { - c, err := makeClient() - assert.NoError(t, err) - c.errorHandler = ErrorHandler(func(c *Client, e error) { - err = e - }) - c.connect() - assert.NoError(t, err) - wCh := make(chan struct{}, 1) - childrenWatcher := ChildWatcher(func(zkc *Client, path string) { - log.V(4).Infoln("Path", path, "changed!") - children, err := c.list(path) - assert.NoError(t, err) - assert.Equal(t, 3, len(children)) - assert.Equal(t, "info_0", children[0]) - assert.Equal(t, "info_5", children[1]) - assert.Equal(t, "info_10", children[2]) - wCh <- struct{}{} - }) - - _, err = c.watchChildren(currentPath, childrenWatcher) - assert.NoError(t, err) - - select { - case <-wCh: - case <-time.After(time.Millisecond * 700): - panic("Waited too long...") - } -} - -func TestClientWatchErrors(t *testing.T) { - path := "/test" - ch := make(chan zk.Event, 1) - ch <- zk.Event{ - Type: zk.EventNotWatching, - Err: errors.New("Event Error"), - } - - c, err := makeClient() - c.state = connectedState - - assert.NoError(t, err) - c.conn = makeMockConnector(path, (<-chan zk.Event)(ch)) - wCh := make(chan struct{}, 1) - c.errorHandler = ErrorHandler(func(zkc *Client, err error) { - assert.Error(t, err) - wCh <- struct{}{} - }) - - c.watchChildren(currentPath, ChildWatcher(func(*Client, string) {})) - - select { - case <-wCh: - case <-time.After(time.Millisecond * 700): - t.Fatalf("timed out waiting for error message") - } - -} - -func TestWatchChildren_flappy(t *testing.T) { - c, err := newClient(test_zk_hosts, test_zk_path) - c.reconnDelay = 10 * time.Millisecond // we don't want this test to take forever - - assert.NoError(t, err) - - attempts := 0 - conn := NewMockConnector() - defer func() { - if !t.Failed() { - conn.AssertExpectations(t) - } - }() - defer func() { - // stop client and give it time to shut down the connector - c.stop() - time.Sleep(100 * time.Millisecond) - }() - c.setFactory(asFactory(func() (Connector, <-chan zk.Event, error) { - log.V(2).Infof("**** Using zk.Conn adapter ****") - ch0 := make(chan zk.Event, 10) // session chan - ch1 := make(chan zk.Event) // watch chan - go func() { - if attempts > 1 { - t.Fatalf("only one connector instance is expected") - } - attempts++ - for i := 0; i < 4; i++ { - ch0 <- zk.Event{ - Type: zk.EventSession, - State: zk.StateConnecting, - Path: test_zk_path, - } - ch0 <- zk.Event{ - Type: zk.EventSession, - State: zk.StateConnected, - Path: test_zk_path, - } - time.Sleep(200 * time.Millisecond) - ch0 <- zk.Event{ - Type: zk.EventSession, - State: zk.StateDisconnected, - Path: test_zk_path, - } - } - ch0 <- zk.Event{ - Type: zk.EventSession, - State: zk.StateConnecting, - Path: test_zk_path, - } - ch0 <- zk.Event{ - Type: zk.EventSession, - State: zk.StateConnected, - Path: test_zk_path, - } - ch1 <- zk.Event{ - Type: zk.EventNodeChildrenChanged, - Path: test_zk_path, - } - }() - simulatedErr := errors.New("simulated watch error") - conn.On("ChildrenW", test_zk_path).Return(nil, nil, nil, simulatedErr).Times(4) - conn.On("ChildrenW", test_zk_path).Return([]string{test_zk_path}, &zk.Stat{}, (<-chan zk.Event)(ch1), nil) - conn.On("Close").Return(nil) - return conn, ch0, nil - })) - - go c.connect() - var watchChildrenCount uint64 - watcherFunc := ChildWatcher(func(zkc *Client, path string) { - log.V(1).Infof("ChildWatcher invoked %d", atomic.LoadUint64(&watchChildrenCount)) - }) - startTime := time.Now() - endTime := startTime.Add(2 * time.Second) -watcherLoop: - for time.Now().Before(endTime) { - log.V(1).Infof("entered watcherLoop") - select { - case <-c.connections(): - log.V(1).Infof("invoking watchChildren") - if _, err := c.watchChildren(currentPath, watcherFunc); err == nil { - // watching children succeeded!! - t.Logf("child watch success") - atomic.AddUint64(&watchChildrenCount, 1) - } else { - // setting the watch failed - t.Logf("setting child watch failed: %v", err) - continue watcherLoop - } - case <-c.stopped(): - t.Logf("detected client termination") - break watcherLoop - case <-time.After(endTime.Sub(time.Now())): - } - } - - wantChildrenCount := atomic.LoadUint64(&watchChildrenCount) - assert.Equal(t, uint64(5), wantChildrenCount, "expected watchChildrenCount = 5 instead of %d, should be reinvoked upon initial ChildrenW failures", wantChildrenCount) -} - -func makeClient() (*Client, error) { - ch0 := make(chan zk.Event, 2) - ch1 := make(chan zk.Event, 1) - - ch0 <- zk.Event{ - State: zk.StateConnected, - Path: test_zk_path, - } - ch1 <- zk.Event{ - Type: zk.EventNodeChildrenChanged, - Path: test_zk_path, - } - go func() { - time.Sleep(1 * time.Second) - ch0 <- zk.Event{ - State: zk.StateDisconnected, - } - close(ch0) - close(ch1) - }() - - c, err := newClient(test_zk_hosts, test_zk_path) - if err != nil { - return nil, err - } - - // only allow a single connection - first := true - c.setFactory(asFactory(func() (Connector, <-chan zk.Event, error) { - if !first { - return nil, nil, errors.New("only a single connection attempt allowed for mock connector") - } else { - first = false - } - log.V(2).Infof("**** Using zk.Conn adapter ****") - connector := makeMockConnector(test_zk_path, ch1) - return connector, ch0, nil - })) - - return c, nil -} - -func makeMockConnector(path string, chEvent <-chan zk.Event) *MockConnector { - log.V(2).Infoln("Making Connector mock.") - conn := NewMockConnector() - conn.On("Close").Return(nil) - conn.On("ChildrenW", path).Return([]string{path}, &zk.Stat{}, chEvent, nil) - conn.On("Children", path).Return([]string{"info_0", "info_5", "info_10"}, &zk.Stat{}, nil) - conn.On("Get", fmt.Sprintf("%s/info_0", path)).Return(makeTestMasterInfo(), &zk.Stat{}, nil) - - return conn -} - -func newTestMasterInfo(id int) []byte { - miPb := util.NewMasterInfo(fmt.Sprintf("master(%d)@localhost:5050", id), 123456789, 400) - data, err := proto.Marshal(miPb) - if err != nil { - panic(err) - } - return data -} - -func makeTestMasterInfo() []byte { - miPb := util.NewMasterInfo("master@localhost:5050", 123456789, 400) - data, err := proto.Marshal(miPb) - if err != nil { - panic(err) - } - return data -} diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/detect.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/detect.go index 48eee4b414014..aca08fe4b2aaf 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/detect.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/detect.go @@ -19,6 +19,7 @@ package zoo import ( + "encoding/json" "fmt" "math" "net/url" @@ -37,25 +38,37 @@ import ( const ( // prefix for nodes listed at the ZK URL path nodePrefix = "info_" + nodeJSONPrefix = "json.info_" defaultMinDetectorCyclePeriod = 1 * time.Second ) // reasonable default for a noop change listener var ignoreChanged = detector.OnMasterChanged(func(*mesos.MasterInfo) {}) +type zkInterface interface { + stopped() <-chan struct{} + stop() + data(string) ([]byte, error) + watchChildren(string) (string, <-chan []string, <-chan error) +} + +type infoCodec func(path, node string) (*mesos.MasterInfo, error) + // Detector uses ZooKeeper to detect new leading master. type MasterDetector struct { - client *Client + client zkInterface leaderNode string - // for one-time zk client initiation - bootstrap sync.Once + bootstrapLock sync.RWMutex // guard against concurrent invocations of bootstrapFunc + bootstrapFunc func() error // for one-time zk client initiation // latch: only install, at most, one ignoreChanged listener; see MasterDetector.Detect ignoreInstalled int32 // detection should not signal master change listeners more frequently than this minDetectorCyclePeriod time.Duration + done chan struct{} + cancel func() } // Internal constructor function @@ -66,17 +79,20 @@ func NewMasterDetector(zkurls string) (*MasterDetector, error) { return nil, err } - client, err := newClient(zkHosts, zkPath) - if err != nil { - return nil, err - } - detector := &MasterDetector{ - client: client, minDetectorCyclePeriod: defaultMinDetectorCyclePeriod, + done: make(chan struct{}), + cancel: func() {}, } - log.V(2).Infoln("Created new detector, watching ", zkHosts, zkPath) + detector.bootstrapFunc = func() (err error) { + if detector.client == nil { + detector.client, err = connect2(zkHosts, zkPath) + } + return + } + + log.V(2).Infoln("Created new detector to watch", zkHosts, zkPath) return detector, nil } @@ -94,42 +110,35 @@ func parseZk(zkurls string) ([]string, string, error) { // returns a chan that, when closed, indicates termination of the detector func (md *MasterDetector) Done() <-chan struct{} { - return md.client.stopped() + return md.done } func (md *MasterDetector) Cancel() { - md.client.stop() + md.bootstrapLock.RLock() + defer md.bootstrapLock.RUnlock() + md.cancel() } -//TODO(jdef) execute async because we don't want to stall our client's event loop? if so -//then we also probably want serial event delivery (aka. delivery via a chan) but then we -//have to deal with chan buffer sizes .. ugh. This is probably the least painful for now. -func (md *MasterDetector) childrenChanged(zkc *Client, path string, obs detector.MasterChanged) { - log.V(2).Infof("fetching children at path '%v'", path) - list, err := zkc.list(path) - if err != nil { - log.Warning(err) - return - } - +func (md *MasterDetector) childrenChanged(path string, list []string, obs detector.MasterChanged) { md.notifyMasterChanged(path, list, obs) md.notifyAllMasters(path, list, obs) } func (md *MasterDetector) notifyMasterChanged(path string, list []string, obs detector.MasterChanged) { - topNode := selectTopNode(list) + // mesos v0.24 writes JSON only, v0.23 writes json and protobuf, v0.22 and prior only write protobuf + topNode, codec := md.selectTopNode(list) if md.leaderNode == topNode { log.V(2).Infof("ignoring children-changed event, leader has not changed: %v", path) return } - log.V(2).Infof("changing leader node from %s -> %s", md.leaderNode, topNode) + log.V(2).Infof("changing leader node from %q -> %q", md.leaderNode, topNode) md.leaderNode = topNode var masterInfo *mesos.MasterInfo if md.leaderNode != "" { var err error - if masterInfo, err = md.pullMasterInfo(path, topNode); err != nil { + if masterInfo, err = codec(path, topNode); err != nil { log.Errorln(err.Error()) } } @@ -156,7 +165,21 @@ func (md *MasterDetector) pullMasterInfo(path, node string) (*mesos.MasterInfo, masterInfo := &mesos.MasterInfo{} err = proto.Unmarshal(data, masterInfo) if err != nil { - return nil, fmt.Errorf("failed to unmarshall MasterInfo data from zookeeper: %v", err) + return nil, fmt.Errorf("failed to unmarshal protobuf MasterInfo data from zookeeper: %v", err) + } + return masterInfo, nil +} + +func (md *MasterDetector) pullMasterJsonInfo(path, node string) (*mesos.MasterInfo, error) { + data, err := md.client.data(fmt.Sprintf("%s/%s", path, node)) + if err != nil { + return nil, fmt.Errorf("failed to retrieve leader data: %v", err) + } + + masterInfo := &mesos.MasterInfo{} + err = json.Unmarshal(data, masterInfo) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal json MasterInfo data from zookeeper: %v", err) } return masterInfo, nil } @@ -167,18 +190,52 @@ func (md *MasterDetector) notifyAllMasters(path string, list []string, obs detec // not interested in entire master list return } - masters := []*mesos.MasterInfo{} - for _, node := range list { - info, err := md.pullMasterInfo(path, node) + + // mesos v0.24 writes JSON only, v0.23 writes json and protobuf, v0.22 and prior only write protobuf + masters := map[string]*mesos.MasterInfo{} + tryStore := func(node string, codec infoCodec) { + info, err := codec(path, node) if err != nil { log.Errorln(err.Error()) } else { - masters = append(masters, info) + masters[info.GetId()] = info } } + for _, node := range list { + // compare https://github.com/apache/mesos/blob/0.23.0/src/master/detector.cpp#L437 + if strings.HasPrefix(node, nodePrefix) { + tryStore(node, md.pullMasterInfo) + } else if strings.HasPrefix(node, nodeJSONPrefix) { + tryStore(node, md.pullMasterJsonInfo) + } else { + continue + } + } + masterList := make([]*mesos.MasterInfo, 0, len(masters)) + for _, v := range masters { + masterList = append(masterList, v) + } - log.V(2).Infof("notifying of master membership change: %+v", masters) - logPanic(func() { all.UpdatedMasters(masters) }) + log.V(2).Infof("notifying of master membership change: %+v", masterList) + logPanic(func() { all.UpdatedMasters(masterList) }) +} + +func (md *MasterDetector) callBootstrap() (e error) { + log.V(2).Infoln("invoking detector boostrap") + md.bootstrapLock.Lock() + defer md.bootstrapLock.Unlock() + + clientConfigured := md.client != nil + if e = md.bootstrapFunc(); e == nil && !clientConfigured && md.client != nil { + // chain the lifetime of this detector to that of the newly created client impl + client := md.client + md.cancel = client.stop + go func() { + defer close(md.done) + <-client.stopped() + }() + } + return } // the first call to Detect will kickstart a connection to zookeeper. a nil change listener may @@ -187,70 +244,111 @@ func (md *MasterDetector) notifyAllMasters(path string, list []string, obs detec // once, and each time the spec'd listener will be added to the list of those receiving notifications. func (md *MasterDetector) Detect(f detector.MasterChanged) (err error) { // kickstart zk client connectivity - md.bootstrap.Do(func() { go md.client.connect() }) + if err := md.callBootstrap(); err != nil { + log.V(3).Infoln("failed to execute bootstrap function", err.Error()) + return err + } if f == nil { // only ever install, at most, one ignoreChanged listener. multiple instances of it // just consume resources and generate misleading log messages. if !atomic.CompareAndSwapInt32(&md.ignoreInstalled, 0, 1) { + log.V(3).Infoln("ignoreChanged listener already installed") return } f = ignoreChanged } + log.V(3).Infoln("spawning detect()") go md.detect(f) return nil } func (md *MasterDetector) detect(f detector.MasterChanged) { + log.V(3).Infoln("detecting children at", currentPath) detectLoop: for { - started := time.Now() select { case <-md.Done(): return - case <-md.client.connections(): - // we let the golang runtime manage our listener list for us, in form of goroutines that - // callback to the master change notification listen func's - if watchEnded, err := md.client.watchChildren(currentPath, ChildWatcher(func(zkc *Client, path string) { - md.childrenChanged(zkc, path, f) - })); err == nil { - log.V(2).Infoln("detector listener installed") + default: + } + log.V(3).Infoln("watching children at", currentPath) + path, childrenCh, errCh := md.client.watchChildren(currentPath) + rewatch := false + for { + started := time.Now() + select { + case children := <-childrenCh: + md.childrenChanged(path, children, f) + case err, ok := <-errCh: + // check for a tie first (required for predictability (tests)); the downside of + // doing this is that a listener might get two callbacks back-to-back ("new leader", + // followed by "no leader"). select { - case <-watchEnded: + case children := <-childrenCh: + md.childrenChanged(path, children, f) + default: + } + if ok { + log.V(1).Infoln("child watch ended with error, master lost; error was:", err.Error()) + } else { + // detector shutdown likely... + log.V(1).Infoln("child watch ended, master lost") + } + select { + case <-md.Done(): + return + default: if md.leaderNode != "" { - log.V(1).Infof("child watch ended, signaling master lost") + log.V(2).Infof("changing leader node from %q -> \"\"", md.leaderNode) md.leaderNode = "" f.OnMasterChanged(nil) } - case <-md.client.stopped(): + } + rewatch = true + } + // rate-limit master changes + if elapsed := time.Now().Sub(started); elapsed > 0 { + log.V(2).Infoln("resting before next detection cycle") + select { + case <-md.Done(): return + case <-time.After(md.minDetectorCyclePeriod - elapsed): // noop } - } else { - log.V(1).Infof("child watch ended with error: %v", err) + } + if rewatch { continue detectLoop } } - // rate-limit master changes - if elapsed := time.Now().Sub(started); elapsed > 0 { - log.V(2).Infoln("resting before next detection cycle") - select { - case <-md.Done(): - return - case <-time.After(md.minDetectorCyclePeriod - elapsed): // noop - } + } +} + +func (md *MasterDetector) selectTopNode(list []string) (topNode string, codec infoCodec) { + // mesos v0.24 writes JSON only, v0.23 writes json and protobuf, v0.22 and prior only write protobuf + topNode = selectTopNodePrefix(list, nodeJSONPrefix) + codec = md.pullMasterJsonInfo + if topNode == "" { + topNode = selectTopNodePrefix(list, nodePrefix) + codec = md.pullMasterInfo + + if topNode != "" { + log.Warningf("Leading master is using a Protobuf binary format when registering "+ + "with Zookeeper (%s): this will be deprecated as of Mesos 0.24 (see MESOS-2340).", + topNode) } } + return } -func selectTopNode(list []string) (node string) { +func selectTopNodePrefix(list []string, pre string) (node string) { var leaderSeq uint64 = math.MaxUint64 for _, v := range list { - if !strings.HasPrefix(v, nodePrefix) { + if !strings.HasPrefix(v, pre) { continue // only care about participants } - seqStr := strings.TrimPrefix(v, nodePrefix) + seqStr := strings.TrimPrefix(v, pre) seq, err := strconv.ParseUint(seqStr, 10, 64) if err != nil { log.Warningf("unexpected zk node format '%s': %v", seqStr, err) diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/detect_test.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/detect_test.go index de1ce9762a97a..863e7caa3b35e 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/detect_test.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/detect_test.go @@ -1,9 +1,7 @@ package zoo import ( - "errors" "fmt" - "sort" "sync" "testing" "time" @@ -12,14 +10,16 @@ import ( log "github.com/golang/glog" "github.com/mesos/mesos-go/detector" mesos "github.com/mesos/mesos-go/mesosproto" + util "github.com/mesos/mesos-go/mesosutil" "github.com/samuel/go-zookeeper/zk" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) const ( - zkurl = "zk://127.0.0.1:2181/mesos" - zkurl_bad = "zk://127.0.0.1:2181" + zkurl = "zk://127.0.0.1:2181/mesos" + zkurl_bad = "zk://127.0.0.1:2181" + test_zk_path = "/test" ) func TestParseZk_single(t *testing.T) { @@ -43,361 +43,299 @@ func TestParseZk_multiIP(t *testing.T) { assert.Equal(t, "/mesos", path) } -func TestMasterDetectorStart(t *testing.T) { - c, err := makeClient() - assert.False(t, c.isConnected()) - md, err := NewMasterDetector(zkurl) - defer md.Cancel() - assert.NoError(t, err) - c.errorHandler = ErrorHandler(func(c *Client, e error) { - err = e - }) - md.client = c // override zk.Conn with our own. - md.client.connect() - assert.NoError(t, err) - assert.True(t, c.isConnected()) +type mockZkClient struct { + mock.Mock } -func TestMasterDetectorChildrenChanged(t *testing.T) { - wCh := make(chan struct{}, 1) +func (m *mockZkClient) stopped() (a <-chan struct{}) { + args := m.Called() + if x := args.Get(0); x != nil { + a = x.(<-chan struct{}) + } + return +} - c, err := makeClient() - assert.NoError(t, err) - assert.False(t, c.isConnected()) +func (m *mockZkClient) stop() { + m.Called() +} + +func (m *mockZkClient) data(path string) (a []byte, b error) { + args := m.Called(path) + if x := args.Get(0); x != nil { + a = x.([]byte) + } + b = args.Error(1) + return +} +func (m *mockZkClient) watchChildren(path string) (a string, b <-chan []string, c <-chan error) { + args := m.Called(path) + a = args.String(0) + if x := args.Get(1); x != nil { + b = x.(<-chan []string) + } + if x := args.Get(2); x != nil { + c = x.(<-chan error) + } + return +} + +// newMockZkClient returns a mocked implementation of zkInterface that implements expectations +// for stop() and stopped(); multiple calls to stop() are safe. +func newMockZkClient(initialChildren ...string) (mocked *mockZkClient, snaps chan []string, errs chan error) { + var doneOnce sync.Once + done := make(chan struct{}) + + mocked = &mockZkClient{} + mocked.On("stop").Return().Run(func(_ mock.Arguments) { doneOnce.Do(func() { close(done) }) }) + mocked.On("stopped").Return((<-chan struct{})(done)) + + if initialChildren != nil { + errs = make(chan error) // this is purposefully unbuffered (some tests depend on this) + snaps = make(chan []string, 1) + snaps <- initialChildren[:] + mocked.On("watchChildren", currentPath).Return( + test_zk_path, (<-chan []string)(snaps), (<-chan error)(errs)).Run( + func(_ mock.Arguments) { log.V(1).Infoln("watchChildren invoked") }) + } + return +} + +func newTestMasterInfo(id int) []byte { + miPb := util.NewMasterInfo(fmt.Sprintf("master(%d)@localhost:5050", id), 123456789, 400) + data, err := proto.Marshal(miPb) + if err != nil { + panic(err) + } + return data +} + +func TestMasterDetectorChildrenChanged(t *testing.T) { md, err := NewMasterDetector(zkurl) defer md.Cancel() assert.NoError(t, err) - // override zk.Conn with our own. - c.errorHandler = ErrorHandler(func(c *Client, e error) { - err = e - }) - md.client = c - md.client.connect() - assert.NoError(t, err) - assert.True(t, c.isConnected()) + + path := test_zk_path + snapDetected := make(chan struct{}) + md.bootstrapFunc = func() error { + if md.client != nil { + return nil + } + log.V(1).Infoln("bootstrapping detector") + defer log.V(1).Infoln("bootstrapping detector ..finished") + + mocked, _, errs := newMockZkClient("info_0", "info_5", "info_10") + md.client = mocked + md.minDetectorCyclePeriod = 10 * time.Millisecond // we don't have all day! + + mocked.On("data", fmt.Sprintf("%s/info_0", path)).Return(newTestMasterInfo(0), nil) + + // wait for the first child snapshot to be processed before signaling end-of-watch + // (which is signalled by closing errs). + go func() { + defer close(errs) + select { + case <-snapDetected: + case <-md.Done(): + t.Errorf("detector died before child snapshot") + } + }() + return nil + } called := 0 - md.Detect(detector.OnMasterChanged(func(master *mesos.MasterInfo) { + lostMaster := make(chan struct{}) + const expectedLeader = "master(0)@localhost:5050" + err = md.Detect(detector.OnMasterChanged(func(master *mesos.MasterInfo) { //expect 2 calls in sequence: the first setting a master //and the second clearing it switch called++; called { case 1: + defer close(snapDetected) assert.NotNil(t, master) - assert.Equal(t, master.GetId(), "master@localhost:5050") - wCh <- struct{}{} + assert.Equal(t, expectedLeader, master.GetId()) case 2: + md.Cancel() + defer close(lostMaster) assert.Nil(t, master) - wCh <- struct{}{} default: - t.Fatalf("unexpected notification call attempt %d", called) + t.Errorf("unexpected notification call attempt %d", called) } })) + assert.NoError(t, err) + + fatalOn(t, 10*time.Second, lostMaster, "Waited too long for lost master") - startWait := time.Now() select { - case <-wCh: - case <-time.After(time.Second * 3): - panic("Waited too long...") + case <-md.Done(): + assert.Equal(t, 2, called, "expected 2 detection callbacks instead of %d", called) + case <-time.After(time.Second * 10): + panic("Waited too long for detector shutdown...") } - - // wait for the disconnect event, should be triggered - // 1s after the connected event - waited := time.Now().Sub(startWait) - time.Sleep((2 * time.Second) - waited) - assert.False(t, c.isConnected()) } -// single connector instance, session does not expire, but it's internal connection to zk is flappy -func TestMasterDetectFlappingConnectionState(t *testing.T) { - c, err := newClient(test_zk_hosts, test_zk_path) +// single connector instance, it's internal connection to zk is flappy +func TestMasterDetectorFlappyConnectionState(t *testing.T) { + md, err := NewMasterDetector(zkurl) + defer md.Cancel() assert.NoError(t, err) - initialChildren := []string{"info_005", "info_010", "info_022"} - connector := NewMockConnector() - connector.On("Close").Return(nil) - connector.On("Children", test_zk_path).Return(initialChildren, &zk.Stat{}, nil) - + const ITERATIONS = 3 var wg sync.WaitGroup - wg.Add(2) // async flapping, master change detection + wg.Add(1 + ITERATIONS) // +1 for the initial snapshot that's sent for the first watch + path := test_zk_path - first := true - c.setFactory(asFactory(func() (Connector, <-chan zk.Event, error) { - if !first { - t.Fatalf("only one connector instance expected") - return nil, nil, errors.New("ran out of connectors") - } else { - first = false + md.bootstrapFunc = func() error { + if md.client != nil { + return nil } - sessionEvents := make(chan zk.Event, 10) - watchEvents := make(chan zk.Event, 10) + log.V(1).Infoln("bootstrapping detector") + defer log.V(1).Infoln("bootstrapping detector ..finished") - connector.On("Get", fmt.Sprintf("%s/info_005", test_zk_path)).Return(newTestMasterInfo(1), &zk.Stat{}, nil).Once() - connector.On("ChildrenW", test_zk_path).Return([]string{test_zk_path}, &zk.Stat{}, (<-chan zk.Event)(watchEvents), nil) + children := []string{"info_0", "info_5", "info_10"} + mocked, snaps, errs := newMockZkClient(children...) + md.client = mocked + md.minDetectorCyclePeriod = 10 * time.Millisecond // we don't have all day! + + mocked.On("data", fmt.Sprintf("%s/info_0", path)).Return(newTestMasterInfo(0), nil) + + // the first snapshot will be sent immediately and the detector will be awaiting en event. + // cycle through some connected/disconnected events but maintain the same snapshot go func() { - defer wg.Done() - time.Sleep(100 * time.Millisecond) - for attempt := 0; attempt < 5; attempt++ { - sessionEvents <- zk.Event{ - Type: zk.EventSession, - State: zk.StateConnected, - } - time.Sleep(500 * time.Millisecond) - sessionEvents <- zk.Event{ - Type: zk.EventSession, - State: zk.StateDisconnected, - } - } - sessionEvents <- zk.Event{ - Type: zk.EventSession, - State: zk.StateConnected, + defer close(errs) + for attempt := 0; attempt < ITERATIONS; attempt++ { + // send an error, should cause the detector to re-issue a watch + errs <- zk.ErrSessionExpired + // the detection loop issues another watch, so send it a snapshot.. + // send another snapshot + snaps <- children } }() - return connector, sessionEvents, nil - })) - c.reconnDelay = 0 // there should be no reconnect, but just in case don't drag the test out - - md, err := NewMasterDetector(zkurl) - defer md.Cancel() - assert.NoError(t, err) - - c.errorHandler = ErrorHandler(func(c *Client, e error) { - t.Logf("zk client error: %v", e) - }) - md.client = c - - startTime := time.Now() - detected := false - md.Detect(detector.OnMasterChanged(func(master *mesos.MasterInfo) { - if detected { - t.Fatalf("already detected master, was not expecting another change: %v", master) - } else { - detected = true - assert.NotNil(t, master, fmt.Sprintf("on-master-changed %v", detected)) - t.Logf("Leader change detected at %v: '%+v'", time.Now().Sub(startTime), master) - wg.Done() - } - })) - - completed := make(chan struct{}) - go func() { - defer close(completed) - wg.Wait() - }() - - select { - case <-completed: // expected - case <-time.After(3 * time.Second): - t.Fatalf("failed to detect master change") + return nil } -} - -func TestMasterDetectFlappingConnector(t *testing.T) { - c, err := newClient(test_zk_hosts, test_zk_path) - assert.NoError(t, err) - - initialChildren := []string{"info_005", "info_010", "info_022"} - connector := NewMockConnector() - connector.On("Close").Return(nil) - connector.On("Children", test_zk_path).Return(initialChildren, &zk.Stat{}, nil) - - // timing - // t=0 t=400ms t=800ms t=1200ms t=1600ms t=2000ms t=2400ms - // |--=--=--=--|--=--=--=--|--=--=--=--|--=--=--=--|--=--=--=--|--=--=--=--|--=--=--=--|--=--=--=-- - // c1 d1 c3 d3 c5 d5 d6 ... - // c2 d2 c4 d4 c6 c7 ... - // M M' M M' M M' - attempt := 0 - c.setFactory(asFactory(func() (Connector, <-chan zk.Event, error) { - attempt++ - sessionEvents := make(chan zk.Event, 5) - watchEvents := make(chan zk.Event, 5) - - sessionEvents <- zk.Event{ - Type: zk.EventSession, - State: zk.StateConnected, - } - connector.On("Get", fmt.Sprintf("%s/info_005", test_zk_path)).Return(newTestMasterInfo(attempt), &zk.Stat{}, nil).Once() - connector.On("ChildrenW", test_zk_path).Return([]string{test_zk_path}, &zk.Stat{}, (<-chan zk.Event)(watchEvents), nil) - go func(attempt int) { - defer close(sessionEvents) - defer close(watchEvents) - time.Sleep(400 * time.Millisecond) - // this is the order in which the embedded zk implementation does it - sessionEvents <- zk.Event{ - Type: zk.EventSession, - State: zk.StateDisconnected, - } - connector.On("ChildrenW", test_zk_path).Return(nil, nil, nil, zk.ErrSessionExpired).Once() - watchEvents <- zk.Event{ - Type: zk.EventNotWatching, - State: zk.StateDisconnected, - Path: test_zk_path, - Err: zk.ErrSessionExpired, + called := 0 + lostMaster := make(chan struct{}) + const EXPECTED_CALLS = (ITERATIONS * 2) + 2 // +1 for initial snapshot, +1 for final lost-leader (close(errs)) + err = md.Detect(detector.OnMasterChanged(func(master *mesos.MasterInfo) { + called++ + log.V(3).Infof("detector invoked: called %d", called) + switch { + case called < EXPECTED_CALLS: + if master != nil { + wg.Done() + assert.Equal(t, master.GetId(), "master(0)@localhost:5050") } - }(attempt) - return connector, sessionEvents, nil - })) - c.reconnDelay = 100 * time.Millisecond - c.rewatchDelay = c.reconnDelay / 2 - - md, err := NewMasterDetector(zkurl) - md.minDetectorCyclePeriod = 600 * time.Millisecond - - defer md.Cancel() - assert.NoError(t, err) - - c.errorHandler = ErrorHandler(func(c *Client, e error) { - t.Logf("zk client error: %v", e) - }) - md.client = c - - var wg sync.WaitGroup - wg.Add(6) // 3 x (connected, disconnected) - detected := 0 - startTime := time.Now() - md.Detect(detector.OnMasterChanged(func(master *mesos.MasterInfo) { - if detected > 5 { - // ignore - return - } - if (detected & 1) == 0 { - assert.NotNil(t, master, fmt.Sprintf("on-master-changed-%d", detected)) - } else { - assert.Nil(t, master, fmt.Sprintf("on-master-changed-%d", detected)) + case called == EXPECTED_CALLS: + md.Cancel() + defer close(lostMaster) + assert.Nil(t, master) + default: + t.Errorf("unexpected notification call attempt %d", called) } - t.Logf("Leader change detected at %v: '%+v'", time.Now().Sub(startTime), master) - detected++ - wg.Done() })) + assert.NoError(t, err) - completed := make(chan struct{}) - go func() { - defer close(completed) - wg.Wait() - }() + fatalAfter(t, 10*time.Second, wg.Wait, "Waited too long for new-master alerts") + fatalOn(t, 3*time.Second, lostMaster, "Waited too long for lost master") select { - case <-completed: // expected - case <-time.After(3 * time.Second): - t.Fatalf("failed to detect flapping master changes") + case <-md.Done(): + assert.Equal(t, EXPECTED_CALLS, called, "expected %d detection callbacks instead of %d", EXPECTED_CALLS, called) + case <-time.After(time.Second * 10): + panic("Waited too long for detector shutdown...") } } -func TestMasterDetectMultiple(t *testing.T) { - ch0 := make(chan zk.Event, 5) - ch1 := make(chan zk.Event, 5) - - ch0 <- zk.Event{ - Type: zk.EventSession, - State: zk.StateConnected, - } - - c, err := newClient(test_zk_hosts, test_zk_path) - assert.NoError(t, err) - - initialChildren := []string{"info_005", "info_010", "info_022"} - connector := NewMockConnector() - connector.On("Close").Return(nil) - connector.On("Children", test_zk_path).Return(initialChildren, &zk.Stat{}, nil).Once() - connector.On("ChildrenW", test_zk_path).Return([]string{test_zk_path}, &zk.Stat{}, (<-chan zk.Event)(ch1), nil) - - first := true - c.setFactory(asFactory(func() (Connector, <-chan zk.Event, error) { - log.V(2).Infof("**** Using zk.Conn adapter ****") - if !first { - return nil, nil, errors.New("only 1 connector allowed") - } else { - first = false - } - return connector, ch0, nil - })) - +func TestMasterDetector_multipleLeadershipChanges(t *testing.T) { md, err := NewMasterDetector(zkurl) defer md.Cancel() assert.NoError(t, err) - c.errorHandler = ErrorHandler(func(c *Client, e error) { - err = e - }) - md.client = c - - // **** Test 4 consecutive ChildrenChangedEvents ****** - // setup event changes - sequences := [][]string{ + leadershipChanges := [][]string{ {"info_014", "info_010", "info_005"}, {"info_005", "info_004", "info_022"}, {}, // indicates no master {"info_017", "info_099", "info_200"}, } + ITERATIONS := len(leadershipChanges) + + // +1 for initial snapshot, +1 for final lost-leader (close(errs)) + EXPECTED_CALLS := (ITERATIONS + 2) + var wg sync.WaitGroup - startTime := time.Now() - detected := 0 - md.Detect(detector.OnMasterChanged(func(master *mesos.MasterInfo) { - if detected == 2 { - assert.Nil(t, master, fmt.Sprintf("on-master-changed-%d", detected)) - } else { - assert.NotNil(t, master, fmt.Sprintf("on-master-changed-%d", detected)) + wg.Add(ITERATIONS) // +1 for the initial snapshot that's sent for the first watch, -1 because set 3 is empty + path := test_zk_path + + md.bootstrapFunc = func() error { + if md.client != nil { + return nil } - t.Logf("Leader change detected at %v: '%+v'", time.Now().Sub(startTime), master) - detected++ - wg.Done() - })) + log.V(1).Infoln("bootstrapping detector") + defer log.V(1).Infoln("bootstrapping detector ..finished") - // 3 leadership changes + disconnect (leader change to '') - wg.Add(4) + children := []string{"info_0", "info_5", "info_10"} + mocked, snaps, errs := newMockZkClient(children...) + md.client = mocked + md.minDetectorCyclePeriod = 10 * time.Millisecond // we don't have all day! - go func() { - for i := range sequences { - sorted := make([]string, len(sequences[i])) - copy(sorted, sequences[i]) - sort.Strings(sorted) - t.Logf("testing master change sequence %d, path '%v'", i, test_zk_path) - connector.On("Children", test_zk_path).Return(sequences[i], &zk.Stat{}, nil).Once() - if len(sequences[i]) > 0 { - connector.On("Get", fmt.Sprintf("%s/%s", test_zk_path, sorted[0])).Return(newTestMasterInfo(i), &zk.Stat{}, nil).Once() + mocked.On("data", fmt.Sprintf("%s/info_0", path)).Return(newTestMasterInfo(0), nil) + mocked.On("data", fmt.Sprintf("%s/info_005", path)).Return(newTestMasterInfo(5), nil) + mocked.On("data", fmt.Sprintf("%s/info_004", path)).Return(newTestMasterInfo(4), nil) + mocked.On("data", fmt.Sprintf("%s/info_017", path)).Return(newTestMasterInfo(17), nil) + + // the first snapshot will be sent immediately and the detector will be awaiting en event. + // cycle through some connected/disconnected events but maintain the same snapshot + go func() { + defer close(errs) + for attempt := 0; attempt < ITERATIONS; attempt++ { + snaps <- leadershipChanges[attempt] } - ch1 <- zk.Event{ - Type: zk.EventNodeChildrenChanged, - Path: test_zk_path, + }() + return nil + } + + called := 0 + lostMaster := make(chan struct{}) + expectedLeaders := []int{0, 5, 4, 17} + leaderIdx := 0 + err = md.Detect(detector.OnMasterChanged(func(master *mesos.MasterInfo) { + called++ + log.V(3).Infof("detector invoked: called %d", called) + switch { + case called < EXPECTED_CALLS: + if master != nil { + expectedLeader := fmt.Sprintf("master(%d)@localhost:5050", expectedLeaders[leaderIdx]) + assert.Equal(t, expectedLeader, master.GetId()) + leaderIdx++ + wg.Done() } - time.Sleep(100 * time.Millisecond) // give async routines time to catch up - } - time.Sleep(1 * time.Second) // give async routines time to catch up - t.Logf("disconnecting...") - ch0 <- zk.Event{ - State: zk.StateDisconnected, + case called == EXPECTED_CALLS: + md.Cancel() + defer close(lostMaster) + assert.Nil(t, master) + default: + t.Errorf("unexpected notification call attempt %d", called) } - //TODO(jdef) does order of close matter here? probably, meaking client code is weak - close(ch0) - time.Sleep(500 * time.Millisecond) // give async routines time to catch up - close(ch1) - }() - completed := make(chan struct{}) - go func() { - defer close(completed) - wg.Wait() - }() + })) + assert.NoError(t, err) - defer func() { - if r := recover(); r != nil { - t.Fatal(r) - } - }() + fatalAfter(t, 10*time.Second, wg.Wait, "Waited too long for new-master alerts") + fatalOn(t, 3*time.Second, lostMaster, "Waited too long for lost master") select { - case <-time.After(2 * time.Second): - panic("timed out waiting for master changes to propagate") - case <-completed: + case <-md.Done(): + assert.Equal(t, EXPECTED_CALLS, called, "expected %d detection callbacks instead of %d", EXPECTED_CALLS, called) + case <-time.After(time.Second * 10): + panic("Waited too long for detector shutdown...") } } func TestMasterDetect_selectTopNode_none(t *testing.T) { assert := assert.New(t) nodeList := []string{} - node := selectTopNode(nodeList) + node := selectTopNodePrefix(nodeList, "foo") assert.Equal("", node) } @@ -410,10 +348,25 @@ func TestMasterDetect_selectTopNode_0000x(t *testing.T) { "info_0000000061", "info_0000000008", } - node := selectTopNode(nodeList) + node := selectTopNodePrefix(nodeList, nodePrefix) assert.Equal("info_0000000008", node) } +func TestMasterDetect_selectTopNode_mixJson(t *testing.T) { + assert := assert.New(t) + nodeList := []string{ + nodePrefix + "0000000046", + nodePrefix + "0000000032", + nodeJSONPrefix + "0000000046", + nodeJSONPrefix + "0000000032", + } + node := selectTopNodePrefix(nodeList, nodeJSONPrefix) + assert.Equal(nodeJSONPrefix+"0000000032", node) + + node = selectTopNodePrefix(nodeList, nodePrefix) + assert.Equal(nodePrefix+"0000000032", node) +} + func TestMasterDetect_selectTopNode_mixedEntries(t *testing.T) { assert := assert.New(t) nodeList := []string{ @@ -424,7 +377,7 @@ func TestMasterDetect_selectTopNode_mixedEntries(t *testing.T) { "log_replicas_fdgwsdfgsdf", "bar", } - node := selectTopNode(nodeList) + node := selectTopNodePrefix(nodeList, nodePrefix) assert.Equal("info_0000000032", node) } @@ -451,15 +404,25 @@ func afterFunc(f func()) <-chan struct{} { } func fatalAfter(t *testing.T, d time.Duration, f func(), msg string, args ...interface{}) { - ch := afterFunc(f) + fatalOn(t, d, afterFunc(f), msg, args...) +} + +func fatalOn(t *testing.T, d time.Duration, ch <-chan struct{}, msg string, args ...interface{}) { select { case <-ch: return case <-time.After(d): - t.Fatalf(msg, args...) + // check for a tie + select { + case <-ch: + return + default: + t.Fatalf(msg, args...) + } } } +/* TODO(jdef) refactor this to work with the new zkInterface func TestNotifyAllMasters(t *testing.T) { c, err := newClient(test_zk_hosts, test_zk_path) assert.NoError(t, err) @@ -482,7 +445,7 @@ func TestNotifyAllMasters(t *testing.T) { assert.NoError(t, err) c.errorHandler = ErrorHandler(func(c *Client, e error) { - t.Fatalf("unexpected error: %v", e) + t.Errorf("unexpected error: %v", e) }) md.client = c @@ -562,3 +525,4 @@ func TestNotifyAllMasters(t *testing.T) { connector.On("Close").Return(nil) } +*/ diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/mocked_detect.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/mocked_detect.go deleted file mode 100644 index d887b6dc869fb..0000000000000 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/mocked_detect.go +++ /dev/null @@ -1,88 +0,0 @@ -package zoo - -import ( - "errors" - "fmt" - "net/url" - - "github.com/gogo/protobuf/proto" - log "github.com/golang/glog" - util "github.com/mesos/mesos-go/mesosutil" - "github.com/samuel/go-zookeeper/zk" -) - -type MockMasterDetector struct { - *MasterDetector - zkPath string - conCh chan zk.Event - sesCh chan zk.Event -} - -func NewMockMasterDetector(zkurls string) (*MockMasterDetector, error) { - log.V(4).Infoln("Creating mock zk master detector") - md, err := NewMasterDetector(zkurls) - if err != nil { - return nil, err - } - - u, _ := url.Parse(zkurls) - m := &MockMasterDetector{ - MasterDetector: md, - zkPath: u.Path, - conCh: make(chan zk.Event, 5), - sesCh: make(chan zk.Event, 5), - } - - path := m.zkPath - connector := NewMockConnector() - connector.On("Children", path).Return([]string{"info_0", "info_5", "info_10"}, &zk.Stat{}, nil) - connector.On("Get", fmt.Sprintf("%s/info_0", path)).Return(m.makeMasterInfo(), &zk.Stat{}, nil) - connector.On("Close").Return(nil) - connector.On("ChildrenW", m.zkPath).Return([]string{m.zkPath}, &zk.Stat{}, (<-chan zk.Event)(m.sesCh), nil) - - first := true - m.client.setFactory(asFactory(func() (Connector, <-chan zk.Event, error) { - if !first { - return nil, nil, errors.New("only 1 connector allowed") - } else { - first = false - } - return connector, m.conCh, nil - })) - - return m, nil -} - -func (m *MockMasterDetector) Start() { - m.client.connect() -} - -func (m *MockMasterDetector) ScheduleConnEvent(s zk.State) { - log.V(4).Infof("Scheduling zk connection event with state: %v\n", s) - go func() { - m.conCh <- zk.Event{ - State: s, - Path: m.zkPath, - } - }() -} - -func (m *MockMasterDetector) ScheduleSessEvent(t zk.EventType) { - log.V(4).Infof("Scheduling zk session event with state: %v\n", t) - go func() { - m.sesCh <- zk.Event{ - Type: t, - Path: m.zkPath, - } - }() -} - -func (m *MockMasterDetector) makeMasterInfo() []byte { - miPb := util.NewMasterInfo("master", 123456789, 400) - miPb.Pid = proto.String("master@127.0.0.1:5050") - data, err := proto.Marshal(miPb) - if err != nil { - panic(err) - } - return data -} diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/types.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/types.go index 8116140421492..9b24b51b7cd71 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/types.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/types.go @@ -14,12 +14,6 @@ type Connector interface { Get(string) ([]byte, *zk.Stat, error) } -// interface for handling watcher event when zk.EventNodeChildrenChanged. -type ChildWatcher func(*Client, string) - -// interface for handling errors (session and watch related). -type ErrorHandler func(*Client, error) - //Factory is an adapter to trap the creation of zk.Conn instances //since the official zk API does not expose an interface for zk.Conn. type Factory interface { diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/executor/executor.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/executor/executor.go index 530fdd5255104..4506522ac24bf 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/executor/executor.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/executor/executor.go @@ -41,17 +41,16 @@ type DriverConfig struct { HostnameOverride string // optional BindingAddress net.IP // optional BindingPort uint16 // optional + PublishedAddress net.IP // optional NewMessenger func() (messenger.Messenger, error) // optional } // MesosExecutorDriver is a implementation of the ExecutorDriver. type MesosExecutorDriver struct { lock sync.RWMutex + cond *sync.Cond self *upid.UPID - exec Executor stopCh chan struct{} - destroyCh chan struct{} - stopped bool status mesosproto.Status messenger messenger.Messenger slaveUPID *upid.UPID @@ -67,6 +66,8 @@ type MesosExecutorDriver struct { recoveryTimeout time.Duration updates map[string]*mesosproto.StatusUpdate // Key is a UUID string. TODO(yifan): Not used yet. tasks map[string]*mesosproto.TaskInfo // Key is a UUID string. TODO(yifan): Not used yet. + withExecutor func(f func(e Executor)) + started chan struct{} // signal chan that closes once start has been invoked } // NewMesosExecutorDriver creates a new mesos executor driver. @@ -82,19 +83,27 @@ func NewMesosExecutorDriver(config DriverConfig) (*MesosExecutorDriver, error) { if newMessenger == nil { newMessenger = func() (messenger.Messenger, error) { process := process.New("executor") - return messenger.ForHostname(process, hostname, config.BindingAddress, config.BindingPort) + return messenger.ForHostname(process, hostname, config.BindingAddress, config.BindingPort, config.PublishedAddress) } } driver := &MesosExecutorDriver{ - exec: config.Executor, - status: mesosproto.Status_DRIVER_NOT_STARTED, - stopCh: make(chan struct{}), - destroyCh: make(chan struct{}), - stopped: true, - updates: make(map[string]*mesosproto.StatusUpdate), - tasks: make(map[string]*mesosproto.TaskInfo), - workDir: ".", + status: mesosproto.Status_DRIVER_NOT_STARTED, + stopCh: make(chan struct{}), + updates: make(map[string]*mesosproto.StatusUpdate), + tasks: make(map[string]*mesosproto.TaskInfo), + workDir: ".", + started: make(chan struct{}), + } + driver.cond = sync.NewCond(&driver.lock) + // decouple serialized executor callback execution from goroutines of this driver + var execLock sync.Mutex + driver.withExecutor = func(f func(e Executor)) { + go func() { + execLock.Lock() + defer execLock.Unlock() + f(config.Executor) + }() } var err error if driver.messenger, err = newMessenger(); err != nil { @@ -110,7 +119,7 @@ func NewMesosExecutorDriver(config DriverConfig) (*MesosExecutorDriver, error) { // init initializes the driver. func (driver *MesosExecutorDriver) init() error { log.Infof("Init mesos executor driver\n") - log.Infof("Version: %v\n", mesosutil.MesosVersion) + log.Infof("Protocol Version: %v\n", mesosutil.MesosVersion) // Parse environments. if err := driver.parseEnviroments(); err != nil { @@ -118,16 +127,24 @@ func (driver *MesosExecutorDriver) init() error { return err } + guard := func(h messenger.MessageHandler) messenger.MessageHandler { + return messenger.MessageHandler(func(from *upid.UPID, pbMsg proto.Message) { + driver.lock.Lock() + defer driver.lock.Unlock() + h(from, pbMsg) + }) + } + // Install handlers. - driver.messenger.Install(driver.registered, &mesosproto.ExecutorRegisteredMessage{}) - driver.messenger.Install(driver.reregistered, &mesosproto.ExecutorReregisteredMessage{}) - driver.messenger.Install(driver.reconnect, &mesosproto.ReconnectExecutorMessage{}) - driver.messenger.Install(driver.runTask, &mesosproto.RunTaskMessage{}) - driver.messenger.Install(driver.killTask, &mesosproto.KillTaskMessage{}) - driver.messenger.Install(driver.statusUpdateAcknowledgement, &mesosproto.StatusUpdateAcknowledgementMessage{}) - driver.messenger.Install(driver.frameworkMessage, &mesosproto.FrameworkToExecutorMessage{}) - driver.messenger.Install(driver.shutdown, &mesosproto.ShutdownExecutorMessage{}) - driver.messenger.Install(driver.frameworkError, &mesosproto.FrameworkErrorMessage{}) + driver.messenger.Install(guard(driver.registered), &mesosproto.ExecutorRegisteredMessage{}) + driver.messenger.Install(guard(driver.reregistered), &mesosproto.ExecutorReregisteredMessage{}) + driver.messenger.Install(guard(driver.reconnect), &mesosproto.ReconnectExecutorMessage{}) + driver.messenger.Install(guard(driver.runTask), &mesosproto.RunTaskMessage{}) + driver.messenger.Install(guard(driver.killTask), &mesosproto.KillTaskMessage{}) + driver.messenger.Install(guard(driver.statusUpdateAcknowledgement), &mesosproto.StatusUpdateAcknowledgementMessage{}) + driver.messenger.Install(guard(driver.frameworkMessage), &mesosproto.FrameworkToExecutorMessage{}) + driver.messenger.Install(guard(driver.shutdown), &mesosproto.ShutdownExecutorMessage{}) + driver.messenger.Install(guard(driver.frameworkError), &mesosproto.FrameworkErrorMessage{}) return nil } @@ -178,22 +195,15 @@ func (driver *MesosExecutorDriver) Status() mesosproto.Status { defer driver.lock.RUnlock() return driver.status } -func (driver *MesosExecutorDriver) setStatus(stat mesosproto.Status) { - driver.lock.Lock() - driver.status = stat - driver.lock.Unlock() -} -func (driver *MesosExecutorDriver) Stopped() bool { +func (driver *MesosExecutorDriver) Running() bool { driver.lock.RLock() defer driver.lock.RUnlock() - return driver.stopped + return driver.status == mesosproto.Status_DRIVER_RUNNING } -func (driver *MesosExecutorDriver) setStopped(val bool) { - driver.lock.Lock() - driver.stopped = val - driver.lock.Unlock() +func (driver *MesosExecutorDriver) stopped() bool { + return driver.status != mesosproto.Status_DRIVER_RUNNING } func (driver *MesosExecutorDriver) Connected() bool { @@ -202,12 +212,6 @@ func (driver *MesosExecutorDriver) Connected() bool { return driver.connected } -func (driver *MesosExecutorDriver) setConnected(val bool) { - driver.lock.Lock() - driver.connected = val - driver.lock.Unlock() -} - // --------------------- Message Handlers --------------------- // func (driver *MesosExecutorDriver) registered(from *upid.UPID, pbMsg proto.Message) { @@ -219,15 +223,16 @@ func (driver *MesosExecutorDriver) registered(from *upid.UPID, pbMsg proto.Messa frameworkInfo := msg.GetFrameworkInfo() slaveInfo := msg.GetSlaveInfo() - if driver.stopped { + if driver.stopped() { log.Infof("Ignoring registered message from slave %v, because the driver is stopped!\n", slaveID) return } log.Infof("Registered on slave %v\n", slaveID) - driver.setConnected(true) + driver.connected = true driver.connection = uuid.NewUUID() - driver.exec.Registered(driver, executorInfo, frameworkInfo, slaveInfo) + driver.cond.Broadcast() // useful for testing + driver.withExecutor(func(e Executor) { e.Registered(driver, executorInfo, frameworkInfo, slaveInfo) }) } func (driver *MesosExecutorDriver) reregistered(from *upid.UPID, pbMsg proto.Message) { @@ -237,15 +242,16 @@ func (driver *MesosExecutorDriver) reregistered(from *upid.UPID, pbMsg proto.Mes slaveID := msg.GetSlaveId() slaveInfo := msg.GetSlaveInfo() - if driver.stopped { + if driver.stopped() { log.Infof("Ignoring re-registered message from slave %v, because the driver is stopped!\n", slaveID) return } log.Infof("Re-registered on slave %v\n", slaveID) - driver.setConnected(true) + driver.connected = true driver.connection = uuid.NewUUID() - driver.exec.Reregistered(driver, slaveInfo) + driver.cond.Broadcast() // useful for testing + driver.withExecutor(func(e Executor) { e.Reregistered(driver, slaveInfo) }) } func (driver *MesosExecutorDriver) send(upid *upid.UPID, msg proto.Message) error { @@ -271,7 +277,7 @@ func (driver *MesosExecutorDriver) reconnect(from *upid.UPID, pbMsg proto.Messag msg := pbMsg.(*mesosproto.ReconnectExecutorMessage) slaveID := msg.GetSlaveId() - if driver.stopped { + if driver.stopped() { log.Infof("Ignoring reconnect message from slave %v, because the driver is stopped!\n", slaveID) return } @@ -304,7 +310,7 @@ func (driver *MesosExecutorDriver) runTask(from *upid.UPID, pbMsg proto.Message) task := msg.GetTask() taskID := task.GetTaskId() - if driver.stopped { + if driver.stopped() { log.Infof("Ignoring run task message for task %v because the driver is stopped!\n", taskID) return } @@ -314,7 +320,7 @@ func (driver *MesosExecutorDriver) runTask(from *upid.UPID, pbMsg proto.Message) log.Infof("Executor asked to run task '%v'\n", taskID) driver.tasks[taskID.String()] = task - driver.exec.LaunchTask(driver, task) + driver.withExecutor(func(e Executor) { e.LaunchTask(driver, task) }) } func (driver *MesosExecutorDriver) killTask(from *upid.UPID, pbMsg proto.Message) { @@ -323,13 +329,13 @@ func (driver *MesosExecutorDriver) killTask(from *upid.UPID, pbMsg proto.Message msg := pbMsg.(*mesosproto.KillTaskMessage) taskID := msg.GetTaskId() - if driver.stopped { + if driver.stopped() { log.Infof("Ignoring kill task message for task %v, because the driver is stopped!\n", taskID) return } log.Infof("Executor driver is asked to kill task '%v'\n", taskID) - driver.exec.KillTask(driver, taskID) + driver.withExecutor(func(e Executor) { e.KillTask(driver, taskID) }) } func (driver *MesosExecutorDriver) statusUpdateAcknowledgement(from *upid.UPID, pbMsg proto.Message) { @@ -342,9 +348,7 @@ func (driver *MesosExecutorDriver) statusUpdateAcknowledgement(from *upid.UPID, taskID := msg.GetTaskId() uuid := uuid.UUID(msg.GetUuid()) - driver.lock.Lock() - defer driver.lock.Unlock() - if driver.stopped { + if driver.stopped() { log.Infof("Ignoring status update acknowledgement %v for task %v of framework %v because the driver is stopped!\n", uuid, taskID, frameworkID) } @@ -361,13 +365,13 @@ func (driver *MesosExecutorDriver) frameworkMessage(from *upid.UPID, pbMsg proto msg := pbMsg.(*mesosproto.FrameworkToExecutorMessage) data := msg.GetData() - if driver.stopped { + if driver.stopped() { log.Infof("Ignoring framework message because the driver is stopped!\n") return } log.Infof("Executor driver receives framework message\n") - driver.exec.FrameworkMessage(driver, string(data)) + driver.withExecutor(func(e Executor) { e.FrameworkMessage(driver, string(data)) }) } func (driver *MesosExecutorDriver) shutdown(from *upid.UPID, pbMsg proto.Message) { @@ -378,45 +382,49 @@ func (driver *MesosExecutorDriver) shutdown(from *upid.UPID, pbMsg proto.Message panic("Not a ShutdownExecutorMessage! This should not happen") } - if driver.stopped { + if driver.stopped() { log.Infof("Ignoring shutdown message because the driver is stopped!\n") return } log.Infof("Executor driver is asked to shutdown\n") - driver.exec.Shutdown(driver) - // driver.Stop() will cause process to eventually stop. - driver.Stop() + driver.withExecutor(func(e Executor) { e.Shutdown(driver) }) + // driver.stop() will cause process to eventually stop. + driver.stop() } func (driver *MesosExecutorDriver) frameworkError(from *upid.UPID, pbMsg proto.Message) { log.Infoln("Executor driver received error") msg := pbMsg.(*mesosproto.FrameworkErrorMessage) - driver.exec.Error(driver, msg.GetMessage()) + driver.withExecutor(func(e Executor) { e.Error(driver, msg.GetMessage()) }) } // ------------------------ Driver Implementation ----------------- // // Start starts the executor driver func (driver *MesosExecutorDriver) Start() (mesosproto.Status, error) { + driver.lock.Lock() + defer driver.lock.Unlock() + return driver.start() +} + +func (driver *MesosExecutorDriver) start() (mesosproto.Status, error) { log.Infoln("Starting the executor driver") - if stat := driver.Status(); stat != mesosproto.Status_DRIVER_NOT_STARTED { - return stat, fmt.Errorf("Unable to Start, expecting status %s, but got %s", mesosproto.Status_DRIVER_NOT_STARTED, stat) + if driver.status != mesosproto.Status_DRIVER_NOT_STARTED { + return driver.status, fmt.Errorf("Unable to Start, expecting status %s, but got %s", mesosproto.Status_DRIVER_NOT_STARTED, driver.status) } - driver.setStatus(mesosproto.Status_DRIVER_NOT_STARTED) - driver.setStopped(true) - // Start the messenger. if err := driver.messenger.Start(); err != nil { log.Errorf("Failed to start executor: %v\n", err) - return driver.Status(), err + return driver.status, err } - driver.self = driver.messenger.UPID() + pid := driver.messenger.UPID() + driver.self = &pid // Register with slave. log.V(3).Infoln("Sending Executor registration") @@ -426,105 +434,142 @@ func (driver *MesosExecutorDriver) Start() (mesosproto.Status, error) { } if err := driver.send(driver.slaveUPID, message); err != nil { - stat := driver.Status() log.Errorf("Stopping the executor, failed to send %v: %v\n", message, err) - err0 := driver.stop(stat) + err0 := driver._stop(driver.status) if err0 != nil { log.Errorf("Failed to stop executor: %v\n", err) - return stat, err0 + return driver.status, err0 } - return stat, err + return driver.status, err } - driver.setStopped(false) - driver.setStatus(mesosproto.Status_DRIVER_RUNNING) - log.Infoln("Mesos executor is started with PID=", driver.self.String()) + driver.status = mesosproto.Status_DRIVER_RUNNING + close(driver.started) - return driver.Status(), nil + log.Infoln("Mesos executor is started with PID=", driver.self.String()) + return driver.status, nil } // Stop stops the driver by sending a 'stopEvent' to the event loop, and // receives the result from the response channel. func (driver *MesosExecutorDriver) Stop() (mesosproto.Status, error) { + driver.lock.Lock() + defer driver.lock.Unlock() + return driver.stop() +} + +func (driver *MesosExecutorDriver) stop() (mesosproto.Status, error) { log.Infoln("Stopping the executor driver") - if stat := driver.Status(); stat != mesosproto.Status_DRIVER_RUNNING { - return stat, fmt.Errorf("Unable to Stop, expecting status %s, but got %s", mesosproto.Status_DRIVER_RUNNING, stat) + if driver.status != mesosproto.Status_DRIVER_RUNNING { + return driver.status, fmt.Errorf("Unable to Stop, expecting status %s, but got %s", mesosproto.Status_DRIVER_RUNNING, driver.status) } - stopStat := mesosproto.Status_DRIVER_STOPPED - return stopStat, driver.stop(stopStat) + return mesosproto.Status_DRIVER_STOPPED, driver._stop(mesosproto.Status_DRIVER_STOPPED) } // internal function for stopping the driver and set reason for stopping // Note that messages inflight or queued will not be processed. -func (driver *MesosExecutorDriver) stop(stopStatus mesosproto.Status) error { +func (driver *MesosExecutorDriver) _stop(stopStatus mesosproto.Status) error { err := driver.messenger.Stop() - defer close(driver.destroyCh) - defer close(driver.stopCh) - - driver.setStatus(stopStatus) - driver.setStopped(true) + defer func() { + select { + case <-driver.stopCh: + // already closed + default: + close(driver.stopCh) + } + driver.cond.Broadcast() + }() + driver.status = stopStatus if err != nil { return err } - return nil } // Abort aborts the driver by sending an 'abortEvent' to the event loop, and // receives the result from the response channel. func (driver *MesosExecutorDriver) Abort() (mesosproto.Status, error) { - if stat := driver.Status(); stat != mesosproto.Status_DRIVER_RUNNING { - return stat, fmt.Errorf("Unable to Stop, expecting status %s, but got %s", mesosproto.Status_DRIVER_RUNNING, stat) + driver.lock.Lock() + defer driver.lock.Unlock() + return driver.abort() +} + +func (driver *MesosExecutorDriver) abort() (mesosproto.Status, error) { + if driver.status != mesosproto.Status_DRIVER_RUNNING { + return driver.status, fmt.Errorf("Unable to Stop, expecting status %s, but got %s", mesosproto.Status_DRIVER_RUNNING, driver.status) } log.Infoln("Aborting the executor driver") - abortStat := mesosproto.Status_DRIVER_ABORTED - return abortStat, driver.stop(abortStat) + return mesosproto.Status_DRIVER_ABORTED, driver._stop(mesosproto.Status_DRIVER_ABORTED) } // Join waits for the driver by sending a 'joinEvent' to the event loop, and wait // on a channel for the notification of driver termination. func (driver *MesosExecutorDriver) Join() (mesosproto.Status, error) { + driver.lock.Lock() + defer driver.lock.Unlock() + return driver.join() +} + +func (driver *MesosExecutorDriver) join() (mesosproto.Status, error) { log.Infoln("Waiting for the executor driver to stop") - if stat := driver.Status(); stat != mesosproto.Status_DRIVER_RUNNING { - return stat, fmt.Errorf("Unable to Join, expecting status %s, but got %s", mesosproto.Status_DRIVER_RUNNING, stat) + if driver.status != mesosproto.Status_DRIVER_RUNNING { + return driver.status, fmt.Errorf("Unable to Join, expecting status %s, but got %s", mesosproto.Status_DRIVER_RUNNING, driver.status) + } + for { + select { + case <-driver.stopCh: // wait for stop signal + return driver.status, nil + default: + driver.cond.Wait() + } } - <-driver.stopCh // wait for stop signal - return driver.Status(), nil } // Run starts the driver and calls Join() to wait for stop request. func (driver *MesosExecutorDriver) Run() (mesosproto.Status, error) { - stat, err := driver.Start() + driver.lock.Lock() + defer driver.lock.Unlock() + return driver.run() +} + +func (driver *MesosExecutorDriver) run() (mesosproto.Status, error) { + stat, err := driver.start() if err != nil { - return driver.Stop() + return driver.stop() } if stat != mesosproto.Status_DRIVER_RUNNING { return stat, fmt.Errorf("Unable to continue to Run, expecting status %s, but got %s", mesosproto.Status_DRIVER_RUNNING, driver.status) } - return driver.Join() + return driver.join() } // SendStatusUpdate sends status updates to the slave. func (driver *MesosExecutorDriver) SendStatusUpdate(taskStatus *mesosproto.TaskStatus) (mesosproto.Status, error) { + driver.lock.Lock() + defer driver.lock.Unlock() + return driver.sendStatusUpdate(taskStatus) +} + +func (driver *MesosExecutorDriver) sendStatusUpdate(taskStatus *mesosproto.TaskStatus) (mesosproto.Status, error) { log.V(3).Infoln("Sending task status update: ", taskStatus.String()) - if stat := driver.Status(); stat != mesosproto.Status_DRIVER_RUNNING { - return stat, fmt.Errorf("Unable to SendStatusUpdate, expecting driver.status %s, but got %s", mesosproto.Status_DRIVER_RUNNING, stat) + if driver.status != mesosproto.Status_DRIVER_RUNNING { + return driver.status, fmt.Errorf("Unable to SendStatusUpdate, expecting driver.status %s, but got %s", mesosproto.Status_DRIVER_RUNNING, driver.status) } if taskStatus.GetState() == mesosproto.TaskState_TASK_STAGING { err := fmt.Errorf("Executor is not allowed to send TASK_STAGING status update. Aborting!") log.Errorln(err) - if err0 := driver.stop(mesosproto.Status_DRIVER_ABORTED); err0 != nil { + if err0 := driver._stop(mesosproto.Status_DRIVER_ABORTED); err0 != nil { log.Errorln("Error while stopping the driver", err0) } - return driver.Status(), err + return driver.status, err } // Set up status update. @@ -532,9 +577,7 @@ func (driver *MesosExecutorDriver) SendStatusUpdate(taskStatus *mesosproto.TaskS log.Infof("Executor sending status update %v\n", update.String()) // Capture the status update. - driver.lock.Lock() driver.updates[uuid.UUID(update.GetUuid()).String()] = update - driver.lock.Unlock() // Put the status update in the message. message := &mesosproto.StatusUpdateMessage{ @@ -547,7 +590,7 @@ func (driver *MesosExecutorDriver) SendStatusUpdate(taskStatus *mesosproto.TaskS return driver.status, err } - return driver.Status(), nil + return driver.status, nil } func (driver *MesosExecutorDriver) makeStatusUpdate(taskStatus *mesosproto.TaskStatus) *mesosproto.StatusUpdate { @@ -569,10 +612,16 @@ func (driver *MesosExecutorDriver) makeStatusUpdate(taskStatus *mesosproto.TaskS // SendFrameworkMessage sends the framework message by sending a 'sendFrameworkMessageEvent' // to the event loop, and receives the result from the response channel. func (driver *MesosExecutorDriver) SendFrameworkMessage(data string) (mesosproto.Status, error) { + driver.lock.Lock() + defer driver.lock.Unlock() + return driver.sendFrameworkMessage(data) +} + +func (driver *MesosExecutorDriver) sendFrameworkMessage(data string) (mesosproto.Status, error) { log.V(3).Infoln("Sending framework message", string(data)) - if stat := driver.Status(); stat != mesosproto.Status_DRIVER_RUNNING { - return stat, fmt.Errorf("Unable to SendFrameworkMessage, expecting status %s, but got %s", mesosproto.Status_DRIVER_RUNNING, stat) + if driver.status != mesosproto.Status_DRIVER_RUNNING { + return driver.status, fmt.Errorf("Unable to SendFrameworkMessage, expecting status %s, but got %s", mesosproto.Status_DRIVER_RUNNING, driver.status) } message := &mesosproto.ExecutorToFrameworkMessage{ diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/executor/executor_intgr_test.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/executor/executor_intgr_test.go index fafbc77dab241..c16c6bd853ba5 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/executor/executor_intgr_test.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/executor/executor_intgr_test.go @@ -104,7 +104,36 @@ func setTestEnv(t *testing.T) { assert.NoError(t, os.Setenv("MESOS_EXECUTOR_ID", executorID)) } -func newIntegrationTestDriver(t *testing.T, exec Executor) *MesosExecutorDriver { +type integrationTestDriver struct { + *MesosExecutorDriver +} + +func (i *integrationTestDriver) setConnected(b bool) { + i.lock.Lock() + defer i.lock.Unlock() + i.connected = b +} + +// connectionListener returns a signal chan that closes once driver.connected == true. +func (i *integrationTestDriver) connectionListener() chan struct{} { + connected := make(chan struct{}) + go func() { + i.lock.Lock() + defer i.lock.Unlock() + for !i.connected { + select { + case <-i.stopCh: + return + default: + i.cond.Wait() + } + } + close(connected) + }() + return connected +} + +func newIntegrationTestDriver(t *testing.T, exec Executor) *integrationTestDriver { dconfig := DriverConfig{ Executor: exec, } @@ -112,12 +141,12 @@ func newIntegrationTestDriver(t *testing.T, exec Executor) *MesosExecutorDriver if err != nil { t.Fatal(err) } - return driver + return &integrationTestDriver{driver} } func TestExecutorDriverRegisterExecutorMessage(t *testing.T) { setTestEnv(t) - ch := make(chan bool) + ch := make(chan bool, 2) server := testutil.NewMockSlaveHttpServer(t, func(rsp http.ResponseWriter, req *http.Request) { reqPath, err := url.QueryUnescape(req.URL.String()) assert.NoError(t, err) @@ -146,23 +175,23 @@ func TestExecutorDriverRegisterExecutorMessage(t *testing.T) { exec.ch = ch driver := newIntegrationTestDriver(t, exec) - assert.True(t, driver.stopped) + assert.False(t, driver.Running()) stat, err := driver.Start() assert.NoError(t, err) - assert.False(t, driver.stopped) + assert.True(t, driver.Running()) assert.Equal(t, mesos.Status_DRIVER_RUNNING, stat) select { case <-ch: - case <-time.After(time.Millisecond * 2): + case <-time.After(time.Second * 1): log.Errorf("Tired of waiting...") } } func TestExecutorDriverExecutorRegisteredEvent(t *testing.T) { setTestEnv(t) - ch := make(chan bool) + ch := make(chan bool, 2) // Mock Slave process to respond to registration event. server := testutil.NewMockSlaveHttpServer(t, func(rsp http.ResponseWriter, req *http.Request) { reqPath, err := url.QueryUnescape(req.URL.String()) @@ -182,28 +211,29 @@ func TestExecutorDriverExecutorRegisteredEvent(t *testing.T) { stat, err := driver.Start() assert.NoError(t, err) assert.Equal(t, mesos.Status_DRIVER_RUNNING, stat) + defer driver.Stop() //simulate sending ExecutorRegisteredMessage from server to exec pid. pbMsg := &mesos.ExecutorRegisteredMessage{ - ExecutorInfo: util.NewExecutorInfo(util.NewExecutorID(executorID), nil), + ExecutorInfo: util.NewExecutorInfo(util.NewExecutorID(executorID), util.NewCommandInfo("ls -l")), FrameworkId: util.NewFrameworkID(frameworkID), FrameworkInfo: util.NewFrameworkInfo("test", "test-framework", util.NewFrameworkID(frameworkID)), SlaveId: util.NewSlaveID(slaveID), SlaveInfo: &mesos.SlaveInfo{Hostname: proto.String("localhost")}, } c := testutil.NewMockMesosClient(t, server.PID) + connected := driver.connectionListener() c.SendMessage(driver.self, pbMsg) - assert.True(t, driver.Connected()) select { - case <-ch: - case <-time.After(time.Millisecond * 2): + case <-connected: + case <-time.After(time.Second * 1): log.Errorf("Tired of waiting...") } } func TestExecutorDriverExecutorReregisteredEvent(t *testing.T) { setTestEnv(t) - ch := make(chan bool) + ch := make(chan bool, 2) // Mock Slave process to respond to registration event. server := testutil.NewMockSlaveHttpServer(t, func(rsp http.ResponseWriter, req *http.Request) { reqPath, err := url.QueryUnescape(req.URL.String()) @@ -223,6 +253,7 @@ func TestExecutorDriverExecutorReregisteredEvent(t *testing.T) { stat, err := driver.Start() assert.NoError(t, err) assert.Equal(t, mesos.Status_DRIVER_RUNNING, stat) + defer driver.Stop() //simulate sending ExecutorRegisteredMessage from server to exec pid. pbMsg := &mesos.ExecutorReregisteredMessage{ @@ -230,18 +261,18 @@ func TestExecutorDriverExecutorReregisteredEvent(t *testing.T) { SlaveInfo: &mesos.SlaveInfo{Hostname: proto.String("localhost")}, } c := testutil.NewMockMesosClient(t, server.PID) + connected := driver.connectionListener() c.SendMessage(driver.self, pbMsg) - assert.True(t, driver.connected) select { - case <-ch: - case <-time.After(time.Millisecond * 2): + case <-connected: + case <-time.After(time.Second * 1): log.Errorf("Tired of waiting...") } } func TestExecutorDriverReconnectEvent(t *testing.T) { setTestEnv(t) - ch := make(chan bool) + ch := make(chan bool, 2) // Mock Slave process to respond to registration event. server := testutil.NewMockSlaveHttpServer(t, func(rsp http.ResponseWriter, req *http.Request) { reqPath, err := url.QueryUnescape(req.URL.String()) @@ -271,7 +302,8 @@ func TestExecutorDriverReconnectEvent(t *testing.T) { stat, err := driver.Start() assert.NoError(t, err) assert.Equal(t, mesos.Status_DRIVER_RUNNING, stat) - driver.connected = true + driver.setConnected(true) + defer driver.Stop() // send "reconnect" event to driver pbMsg := &mesos.ReconnectExecutorMessage{ @@ -282,7 +314,7 @@ func TestExecutorDriverReconnectEvent(t *testing.T) { select { case <-ch: - case <-time.After(time.Millisecond * 2): + case <-time.After(time.Second * 2): log.Errorf("Tired of waiting...") } @@ -290,7 +322,7 @@ func TestExecutorDriverReconnectEvent(t *testing.T) { func TestExecutorDriverRunTaskEvent(t *testing.T) { setTestEnv(t) - ch := make(chan bool) + ch := make(chan bool, 2) // Mock Slave process to respond to registration event. server := testutil.NewMockSlaveHttpServer(t, func(rsp http.ResponseWriter, req *http.Request) { reqPath, err := url.QueryUnescape(req.URL.String()) @@ -310,7 +342,8 @@ func TestExecutorDriverRunTaskEvent(t *testing.T) { stat, err := driver.Start() assert.NoError(t, err) assert.Equal(t, mesos.Status_DRIVER_RUNNING, stat) - driver.connected = true + driver.setConnected(true) + defer driver.Stop() // send runtask event to driver pbMsg := &mesos.RunTaskMessage{ @@ -335,7 +368,7 @@ func TestExecutorDriverRunTaskEvent(t *testing.T) { select { case <-ch: - case <-time.After(time.Millisecond * 2): + case <-time.After(time.Second * 2): log.Errorf("Tired of waiting...") } @@ -343,7 +376,7 @@ func TestExecutorDriverRunTaskEvent(t *testing.T) { func TestExecutorDriverKillTaskEvent(t *testing.T) { setTestEnv(t) - ch := make(chan bool) + ch := make(chan bool, 2) // Mock Slave process to respond to registration event. server := testutil.NewMockSlaveHttpServer(t, func(rsp http.ResponseWriter, req *http.Request) { reqPath, err := url.QueryUnescape(req.URL.String()) @@ -363,7 +396,8 @@ func TestExecutorDriverKillTaskEvent(t *testing.T) { stat, err := driver.Start() assert.NoError(t, err) assert.Equal(t, mesos.Status_DRIVER_RUNNING, stat) - driver.connected = true + driver.setConnected(true) + defer driver.Stop() // send runtask event to driver pbMsg := &mesos.KillTaskMessage{ @@ -376,14 +410,14 @@ func TestExecutorDriverKillTaskEvent(t *testing.T) { select { case <-ch: - case <-time.After(time.Millisecond * 2): + case <-time.After(time.Second * 2): log.Errorf("Tired of waiting...") } } func TestExecutorDriverStatusUpdateAcknowledgement(t *testing.T) { setTestEnv(t) - ch := make(chan bool) + ch := make(chan bool, 2) // Mock Slave process to respond to registration event. server := testutil.NewMockSlaveHttpServer(t, func(rsp http.ResponseWriter, req *http.Request) { reqPath, err := url.QueryUnescape(req.URL.String()) @@ -403,7 +437,8 @@ func TestExecutorDriverStatusUpdateAcknowledgement(t *testing.T) { stat, err := driver.Start() assert.NoError(t, err) assert.Equal(t, mesos.Status_DRIVER_RUNNING, stat) - driver.connected = true + driver.setConnected(true) + defer driver.Stop() // send ACK from server pbMsg := &mesos.StatusUpdateAcknowledgementMessage{ @@ -415,12 +450,12 @@ func TestExecutorDriverStatusUpdateAcknowledgement(t *testing.T) { c := testutil.NewMockMesosClient(t, server.PID) c.SendMessage(driver.self, pbMsg) - <-time.After(time.Millisecond * 2) + <-time.After(time.Second * 1) } func TestExecutorDriverFrameworkToExecutorMessageEvent(t *testing.T) { setTestEnv(t) - ch := make(chan bool) + ch := make(chan bool, 2) // Mock Slave process to respond to registration event. server := testutil.NewMockSlaveHttpServer(t, func(rsp http.ResponseWriter, req *http.Request) { reqPath, err := url.QueryUnescape(req.URL.String()) @@ -440,7 +475,8 @@ func TestExecutorDriverFrameworkToExecutorMessageEvent(t *testing.T) { stat, err := driver.Start() assert.NoError(t, err) assert.Equal(t, mesos.Status_DRIVER_RUNNING, stat) - driver.connected = true + driver.setConnected(true) + defer driver.Stop() // send runtask event to driver pbMsg := &mesos.FrameworkToExecutorMessage{ @@ -455,14 +491,14 @@ func TestExecutorDriverFrameworkToExecutorMessageEvent(t *testing.T) { select { case <-ch: - case <-time.After(time.Millisecond * 2): + case <-time.After(time.Second * 1): log.Errorf("Tired of waiting...") } } func TestExecutorDriverShutdownEvent(t *testing.T) { setTestEnv(t) - ch := make(chan bool) + ch := make(chan bool, 2) // Mock Slave process to respond to registration event. server := testutil.NewMockSlaveHttpServer(t, func(rsp http.ResponseWriter, req *http.Request) { reqPath, err := url.QueryUnescape(req.URL.String()) @@ -482,7 +518,7 @@ func TestExecutorDriverShutdownEvent(t *testing.T) { stat, err := driver.Start() assert.NoError(t, err) assert.Equal(t, mesos.Status_DRIVER_RUNNING, stat) - driver.connected = true + driver.setConnected(true) // send runtask event to driver pbMsg := &mesos.ShutdownExecutorMessage{} @@ -492,16 +528,17 @@ func TestExecutorDriverShutdownEvent(t *testing.T) { select { case <-ch: - case <-time.After(time.Millisecond * 5): + case <-time.After(time.Second * 5): log.Errorf("Tired of waiting...") } - <-time.After(time.Millisecond * 5) // wait for shutdown to finish. + <-time.After(time.Second * 1) // wait for shutdown to finish. assert.Equal(t, mesos.Status_DRIVER_STOPPED, driver.Status()) } func TestExecutorDriverError(t *testing.T) { setTestEnv(t) + ch := make(chan bool, 2) // Mock Slave process to respond to registration event. server := testutil.NewMockSlaveHttpServer(t, func(rsp http.ResponseWriter, req *http.Request) { reqPath, err := url.QueryUnescape(req.URL.String()) @@ -510,7 +547,6 @@ func TestExecutorDriverError(t *testing.T) { rsp.WriteHeader(http.StatusAccepted) }) - ch := make(chan bool) exec := newTestExecutor(t) exec.ch = ch exec.t = t @@ -525,7 +561,7 @@ func TestExecutorDriverError(t *testing.T) { select { case <-ch: - case <-time.After(time.Millisecond * 5): + case <-time.After(time.Second * 1): log.Errorf("Tired of waiting...") } } diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/executor/executor_test.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/executor/executor_test.go index 067e21cebfee3..d464172550cba 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/executor/executor_test.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/executor/executor_test.go @@ -22,7 +22,6 @@ import ( "fmt" "os" "testing" - "time" "github.com/mesos/mesos-go/healthchecker" "github.com/mesos/mesos-go/mesosproto" @@ -70,19 +69,30 @@ func newTestExecutorDriver(t *testing.T, exec Executor) *MesosExecutorDriver { return driver } +type testExecutorDriver struct { + *MesosExecutorDriver +} + +func (e *testExecutorDriver) setConnected(b bool) { + e.lock.Lock() + defer e.lock.Unlock() + e.connected = b +} + func createTestExecutorDriver(t *testing.T) ( - *MesosExecutorDriver, + *testExecutorDriver, *messenger.MockedMessenger, *healthchecker.MockedHealthChecker) { exec := NewMockedExecutor() + exec.On("Error").Return(nil) setEnvironments(t, "", false) driver := newTestExecutorDriver(t, exec) messenger := messenger.NewMockedMessenger() messenger.On("Start").Return(nil) - messenger.On("UPID").Return(&upid.UPID{}) + messenger.On("UPID").Return(upid.UPID{}) messenger.On("Send").Return(nil) messenger.On("Stop").Return(nil) @@ -91,7 +101,7 @@ func createTestExecutorDriver(t *testing.T) ( checker.On("Stop").Return() driver.messenger = messenger - return driver, messenger, checker + return &testExecutorDriver{driver}, messenger, checker } func TestExecutorDriverStartFailedToParseEnvironment(t *testing.T) { @@ -137,7 +147,7 @@ func TestExecutorDriverStartFailedToSendRegisterMessage(t *testing.T) { // Set expections and return values. messenger.On("Start").Return(nil) - messenger.On("UPID").Return(&upid.UPID{}) + messenger.On("UPID").Return(upid.UPID{}) messenger.On("Send").Return(fmt.Errorf("messenger failed to send")) messenger.On("Stop").Return(nil) @@ -162,7 +172,7 @@ func TestExecutorDriverStartSucceed(t *testing.T) { messenger := messenger.NewMockedMessenger() driver.messenger = messenger messenger.On("Start").Return(nil) - messenger.On("UPID").Return(&upid.UPID{}) + messenger.On("UPID").Return(upid.UPID{}) messenger.On("Send").Return(nil) messenger.On("Stop").Return(nil) @@ -170,9 +180,9 @@ func TestExecutorDriverStartSucceed(t *testing.T) { checker.On("Start").Return() checker.On("Stop").Return() - assert.True(t, driver.stopped) + assert.False(t, driver.Running()) status, err := driver.Start() - assert.False(t, driver.stopped) + assert.True(t, driver.Running()) assert.NoError(t, err) assert.Equal(t, mesosproto.Status_DRIVER_RUNNING, status) @@ -187,7 +197,7 @@ func TestExecutorDriverRun(t *testing.T) { // Set expections and return values. messenger := messenger.NewMockedMessenger() messenger.On("Start").Return(nil) - messenger.On("UPID").Return(&upid.UPID{}) + messenger.On("UPID").Return(upid.UPID{}) messenger.On("Send").Return(nil) messenger.On("Stop").Return(nil) @@ -196,25 +206,23 @@ func TestExecutorDriverRun(t *testing.T) { driver := newTestExecutorDriver(t, exec) driver.messenger = messenger - assert.True(t, driver.stopped) + assert.False(t, driver.Running()) checker := healthchecker.NewMockedHealthChecker() checker.On("Start").Return() checker.On("Stop").Return() + ch := make(chan struct{}) go func() { + defer close(ch) stat, err := driver.Run() assert.NoError(t, err) assert.Equal(t, mesosproto.Status_DRIVER_STOPPED, stat) }() - time.Sleep(time.Millisecond * 1) // allow for things to settle - assert.False(t, driver.Stopped()) - assert.Equal(t, mesosproto.Status_DRIVER_RUNNING, driver.Status()) - - // mannually close it all - driver.setStatus(mesosproto.Status_DRIVER_STOPPED) - close(driver.stopCh) - time.Sleep(time.Millisecond * 1) + <-driver.started + assert.True(t, driver.Running()) + driver.Stop() + <-ch } func TestExecutorDriverJoin(t *testing.T) { @@ -223,7 +231,7 @@ func TestExecutorDriverJoin(t *testing.T) { // Set expections and return values. messenger := messenger.NewMockedMessenger() messenger.On("Start").Return(nil) - messenger.On("UPID").Return(&upid.UPID{}) + messenger.On("UPID").Return(upid.UPID{}) messenger.On("Send").Return(nil) messenger.On("Stop").Return(nil) @@ -232,7 +240,7 @@ func TestExecutorDriverJoin(t *testing.T) { driver := newTestExecutorDriver(t, exec) driver.messenger = messenger - assert.True(t, driver.stopped) + assert.False(t, driver.Running()) checker := healthchecker.NewMockedHealthChecker() checker.On("Start").Return() @@ -240,7 +248,7 @@ func TestExecutorDriverJoin(t *testing.T) { stat, err := driver.Start() assert.NoError(t, err) - assert.False(t, driver.stopped) + assert.True(t, driver.Running()) assert.Equal(t, mesosproto.Status_DRIVER_RUNNING, stat) testCh := make(chan mesosproto.Status) @@ -249,18 +257,18 @@ func TestExecutorDriverJoin(t *testing.T) { testCh <- stat }() - close(driver.stopCh) // manually stopping - stat = <-testCh // when Stop() is called, stat will be DRIVER_STOPPED. - + driver.Stop() + stat = <-testCh // when Stop() is called, stat will be DRIVER_STOPPED. + assert.Equal(t, mesosproto.Status_DRIVER_STOPPED, stat) } func TestExecutorDriverAbort(t *testing.T) { statusChan := make(chan mesosproto.Status) driver, messenger, _ := createTestExecutorDriver(t) - assert.True(t, driver.stopped) + assert.False(t, driver.Running()) stat, err := driver.Start() - assert.False(t, driver.stopped) + assert.True(t, driver.Running()) assert.NoError(t, err) assert.Equal(t, mesosproto.Status_DRIVER_RUNNING, stat) go func() { @@ -272,7 +280,7 @@ func TestExecutorDriverAbort(t *testing.T) { assert.NoError(t, err) assert.Equal(t, mesosproto.Status_DRIVER_ABORTED, stat) assert.Equal(t, mesosproto.Status_DRIVER_ABORTED, <-statusChan) - assert.True(t, driver.stopped) + assert.False(t, driver.Running()) // Abort for the second time, should return directly. stat, err = driver.Abort() @@ -281,11 +289,11 @@ func TestExecutorDriverAbort(t *testing.T) { stat, err = driver.Stop() assert.Error(t, err) assert.Equal(t, mesosproto.Status_DRIVER_ABORTED, stat) - assert.True(t, driver.stopped) + assert.False(t, driver.Running()) // Restart should not start. stat, err = driver.Start() - assert.True(t, driver.stopped) + assert.False(t, driver.Running()) assert.Error(t, err) assert.Equal(t, mesosproto.Status_DRIVER_ABORTED, stat) @@ -299,9 +307,9 @@ func TestExecutorDriverStop(t *testing.T) { statusChan := make(chan mesosproto.Status) driver, messenger, _ := createTestExecutorDriver(t) - assert.True(t, driver.stopped) + assert.False(t, driver.Running()) stat, err := driver.Start() - assert.False(t, driver.stopped) + assert.True(t, driver.Running()) assert.NoError(t, err) assert.Equal(t, mesosproto.Status_DRIVER_RUNNING, stat) go func() { @@ -312,7 +320,7 @@ func TestExecutorDriverStop(t *testing.T) { assert.NoError(t, err) assert.Equal(t, mesosproto.Status_DRIVER_STOPPED, stat) assert.Equal(t, mesosproto.Status_DRIVER_STOPPED, <-statusChan) - assert.True(t, driver.stopped) + assert.False(t, driver.Running()) // Stop for the second time, should return directly. stat, err = driver.Stop() @@ -321,11 +329,11 @@ func TestExecutorDriverStop(t *testing.T) { stat, err = driver.Abort() assert.Error(t, err) assert.Equal(t, mesosproto.Status_DRIVER_STOPPED, stat) - assert.True(t, driver.stopped) + assert.False(t, driver.Running()) // Restart should not start. stat, err = driver.Start() - assert.True(t, driver.stopped) + assert.False(t, driver.Running()) assert.Error(t, err) assert.Equal(t, mesosproto.Status_DRIVER_STOPPED, stat) @@ -342,8 +350,7 @@ func TestExecutorDriverSendStatusUpdate(t *testing.T) { stat, err := driver.Start() assert.NoError(t, err) assert.Equal(t, mesosproto.Status_DRIVER_RUNNING, stat) - driver.connected = true - driver.stopped = false + driver.setConnected(true) taskStatus := util.NewTaskStatus( util.NewTaskID("test-task-001"), @@ -358,16 +365,10 @@ func TestExecutorDriverSendStatusUpdate(t *testing.T) { func TestExecutorDriverSendStatusUpdateStaging(t *testing.T) { driver, _, _ := createTestExecutorDriver(t) - - exec := NewMockedExecutor() - exec.On("Error").Return(nil) - driver.exec = exec - stat, err := driver.Start() assert.NoError(t, err) assert.Equal(t, mesosproto.Status_DRIVER_RUNNING, stat) - driver.connected = true - driver.stopped = false + driver.setConnected(true) taskStatus := util.NewTaskStatus( util.NewTaskID("test-task-001"), @@ -389,8 +390,7 @@ func TestExecutorDriverSendFrameworkMessage(t *testing.T) { stat, err = driver.Start() assert.NoError(t, err) assert.Equal(t, mesosproto.Status_DRIVER_RUNNING, stat) - driver.connected = true - driver.stopped = false + driver.setConnected(true) stat, err = driver.SendFrameworkMessage("Testing Mesos") assert.NoError(t, err) @@ -403,7 +403,11 @@ func TestStatusUpdateAckRace_Issue103(t *testing.T) { assert.NoError(t, err) msg := &mesosproto.StatusUpdateAcknowledgementMessage{} - go driver.statusUpdateAcknowledgement(nil, msg) + go func() { + driver.lock.Lock() + defer driver.lock.Unlock() + driver.statusUpdateAcknowledgement(nil, msg) + }() taskStatus := util.NewTaskStatus( util.NewTaskID("test-task-001"), diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/authentication.pb.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/authentication.pb.go new file mode 100644 index 0000000000000..76bd7b3a9d14e --- /dev/null +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/authentication.pb.go @@ -0,0 +1,255 @@ +// Code generated by protoc-gen-gogo. +// source: authentication.proto +// DO NOT EDIT! + +/* + Package mesosproto is a generated protocol buffer package. + + It is generated from these files: + authentication.proto + containerizer.proto + internal.proto + log.proto + mesos.proto + messages.proto + registry.proto + scheduler.proto + state.proto + + It has these top-level messages: + AuthenticateMessage + AuthenticationMechanismsMessage + AuthenticationStartMessage + AuthenticationStepMessage + AuthenticationCompletedMessage + AuthenticationFailedMessage + AuthenticationErrorMessage + Launch + Update + Wait + Destroy + Usage + Termination + Containers + InternalMasterChangeDetected + InternalTryAuthentication + InternalAuthenticationResult + Promise + Action + Metadata + Record + PromiseRequest + PromiseResponse + WriteRequest + WriteResponse + LearnedMessage + RecoverRequest + RecoverResponse + FrameworkID + OfferID + SlaveID + TaskID + ExecutorID + ContainerID + FrameworkInfo + HealthCheck + CommandInfo + ExecutorInfo + MasterInfo + SlaveInfo + Value + Attribute + Resource + TrafficControlStatistics + ResourceStatistics + ResourceUsage + PerfStatistics + Request + Offer + TaskInfo + TaskStatus + Filters + Environment + Parameter + Parameters + Credential + Credentials + ACL + ACLs + RateLimit + RateLimits + Volume + ContainerInfo + Labels + Label + Port + Ports + DiscoveryInfo + Task + StatusUpdate + StatusUpdateRecord + SubmitSchedulerRequest + SubmitSchedulerResponse + ExecutorToFrameworkMessage + FrameworkToExecutorMessage + RegisterFrameworkMessage + ReregisterFrameworkMessage + FrameworkRegisteredMessage + FrameworkReregisteredMessage + UnregisterFrameworkMessage + DeactivateFrameworkMessage + ResourceRequestMessage + ResourceOffersMessage + LaunchTasksMessage + RescindResourceOfferMessage + ReviveOffersMessage + RunTaskMessage + KillTaskMessage + StatusUpdateMessage + StatusUpdateAcknowledgementMessage + LostSlaveMessage + ReconcileTasksMessage + FrameworkErrorMessage + RegisterSlaveMessage + ReregisterSlaveMessage + SlaveRegisteredMessage + SlaveReregisteredMessage + UnregisterSlaveMessage + MasterSlaveConnection + PingSlaveMessage + PongSlaveMessage + ShutdownFrameworkMessage + ShutdownExecutorMessage + UpdateFrameworkMessage + CheckpointResourcesMessage + UpdateSlaveMessage + RegisterExecutorMessage + ExecutorRegisteredMessage + ExecutorReregisteredMessage + ExitedExecutorMessage + ReconnectExecutorMessage + ReregisterExecutorMessage + ShutdownMessage + Archive + TaskHealthStatus + HookExecuted + Registry + Event + Call + Entry + Operation +*/ +package mesosproto + +import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +type AuthenticateMessage struct { + Pid *string `protobuf:"bytes,1,req,name=pid" json:"pid,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *AuthenticateMessage) Reset() { *m = AuthenticateMessage{} } +func (m *AuthenticateMessage) String() string { return proto.CompactTextString(m) } +func (*AuthenticateMessage) ProtoMessage() {} + +func (m *AuthenticateMessage) GetPid() string { + if m != nil && m.Pid != nil { + return *m.Pid + } + return "" +} + +type AuthenticationMechanismsMessage struct { + Mechanisms []string `protobuf:"bytes,1,rep,name=mechanisms" json:"mechanisms,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *AuthenticationMechanismsMessage) Reset() { *m = AuthenticationMechanismsMessage{} } +func (m *AuthenticationMechanismsMessage) String() string { return proto.CompactTextString(m) } +func (*AuthenticationMechanismsMessage) ProtoMessage() {} + +func (m *AuthenticationMechanismsMessage) GetMechanisms() []string { + if m != nil { + return m.Mechanisms + } + return nil +} + +type AuthenticationStartMessage struct { + Mechanism *string `protobuf:"bytes,1,req,name=mechanism" json:"mechanism,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data" json:"data,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *AuthenticationStartMessage) Reset() { *m = AuthenticationStartMessage{} } +func (m *AuthenticationStartMessage) String() string { return proto.CompactTextString(m) } +func (*AuthenticationStartMessage) ProtoMessage() {} + +func (m *AuthenticationStartMessage) GetMechanism() string { + if m != nil && m.Mechanism != nil { + return *m.Mechanism + } + return "" +} + +func (m *AuthenticationStartMessage) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +type AuthenticationStepMessage struct { + Data []byte `protobuf:"bytes,1,req,name=data" json:"data,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *AuthenticationStepMessage) Reset() { *m = AuthenticationStepMessage{} } +func (m *AuthenticationStepMessage) String() string { return proto.CompactTextString(m) } +func (*AuthenticationStepMessage) ProtoMessage() {} + +func (m *AuthenticationStepMessage) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +type AuthenticationCompletedMessage struct { + XXX_unrecognized []byte `json:"-"` +} + +func (m *AuthenticationCompletedMessage) Reset() { *m = AuthenticationCompletedMessage{} } +func (m *AuthenticationCompletedMessage) String() string { return proto.CompactTextString(m) } +func (*AuthenticationCompletedMessage) ProtoMessage() {} + +type AuthenticationFailedMessage struct { + XXX_unrecognized []byte `json:"-"` +} + +func (m *AuthenticationFailedMessage) Reset() { *m = AuthenticationFailedMessage{} } +func (m *AuthenticationFailedMessage) String() string { return proto.CompactTextString(m) } +func (*AuthenticationFailedMessage) ProtoMessage() {} + +type AuthenticationErrorMessage struct { + Error *string `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *AuthenticationErrorMessage) Reset() { *m = AuthenticationErrorMessage{} } +func (m *AuthenticationErrorMessage) String() string { return proto.CompactTextString(m) } +func (*AuthenticationErrorMessage) ProtoMessage() {} + +func (m *AuthenticationErrorMessage) GetError() string { + if m != nil && m.Error != nil { + return *m.Error + } + return "" +} diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/authentication.proto b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/authentication.proto new file mode 100644 index 0000000000000..d8e42569e3988 --- /dev/null +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/authentication.proto @@ -0,0 +1,53 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package mesosproto; + +import "mesos.proto"; + + +message AuthenticateMessage { + required string pid = 1; // PID that needs to be authenticated. +} + + +message AuthenticationMechanismsMessage { + repeated string mechanisms = 1; // List of available SASL mechanisms. +} + + +message AuthenticationStartMessage { + required string mechanism = 1; + optional bytes data = 2; +} + + +message AuthenticationStepMessage { + required bytes data = 1; +} + + +message AuthenticationCompletedMessage {} + + +message AuthenticationFailedMessage {} + + +message AuthenticationErrorMessage { + optional string error = 1; +} diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/containerizer.pb.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/containerizer.pb.go index 2e1e7921c53f1..da62428f08013 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/containerizer.pb.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/containerizer.pb.go @@ -2,37 +2,17 @@ // source: containerizer.proto // DO NOT EDIT! -/* - Package mesosproto is a generated protocol buffer package. - - It is generated from these files: - containerizer.proto - internal.proto - log.proto - mesos.proto - messages.proto - registry.proto - scheduler.proto - state.proto - - It has these top-level messages: - Launch - Update - Wait - Destroy - Usage - Termination - Containers -*/ package mesosproto import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" import math "math" -// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto/gogo.pb" +// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal +var _ = fmt.Errorf var _ = math.Inf // * @@ -200,6 +180,8 @@ func (m *Usage) GetContainerId() *ContainerID { type Termination struct { // A container may be killed if it exceeds its resources; this will // be indicated by killed=true and described by the message string. + // TODO(jaybuff): As part of MESOS-2035 we should remove killed and + // replace it with a TaskStatus::Reason. Killed *bool `protobuf:"varint,1,req,name=killed" json:"killed,omitempty"` Message *string `protobuf:"bytes,2,req,name=message" json:"message,omitempty"` // Exit status of the process. @@ -250,6 +232,3 @@ func (m *Containers) GetContainers() []*ContainerID { } return nil } - -func init() { -} diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/containerizer.proto b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/containerizer.proto index 79eda53197659..878060cc4923a 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/containerizer.proto +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/containerizer.proto @@ -82,6 +82,8 @@ message Usage { message Termination { // A container may be killed if it exceeds its resources; this will // be indicated by killed=true and described by the message string. + // TODO(jaybuff): As part of MESOS-2035 we should remove killed and + // replace it with a TaskStatus::Reason. required bool killed = 1; required string message = 2; diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/internal.pb.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/internal.pb.go index c794dd359dabb..8988e89978bec 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/internal.pb.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/internal.pb.go @@ -5,12 +5,14 @@ package mesosproto import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" import math "math" -// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto/gogo.pb" +// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal +var _ = fmt.Errorf var _ = math.Inf // For use with detector callbacks @@ -73,6 +75,3 @@ func (m *InternalAuthenticationResult) GetPid() string { } return "" } - -func init() { -} diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/log.pb.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/log.pb.go index 06db2ecc18408..2b62f81d64af4 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/log.pb.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/log.pb.go @@ -5,30 +5,24 @@ package mesosproto import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" import math "math" -// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto/gogo.pb" +// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" -import io1 "io" -import fmt4 "fmt" -import github_com_gogo_protobuf_proto2 "github.com/gogo/protobuf/proto" +import bytes "bytes" -import fmt5 "fmt" -import strings2 "strings" -import reflect2 "reflect" +import strings "strings" +import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" +import sort "sort" +import strconv "strconv" +import reflect "reflect" -import fmt6 "fmt" -import strings3 "strings" -import github_com_gogo_protobuf_proto3 "github.com/gogo/protobuf/proto" -import sort1 "sort" -import strconv1 "strconv" -import reflect3 "reflect" - -import fmt7 "fmt" -import bytes1 "bytes" +import io "io" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal +var _ = fmt.Errorf var _ = math.Inf type Action_Type int32 @@ -614,2104 +608,1540 @@ func init() { proto.RegisterEnum("mesosproto.Metadata_Status", Metadata_Status_name, Metadata_Status_value) proto.RegisterEnum("mesosproto.Record_Type", Record_Type_name, Record_Type_value) } -func (m *Promise) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Proposal", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Proposal = &v - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto2.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io1.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy +func (this *Promise) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } + return fmt.Errorf("that == nil && this != nil") } - return nil -} -func (m *Action) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } + + that1, ok := that.(*Promise) + if !ok { + return fmt.Errorf("that is not of type *Promise") + } + if that1 == nil { + if this == nil { + return nil } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Position", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Position = &v - case 2: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Promised", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Promised = &v - case 3: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Performed", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Performed = &v - case 4: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Learned", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Learned = &b - case 5: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v Action_Type - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (Action_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - case 6: - if wireType != 2 { - return fmt4.Errorf("proto: wrong wireType = %d for field Nop", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io1.ErrUnexpectedEOF - } - if m.Nop == nil { - m.Nop = &Action_Nop{} - } - if err := m.Nop.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 7: - if wireType != 2 { - return fmt4.Errorf("proto: wrong wireType = %d for field Append", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io1.ErrUnexpectedEOF - } - if m.Append == nil { - m.Append = &Action_Append{} - } - if err := m.Append.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 8: - if wireType != 2 { - return fmt4.Errorf("proto: wrong wireType = %d for field Truncate", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io1.ErrUnexpectedEOF - } - if m.Truncate == nil { - m.Truncate = &Action_Truncate{} - } - if err := m.Truncate.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto2.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io1.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return fmt.Errorf("that is type *Promise but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Promisebut is not nil && this == nil") + } + if this.Proposal != nil && that1.Proposal != nil { + if *this.Proposal != *that1.Proposal { + return fmt.Errorf("Proposal this(%v) Not Equal that(%v)", *this.Proposal, *that1.Proposal) } + } else if this.Proposal != nil { + return fmt.Errorf("this.Proposal == nil && that.Proposal != nil") + } else if that1.Proposal != nil { + return fmt.Errorf("Proposal this(%v) Not Equal that(%v)", this.Proposal, that1.Proposal) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *Action_Nop) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *Promise) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - switch fieldNum { - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto2.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io1.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return false + } + + that1, ok := that.(*Promise) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true } + return false + } else if this == nil { + return false } - return nil -} -func (m *Action_Append) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt4.Errorf("proto: wrong wireType = %d for field Bytes", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + byteLen - if postIndex > l { - return io1.ErrUnexpectedEOF - } - m.Bytes = append([]byte{}, data[index:postIndex]...) - index = postIndex - case 2: - if wireType != 2 { - return fmt4.Errorf("proto: wrong wireType = %d for field Cksum", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + byteLen - if postIndex > l { - return io1.ErrUnexpectedEOF - } - m.Cksum = append([]byte{}, data[index:postIndex]...) - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto2.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io1.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + if this.Proposal != nil && that1.Proposal != nil { + if *this.Proposal != *that1.Proposal { + return false } + } else if this.Proposal != nil { + return false + } else if that1.Proposal != nil { + return false } - return nil + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true } -func (m *Action_Truncate) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *Action) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field To", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.To = &v - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto2.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io1.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Action) + if !ok { + return fmt.Errorf("that is not of type *Action") + } + if that1 == nil { + if this == nil { + return nil } + return fmt.Errorf("that is type *Action but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Actionbut is not nil && this == nil") } - return nil -} -func (m *Metadata) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } + if this.Position != nil && that1.Position != nil { + if *this.Position != *that1.Position { + return fmt.Errorf("Position this(%v) Not Equal that(%v)", *this.Position, *that1.Position) } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var v Metadata_Status - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (Metadata_Status(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Status = &v - case 2: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Promised", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Promised = &v - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto2.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io1.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + } else if this.Position != nil { + return fmt.Errorf("this.Position == nil && that.Position != nil") + } else if that1.Position != nil { + return fmt.Errorf("Position this(%v) Not Equal that(%v)", this.Position, that1.Position) + } + if this.Promised != nil && that1.Promised != nil { + if *this.Promised != *that1.Promised { + return fmt.Errorf("Promised this(%v) Not Equal that(%v)", *this.Promised, *that1.Promised) + } + } else if this.Promised != nil { + return fmt.Errorf("this.Promised == nil && that.Promised != nil") + } else if that1.Promised != nil { + return fmt.Errorf("Promised this(%v) Not Equal that(%v)", this.Promised, that1.Promised) + } + if this.Performed != nil && that1.Performed != nil { + if *this.Performed != *that1.Performed { + return fmt.Errorf("Performed this(%v) Not Equal that(%v)", *this.Performed, *that1.Performed) + } + } else if this.Performed != nil { + return fmt.Errorf("this.Performed == nil && that.Performed != nil") + } else if that1.Performed != nil { + return fmt.Errorf("Performed this(%v) Not Equal that(%v)", this.Performed, that1.Performed) + } + if this.Learned != nil && that1.Learned != nil { + if *this.Learned != *that1.Learned { + return fmt.Errorf("Learned this(%v) Not Equal that(%v)", *this.Learned, *that1.Learned) + } + } else if this.Learned != nil { + return fmt.Errorf("this.Learned == nil && that.Learned != nil") + } else if that1.Learned != nil { + return fmt.Errorf("Learned this(%v) Not Equal that(%v)", this.Learned, that1.Learned) + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) } + } else if this.Type != nil { + return fmt.Errorf("this.Type == nil && that.Type != nil") + } else if that1.Type != nil { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) + } + if !this.Nop.Equal(that1.Nop) { + return fmt.Errorf("Nop this(%v) Not Equal that(%v)", this.Nop, that1.Nop) + } + if !this.Append.Equal(that1.Append) { + return fmt.Errorf("Append this(%v) Not Equal that(%v)", this.Append, that1.Append) + } + if !this.Truncate.Equal(that1.Truncate) { + return fmt.Errorf("Truncate this(%v) Not Equal that(%v)", this.Truncate, that1.Truncate) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *Record) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *Action) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v Record_Type - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (Record_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - case 2: - if wireType != 2 { - return fmt4.Errorf("proto: wrong wireType = %d for field Promise", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io1.ErrUnexpectedEOF - } - if m.Promise == nil { - m.Promise = &Promise{} - } - if err := m.Promise.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 3: - if wireType != 2 { - return fmt4.Errorf("proto: wrong wireType = %d for field Action", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io1.ErrUnexpectedEOF - } - if m.Action == nil { - m.Action = &Action{} - } - if err := m.Action.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 4: - if wireType != 2 { - return fmt4.Errorf("proto: wrong wireType = %d for field Metadata", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io1.ErrUnexpectedEOF - } - if m.Metadata == nil { - m.Metadata = &Metadata{} - } - if err := m.Metadata.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto2.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io1.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return false + } + + that1, ok := that.(*Action) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true } + return false + } else if this == nil { + return false } - return nil -} -func (m *PromiseRequest) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } + if this.Position != nil && that1.Position != nil { + if *this.Position != *that1.Position { + return false } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Proposal", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Proposal = &v - case 2: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Position", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Position = &v - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto2.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io1.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + } else if this.Position != nil { + return false + } else if that1.Position != nil { + return false + } + if this.Promised != nil && that1.Promised != nil { + if *this.Promised != *that1.Promised { + return false } + } else if this.Promised != nil { + return false + } else if that1.Promised != nil { + return false } - return nil + if this.Performed != nil && that1.Performed != nil { + if *this.Performed != *that1.Performed { + return false + } + } else if this.Performed != nil { + return false + } else if that1.Performed != nil { + return false + } + if this.Learned != nil && that1.Learned != nil { + if *this.Learned != *that1.Learned { + return false + } + } else if this.Learned != nil { + return false + } else if that1.Learned != nil { + return false + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return false + } + } else if this.Type != nil { + return false + } else if that1.Type != nil { + return false + } + if !this.Nop.Equal(that1.Nop) { + return false + } + if !this.Append.Equal(that1.Append) { + return false + } + if !this.Truncate.Equal(that1.Truncate) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true } -func (m *PromiseResponse) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *Action_Nop) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Okay", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Okay = &b - case 2: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Proposal", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Proposal = &v - case 4: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Position", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Position = &v - case 3: - if wireType != 2 { - return fmt4.Errorf("proto: wrong wireType = %d for field Action", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io1.ErrUnexpectedEOF - } - if m.Action == nil { - m.Action = &Action{} - } - if err := m.Action.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto2.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io1.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Action_Nop) + if !ok { + return fmt.Errorf("that is not of type *Action_Nop") + } + if that1 == nil { + if this == nil { + return nil } + return fmt.Errorf("that is type *Action_Nop but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Action_Nopbut is not nil && this == nil") + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *WriteRequest) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *Action_Nop) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Proposal", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Proposal = &v - case 2: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Position", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Position = &v - case 3: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Learned", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Learned = &b - case 4: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v Action_Type - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (Action_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - case 5: - if wireType != 2 { - return fmt4.Errorf("proto: wrong wireType = %d for field Nop", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io1.ErrUnexpectedEOF - } - if m.Nop == nil { - m.Nop = &Action_Nop{} - } - if err := m.Nop.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 6: - if wireType != 2 { - return fmt4.Errorf("proto: wrong wireType = %d for field Append", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io1.ErrUnexpectedEOF - } - if m.Append == nil { - m.Append = &Action_Append{} - } - if err := m.Append.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 7: - if wireType != 2 { - return fmt4.Errorf("proto: wrong wireType = %d for field Truncate", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io1.ErrUnexpectedEOF - } - if m.Truncate == nil { - m.Truncate = &Action_Truncate{} - } - if err := m.Truncate.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto2.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io1.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return false + } + + that1, ok := that.(*Action_Nop) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Action_Append) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Action_Append) + if !ok { + return fmt.Errorf("that is not of type *Action_Append") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Action_Append but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Action_Appendbut is not nil && this == nil") + } + if !bytes.Equal(this.Bytes, that1.Bytes) { + return fmt.Errorf("Bytes this(%v) Not Equal that(%v)", this.Bytes, that1.Bytes) + } + if !bytes.Equal(this.Cksum, that1.Cksum) { + return fmt.Errorf("Cksum this(%v) Not Equal that(%v)", this.Cksum, that1.Cksum) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Action_Append) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Action_Append) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if !bytes.Equal(this.Bytes, that1.Bytes) { + return false + } + if !bytes.Equal(this.Cksum, that1.Cksum) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Action_Truncate) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Action_Truncate) + if !ok { + return fmt.Errorf("that is not of type *Action_Truncate") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Action_Truncate but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Action_Truncatebut is not nil && this == nil") + } + if this.To != nil && that1.To != nil { + if *this.To != *that1.To { + return fmt.Errorf("To this(%v) Not Equal that(%v)", *this.To, *that1.To) + } + } else if this.To != nil { + return fmt.Errorf("this.To == nil && that.To != nil") + } else if that1.To != nil { + return fmt.Errorf("To this(%v) Not Equal that(%v)", this.To, that1.To) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Action_Truncate) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Action_Truncate) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.To != nil && that1.To != nil { + if *this.To != *that1.To { + return false + } + } else if this.To != nil { + return false + } else if that1.To != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Metadata) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Metadata) + if !ok { + return fmt.Errorf("that is not of type *Metadata") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Metadata but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Metadatabut is not nil && this == nil") + } + if this.Status != nil && that1.Status != nil { + if *this.Status != *that1.Status { + return fmt.Errorf("Status this(%v) Not Equal that(%v)", *this.Status, *that1.Status) + } + } else if this.Status != nil { + return fmt.Errorf("this.Status == nil && that.Status != nil") + } else if that1.Status != nil { + return fmt.Errorf("Status this(%v) Not Equal that(%v)", this.Status, that1.Status) + } + if this.Promised != nil && that1.Promised != nil { + if *this.Promised != *that1.Promised { + return fmt.Errorf("Promised this(%v) Not Equal that(%v)", *this.Promised, *that1.Promised) + } + } else if this.Promised != nil { + return fmt.Errorf("this.Promised == nil && that.Promised != nil") + } else if that1.Promised != nil { + return fmt.Errorf("Promised this(%v) Not Equal that(%v)", this.Promised, that1.Promised) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Metadata) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Metadata) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Status != nil && that1.Status != nil { + if *this.Status != *that1.Status { + return false + } + } else if this.Status != nil { + return false + } else if that1.Status != nil { + return false + } + if this.Promised != nil && that1.Promised != nil { + if *this.Promised != *that1.Promised { + return false } + } else if this.Promised != nil { + return false + } else if that1.Promised != nil { + return false } - return nil + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true } -func (m *WriteResponse) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *Record) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Okay", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Okay = &b - case 2: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Proposal", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Proposal = &v - case 3: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Position", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Position = &v - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto2.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io1.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Record) + if !ok { + return fmt.Errorf("that is not of type *Record") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Record but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Recordbut is not nil && this == nil") + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) } + } else if this.Type != nil { + return fmt.Errorf("this.Type == nil && that.Type != nil") + } else if that1.Type != nil { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) + } + if !this.Promise.Equal(that1.Promise) { + return fmt.Errorf("Promise this(%v) Not Equal that(%v)", this.Promise, that1.Promise) + } + if !this.Action.Equal(that1.Action) { + return fmt.Errorf("Action this(%v) Not Equal that(%v)", this.Action, that1.Action) + } + if !this.Metadata.Equal(that1.Metadata) { + return fmt.Errorf("Metadata this(%v) Not Equal that(%v)", this.Metadata, that1.Metadata) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *LearnedMessage) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *Record) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt4.Errorf("proto: wrong wireType = %d for field Action", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io1.ErrUnexpectedEOF - } - if m.Action == nil { - m.Action = &Action{} - } - if err := m.Action.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto2.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io1.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return false + } + + that1, ok := that.(*Record) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return false + } + } else if this.Type != nil { + return false + } else if that1.Type != nil { + return false + } + if !this.Promise.Equal(that1.Promise) { + return false + } + if !this.Action.Equal(that1.Action) { + return false + } + if !this.Metadata.Equal(that1.Metadata) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *PromiseRequest) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*PromiseRequest) + if !ok { + return fmt.Errorf("that is not of type *PromiseRequest") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *PromiseRequest but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *PromiseRequestbut is not nil && this == nil") + } + if this.Proposal != nil && that1.Proposal != nil { + if *this.Proposal != *that1.Proposal { + return fmt.Errorf("Proposal this(%v) Not Equal that(%v)", *this.Proposal, *that1.Proposal) + } + } else if this.Proposal != nil { + return fmt.Errorf("this.Proposal == nil && that.Proposal != nil") + } else if that1.Proposal != nil { + return fmt.Errorf("Proposal this(%v) Not Equal that(%v)", this.Proposal, that1.Proposal) + } + if this.Position != nil && that1.Position != nil { + if *this.Position != *that1.Position { + return fmt.Errorf("Position this(%v) Not Equal that(%v)", *this.Position, *that1.Position) + } + } else if this.Position != nil { + return fmt.Errorf("this.Position == nil && that.Position != nil") + } else if that1.Position != nil { + return fmt.Errorf("Position this(%v) Not Equal that(%v)", this.Position, that1.Position) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *RecoverRequest) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *PromiseRequest) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*PromiseRequest) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Proposal != nil && that1.Proposal != nil { + if *this.Proposal != *that1.Proposal { + return false + } + } else if this.Proposal != nil { + return false + } else if that1.Proposal != nil { + return false + } + if this.Position != nil && that1.Position != nil { + if *this.Position != *that1.Position { + return false + } + } else if this.Position != nil { + return false + } else if that1.Position != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *PromiseResponse) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } - fieldNum := int32(wire >> 3) - switch fieldNum { - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto2.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io1.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*PromiseResponse) + if !ok { + return fmt.Errorf("that is not of type *PromiseResponse") + } + if that1 == nil { + if this == nil { + return nil } + return fmt.Errorf("that is type *PromiseResponse but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *PromiseResponsebut is not nil && this == nil") } - return nil -} -func (m *RecoverResponse) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } + if this.Okay != nil && that1.Okay != nil { + if *this.Okay != *that1.Okay { + return fmt.Errorf("Okay this(%v) Not Equal that(%v)", *this.Okay, *that1.Okay) } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var v Metadata_Status - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (Metadata_Status(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Status = &v - case 2: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Begin", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Begin = &v - case 3: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field End", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.End = &v - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto2.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io1.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + } else if this.Okay != nil { + return fmt.Errorf("this.Okay == nil && that.Okay != nil") + } else if that1.Okay != nil { + return fmt.Errorf("Okay this(%v) Not Equal that(%v)", this.Okay, that1.Okay) + } + if this.Proposal != nil && that1.Proposal != nil { + if *this.Proposal != *that1.Proposal { + return fmt.Errorf("Proposal this(%v) Not Equal that(%v)", *this.Proposal, *that1.Proposal) } + } else if this.Proposal != nil { + return fmt.Errorf("this.Proposal == nil && that.Proposal != nil") + } else if that1.Proposal != nil { + return fmt.Errorf("Proposal this(%v) Not Equal that(%v)", this.Proposal, that1.Proposal) } - return nil -} -func (this *Promise) String() string { - if this == nil { - return "nil" + if this.Position != nil && that1.Position != nil { + if *this.Position != *that1.Position { + return fmt.Errorf("Position this(%v) Not Equal that(%v)", *this.Position, *that1.Position) + } + } else if this.Position != nil { + return fmt.Errorf("this.Position == nil && that.Position != nil") + } else if that1.Position != nil { + return fmt.Errorf("Position this(%v) Not Equal that(%v)", this.Position, that1.Position) } - s := strings2.Join([]string{`&Promise{`, - `Proposal:` + valueToStringLog(this.Proposal) + `,`, - `XXX_unrecognized:` + fmt5.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Action) String() string { - if this == nil { - return "nil" + if !this.Action.Equal(that1.Action) { + return fmt.Errorf("Action this(%v) Not Equal that(%v)", this.Action, that1.Action) } - s := strings2.Join([]string{`&Action{`, - `Position:` + valueToStringLog(this.Position) + `,`, - `Promised:` + valueToStringLog(this.Promised) + `,`, - `Performed:` + valueToStringLog(this.Performed) + `,`, - `Learned:` + valueToStringLog(this.Learned) + `,`, - `Type:` + valueToStringLog(this.Type) + `,`, - `Nop:` + strings2.Replace(fmt5.Sprintf("%v", this.Nop), "Action_Nop", "Action_Nop", 1) + `,`, - `Append:` + strings2.Replace(fmt5.Sprintf("%v", this.Append), "Action_Append", "Action_Append", 1) + `,`, - `Truncate:` + strings2.Replace(fmt5.Sprintf("%v", this.Truncate), "Action_Truncate", "Action_Truncate", 1) + `,`, - `XXX_unrecognized:` + fmt5.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Action_Nop) String() string { - if this == nil { - return "nil" + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } - s := strings2.Join([]string{`&Action_Nop{`, - `XXX_unrecognized:` + fmt5.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + return nil } -func (this *Action_Append) String() string { - if this == nil { - return "nil" +func (this *PromiseResponse) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false } - s := strings2.Join([]string{`&Action_Append{`, - `Bytes:` + valueToStringLog(this.Bytes) + `,`, - `Cksum:` + valueToStringLog(this.Cksum) + `,`, - `XXX_unrecognized:` + fmt5.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Action_Truncate) String() string { - if this == nil { - return "nil" + + that1, ok := that.(*PromiseResponse) + if !ok { + return false } - s := strings2.Join([]string{`&Action_Truncate{`, - `To:` + valueToStringLog(this.To) + `,`, - `XXX_unrecognized:` + fmt5.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Metadata) String() string { - if this == nil { - return "nil" + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false } - s := strings2.Join([]string{`&Metadata{`, - `Status:` + valueToStringLog(this.Status) + `,`, - `Promised:` + valueToStringLog(this.Promised) + `,`, - `XXX_unrecognized:` + fmt5.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Record) String() string { - if this == nil { - return "nil" + if this.Okay != nil && that1.Okay != nil { + if *this.Okay != *that1.Okay { + return false + } + } else if this.Okay != nil { + return false + } else if that1.Okay != nil { + return false } - s := strings2.Join([]string{`&Record{`, - `Type:` + valueToStringLog(this.Type) + `,`, - `Promise:` + strings2.Replace(fmt5.Sprintf("%v", this.Promise), "Promise", "Promise", 1) + `,`, - `Action:` + strings2.Replace(fmt5.Sprintf("%v", this.Action), "Action", "Action", 1) + `,`, - `Metadata:` + strings2.Replace(fmt5.Sprintf("%v", this.Metadata), "Metadata", "Metadata", 1) + `,`, - `XXX_unrecognized:` + fmt5.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *PromiseRequest) String() string { - if this == nil { - return "nil" + if this.Proposal != nil && that1.Proposal != nil { + if *this.Proposal != *that1.Proposal { + return false + } + } else if this.Proposal != nil { + return false + } else if that1.Proposal != nil { + return false } - s := strings2.Join([]string{`&PromiseRequest{`, - `Proposal:` + valueToStringLog(this.Proposal) + `,`, - `Position:` + valueToStringLog(this.Position) + `,`, - `XXX_unrecognized:` + fmt5.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *PromiseResponse) String() string { - if this == nil { - return "nil" + if this.Position != nil && that1.Position != nil { + if *this.Position != *that1.Position { + return false + } + } else if this.Position != nil { + return false + } else if that1.Position != nil { + return false } - s := strings2.Join([]string{`&PromiseResponse{`, - `Okay:` + valueToStringLog(this.Okay) + `,`, - `Proposal:` + valueToStringLog(this.Proposal) + `,`, - `Position:` + valueToStringLog(this.Position) + `,`, - `Action:` + strings2.Replace(fmt5.Sprintf("%v", this.Action), "Action", "Action", 1) + `,`, - `XXX_unrecognized:` + fmt5.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *WriteRequest) String() string { - if this == nil { - return "nil" + if !this.Action.Equal(that1.Action) { + return false } - s := strings2.Join([]string{`&WriteRequest{`, - `Proposal:` + valueToStringLog(this.Proposal) + `,`, - `Position:` + valueToStringLog(this.Position) + `,`, - `Learned:` + valueToStringLog(this.Learned) + `,`, - `Type:` + valueToStringLog(this.Type) + `,`, - `Nop:` + strings2.Replace(fmt5.Sprintf("%v", this.Nop), "Action_Nop", "Action_Nop", 1) + `,`, - `Append:` + strings2.Replace(fmt5.Sprintf("%v", this.Append), "Action_Append", "Action_Append", 1) + `,`, - `Truncate:` + strings2.Replace(fmt5.Sprintf("%v", this.Truncate), "Action_Truncate", "Action_Truncate", 1) + `,`, - `XXX_unrecognized:` + fmt5.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *WriteResponse) String() string { - if this == nil { - return "nil" + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false } - s := strings2.Join([]string{`&WriteResponse{`, - `Okay:` + valueToStringLog(this.Okay) + `,`, - `Proposal:` + valueToStringLog(this.Proposal) + `,`, - `Position:` + valueToStringLog(this.Position) + `,`, - `XXX_unrecognized:` + fmt5.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + return true } -func (this *LearnedMessage) String() string { - if this == nil { - return "nil" +func (this *WriteRequest) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") } - s := strings2.Join([]string{`&LearnedMessage{`, - `Action:` + strings2.Replace(fmt5.Sprintf("%v", this.Action), "Action", "Action", 1) + `,`, - `XXX_unrecognized:` + fmt5.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *RecoverRequest) String() string { - if this == nil { - return "nil" + + that1, ok := that.(*WriteRequest) + if !ok { + return fmt.Errorf("that is not of type *WriteRequest") } - s := strings2.Join([]string{`&RecoverRequest{`, - `XXX_unrecognized:` + fmt5.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *RecoverResponse) String() string { - if this == nil { - return "nil" + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *WriteRequest but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *WriteRequestbut is not nil && this == nil") } - s := strings2.Join([]string{`&RecoverResponse{`, - `Status:` + valueToStringLog(this.Status) + `,`, - `Begin:` + valueToStringLog(this.Begin) + `,`, - `End:` + valueToStringLog(this.End) + `,`, - `XXX_unrecognized:` + fmt5.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func valueToStringLog(v interface{}) string { - rv := reflect2.ValueOf(v) - if rv.IsNil() { - return "nil" + if this.Proposal != nil && that1.Proposal != nil { + if *this.Proposal != *that1.Proposal { + return fmt.Errorf("Proposal this(%v) Not Equal that(%v)", *this.Proposal, *that1.Proposal) + } + } else if this.Proposal != nil { + return fmt.Errorf("this.Proposal == nil && that.Proposal != nil") + } else if that1.Proposal != nil { + return fmt.Errorf("Proposal this(%v) Not Equal that(%v)", this.Proposal, that1.Proposal) } - pv := reflect2.Indirect(rv).Interface() - return fmt5.Sprintf("*%v", pv) -} -func (m *Promise) Size() (n int) { - var l int - _ = l - if m.Proposal != nil { - n += 1 + sovLog(uint64(*m.Proposal)) + if this.Position != nil && that1.Position != nil { + if *this.Position != *that1.Position { + return fmt.Errorf("Position this(%v) Not Equal that(%v)", *this.Position, *that1.Position) + } + } else if this.Position != nil { + return fmt.Errorf("this.Position == nil && that.Position != nil") + } else if that1.Position != nil { + return fmt.Errorf("Position this(%v) Not Equal that(%v)", this.Position, that1.Position) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.Learned != nil && that1.Learned != nil { + if *this.Learned != *that1.Learned { + return fmt.Errorf("Learned this(%v) Not Equal that(%v)", *this.Learned, *that1.Learned) + } + } else if this.Learned != nil { + return fmt.Errorf("this.Learned == nil && that.Learned != nil") + } else if that1.Learned != nil { + return fmt.Errorf("Learned this(%v) Not Equal that(%v)", this.Learned, that1.Learned) } - return n + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) + } + } else if this.Type != nil { + return fmt.Errorf("this.Type == nil && that.Type != nil") + } else if that1.Type != nil { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) + } + if !this.Nop.Equal(that1.Nop) { + return fmt.Errorf("Nop this(%v) Not Equal that(%v)", this.Nop, that1.Nop) + } + if !this.Append.Equal(that1.Append) { + return fmt.Errorf("Append this(%v) Not Equal that(%v)", this.Append, that1.Append) + } + if !this.Truncate.Equal(that1.Truncate) { + return fmt.Errorf("Truncate this(%v) Not Equal that(%v)", this.Truncate, that1.Truncate) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil } +func (this *WriteRequest) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } -func (m *Action) Size() (n int) { - var l int - _ = l - if m.Position != nil { - n += 1 + sovLog(uint64(*m.Position)) + that1, ok := that.(*WriteRequest) + if !ok { + return false } - if m.Promised != nil { - n += 1 + sovLog(uint64(*m.Promised)) + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false } - if m.Performed != nil { - n += 1 + sovLog(uint64(*m.Performed)) + if this.Proposal != nil && that1.Proposal != nil { + if *this.Proposal != *that1.Proposal { + return false + } + } else if this.Proposal != nil { + return false + } else if that1.Proposal != nil { + return false } - if m.Learned != nil { - n += 2 + if this.Position != nil && that1.Position != nil { + if *this.Position != *that1.Position { + return false + } + } else if this.Position != nil { + return false + } else if that1.Position != nil { + return false } - if m.Type != nil { - n += 1 + sovLog(uint64(*m.Type)) + if this.Learned != nil && that1.Learned != nil { + if *this.Learned != *that1.Learned { + return false + } + } else if this.Learned != nil { + return false + } else if that1.Learned != nil { + return false } - if m.Nop != nil { - l = m.Nop.Size() - n += 1 + l + sovLog(uint64(l)) + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return false + } + } else if this.Type != nil { + return false + } else if that1.Type != nil { + return false } - if m.Append != nil { - l = m.Append.Size() - n += 1 + l + sovLog(uint64(l)) + if !this.Nop.Equal(that1.Nop) { + return false } - if m.Truncate != nil { - l = m.Truncate.Size() - n += 1 + l + sovLog(uint64(l)) + if !this.Append.Equal(that1.Append) { + return false } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if !this.Truncate.Equal(that1.Truncate) { + return false } - return n + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true } +func (this *WriteResponse) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } -func (m *Action_Nop) Size() (n int) { - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + that1, ok := that.(*WriteResponse) + if !ok { + return fmt.Errorf("that is not of type *WriteResponse") } - return n + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *WriteResponse but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *WriteResponsebut is not nil && this == nil") + } + if this.Okay != nil && that1.Okay != nil { + if *this.Okay != *that1.Okay { + return fmt.Errorf("Okay this(%v) Not Equal that(%v)", *this.Okay, *that1.Okay) + } + } else if this.Okay != nil { + return fmt.Errorf("this.Okay == nil && that.Okay != nil") + } else if that1.Okay != nil { + return fmt.Errorf("Okay this(%v) Not Equal that(%v)", this.Okay, that1.Okay) + } + if this.Proposal != nil && that1.Proposal != nil { + if *this.Proposal != *that1.Proposal { + return fmt.Errorf("Proposal this(%v) Not Equal that(%v)", *this.Proposal, *that1.Proposal) + } + } else if this.Proposal != nil { + return fmt.Errorf("this.Proposal == nil && that.Proposal != nil") + } else if that1.Proposal != nil { + return fmt.Errorf("Proposal this(%v) Not Equal that(%v)", this.Proposal, that1.Proposal) + } + if this.Position != nil && that1.Position != nil { + if *this.Position != *that1.Position { + return fmt.Errorf("Position this(%v) Not Equal that(%v)", *this.Position, *that1.Position) + } + } else if this.Position != nil { + return fmt.Errorf("this.Position == nil && that.Position != nil") + } else if that1.Position != nil { + return fmt.Errorf("Position this(%v) Not Equal that(%v)", this.Position, that1.Position) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil } +func (this *WriteResponse) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } -func (m *Action_Append) Size() (n int) { - var l int - _ = l - if m.Bytes != nil { - l = len(m.Bytes) - n += 1 + l + sovLog(uint64(l)) + that1, ok := that.(*WriteResponse) + if !ok { + return false } - if m.Cksum != nil { - l = len(m.Cksum) - n += 1 + l + sovLog(uint64(l)) + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Okay != nil && that1.Okay != nil { + if *this.Okay != *that1.Okay { + return false + } + } else if this.Okay != nil { + return false + } else if that1.Okay != nil { + return false + } + if this.Proposal != nil && that1.Proposal != nil { + if *this.Proposal != *that1.Proposal { + return false + } + } else if this.Proposal != nil { + return false + } else if that1.Proposal != nil { + return false + } + if this.Position != nil && that1.Position != nil { + if *this.Position != *that1.Position { + return false + } + } else if this.Position != nil { + return false + } else if that1.Position != nil { + return false } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false } - return n + return true } +func (this *LearnedMessage) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } -func (m *Action_Truncate) Size() (n int) { - var l int - _ = l - if m.To != nil { - n += 1 + sovLog(uint64(*m.To)) + that1, ok := that.(*LearnedMessage) + if !ok { + return fmt.Errorf("that is not of type *LearnedMessage") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *LearnedMessage but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *LearnedMessagebut is not nil && this == nil") } - return n + if !this.Action.Equal(that1.Action) { + return fmt.Errorf("Action this(%v) Not Equal that(%v)", this.Action, that1.Action) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil } +func (this *LearnedMessage) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } -func (m *Metadata) Size() (n int) { - var l int - _ = l - if m.Status != nil { - n += 1 + sovLog(uint64(*m.Status)) + that1, ok := that.(*LearnedMessage) + if !ok { + return false } - if m.Promised != nil { - n += 1 + sovLog(uint64(*m.Promised)) + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if !this.Action.Equal(that1.Action) { + return false } - return n -} - -func (m *Record) Size() (n int) { - var l int - _ = l - if m.Type != nil { - n += 1 + sovLog(uint64(*m.Type)) + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false } - if m.Promise != nil { - l = m.Promise.Size() - n += 1 + l + sovLog(uint64(l)) + return true +} +func (this *RecoverRequest) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") } - if m.Action != nil { - l = m.Action.Size() - n += 1 + l + sovLog(uint64(l)) + + that1, ok := that.(*RecoverRequest) + if !ok { + return fmt.Errorf("that is not of type *RecoverRequest") } - if m.Metadata != nil { - l = m.Metadata.Size() - n += 1 + l + sovLog(uint64(l)) + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *RecoverRequest but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *RecoverRequestbut is not nil && this == nil") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } - return n + return nil } +func (this *RecoverRequest) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } -func (m *PromiseRequest) Size() (n int) { - var l int - _ = l - if m.Proposal != nil { - n += 1 + sovLog(uint64(*m.Proposal)) + that1, ok := that.(*RecoverRequest) + if !ok { + return false } - if m.Position != nil { - n += 1 + sovLog(uint64(*m.Position)) + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false } - return n + return true } +func (this *RecoverResponse) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } -func (m *PromiseResponse) Size() (n int) { - var l int - _ = l - if m.Okay != nil { - n += 2 + that1, ok := that.(*RecoverResponse) + if !ok { + return fmt.Errorf("that is not of type *RecoverResponse") } - if m.Proposal != nil { - n += 1 + sovLog(uint64(*m.Proposal)) + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *RecoverResponse but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *RecoverResponsebut is not nil && this == nil") } - if m.Position != nil { - n += 1 + sovLog(uint64(*m.Position)) + if this.Status != nil && that1.Status != nil { + if *this.Status != *that1.Status { + return fmt.Errorf("Status this(%v) Not Equal that(%v)", *this.Status, *that1.Status) + } + } else if this.Status != nil { + return fmt.Errorf("this.Status == nil && that.Status != nil") + } else if that1.Status != nil { + return fmt.Errorf("Status this(%v) Not Equal that(%v)", this.Status, that1.Status) } - if m.Action != nil { - l = m.Action.Size() - n += 1 + l + sovLog(uint64(l)) + if this.Begin != nil && that1.Begin != nil { + if *this.Begin != *that1.Begin { + return fmt.Errorf("Begin this(%v) Not Equal that(%v)", *this.Begin, *that1.Begin) + } + } else if this.Begin != nil { + return fmt.Errorf("this.Begin == nil && that.Begin != nil") + } else if that1.Begin != nil { + return fmt.Errorf("Begin this(%v) Not Equal that(%v)", this.Begin, that1.Begin) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.End != nil && that1.End != nil { + if *this.End != *that1.End { + return fmt.Errorf("End this(%v) Not Equal that(%v)", *this.End, *that1.End) + } + } else if this.End != nil { + return fmt.Errorf("this.End == nil && that.End != nil") + } else if that1.End != nil { + return fmt.Errorf("End this(%v) Not Equal that(%v)", this.End, that1.End) } - return n -} - -func (m *WriteRequest) Size() (n int) { - var l int - _ = l - if m.Proposal != nil { - n += 1 + sovLog(uint64(*m.Proposal)) + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } - if m.Position != nil { - n += 1 + sovLog(uint64(*m.Position)) + return nil +} +func (this *RecoverResponse) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false } - if m.Learned != nil { - n += 2 + + that1, ok := that.(*RecoverResponse) + if !ok { + return false } - if m.Type != nil { - n += 1 + sovLog(uint64(*m.Type)) + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false } - if m.Nop != nil { - l = m.Nop.Size() - n += 1 + l + sovLog(uint64(l)) + if this.Status != nil && that1.Status != nil { + if *this.Status != *that1.Status { + return false + } + } else if this.Status != nil { + return false + } else if that1.Status != nil { + return false } - if m.Append != nil { - l = m.Append.Size() - n += 1 + l + sovLog(uint64(l)) + if this.Begin != nil && that1.Begin != nil { + if *this.Begin != *that1.Begin { + return false + } + } else if this.Begin != nil { + return false + } else if that1.Begin != nil { + return false } - if m.Truncate != nil { - l = m.Truncate.Size() - n += 1 + l + sovLog(uint64(l)) + if this.End != nil && that1.End != nil { + if *this.End != *that1.End { + return false + } + } else if this.End != nil { + return false + } else if that1.End != nil { + return false } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false } - return n + return true } - -func (m *WriteResponse) Size() (n int) { - var l int - _ = l - if m.Okay != nil { - n += 2 - } - if m.Proposal != nil { - n += 1 + sovLog(uint64(*m.Proposal)) +func (this *Promise) GoString() string { + if this == nil { + return "nil" } - if m.Position != nil { - n += 1 + sovLog(uint64(*m.Position)) + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Promise{") + if this.Proposal != nil { + s = append(s, "Proposal: "+valueToGoStringLog(this.Proposal, "uint64")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - return n + s = append(s, "}") + return strings.Join(s, "") } - -func (m *LearnedMessage) Size() (n int) { - var l int - _ = l - if m.Action != nil { - l = m.Action.Size() - n += 1 + l + sovLog(uint64(l)) +func (this *Action) GoString() string { + if this == nil { + return "nil" } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + s := make([]string, 0, 12) + s = append(s, "&mesosproto.Action{") + if this.Position != nil { + s = append(s, "Position: "+valueToGoStringLog(this.Position, "uint64")+",\n") } - return n -} - -func (m *RecoverRequest) Size() (n int) { - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.Promised != nil { + s = append(s, "Promised: "+valueToGoStringLog(this.Promised, "uint64")+",\n") } - return n -} - -func (m *RecoverResponse) Size() (n int) { - var l int - _ = l - if m.Status != nil { - n += 1 + sovLog(uint64(*m.Status)) + if this.Performed != nil { + s = append(s, "Performed: "+valueToGoStringLog(this.Performed, "uint64")+",\n") } - if m.Begin != nil { - n += 1 + sovLog(uint64(*m.Begin)) + if this.Learned != nil { + s = append(s, "Learned: "+valueToGoStringLog(this.Learned, "bool")+",\n") } - if m.End != nil { - n += 1 + sovLog(uint64(*m.End)) + if this.Type != nil { + s = append(s, "Type: "+valueToGoStringLog(this.Type, "mesosproto.Action_Type")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.Nop != nil { + s = append(s, "Nop: "+fmt.Sprintf("%#v", this.Nop)+",\n") } - return n -} - -func sovLog(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } + if this.Append != nil { + s = append(s, "Append: "+fmt.Sprintf("%#v", this.Append)+",\n") } - return n -} -func sozLog(x uint64) (n int) { - return sovLog(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + if this.Truncate != nil { + s = append(s, "Truncate: "+fmt.Sprintf("%#v", this.Truncate)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func NewPopulatedPromise(r randyLog, easy bool) *Promise { - this := &Promise{} - v1 := uint64(r.Uint32()) - this.Proposal = &v1 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 2) +func (this *Action_Nop) GoString() string { + if this == nil { + return "nil" } - return this + s := make([]string, 0, 4) + s = append(s, "&mesosproto.Action_Nop{") + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func NewPopulatedAction(r randyLog, easy bool) *Action { - this := &Action{} - v2 := uint64(r.Uint32()) - this.Position = &v2 - v3 := uint64(r.Uint32()) - this.Promised = &v3 - if r.Intn(10) != 0 { - v4 := uint64(r.Uint32()) - this.Performed = &v4 +func (this *Action_Append) GoString() string { + if this == nil { + return "nil" } - if r.Intn(10) != 0 { - v5 := bool(r.Intn(2) == 0) - this.Learned = &v5 + s := make([]string, 0, 6) + s = append(s, "&mesosproto.Action_Append{") + if this.Bytes != nil { + s = append(s, "Bytes: "+valueToGoStringLog(this.Bytes, "byte")+",\n") } - if r.Intn(10) != 0 { - v6 := Action_Type([]int32{1, 2, 3}[r.Intn(3)]) - this.Type = &v6 + if this.Cksum != nil { + s = append(s, "Cksum: "+valueToGoStringLog(this.Cksum, "byte")+",\n") } - if r.Intn(10) != 0 { - this.Nop = NewPopulatedAction_Nop(r, easy) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if r.Intn(10) != 0 { - this.Append = NewPopulatedAction_Append(r, easy) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Action_Truncate) GoString() string { + if this == nil { + return "nil" } - if r.Intn(10) != 0 { - this.Truncate = NewPopulatedAction_Truncate(r, easy) + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Action_Truncate{") + if this.To != nil { + s = append(s, "To: "+valueToGoStringLog(this.To, "uint64")+",\n") } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 9) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - return this + s = append(s, "}") + return strings.Join(s, "") } - -func NewPopulatedAction_Nop(r randyLog, easy bool) *Action_Nop { - this := &Action_Nop{} - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 1) +func (this *Metadata) GoString() string { + if this == nil { + return "nil" } - return this -} - -func NewPopulatedAction_Append(r randyLog, easy bool) *Action_Append { - this := &Action_Append{} - v7 := r.Intn(100) - this.Bytes = make([]byte, v7) - for i := 0; i < v7; i++ { - this.Bytes[i] = byte(r.Intn(256)) + s := make([]string, 0, 6) + s = append(s, "&mesosproto.Metadata{") + if this.Status != nil { + s = append(s, "Status: "+valueToGoStringLog(this.Status, "mesosproto.Metadata_Status")+",\n") } - if r.Intn(10) != 0 { - v8 := r.Intn(100) - this.Cksum = make([]byte, v8) - for i := 0; i < v8; i++ { - this.Cksum[i] = byte(r.Intn(256)) - } + if this.Promised != nil { + s = append(s, "Promised: "+valueToGoStringLog(this.Promised, "uint64")+",\n") } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 3) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - return this + s = append(s, "}") + return strings.Join(s, "") } - -func NewPopulatedAction_Truncate(r randyLog, easy bool) *Action_Truncate { - this := &Action_Truncate{} - v9 := uint64(r.Uint32()) - this.To = &v9 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 2) +func (this *Record) GoString() string { + if this == nil { + return "nil" } - return this -} - -func NewPopulatedMetadata(r randyLog, easy bool) *Metadata { - this := &Metadata{} - v10 := Metadata_Status([]int32{1, 2, 3, 4}[r.Intn(4)]) - this.Status = &v10 - v11 := uint64(r.Uint32()) - this.Promised = &v11 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 3) + s := make([]string, 0, 8) + s = append(s, "&mesosproto.Record{") + if this.Type != nil { + s = append(s, "Type: "+valueToGoStringLog(this.Type, "mesosproto.Record_Type")+",\n") } - return this -} - -func NewPopulatedRecord(r randyLog, easy bool) *Record { - this := &Record{} - v12 := Record_Type([]int32{1, 2, 3}[r.Intn(3)]) - this.Type = &v12 - if r.Intn(10) != 0 { - this.Promise = NewPopulatedPromise(r, easy) + if this.Promise != nil { + s = append(s, "Promise: "+fmt.Sprintf("%#v", this.Promise)+",\n") } - if r.Intn(10) != 0 { - this.Action = NewPopulatedAction(r, easy) + if this.Action != nil { + s = append(s, "Action: "+fmt.Sprintf("%#v", this.Action)+",\n") } - if r.Intn(10) != 0 { - this.Metadata = NewPopulatedMetadata(r, easy) + if this.Metadata != nil { + s = append(s, "Metadata: "+fmt.Sprintf("%#v", this.Metadata)+",\n") } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 5) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - return this + s = append(s, "}") + return strings.Join(s, "") } - -func NewPopulatedPromiseRequest(r randyLog, easy bool) *PromiseRequest { - this := &PromiseRequest{} - v13 := uint64(r.Uint32()) - this.Proposal = &v13 - if r.Intn(10) != 0 { - v14 := uint64(r.Uint32()) - this.Position = &v14 +func (this *PromiseRequest) GoString() string { + if this == nil { + return "nil" } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 3) + s := make([]string, 0, 6) + s = append(s, "&mesosproto.PromiseRequest{") + if this.Proposal != nil { + s = append(s, "Proposal: "+valueToGoStringLog(this.Proposal, "uint64")+",\n") } - return this + if this.Position != nil { + s = append(s, "Position: "+valueToGoStringLog(this.Position, "uint64")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func NewPopulatedPromiseResponse(r randyLog, easy bool) *PromiseResponse { - this := &PromiseResponse{} - v15 := bool(r.Intn(2) == 0) - this.Okay = &v15 - v16 := uint64(r.Uint32()) - this.Proposal = &v16 - if r.Intn(10) != 0 { - v17 := uint64(r.Uint32()) - this.Position = &v17 +func (this *PromiseResponse) GoString() string { + if this == nil { + return "nil" } - if r.Intn(10) != 0 { - this.Action = NewPopulatedAction(r, easy) + s := make([]string, 0, 8) + s = append(s, "&mesosproto.PromiseResponse{") + if this.Okay != nil { + s = append(s, "Okay: "+valueToGoStringLog(this.Okay, "bool")+",\n") } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 5) + if this.Proposal != nil { + s = append(s, "Proposal: "+valueToGoStringLog(this.Proposal, "uint64")+",\n") } - return this + if this.Position != nil { + s = append(s, "Position: "+valueToGoStringLog(this.Position, "uint64")+",\n") + } + if this.Action != nil { + s = append(s, "Action: "+fmt.Sprintf("%#v", this.Action)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func NewPopulatedWriteRequest(r randyLog, easy bool) *WriteRequest { - this := &WriteRequest{} - v18 := uint64(r.Uint32()) - this.Proposal = &v18 - v19 := uint64(r.Uint32()) - this.Position = &v19 - if r.Intn(10) != 0 { - v20 := bool(r.Intn(2) == 0) - this.Learned = &v20 +func (this *WriteRequest) GoString() string { + if this == nil { + return "nil" } - v21 := Action_Type([]int32{1, 2, 3}[r.Intn(3)]) - this.Type = &v21 - if r.Intn(10) != 0 { - this.Nop = NewPopulatedAction_Nop(r, easy) + s := make([]string, 0, 11) + s = append(s, "&mesosproto.WriteRequest{") + if this.Proposal != nil { + s = append(s, "Proposal: "+valueToGoStringLog(this.Proposal, "uint64")+",\n") } - if r.Intn(10) != 0 { - this.Append = NewPopulatedAction_Append(r, easy) + if this.Position != nil { + s = append(s, "Position: "+valueToGoStringLog(this.Position, "uint64")+",\n") } - if r.Intn(10) != 0 { - this.Truncate = NewPopulatedAction_Truncate(r, easy) + if this.Learned != nil { + s = append(s, "Learned: "+valueToGoStringLog(this.Learned, "bool")+",\n") } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 8) + if this.Type != nil { + s = append(s, "Type: "+valueToGoStringLog(this.Type, "mesosproto.Action_Type")+",\n") } - return this -} - -func NewPopulatedWriteResponse(r randyLog, easy bool) *WriteResponse { - this := &WriteResponse{} - v22 := bool(r.Intn(2) == 0) - this.Okay = &v22 - v23 := uint64(r.Uint32()) - this.Proposal = &v23 - v24 := uint64(r.Uint32()) - this.Position = &v24 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 4) + if this.Nop != nil { + s = append(s, "Nop: "+fmt.Sprintf("%#v", this.Nop)+",\n") } - return this -} - -func NewPopulatedLearnedMessage(r randyLog, easy bool) *LearnedMessage { - this := &LearnedMessage{} - this.Action = NewPopulatedAction(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 2) + if this.Append != nil { + s = append(s, "Append: "+fmt.Sprintf("%#v", this.Append)+",\n") } - return this -} - -func NewPopulatedRecoverRequest(r randyLog, easy bool) *RecoverRequest { - this := &RecoverRequest{} - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 1) + if this.Truncate != nil { + s = append(s, "Truncate: "+fmt.Sprintf("%#v", this.Truncate)+",\n") } - return this + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func NewPopulatedRecoverResponse(r randyLog, easy bool) *RecoverResponse { - this := &RecoverResponse{} - v25 := Metadata_Status([]int32{1, 2, 3, 4}[r.Intn(4)]) - this.Status = &v25 - if r.Intn(10) != 0 { - v26 := uint64(r.Uint32()) - this.Begin = &v26 +func (this *WriteResponse) GoString() string { + if this == nil { + return "nil" } - if r.Intn(10) != 0 { - v27 := uint64(r.Uint32()) - this.End = &v27 + s := make([]string, 0, 7) + s = append(s, "&mesosproto.WriteResponse{") + if this.Okay != nil { + s = append(s, "Okay: "+valueToGoStringLog(this.Okay, "bool")+",\n") } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 4) + if this.Proposal != nil { + s = append(s, "Proposal: "+valueToGoStringLog(this.Proposal, "uint64")+",\n") } - return this -} - -type randyLog interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int + if this.Position != nil { + s = append(s, "Position: "+valueToGoStringLog(this.Position, "uint64")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func randUTF8RuneLog(r randyLog) rune { - res := rune(r.Uint32() % 1112064) - if 55296 <= res { - res += 2047 +func (this *LearnedMessage) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&mesosproto.LearnedMessage{") + if this.Action != nil { + s = append(s, "Action: "+fmt.Sprintf("%#v", this.Action)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - return res + s = append(s, "}") + return strings.Join(s, "") } -func randStringLog(r randyLog) string { - v28 := r.Intn(100) - tmps := make([]rune, v28) - for i := 0; i < v28; i++ { - tmps[i] = randUTF8RuneLog(r) +func (this *RecoverRequest) GoString() string { + if this == nil { + return "nil" } - return string(tmps) + s := make([]string, 0, 4) + s = append(s, "&mesosproto.RecoverRequest{") + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func randUnrecognizedLog(r randyLog, maxFieldNumber int) (data []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - data = randFieldLog(data, r, fieldNumber, wire) +func (this *RecoverResponse) GoString() string { + if this == nil { + return "nil" } - return data + s := make([]string, 0, 7) + s = append(s, "&mesosproto.RecoverResponse{") + if this.Status != nil { + s = append(s, "Status: "+valueToGoStringLog(this.Status, "mesosproto.Metadata_Status")+",\n") + } + if this.Begin != nil { + s = append(s, "Begin: "+valueToGoStringLog(this.Begin, "uint64")+",\n") + } + if this.End != nil { + s = append(s, "End: "+valueToGoStringLog(this.End, "uint64")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func randFieldLog(data []byte, r randyLog, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - data = encodeVarintPopulateLog(data, uint64(key)) - v29 := r.Int63() - if r.Intn(2) == 0 { - v29 *= -1 - } - data = encodeVarintPopulateLog(data, uint64(v29)) - case 1: - data = encodeVarintPopulateLog(data, uint64(key)) - data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - data = encodeVarintPopulateLog(data, uint64(key)) - ll := r.Intn(100) - data = encodeVarintPopulateLog(data, uint64(ll)) - for j := 0; j < ll; j++ { - data = append(data, byte(r.Intn(256))) - } - default: - data = encodeVarintPopulateLog(data, uint64(key)) - data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) +func valueToGoStringLog(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" } - return data + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) } -func encodeVarintPopulateLog(data []byte, v uint64) []byte { - for v >= 1<<7 { - data = append(data, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 +func extensionToGoStringLog(e map[int32]github_com_gogo_protobuf_proto.Extension) string { + if e == nil { + return "nil" } - data = append(data, uint8(v)) - return data + s := "map[int32]proto.Extension{" + keys := make([]int, 0, len(e)) + for k := range e { + keys = append(keys, int(k)) + } + sort.Ints(keys) + ss := []string{} + for _, k := range keys { + ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString()) + } + s += strings.Join(ss, ",") + "}" + return s } func (m *Promise) Marshal() (data []byte, err error) { size := m.Size() @@ -2723,12 +2153,14 @@ func (m *Promise) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Promise) MarshalTo(data []byte) (n int, err error) { +func (m *Promise) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Proposal != nil { + if m.Proposal == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("proposal") + } else { data[i] = 0x8 i++ i = encodeVarintLog(data, i, uint64(*m.Proposal)) @@ -2749,17 +2181,21 @@ func (m *Action) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Action) MarshalTo(data []byte) (n int, err error) { +func (m *Action) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Position != nil { + if m.Position == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("position") + } else { data[i] = 0x8 i++ i = encodeVarintLog(data, i, uint64(*m.Position)) } - if m.Promised != nil { + if m.Promised == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("promised") + } else { data[i] = 0x10 i++ i = encodeVarintLog(data, i, uint64(*m.Promised)) @@ -2830,7 +2266,7 @@ func (m *Action_Nop) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Action_Nop) MarshalTo(data []byte) (n int, err error) { +func (m *Action_Nop) MarshalTo(data []byte) (int, error) { var i int _ = i var l int @@ -2851,12 +2287,14 @@ func (m *Action_Append) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Action_Append) MarshalTo(data []byte) (n int, err error) { +func (m *Action_Append) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Bytes != nil { + if m.Bytes == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("bytes") + } else { data[i] = 0xa i++ i = encodeVarintLog(data, i, uint64(len(m.Bytes))) @@ -2884,12 +2322,14 @@ func (m *Action_Truncate) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Action_Truncate) MarshalTo(data []byte) (n int, err error) { +func (m *Action_Truncate) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.To != nil { + if m.To == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("to") + } else { data[i] = 0x8 i++ i = encodeVarintLog(data, i, uint64(*m.To)) @@ -2910,17 +2350,21 @@ func (m *Metadata) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Metadata) MarshalTo(data []byte) (n int, err error) { +func (m *Metadata) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Status != nil { + if m.Status == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("status") + } else { data[i] = 0x8 i++ i = encodeVarintLog(data, i, uint64(*m.Status)) } - if m.Promised != nil { + if m.Promised == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("promised") + } else { data[i] = 0x10 i++ i = encodeVarintLog(data, i, uint64(*m.Promised)) @@ -2941,12 +2385,14 @@ func (m *Record) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Record) MarshalTo(data []byte) (n int, err error) { +func (m *Record) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Type != nil { + if m.Type == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") + } else { data[i] = 0x8 i++ i = encodeVarintLog(data, i, uint64(*m.Type)) @@ -2997,12 +2443,14 @@ func (m *PromiseRequest) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *PromiseRequest) MarshalTo(data []byte) (n int, err error) { +func (m *PromiseRequest) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Proposal != nil { + if m.Proposal == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("proposal") + } else { data[i] = 0x8 i++ i = encodeVarintLog(data, i, uint64(*m.Proposal)) @@ -3028,12 +2476,14 @@ func (m *PromiseResponse) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *PromiseResponse) MarshalTo(data []byte) (n int, err error) { +func (m *PromiseResponse) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Okay != nil { + if m.Okay == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("okay") + } else { data[i] = 0x8 i++ if *m.Okay { @@ -3043,16 +2493,13 @@ func (m *PromiseResponse) MarshalTo(data []byte) (n int, err error) { } i++ } - if m.Proposal != nil { + if m.Proposal == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("proposal") + } else { data[i] = 0x10 i++ i = encodeVarintLog(data, i, uint64(*m.Proposal)) } - if m.Position != nil { - data[i] = 0x20 - i++ - i = encodeVarintLog(data, i, uint64(*m.Position)) - } if m.Action != nil { data[i] = 0x1a i++ @@ -3063,6 +2510,11 @@ func (m *PromiseResponse) MarshalTo(data []byte) (n int, err error) { } i += n7 } + if m.Position != nil { + data[i] = 0x20 + i++ + i = encodeVarintLog(data, i, uint64(*m.Position)) + } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) } @@ -3079,17 +2531,21 @@ func (m *WriteRequest) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *WriteRequest) MarshalTo(data []byte) (n int, err error) { +func (m *WriteRequest) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Proposal != nil { + if m.Proposal == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("proposal") + } else { data[i] = 0x8 i++ i = encodeVarintLog(data, i, uint64(*m.Proposal)) } - if m.Position != nil { + if m.Position == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("position") + } else { data[i] = 0x10 i++ i = encodeVarintLog(data, i, uint64(*m.Position)) @@ -3104,7 +2560,9 @@ func (m *WriteRequest) MarshalTo(data []byte) (n int, err error) { } i++ } - if m.Type != nil { + if m.Type == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") + } else { data[i] = 0x20 i++ i = encodeVarintLog(data, i, uint64(*m.Type)) @@ -3155,12 +2613,14 @@ func (m *WriteResponse) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *WriteResponse) MarshalTo(data []byte) (n int, err error) { +func (m *WriteResponse) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Okay != nil { + if m.Okay == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("okay") + } else { data[i] = 0x8 i++ if *m.Okay { @@ -3170,12 +2630,16 @@ func (m *WriteResponse) MarshalTo(data []byte) (n int, err error) { } i++ } - if m.Proposal != nil { + if m.Proposal == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("proposal") + } else { data[i] = 0x10 i++ i = encodeVarintLog(data, i, uint64(*m.Proposal)) } - if m.Position != nil { + if m.Position == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("position") + } else { data[i] = 0x18 i++ i = encodeVarintLog(data, i, uint64(*m.Position)) @@ -3196,12 +2660,14 @@ func (m *LearnedMessage) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *LearnedMessage) MarshalTo(data []byte) (n int, err error) { +func (m *LearnedMessage) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Action != nil { + if m.Action == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("action") + } else { data[i] = 0xa i++ i = encodeVarintLog(data, i, uint64(m.Action.Size())) @@ -3227,7 +2693,7 @@ func (m *RecoverRequest) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *RecoverRequest) MarshalTo(data []byte) (n int, err error) { +func (m *RecoverRequest) MarshalTo(data []byte) (int, error) { var i int _ = i var l int @@ -3248,12 +2714,14 @@ func (m *RecoverResponse) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *RecoverResponse) MarshalTo(data []byte) (n int, err error) { +func (m *RecoverResponse) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Status != nil { + if m.Status == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("status") + } else { data[i] = 0x8 i++ i = encodeVarintLog(data, i, uint64(*m.Status)) @@ -3301,1406 +2769,2378 @@ func encodeVarintLog(data []byte, offset int, v uint64) int { data[offset] = uint8(v) return offset + 1 } -func (this *Promise) GoString() string { - if this == nil { - return "nil" +func NewPopulatedPromise(r randyLog, easy bool) *Promise { + this := &Promise{} + v1 := uint64(uint64(r.Uint32())) + this.Proposal = &v1 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedLog(r, 2) } - s := strings3.Join([]string{`&mesosproto.Promise{` + - `Proposal:` + valueToGoStringLog(this.Proposal, "uint64"), - `XXX_unrecognized:` + fmt6.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + return this } -func (this *Action) GoString() string { - if this == nil { - return "nil" + +func NewPopulatedAction(r randyLog, easy bool) *Action { + this := &Action{} + v2 := uint64(uint64(r.Uint32())) + this.Position = &v2 + v3 := uint64(uint64(r.Uint32())) + this.Promised = &v3 + if r.Intn(10) != 0 { + v4 := uint64(uint64(r.Uint32())) + this.Performed = &v4 } - s := strings3.Join([]string{`&mesosproto.Action{` + - `Position:` + valueToGoStringLog(this.Position, "uint64"), - `Promised:` + valueToGoStringLog(this.Promised, "uint64"), - `Performed:` + valueToGoStringLog(this.Performed, "uint64"), - `Learned:` + valueToGoStringLog(this.Learned, "bool"), - `Type:` + valueToGoStringLog(this.Type, "mesosproto.Action_Type"), - `Nop:` + fmt6.Sprintf("%#v", this.Nop), - `Append:` + fmt6.Sprintf("%#v", this.Append), - `Truncate:` + fmt6.Sprintf("%#v", this.Truncate), - `XXX_unrecognized:` + fmt6.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + if r.Intn(10) != 0 { + v5 := bool(bool(r.Intn(2) == 0)) + this.Learned = &v5 + } + if r.Intn(10) != 0 { + v6 := Action_Type([]int32{1, 2, 3}[r.Intn(3)]) + this.Type = &v6 + } + if r.Intn(10) != 0 { + this.Nop = NewPopulatedAction_Nop(r, easy) + } + if r.Intn(10) != 0 { + this.Append = NewPopulatedAction_Append(r, easy) + } + if r.Intn(10) != 0 { + this.Truncate = NewPopulatedAction_Truncate(r, easy) + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedLog(r, 9) + } + return this } -func (this *Action_Nop) GoString() string { - if this == nil { - return "nil" + +func NewPopulatedAction_Nop(r randyLog, easy bool) *Action_Nop { + this := &Action_Nop{} + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedLog(r, 1) } - s := strings3.Join([]string{`&mesosproto.Action_Nop{` + - `XXX_unrecognized:` + fmt6.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + return this } -func (this *Action_Append) GoString() string { - if this == nil { - return "nil" + +func NewPopulatedAction_Append(r randyLog, easy bool) *Action_Append { + this := &Action_Append{} + v7 := r.Intn(100) + this.Bytes = make([]byte, v7) + for i := 0; i < v7; i++ { + this.Bytes[i] = byte(r.Intn(256)) } - s := strings3.Join([]string{`&mesosproto.Action_Append{` + - `Bytes:` + valueToGoStringLog(this.Bytes, "byte"), - `Cksum:` + valueToGoStringLog(this.Cksum, "byte"), - `XXX_unrecognized:` + fmt6.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + if r.Intn(10) != 0 { + v8 := r.Intn(100) + this.Cksum = make([]byte, v8) + for i := 0; i < v8; i++ { + this.Cksum[i] = byte(r.Intn(256)) + } + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedLog(r, 3) + } + return this } -func (this *Action_Truncate) GoString() string { - if this == nil { - return "nil" + +func NewPopulatedAction_Truncate(r randyLog, easy bool) *Action_Truncate { + this := &Action_Truncate{} + v9 := uint64(uint64(r.Uint32())) + this.To = &v9 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedLog(r, 2) } - s := strings3.Join([]string{`&mesosproto.Action_Truncate{` + - `To:` + valueToGoStringLog(this.To, "uint64"), - `XXX_unrecognized:` + fmt6.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + return this } -func (this *Metadata) GoString() string { - if this == nil { - return "nil" + +func NewPopulatedMetadata(r randyLog, easy bool) *Metadata { + this := &Metadata{} + v10 := Metadata_Status([]int32{1, 2, 3, 4}[r.Intn(4)]) + this.Status = &v10 + v11 := uint64(uint64(r.Uint32())) + this.Promised = &v11 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedLog(r, 3) } - s := strings3.Join([]string{`&mesosproto.Metadata{` + - `Status:` + valueToGoStringLog(this.Status, "mesosproto.Metadata_Status"), - `Promised:` + valueToGoStringLog(this.Promised, "uint64"), - `XXX_unrecognized:` + fmt6.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + return this } -func (this *Record) GoString() string { - if this == nil { - return "nil" + +func NewPopulatedRecord(r randyLog, easy bool) *Record { + this := &Record{} + v12 := Record_Type([]int32{1, 2, 3}[r.Intn(3)]) + this.Type = &v12 + if r.Intn(10) != 0 { + this.Promise = NewPopulatedPromise(r, easy) } - s := strings3.Join([]string{`&mesosproto.Record{` + - `Type:` + valueToGoStringLog(this.Type, "mesosproto.Record_Type"), - `Promise:` + fmt6.Sprintf("%#v", this.Promise), - `Action:` + fmt6.Sprintf("%#v", this.Action), - `Metadata:` + fmt6.Sprintf("%#v", this.Metadata), - `XXX_unrecognized:` + fmt6.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + if r.Intn(10) != 0 { + this.Action = NewPopulatedAction(r, easy) + } + if r.Intn(10) != 0 { + this.Metadata = NewPopulatedMetadata(r, easy) + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedLog(r, 5) + } + return this } -func (this *PromiseRequest) GoString() string { - if this == nil { - return "nil" + +func NewPopulatedPromiseRequest(r randyLog, easy bool) *PromiseRequest { + this := &PromiseRequest{} + v13 := uint64(uint64(r.Uint32())) + this.Proposal = &v13 + if r.Intn(10) != 0 { + v14 := uint64(uint64(r.Uint32())) + this.Position = &v14 } - s := strings3.Join([]string{`&mesosproto.PromiseRequest{` + - `Proposal:` + valueToGoStringLog(this.Proposal, "uint64"), - `Position:` + valueToGoStringLog(this.Position, "uint64"), - `XXX_unrecognized:` + fmt6.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedLog(r, 3) + } + return this } -func (this *PromiseResponse) GoString() string { - if this == nil { - return "nil" + +func NewPopulatedPromiseResponse(r randyLog, easy bool) *PromiseResponse { + this := &PromiseResponse{} + v15 := bool(bool(r.Intn(2) == 0)) + this.Okay = &v15 + v16 := uint64(uint64(r.Uint32())) + this.Proposal = &v16 + if r.Intn(10) != 0 { + this.Action = NewPopulatedAction(r, easy) + } + if r.Intn(10) != 0 { + v17 := uint64(uint64(r.Uint32())) + this.Position = &v17 + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedLog(r, 5) } - s := strings3.Join([]string{`&mesosproto.PromiseResponse{` + - `Okay:` + valueToGoStringLog(this.Okay, "bool"), - `Proposal:` + valueToGoStringLog(this.Proposal, "uint64"), - `Position:` + valueToGoStringLog(this.Position, "uint64"), - `Action:` + fmt6.Sprintf("%#v", this.Action), - `XXX_unrecognized:` + fmt6.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + return this } -func (this *WriteRequest) GoString() string { - if this == nil { - return "nil" + +func NewPopulatedWriteRequest(r randyLog, easy bool) *WriteRequest { + this := &WriteRequest{} + v18 := uint64(uint64(r.Uint32())) + this.Proposal = &v18 + v19 := uint64(uint64(r.Uint32())) + this.Position = &v19 + if r.Intn(10) != 0 { + v20 := bool(bool(r.Intn(2) == 0)) + this.Learned = &v20 } - s := strings3.Join([]string{`&mesosproto.WriteRequest{` + - `Proposal:` + valueToGoStringLog(this.Proposal, "uint64"), - `Position:` + valueToGoStringLog(this.Position, "uint64"), - `Learned:` + valueToGoStringLog(this.Learned, "bool"), - `Type:` + valueToGoStringLog(this.Type, "mesosproto.Action_Type"), - `Nop:` + fmt6.Sprintf("%#v", this.Nop), - `Append:` + fmt6.Sprintf("%#v", this.Append), - `Truncate:` + fmt6.Sprintf("%#v", this.Truncate), - `XXX_unrecognized:` + fmt6.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *WriteResponse) GoString() string { - if this == nil { - return "nil" + v21 := Action_Type([]int32{1, 2, 3}[r.Intn(3)]) + this.Type = &v21 + if r.Intn(10) != 0 { + this.Nop = NewPopulatedAction_Nop(r, easy) } - s := strings3.Join([]string{`&mesosproto.WriteResponse{` + - `Okay:` + valueToGoStringLog(this.Okay, "bool"), - `Proposal:` + valueToGoStringLog(this.Proposal, "uint64"), - `Position:` + valueToGoStringLog(this.Position, "uint64"), - `XXX_unrecognized:` + fmt6.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *LearnedMessage) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + this.Append = NewPopulatedAction_Append(r, easy) } - s := strings3.Join([]string{`&mesosproto.LearnedMessage{` + - `Action:` + fmt6.Sprintf("%#v", this.Action), - `XXX_unrecognized:` + fmt6.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + if r.Intn(10) != 0 { + this.Truncate = NewPopulatedAction_Truncate(r, easy) + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedLog(r, 8) + } + return this } -func (this *RecoverRequest) GoString() string { - if this == nil { - return "nil" + +func NewPopulatedWriteResponse(r randyLog, easy bool) *WriteResponse { + this := &WriteResponse{} + v22 := bool(bool(r.Intn(2) == 0)) + this.Okay = &v22 + v23 := uint64(uint64(r.Uint32())) + this.Proposal = &v23 + v24 := uint64(uint64(r.Uint32())) + this.Position = &v24 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedLog(r, 4) } - s := strings3.Join([]string{`&mesosproto.RecoverRequest{` + - `XXX_unrecognized:` + fmt6.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + return this } -func (this *RecoverResponse) GoString() string { - if this == nil { - return "nil" + +func NewPopulatedLearnedMessage(r randyLog, easy bool) *LearnedMessage { + this := &LearnedMessage{} + this.Action = NewPopulatedAction(r, easy) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedLog(r, 2) } - s := strings3.Join([]string{`&mesosproto.RecoverResponse{` + - `Status:` + valueToGoStringLog(this.Status, "mesosproto.Metadata_Status"), - `Begin:` + valueToGoStringLog(this.Begin, "uint64"), - `End:` + valueToGoStringLog(this.End, "uint64"), - `XXX_unrecognized:` + fmt6.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + return this } -func valueToGoStringLog(v interface{}, typ string) string { - rv := reflect3.ValueOf(v) - if rv.IsNil() { - return "nil" + +func NewPopulatedRecoverRequest(r randyLog, easy bool) *RecoverRequest { + this := &RecoverRequest{} + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedLog(r, 1) } - pv := reflect3.Indirect(rv).Interface() - return fmt6.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) + return this } -func extensionToGoStringLog(e map[int32]github_com_gogo_protobuf_proto3.Extension) string { - if e == nil { - return "nil" + +func NewPopulatedRecoverResponse(r randyLog, easy bool) *RecoverResponse { + this := &RecoverResponse{} + v25 := Metadata_Status([]int32{1, 2, 3, 4}[r.Intn(4)]) + this.Status = &v25 + if r.Intn(10) != 0 { + v26 := uint64(uint64(r.Uint32())) + this.Begin = &v26 } - s := "map[int32]proto.Extension{" - keys := make([]int, 0, len(e)) - for k := range e { - keys = append(keys, int(k)) + if r.Intn(10) != 0 { + v27 := uint64(uint64(r.Uint32())) + this.End = &v27 } - sort1.Ints(keys) - ss := []string{} - for _, k := range keys { - ss = append(ss, strconv1.Itoa(k)+": "+e[int32(k)].GoString()) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedLog(r, 4) } - s += strings3.Join(ss, ",") + "}" - return s + return this } -func (this *Promise) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that == nil && this != nil") - } - that1, ok := that.(*Promise) - if !ok { - return fmt7.Errorf("that is not of type *Promise") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that is type *Promise but is nil && this != nil") - } else if this == nil { - return fmt7.Errorf("that is type *Promisebut is not nil && this == nil") - } - if this.Proposal != nil && that1.Proposal != nil { - if *this.Proposal != *that1.Proposal { - return fmt7.Errorf("Proposal this(%v) Not Equal that(%v)", *this.Proposal, *that1.Proposal) - } - } else if this.Proposal != nil { - return fmt7.Errorf("this.Proposal == nil && that.Proposal != nil") - } else if that1.Proposal != nil { - return fmt7.Errorf("Proposal this(%v) Not Equal that(%v)", this.Proposal, that1.Proposal) +type randyLog interface { + Float32() float32 + Float64() float64 + Int63() int64 + Int31() int32 + Uint32() uint32 + Intn(n int) int +} + +func randUTF8RuneLog(r randyLog) rune { + ru := r.Intn(62) + if ru < 10 { + return rune(ru + 48) + } else if ru < 36 { + return rune(ru + 55) } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt7.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + return rune(ru + 61) +} +func randStringLog(r randyLog) string { + v28 := r.Intn(100) + tmps := make([]rune, v28) + for i := 0; i < v28; i++ { + tmps[i] = randUTF8RuneLog(r) } - return nil + return string(tmps) } -func (this *Promise) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true +func randUnrecognizedLog(r randyLog, maxFieldNumber int) (data []byte) { + l := r.Intn(5) + for i := 0; i < l; i++ { + wire := r.Intn(4) + if wire == 3 { + wire = 5 } - return false - } - - that1, ok := that.(*Promise) - if !ok { - return false + fieldNumber := maxFieldNumber + r.Intn(100) + data = randFieldLog(data, r, fieldNumber, wire) } - if that1 == nil { - if this == nil { - return true + return data +} +func randFieldLog(data []byte, r randyLog, fieldNumber int, wire int) []byte { + key := uint32(fieldNumber)<<3 | uint32(wire) + switch wire { + case 0: + data = encodeVarintPopulateLog(data, uint64(key)) + v29 := r.Int63() + if r.Intn(2) == 0 { + v29 *= -1 } - return false - } else if this == nil { - return false - } - if this.Proposal != nil && that1.Proposal != nil { - if *this.Proposal != *that1.Proposal { - return false + data = encodeVarintPopulateLog(data, uint64(v29)) + case 1: + data = encodeVarintPopulateLog(data, uint64(key)) + data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) + case 2: + data = encodeVarintPopulateLog(data, uint64(key)) + ll := r.Intn(100) + data = encodeVarintPopulateLog(data, uint64(ll)) + for j := 0; j < ll; j++ { + data = append(data, byte(r.Intn(256))) } - } else if this.Proposal != nil { - return false - } else if that1.Proposal != nil { - return false - } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + default: + data = encodeVarintPopulateLog(data, uint64(key)) + data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) } - return true + return data } -func (this *Action) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that == nil && this != nil") +func encodeVarintPopulateLog(data []byte, v uint64) []byte { + for v >= 1<<7 { + data = append(data, uint8(uint64(v)&0x7f|0x80)) + v >>= 7 } - - that1, ok := that.(*Action) - if !ok { - return fmt7.Errorf("that is not of type *Action") + data = append(data, uint8(v)) + return data +} +func (m *Promise) Size() (n int) { + var l int + _ = l + if m.Proposal != nil { + n += 1 + sovLog(uint64(*m.Proposal)) } - if that1 == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that is type *Action but is nil && this != nil") - } else if this == nil { - return fmt7.Errorf("that is type *Actionbut is not nil && this == nil") + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.Position != nil && that1.Position != nil { - if *this.Position != *that1.Position { - return fmt7.Errorf("Position this(%v) Not Equal that(%v)", *this.Position, *that1.Position) - } - } else if this.Position != nil { - return fmt7.Errorf("this.Position == nil && that.Position != nil") - } else if that1.Position != nil { - return fmt7.Errorf("Position this(%v) Not Equal that(%v)", this.Position, that1.Position) + return n +} + +func (m *Action) Size() (n int) { + var l int + _ = l + if m.Position != nil { + n += 1 + sovLog(uint64(*m.Position)) } - if this.Promised != nil && that1.Promised != nil { - if *this.Promised != *that1.Promised { - return fmt7.Errorf("Promised this(%v) Not Equal that(%v)", *this.Promised, *that1.Promised) - } - } else if this.Promised != nil { - return fmt7.Errorf("this.Promised == nil && that.Promised != nil") - } else if that1.Promised != nil { - return fmt7.Errorf("Promised this(%v) Not Equal that(%v)", this.Promised, that1.Promised) + if m.Promised != nil { + n += 1 + sovLog(uint64(*m.Promised)) } - if this.Performed != nil && that1.Performed != nil { - if *this.Performed != *that1.Performed { - return fmt7.Errorf("Performed this(%v) Not Equal that(%v)", *this.Performed, *that1.Performed) - } - } else if this.Performed != nil { - return fmt7.Errorf("this.Performed == nil && that.Performed != nil") - } else if that1.Performed != nil { - return fmt7.Errorf("Performed this(%v) Not Equal that(%v)", this.Performed, that1.Performed) + if m.Performed != nil { + n += 1 + sovLog(uint64(*m.Performed)) } - if this.Learned != nil && that1.Learned != nil { - if *this.Learned != *that1.Learned { - return fmt7.Errorf("Learned this(%v) Not Equal that(%v)", *this.Learned, *that1.Learned) - } - } else if this.Learned != nil { - return fmt7.Errorf("this.Learned == nil && that.Learned != nil") - } else if that1.Learned != nil { - return fmt7.Errorf("Learned this(%v) Not Equal that(%v)", this.Learned, that1.Learned) + if m.Learned != nil { + n += 2 } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt7.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) - } - } else if this.Type != nil { - return fmt7.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt7.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) + if m.Type != nil { + n += 1 + sovLog(uint64(*m.Type)) } - if !this.Nop.Equal(that1.Nop) { - return fmt7.Errorf("Nop this(%v) Not Equal that(%v)", this.Nop, that1.Nop) + if m.Nop != nil { + l = m.Nop.Size() + n += 1 + l + sovLog(uint64(l)) } - if !this.Append.Equal(that1.Append) { - return fmt7.Errorf("Append this(%v) Not Equal that(%v)", this.Append, that1.Append) + if m.Append != nil { + l = m.Append.Size() + n += 1 + l + sovLog(uint64(l)) } - if !this.Truncate.Equal(that1.Truncate) { - return fmt7.Errorf("Truncate this(%v) Not Equal that(%v)", this.Truncate, that1.Truncate) + if m.Truncate != nil { + l = m.Truncate.Size() + n += 1 + l + sovLog(uint64(l)) } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt7.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return nil + return n } -func (this *Action) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - that1, ok := that.(*Action) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Position != nil && that1.Position != nil { - if *this.Position != *that1.Position { - return false - } - } else if this.Position != nil { - return false - } else if that1.Position != nil { - return false +func (m *Action_Nop) Size() (n int) { + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.Promised != nil && that1.Promised != nil { - if *this.Promised != *that1.Promised { - return false - } - } else if this.Promised != nil { - return false - } else if that1.Promised != nil { - return false + return n +} + +func (m *Action_Append) Size() (n int) { + var l int + _ = l + if m.Bytes != nil { + l = len(m.Bytes) + n += 1 + l + sovLog(uint64(l)) } - if this.Performed != nil && that1.Performed != nil { - if *this.Performed != *that1.Performed { - return false - } - } else if this.Performed != nil { - return false - } else if that1.Performed != nil { - return false + if m.Cksum != nil { + l = len(m.Cksum) + n += 1 + l + sovLog(uint64(l)) } - if this.Learned != nil && that1.Learned != nil { - if *this.Learned != *that1.Learned { - return false - } - } else if this.Learned != nil { - return false - } else if that1.Learned != nil { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false - } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false + return n +} + +func (m *Action_Truncate) Size() (n int) { + var l int + _ = l + if m.To != nil { + n += 1 + sovLog(uint64(*m.To)) } - if !this.Nop.Equal(that1.Nop) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if !this.Append.Equal(that1.Append) { - return false + return n +} + +func (m *Metadata) Size() (n int) { + var l int + _ = l + if m.Status != nil { + n += 1 + sovLog(uint64(*m.Status)) } - if !this.Truncate.Equal(that1.Truncate) { - return false + if m.Promised != nil { + n += 1 + sovLog(uint64(*m.Promised)) } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return true + return n } -func (this *Action_Nop) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that == nil && this != nil") - } - that1, ok := that.(*Action_Nop) - if !ok { - return fmt7.Errorf("that is not of type *Action_Nop") +func (m *Record) Size() (n int) { + var l int + _ = l + if m.Type != nil { + n += 1 + sovLog(uint64(*m.Type)) } - if that1 == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that is type *Action_Nop but is nil && this != nil") - } else if this == nil { - return fmt7.Errorf("that is type *Action_Nopbut is not nil && this == nil") + if m.Promise != nil { + l = m.Promise.Size() + n += 1 + l + sovLog(uint64(l)) } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt7.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if m.Action != nil { + l = m.Action.Size() + n += 1 + l + sovLog(uint64(l)) } - return nil -} -func (this *Action_Nop) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovLog(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } + return n +} - that1, ok := that.(*Action_Nop) - if !ok { - return false +func (m *PromiseRequest) Size() (n int) { + var l int + _ = l + if m.Proposal != nil { + n += 1 + sovLog(uint64(*m.Proposal)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.Position != nil { + n += 1 + sovLog(uint64(*m.Position)) } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return true + return n } -func (this *Action_Append) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that == nil && this != nil") - } - that1, ok := that.(*Action_Append) - if !ok { - return fmt7.Errorf("that is not of type *Action_Append") +func (m *PromiseResponse) Size() (n int) { + var l int + _ = l + if m.Okay != nil { + n += 2 } - if that1 == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that is type *Action_Append but is nil && this != nil") - } else if this == nil { - return fmt7.Errorf("that is type *Action_Appendbut is not nil && this == nil") + if m.Proposal != nil { + n += 1 + sovLog(uint64(*m.Proposal)) } - if !bytes1.Equal(this.Bytes, that1.Bytes) { - return fmt7.Errorf("Bytes this(%v) Not Equal that(%v)", this.Bytes, that1.Bytes) + if m.Action != nil { + l = m.Action.Size() + n += 1 + l + sovLog(uint64(l)) } - if !bytes1.Equal(this.Cksum, that1.Cksum) { - return fmt7.Errorf("Cksum this(%v) Not Equal that(%v)", this.Cksum, that1.Cksum) + if m.Position != nil { + n += 1 + sovLog(uint64(*m.Position)) } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt7.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return nil + return n } -func (this *Action_Append) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - that1, ok := that.(*Action_Append) - if !ok { - return false +func (m *WriteRequest) Size() (n int) { + var l int + _ = l + if m.Proposal != nil { + n += 1 + sovLog(uint64(*m.Proposal)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.Position != nil { + n += 1 + sovLog(uint64(*m.Position)) } - if !bytes1.Equal(this.Bytes, that1.Bytes) { - return false + if m.Learned != nil { + n += 2 } - if !bytes1.Equal(this.Cksum, that1.Cksum) { - return false + if m.Type != nil { + n += 1 + sovLog(uint64(*m.Type)) + } + if m.Nop != nil { + l = m.Nop.Size() + n += 1 + l + sovLog(uint64(l)) + } + if m.Append != nil { + l = m.Append.Size() + n += 1 + l + sovLog(uint64(l)) + } + if m.Truncate != nil { + l = m.Truncate.Size() + n += 1 + l + sovLog(uint64(l)) } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return true + return n } -func (this *Action_Truncate) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that == nil && this != nil") - } - that1, ok := that.(*Action_Truncate) - if !ok { - return fmt7.Errorf("that is not of type *Action_Truncate") +func (m *WriteResponse) Size() (n int) { + var l int + _ = l + if m.Okay != nil { + n += 2 } - if that1 == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that is type *Action_Truncate but is nil && this != nil") - } else if this == nil { - return fmt7.Errorf("that is type *Action_Truncatebut is not nil && this == nil") + if m.Proposal != nil { + n += 1 + sovLog(uint64(*m.Proposal)) } - if this.To != nil && that1.To != nil { - if *this.To != *that1.To { - return fmt7.Errorf("To this(%v) Not Equal that(%v)", *this.To, *that1.To) - } - } else if this.To != nil { - return fmt7.Errorf("this.To == nil && that.To != nil") - } else if that1.To != nil { - return fmt7.Errorf("To this(%v) Not Equal that(%v)", this.To, that1.To) + if m.Position != nil { + n += 1 + sovLog(uint64(*m.Position)) } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt7.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return nil + return n } -func (this *Action_Truncate) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false + +func (m *LearnedMessage) Size() (n int) { + var l int + _ = l + if m.Action != nil { + l = m.Action.Size() + n += 1 + l + sovLog(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } + return n +} - that1, ok := that.(*Action_Truncate) - if !ok { - return false +func (m *RecoverRequest) Size() (n int) { + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + return n +} + +func (m *RecoverResponse) Size() (n int) { + var l int + _ = l + if m.Status != nil { + n += 1 + sovLog(uint64(*m.Status)) } - if this.To != nil && that1.To != nil { - if *this.To != *that1.To { - return false - } - } else if this.To != nil { - return false - } else if that1.To != nil { - return false + if m.Begin != nil { + n += 1 + sovLog(uint64(*m.Begin)) } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.End != nil { + n += 1 + sovLog(uint64(*m.End)) } - return true + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n } -func (this *Metadata) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil + +func sovLog(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break } - return fmt7.Errorf("that == nil && this != nil") } - - that1, ok := that.(*Metadata) - if !ok { - return fmt7.Errorf("that is not of type *Metadata") + return n +} +func sozLog(x uint64) (n int) { + return sovLog(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *Promise) String() string { + if this == nil { + return "nil" } - if that1 == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that is type *Metadata but is nil && this != nil") - } else if this == nil { - return fmt7.Errorf("that is type *Metadatabut is not nil && this == nil") + s := strings.Join([]string{`&Promise{`, + `Proposal:` + valueToStringLog(this.Proposal) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Action) String() string { + if this == nil { + return "nil" } - if this.Status != nil && that1.Status != nil { - if *this.Status != *that1.Status { - return fmt7.Errorf("Status this(%v) Not Equal that(%v)", *this.Status, *that1.Status) - } - } else if this.Status != nil { - return fmt7.Errorf("this.Status == nil && that.Status != nil") - } else if that1.Status != nil { - return fmt7.Errorf("Status this(%v) Not Equal that(%v)", this.Status, that1.Status) + s := strings.Join([]string{`&Action{`, + `Position:` + valueToStringLog(this.Position) + `,`, + `Promised:` + valueToStringLog(this.Promised) + `,`, + `Performed:` + valueToStringLog(this.Performed) + `,`, + `Learned:` + valueToStringLog(this.Learned) + `,`, + `Type:` + valueToStringLog(this.Type) + `,`, + `Nop:` + strings.Replace(fmt.Sprintf("%v", this.Nop), "Action_Nop", "Action_Nop", 1) + `,`, + `Append:` + strings.Replace(fmt.Sprintf("%v", this.Append), "Action_Append", "Action_Append", 1) + `,`, + `Truncate:` + strings.Replace(fmt.Sprintf("%v", this.Truncate), "Action_Truncate", "Action_Truncate", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Action_Nop) String() string { + if this == nil { + return "nil" } - if this.Promised != nil && that1.Promised != nil { - if *this.Promised != *that1.Promised { - return fmt7.Errorf("Promised this(%v) Not Equal that(%v)", *this.Promised, *that1.Promised) - } - } else if this.Promised != nil { - return fmt7.Errorf("this.Promised == nil && that.Promised != nil") - } else if that1.Promised != nil { - return fmt7.Errorf("Promised this(%v) Not Equal that(%v)", this.Promised, that1.Promised) + s := strings.Join([]string{`&Action_Nop{`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Action_Append) String() string { + if this == nil { + return "nil" } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt7.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + s := strings.Join([]string{`&Action_Append{`, + `Bytes:` + valueToStringLog(this.Bytes) + `,`, + `Cksum:` + valueToStringLog(this.Cksum) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Action_Truncate) String() string { + if this == nil { + return "nil" } - return nil + s := strings.Join([]string{`&Action_Truncate{`, + `To:` + valueToStringLog(this.To) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s } -func (this *Metadata) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false +func (this *Metadata) String() string { + if this == nil { + return "nil" } - - that1, ok := that.(*Metadata) - if !ok { - return false + s := strings.Join([]string{`&Metadata{`, + `Status:` + valueToStringLog(this.Status) + `,`, + `Promised:` + valueToStringLog(this.Promised) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Record) String() string { + if this == nil { + return "nil" } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + s := strings.Join([]string{`&Record{`, + `Type:` + valueToStringLog(this.Type) + `,`, + `Promise:` + strings.Replace(fmt.Sprintf("%v", this.Promise), "Promise", "Promise", 1) + `,`, + `Action:` + strings.Replace(fmt.Sprintf("%v", this.Action), "Action", "Action", 1) + `,`, + `Metadata:` + strings.Replace(fmt.Sprintf("%v", this.Metadata), "Metadata", "Metadata", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *PromiseRequest) String() string { + if this == nil { + return "nil" } - if this.Status != nil && that1.Status != nil { - if *this.Status != *that1.Status { - return false - } - } else if this.Status != nil { - return false - } else if that1.Status != nil { - return false + s := strings.Join([]string{`&PromiseRequest{`, + `Proposal:` + valueToStringLog(this.Proposal) + `,`, + `Position:` + valueToStringLog(this.Position) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *PromiseResponse) String() string { + if this == nil { + return "nil" } - if this.Promised != nil && that1.Promised != nil { - if *this.Promised != *that1.Promised { - return false - } - } else if this.Promised != nil { - return false - } else if that1.Promised != nil { - return false + s := strings.Join([]string{`&PromiseResponse{`, + `Okay:` + valueToStringLog(this.Okay) + `,`, + `Proposal:` + valueToStringLog(this.Proposal) + `,`, + `Action:` + strings.Replace(fmt.Sprintf("%v", this.Action), "Action", "Action", 1) + `,`, + `Position:` + valueToStringLog(this.Position) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *WriteRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&WriteRequest{`, + `Proposal:` + valueToStringLog(this.Proposal) + `,`, + `Position:` + valueToStringLog(this.Position) + `,`, + `Learned:` + valueToStringLog(this.Learned) + `,`, + `Type:` + valueToStringLog(this.Type) + `,`, + `Nop:` + strings.Replace(fmt.Sprintf("%v", this.Nop), "Action_Nop", "Action_Nop", 1) + `,`, + `Append:` + strings.Replace(fmt.Sprintf("%v", this.Append), "Action_Append", "Action_Append", 1) + `,`, + `Truncate:` + strings.Replace(fmt.Sprintf("%v", this.Truncate), "Action_Truncate", "Action_Truncate", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *WriteResponse) String() string { + if this == nil { + return "nil" } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + s := strings.Join([]string{`&WriteResponse{`, + `Okay:` + valueToStringLog(this.Okay) + `,`, + `Proposal:` + valueToStringLog(this.Proposal) + `,`, + `Position:` + valueToStringLog(this.Position) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *LearnedMessage) String() string { + if this == nil { + return "nil" } - return true + s := strings.Join([]string{`&LearnedMessage{`, + `Action:` + strings.Replace(fmt.Sprintf("%v", this.Action), "Action", "Action", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s } -func (this *Record) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that == nil && this != nil") +func (this *RecoverRequest) String() string { + if this == nil { + return "nil" } - - that1, ok := that.(*Record) - if !ok { - return fmt7.Errorf("that is not of type *Record") + s := strings.Join([]string{`&RecoverRequest{`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *RecoverResponse) String() string { + if this == nil { + return "nil" } - if that1 == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that is type *Record but is nil && this != nil") - } else if this == nil { - return fmt7.Errorf("that is type *Recordbut is not nil && this == nil") + s := strings.Join([]string{`&RecoverResponse{`, + `Status:` + valueToStringLog(this.Status) + `,`, + `Begin:` + valueToStringLog(this.Begin) + `,`, + `End:` + valueToStringLog(this.End) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func valueToStringLog(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt7.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *Promise) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Proposal = &v + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipLog(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLog + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Type != nil { - return fmt7.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt7.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) - } - if !this.Promise.Equal(that1.Promise) { - return fmt7.Errorf("Promise this(%v) Not Equal that(%v)", this.Promise, that1.Promise) - } - if !this.Action.Equal(that1.Action) { - return fmt7.Errorf("Action this(%v) Not Equal that(%v)", this.Action, that1.Action) - } - if !this.Metadata.Equal(that1.Metadata) { - return fmt7.Errorf("Metadata this(%v) Not Equal that(%v)", this.Metadata, that1.Metadata) } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt7.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("proposal") } + return nil } -func (this *Record) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Record) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true +func (m *Action) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - return false - } else if this == nil { - return false - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Position", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Position = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Promised", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Promised = &v + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Performed", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Performed = &v + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Learned", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Learned = &b + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var v Action_Type + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (Action_Type(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Type = &v + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nop", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Nop == nil { + m.Nop = &Action_Nop{} + } + if err := m.Nop.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Append", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Append == nil { + m.Append = &Action_Append{} + } + if err := m.Append.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Truncate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Truncate == nil { + m.Truncate = &Action_Truncate{} + } + if err := m.Truncate.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipLog(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLog + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false - } - if !this.Promise.Equal(that1.Promise) { - return false - } - if !this.Action.Equal(that1.Action) { - return false - } - if !this.Metadata.Equal(that1.Metadata) { - return false } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("position") } - return true -} -func (this *PromiseRequest) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that == nil && this != nil") + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("promised") } - that1, ok := that.(*PromiseRequest) - if !ok { - return fmt7.Errorf("that is not of type *PromiseRequest") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that is type *PromiseRequest but is nil && this != nil") - } else if this == nil { - return fmt7.Errorf("that is type *PromiseRequestbut is not nil && this == nil") - } - if this.Proposal != nil && that1.Proposal != nil { - if *this.Proposal != *that1.Proposal { - return fmt7.Errorf("Proposal this(%v) Not Equal that(%v)", *this.Proposal, *that1.Proposal) - } - } else if this.Proposal != nil { - return fmt7.Errorf("this.Proposal == nil && that.Proposal != nil") - } else if that1.Proposal != nil { - return fmt7.Errorf("Proposal this(%v) Not Equal that(%v)", this.Proposal, that1.Proposal) - } - if this.Position != nil && that1.Position != nil { - if *this.Position != *that1.Position { - return fmt7.Errorf("Position this(%v) Not Equal that(%v)", *this.Position, *that1.Position) - } - } else if this.Position != nil { - return fmt7.Errorf("this.Position == nil && that.Position != nil") - } else if that1.Position != nil { - return fmt7.Errorf("Position this(%v) Not Equal that(%v)", this.Position, that1.Position) - } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt7.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } return nil } -func (this *PromiseRequest) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*PromiseRequest) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Proposal != nil && that1.Proposal != nil { - if *this.Proposal != *that1.Proposal { - return false - } - } else if this.Proposal != nil { - return false - } else if that1.Proposal != nil { - return false - } - if this.Position != nil && that1.Position != nil { - if *this.Position != *that1.Position { - return false +func (m *Action_Nop) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.Position != nil { - return false - } else if that1.Position != nil { - return false - } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *PromiseResponse) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil + fieldNum := int32(wire >> 3) + switch fieldNum { + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipLog(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLog + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt7.Errorf("that == nil && this != nil") } - that1, ok := that.(*PromiseResponse) - if !ok { - return fmt7.Errorf("that is not of type *PromiseResponse") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that is type *PromiseResponse but is nil && this != nil") - } else if this == nil { - return fmt7.Errorf("that is type *PromiseResponsebut is not nil && this == nil") - } - if this.Okay != nil && that1.Okay != nil { - if *this.Okay != *that1.Okay { - return fmt7.Errorf("Okay this(%v) Not Equal that(%v)", *this.Okay, *that1.Okay) - } - } else if this.Okay != nil { - return fmt7.Errorf("this.Okay == nil && that.Okay != nil") - } else if that1.Okay != nil { - return fmt7.Errorf("Okay this(%v) Not Equal that(%v)", this.Okay, that1.Okay) - } - if this.Proposal != nil && that1.Proposal != nil { - if *this.Proposal != *that1.Proposal { - return fmt7.Errorf("Proposal this(%v) Not Equal that(%v)", *this.Proposal, *that1.Proposal) - } - } else if this.Proposal != nil { - return fmt7.Errorf("this.Proposal == nil && that.Proposal != nil") - } else if that1.Proposal != nil { - return fmt7.Errorf("Proposal this(%v) Not Equal that(%v)", this.Proposal, that1.Proposal) - } - if this.Position != nil && that1.Position != nil { - if *this.Position != *that1.Position { - return fmt7.Errorf("Position this(%v) Not Equal that(%v)", *this.Position, *that1.Position) - } - } else if this.Position != nil { - return fmt7.Errorf("this.Position == nil && that.Position != nil") - } else if that1.Position != nil { - return fmt7.Errorf("Position this(%v) Not Equal that(%v)", this.Position, that1.Position) - } - if !this.Action.Equal(that1.Action) { - return fmt7.Errorf("Action this(%v) Not Equal that(%v)", this.Action, that1.Action) - } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt7.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } return nil } -func (this *PromiseResponse) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*PromiseResponse) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Okay != nil && that1.Okay != nil { - if *this.Okay != *that1.Okay { - return false - } - } else if this.Okay != nil { - return false - } else if that1.Okay != nil { - return false - } - if this.Proposal != nil && that1.Proposal != nil { - if *this.Proposal != *that1.Proposal { - return false - } - } else if this.Proposal != nil { - return false - } else if that1.Proposal != nil { - return false - } - if this.Position != nil && that1.Position != nil { - if *this.Position != *that1.Position { - return false - } - } else if this.Position != nil { - return false - } else if that1.Position != nil { - return false - } - if !this.Action.Equal(that1.Action) { - return false - } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *WriteRequest) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*WriteRequest) - if !ok { - return fmt7.Errorf("that is not of type *WriteRequest") - } - if that1 == nil { - if this == nil { - return nil +func (m *Action_Append) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - return fmt7.Errorf("that is type *WriteRequest but is nil && this != nil") - } else if this == nil { - return fmt7.Errorf("that is type *WriteRequestbut is not nil && this == nil") - } - if this.Proposal != nil && that1.Proposal != nil { - if *this.Proposal != *that1.Proposal { - return fmt7.Errorf("Proposal this(%v) Not Equal that(%v)", *this.Proposal, *that1.Proposal) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bytes", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bytes = append([]byte{}, data[iNdEx:postIndex]...) + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cksum", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Cksum = append([]byte{}, data[iNdEx:postIndex]...) + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipLog(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLog + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Proposal != nil { - return fmt7.Errorf("this.Proposal == nil && that.Proposal != nil") - } else if that1.Proposal != nil { - return fmt7.Errorf("Proposal this(%v) Not Equal that(%v)", this.Proposal, that1.Proposal) } - if this.Position != nil && that1.Position != nil { - if *this.Position != *that1.Position { - return fmt7.Errorf("Position this(%v) Not Equal that(%v)", *this.Position, *that1.Position) - } - } else if this.Position != nil { - return fmt7.Errorf("this.Position == nil && that.Position != nil") - } else if that1.Position != nil { - return fmt7.Errorf("Position this(%v) Not Equal that(%v)", this.Position, that1.Position) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("bytes") } - if this.Learned != nil && that1.Learned != nil { - if *this.Learned != *that1.Learned { - return fmt7.Errorf("Learned this(%v) Not Equal that(%v)", *this.Learned, *that1.Learned) + + return nil +} +func (m *Action_Truncate) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.Learned != nil { - return fmt7.Errorf("this.Learned == nil && that.Learned != nil") - } else if that1.Learned != nil { - return fmt7.Errorf("Learned this(%v) Not Equal that(%v)", this.Learned, that1.Learned) - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt7.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.To = &v + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipLog(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLog + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Type != nil { - return fmt7.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt7.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) } - if !this.Nop.Equal(that1.Nop) { - return fmt7.Errorf("Nop this(%v) Not Equal that(%v)", this.Nop, that1.Nop) - } - if !this.Append.Equal(that1.Append) { - return fmt7.Errorf("Append this(%v) Not Equal that(%v)", this.Append, that1.Append) - } - if !this.Truncate.Equal(that1.Truncate) { - return fmt7.Errorf("Truncate this(%v) Not Equal that(%v)", this.Truncate, that1.Truncate) - } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt7.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("to") } + return nil } -func (this *WriteRequest) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true +func (m *Metadata) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - return false - } - - that1, ok := that.(*WriteRequest) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var v Metadata_Status + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (Metadata_Status(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Status = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Promised", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Promised = &v + hasFields[0] |= uint64(0x00000002) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipLog(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLog + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false - } else if this == nil { - return false } - if this.Proposal != nil && that1.Proposal != nil { - if *this.Proposal != *that1.Proposal { - return false - } - } else if this.Proposal != nil { - return false - } else if that1.Proposal != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("status") } - if this.Position != nil && that1.Position != nil { - if *this.Position != *that1.Position { - return false - } - } else if this.Position != nil { - return false - } else if that1.Position != nil { - return false + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("promised") } - if this.Learned != nil && that1.Learned != nil { - if *this.Learned != *that1.Learned { - return false + + return nil +} +func (m *Record) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.Learned != nil { - return false - } else if that1.Learned != nil { - return false - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var v Record_Type + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (Record_Type(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Type = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Promise", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Promise == nil { + m.Promise = &Promise{} + } + if err := m.Promise.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Action == nil { + m.Action = &Action{} + } + if err := m.Action.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = &Metadata{} + } + if err := m.Metadata.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipLog(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLog + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false - } - if !this.Nop.Equal(that1.Nop) { - return false - } - if !this.Append.Equal(that1.Append) { - return false - } - if !this.Truncate.Equal(that1.Truncate) { - return false } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *WriteResponse) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that == nil && this != nil") + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") } - that1, ok := that.(*WriteResponse) - if !ok { - return fmt7.Errorf("that is not of type *WriteResponse") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that is type *WriteResponse but is nil && this != nil") - } else if this == nil { - return fmt7.Errorf("that is type *WriteResponsebut is not nil && this == nil") - } - if this.Okay != nil && that1.Okay != nil { - if *this.Okay != *that1.Okay { - return fmt7.Errorf("Okay this(%v) Not Equal that(%v)", *this.Okay, *that1.Okay) - } - } else if this.Okay != nil { - return fmt7.Errorf("this.Okay == nil && that.Okay != nil") - } else if that1.Okay != nil { - return fmt7.Errorf("Okay this(%v) Not Equal that(%v)", this.Okay, that1.Okay) - } - if this.Proposal != nil && that1.Proposal != nil { - if *this.Proposal != *that1.Proposal { - return fmt7.Errorf("Proposal this(%v) Not Equal that(%v)", *this.Proposal, *that1.Proposal) - } - } else if this.Proposal != nil { - return fmt7.Errorf("this.Proposal == nil && that.Proposal != nil") - } else if that1.Proposal != nil { - return fmt7.Errorf("Proposal this(%v) Not Equal that(%v)", this.Proposal, that1.Proposal) - } - if this.Position != nil && that1.Position != nil { - if *this.Position != *that1.Position { - return fmt7.Errorf("Position this(%v) Not Equal that(%v)", *this.Position, *that1.Position) - } - } else if this.Position != nil { - return fmt7.Errorf("this.Position == nil && that.Position != nil") - } else if that1.Position != nil { - return fmt7.Errorf("Position this(%v) Not Equal that(%v)", this.Position, that1.Position) - } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt7.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } return nil } -func (this *WriteResponse) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*WriteResponse) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Okay != nil && that1.Okay != nil { - if *this.Okay != *that1.Okay { - return false - } - } else if this.Okay != nil { - return false - } else if that1.Okay != nil { - return false - } - if this.Proposal != nil && that1.Proposal != nil { - if *this.Proposal != *that1.Proposal { - return false +func (m *PromiseRequest) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.Proposal != nil { - return false - } else if that1.Proposal != nil { - return false - } - if this.Position != nil && that1.Position != nil { - if *this.Position != *that1.Position { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Proposal = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Position", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Position = &v + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipLog(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLog + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Position != nil { - return false - } else if that1.Position != nil { - return false } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("proposal") } - return true + + return nil } -func (this *LearnedMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil +func (m *PromiseResponse) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - return fmt7.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*LearnedMessage) - if !ok { - return fmt7.Errorf("that is not of type *LearnedMessage") - } - if that1 == nil { - if this == nil { - return nil + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Okay", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Okay = &b + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Proposal = &v + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Action == nil { + m.Action = &Action{} + } + if err := m.Action.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Position", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Position = &v + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipLog(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLog + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt7.Errorf("that is type *LearnedMessage but is nil && this != nil") - } else if this == nil { - return fmt7.Errorf("that is type *LearnedMessagebut is not nil && this == nil") } - if !this.Action.Equal(that1.Action) { - return fmt7.Errorf("Action this(%v) Not Equal that(%v)", this.Action, that1.Action) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("okay") } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt7.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("proposal") } + return nil } -func (this *LearnedMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true +func (m *WriteRequest) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - return false - } - - that1, ok := that.(*LearnedMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Proposal = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Position", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Position = &v + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Learned", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Learned = &b + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var v Action_Type + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (Action_Type(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Type = &v + hasFields[0] |= uint64(0x00000004) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nop", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Nop == nil { + m.Nop = &Action_Nop{} + } + if err := m.Nop.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Append", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Append == nil { + m.Append = &Action_Append{} + } + if err := m.Append.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Truncate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Truncate == nil { + m.Truncate = &Action_Truncate{} + } + if err := m.Truncate.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipLog(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLog + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false - } else if this == nil { - return false } - if !this.Action.Equal(that1.Action) { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("proposal") } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("position") } - return true -} -func (this *RecoverRequest) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that == nil && this != nil") + if hasFields[0]&uint64(0x00000004) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") } - that1, ok := that.(*RecoverRequest) - if !ok { - return fmt7.Errorf("that is not of type *RecoverRequest") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that is type *RecoverRequest but is nil && this != nil") - } else if this == nil { - return fmt7.Errorf("that is type *RecoverRequestbut is not nil && this == nil") - } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt7.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } return nil } -func (this *RecoverRequest) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*RecoverRequest) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true +func (m *WriteResponse) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - return false - } else if this == nil { - return false - } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *RecoverResponse) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Okay", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Okay = &b + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Proposal = &v + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Position", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Position = &v + hasFields[0] |= uint64(0x00000004) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipLog(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLog + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt7.Errorf("that == nil && this != nil") } - - that1, ok := that.(*RecoverResponse) - if !ok { - return fmt7.Errorf("that is not of type *RecoverResponse") + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("okay") } - if that1 == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that is type *RecoverResponse but is nil && this != nil") - } else if this == nil { - return fmt7.Errorf("that is type *RecoverResponsebut is not nil && this == nil") + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("proposal") } - if this.Status != nil && that1.Status != nil { - if *this.Status != *that1.Status { - return fmt7.Errorf("Status this(%v) Not Equal that(%v)", *this.Status, *that1.Status) - } - } else if this.Status != nil { - return fmt7.Errorf("this.Status == nil && that.Status != nil") - } else if that1.Status != nil { - return fmt7.Errorf("Status this(%v) Not Equal that(%v)", this.Status, that1.Status) + if hasFields[0]&uint64(0x00000004) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("position") } - if this.Begin != nil && that1.Begin != nil { - if *this.Begin != *that1.Begin { - return fmt7.Errorf("Begin this(%v) Not Equal that(%v)", *this.Begin, *that1.Begin) + + return nil +} +func (m *LearnedMessage) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.Begin != nil { - return fmt7.Errorf("this.Begin == nil && that.Begin != nil") - } else if that1.Begin != nil { - return fmt7.Errorf("Begin this(%v) Not Equal that(%v)", this.Begin, that1.Begin) - } - if this.End != nil && that1.End != nil { - if *this.End != *that1.End { - return fmt7.Errorf("End this(%v) Not Equal that(%v)", *this.End, *that1.End) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Action == nil { + m.Action = &Action{} + } + if err := m.Action.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipLog(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLog + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.End != nil { - return fmt7.Errorf("this.End == nil && that.End != nil") - } else if that1.End != nil { - return fmt7.Errorf("End this(%v) Not Equal that(%v)", this.End, that1.End) } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt7.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("action") } + return nil } -func (this *RecoverResponse) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true +func (m *RecoverRequest) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + switch fieldNum { + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipLog(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLog + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false } - that1, ok := that.(*RecoverResponse) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true + return nil +} +func (m *RecoverResponse) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - return false - } else if this == nil { - return false - } - if this.Status != nil && that1.Status != nil { - if *this.Status != *that1.Status { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var v Metadata_Status + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (Metadata_Status(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Status = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Begin", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Begin = &v + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field End", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.End = &v + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipLog(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLog + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Status != nil { - return false - } else if that1.Status != nil { - return false } - if this.Begin != nil && that1.Begin != nil { - if *this.Begin != *that1.Begin { - return false - } - } else if this.Begin != nil { - return false - } else if that1.Begin != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("status") } - if this.End != nil && that1.End != nil { - if *this.End != *that1.End { - return false + + return nil +} +func skipLog(data []byte) (n int, err error) { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for { + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if data[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + iNdEx += length + if length < 0 { + return 0, ErrInvalidLengthLog + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipLog(data[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } - } else if this.End != nil { - return false - } else if that1.End != nil { - return false - } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false } - return true + panic("unreachable") } + +var ( + ErrInvalidLengthLog = fmt.Errorf("proto: negative length found during unmarshaling") +) diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/logpb_test.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/logpb_test.go index 0511bd3d8e409..20e6005eaf72d 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/logpb_test.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/logpb_test.go @@ -4,60 +4,60 @@ package mesosproto -import testing7 "testing" -import math_rand7 "math/rand" -import time7 "time" -import github_com_gogo_protobuf_proto4 "github.com/gogo/protobuf/proto" -import testing8 "testing" -import math_rand8 "math/rand" -import time8 "time" -import encoding_json1 "encoding/json" -import testing9 "testing" -import math_rand9 "math/rand" -import time9 "time" -import github_com_gogo_protobuf_proto5 "github.com/gogo/protobuf/proto" -import math_rand10 "math/rand" -import time10 "time" -import testing10 "testing" -import fmt2 "fmt" -import math_rand11 "math/rand" -import time11 "time" -import testing11 "testing" -import github_com_gogo_protobuf_proto6 "github.com/gogo/protobuf/proto" -import math_rand12 "math/rand" -import time12 "time" -import testing12 "testing" -import fmt3 "fmt" -import go_parser1 "go/parser" -import math_rand13 "math/rand" -import time13 "time" -import testing13 "testing" -import github_com_gogo_protobuf_proto7 "github.com/gogo/protobuf/proto" - -func TestPromiseProto(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +import testing "testing" +import math_rand "math/rand" +import time "time" +import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" +import github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb" +import fmt "fmt" +import go_parser "go/parser" +import proto "github.com/gogo/protobuf/proto" +import math "math" + +// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +func TestPromiseProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromise(popr, false) - data, err := github_com_gogo_protobuf_proto4.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Promise{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestPromiseMarshalTo(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestPromiseMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromise(popr, false) size := p.Size() data := make([]byte, size) @@ -66,25 +66,25 @@ func TestPromiseMarshalTo(t *testing7.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Promise{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkPromiseProtoMarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkPromiseProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Promise, 10000) for i := 0; i < 10000; i++ { @@ -92,7 +92,7 @@ func BenchmarkPromiseProtoMarshal(b *testing7.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -101,12 +101,12 @@ func BenchmarkPromiseProtoMarshal(b *testing7.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkPromiseProtoUnmarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkPromiseProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(NewPopulatedPromise(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedPromise(popr, false)) if err != nil { panic(err) } @@ -116,37 +116,50 @@ func BenchmarkPromiseProtoUnmarshal(b *testing7.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto4.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestActionProto(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestActionProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction(popr, false) - data, err := github_com_gogo_protobuf_proto4.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Action{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestActionMarshalTo(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestActionMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction(popr, false) size := p.Size() data := make([]byte, size) @@ -155,25 +168,25 @@ func TestActionMarshalTo(t *testing7.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Action{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkActionProtoMarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkActionProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Action, 10000) for i := 0; i < 10000; i++ { @@ -181,7 +194,7 @@ func BenchmarkActionProtoMarshal(b *testing7.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -190,12 +203,12 @@ func BenchmarkActionProtoMarshal(b *testing7.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkActionProtoUnmarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkActionProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(NewPopulatedAction(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedAction(popr, false)) if err != nil { panic(err) } @@ -205,37 +218,50 @@ func BenchmarkActionProtoUnmarshal(b *testing7.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto4.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestAction_NopProto(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestAction_NopProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Nop(popr, false) - data, err := github_com_gogo_protobuf_proto4.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Action_Nop{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestAction_NopMarshalTo(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestAction_NopMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Nop(popr, false) size := p.Size() data := make([]byte, size) @@ -244,25 +270,25 @@ func TestAction_NopMarshalTo(t *testing7.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Action_Nop{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkAction_NopProtoMarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkAction_NopProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Action_Nop, 10000) for i := 0; i < 10000; i++ { @@ -270,7 +296,7 @@ func BenchmarkAction_NopProtoMarshal(b *testing7.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -279,12 +305,12 @@ func BenchmarkAction_NopProtoMarshal(b *testing7.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkAction_NopProtoUnmarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkAction_NopProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(NewPopulatedAction_Nop(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedAction_Nop(popr, false)) if err != nil { panic(err) } @@ -294,37 +320,50 @@ func BenchmarkAction_NopProtoUnmarshal(b *testing7.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto4.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestAction_AppendProto(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestAction_AppendProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Append(popr, false) - data, err := github_com_gogo_protobuf_proto4.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Action_Append{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestAction_AppendMarshalTo(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestAction_AppendMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Append(popr, false) size := p.Size() data := make([]byte, size) @@ -333,25 +372,25 @@ func TestAction_AppendMarshalTo(t *testing7.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Action_Append{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkAction_AppendProtoMarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkAction_AppendProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Action_Append, 10000) for i := 0; i < 10000; i++ { @@ -359,7 +398,7 @@ func BenchmarkAction_AppendProtoMarshal(b *testing7.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -368,12 +407,12 @@ func BenchmarkAction_AppendProtoMarshal(b *testing7.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkAction_AppendProtoUnmarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkAction_AppendProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(NewPopulatedAction_Append(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedAction_Append(popr, false)) if err != nil { panic(err) } @@ -383,37 +422,50 @@ func BenchmarkAction_AppendProtoUnmarshal(b *testing7.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto4.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestAction_TruncateProto(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestAction_TruncateProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Truncate(popr, false) - data, err := github_com_gogo_protobuf_proto4.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Action_Truncate{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestAction_TruncateMarshalTo(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestAction_TruncateMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Truncate(popr, false) size := p.Size() data := make([]byte, size) @@ -422,25 +474,25 @@ func TestAction_TruncateMarshalTo(t *testing7.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Action_Truncate{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkAction_TruncateProtoMarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkAction_TruncateProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Action_Truncate, 10000) for i := 0; i < 10000; i++ { @@ -448,7 +500,7 @@ func BenchmarkAction_TruncateProtoMarshal(b *testing7.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -457,12 +509,12 @@ func BenchmarkAction_TruncateProtoMarshal(b *testing7.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkAction_TruncateProtoUnmarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkAction_TruncateProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(NewPopulatedAction_Truncate(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedAction_Truncate(popr, false)) if err != nil { panic(err) } @@ -472,37 +524,50 @@ func BenchmarkAction_TruncateProtoUnmarshal(b *testing7.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto4.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestMetadataProto(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestMetadataProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedMetadata(popr, false) - data, err := github_com_gogo_protobuf_proto4.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Metadata{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestMetadataMarshalTo(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestMetadataMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedMetadata(popr, false) size := p.Size() data := make([]byte, size) @@ -511,25 +576,25 @@ func TestMetadataMarshalTo(t *testing7.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Metadata{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkMetadataProtoMarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkMetadataProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Metadata, 10000) for i := 0; i < 10000; i++ { @@ -537,7 +602,7 @@ func BenchmarkMetadataProtoMarshal(b *testing7.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -546,12 +611,12 @@ func BenchmarkMetadataProtoMarshal(b *testing7.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkMetadataProtoUnmarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkMetadataProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(NewPopulatedMetadata(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedMetadata(popr, false)) if err != nil { panic(err) } @@ -561,37 +626,50 @@ func BenchmarkMetadataProtoUnmarshal(b *testing7.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto4.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestRecordProto(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestRecordProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecord(popr, false) - data, err := github_com_gogo_protobuf_proto4.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Record{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestRecordMarshalTo(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestRecordMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecord(popr, false) size := p.Size() data := make([]byte, size) @@ -600,25 +678,25 @@ func TestRecordMarshalTo(t *testing7.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Record{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkRecordProtoMarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkRecordProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Record, 10000) for i := 0; i < 10000; i++ { @@ -626,7 +704,7 @@ func BenchmarkRecordProtoMarshal(b *testing7.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -635,12 +713,12 @@ func BenchmarkRecordProtoMarshal(b *testing7.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkRecordProtoUnmarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkRecordProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(NewPopulatedRecord(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedRecord(popr, false)) if err != nil { panic(err) } @@ -650,37 +728,50 @@ func BenchmarkRecordProtoUnmarshal(b *testing7.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto4.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestPromiseRequestProto(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestPromiseRequestProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromiseRequest(popr, false) - data, err := github_com_gogo_protobuf_proto4.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &PromiseRequest{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestPromiseRequestMarshalTo(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestPromiseRequestMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromiseRequest(popr, false) size := p.Size() data := make([]byte, size) @@ -689,25 +780,25 @@ func TestPromiseRequestMarshalTo(t *testing7.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &PromiseRequest{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkPromiseRequestProtoMarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkPromiseRequestProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*PromiseRequest, 10000) for i := 0; i < 10000; i++ { @@ -715,7 +806,7 @@ func BenchmarkPromiseRequestProtoMarshal(b *testing7.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -724,12 +815,12 @@ func BenchmarkPromiseRequestProtoMarshal(b *testing7.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkPromiseRequestProtoUnmarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkPromiseRequestProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(NewPopulatedPromiseRequest(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedPromiseRequest(popr, false)) if err != nil { panic(err) } @@ -739,37 +830,50 @@ func BenchmarkPromiseRequestProtoUnmarshal(b *testing7.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto4.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestPromiseResponseProto(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestPromiseResponseProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromiseResponse(popr, false) - data, err := github_com_gogo_protobuf_proto4.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &PromiseResponse{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestPromiseResponseMarshalTo(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestPromiseResponseMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromiseResponse(popr, false) size := p.Size() data := make([]byte, size) @@ -778,25 +882,25 @@ func TestPromiseResponseMarshalTo(t *testing7.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &PromiseResponse{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkPromiseResponseProtoMarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkPromiseResponseProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*PromiseResponse, 10000) for i := 0; i < 10000; i++ { @@ -804,7 +908,7 @@ func BenchmarkPromiseResponseProtoMarshal(b *testing7.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -813,12 +917,12 @@ func BenchmarkPromiseResponseProtoMarshal(b *testing7.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkPromiseResponseProtoUnmarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkPromiseResponseProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(NewPopulatedPromiseResponse(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedPromiseResponse(popr, false)) if err != nil { panic(err) } @@ -828,37 +932,50 @@ func BenchmarkPromiseResponseProtoUnmarshal(b *testing7.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto4.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestWriteRequestProto(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestWriteRequestProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedWriteRequest(popr, false) - data, err := github_com_gogo_protobuf_proto4.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &WriteRequest{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestWriteRequestMarshalTo(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestWriteRequestMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedWriteRequest(popr, false) size := p.Size() data := make([]byte, size) @@ -867,25 +984,25 @@ func TestWriteRequestMarshalTo(t *testing7.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &WriteRequest{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkWriteRequestProtoMarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkWriteRequestProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*WriteRequest, 10000) for i := 0; i < 10000; i++ { @@ -893,7 +1010,7 @@ func BenchmarkWriteRequestProtoMarshal(b *testing7.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -902,12 +1019,12 @@ func BenchmarkWriteRequestProtoMarshal(b *testing7.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkWriteRequestProtoUnmarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkWriteRequestProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(NewPopulatedWriteRequest(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedWriteRequest(popr, false)) if err != nil { panic(err) } @@ -917,37 +1034,50 @@ func BenchmarkWriteRequestProtoUnmarshal(b *testing7.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto4.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestWriteResponseProto(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestWriteResponseProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedWriteResponse(popr, false) - data, err := github_com_gogo_protobuf_proto4.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &WriteResponse{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestWriteResponseMarshalTo(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestWriteResponseMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedWriteResponse(popr, false) size := p.Size() data := make([]byte, size) @@ -956,25 +1086,25 @@ func TestWriteResponseMarshalTo(t *testing7.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &WriteResponse{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkWriteResponseProtoMarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkWriteResponseProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*WriteResponse, 10000) for i := 0; i < 10000; i++ { @@ -982,7 +1112,7 @@ func BenchmarkWriteResponseProtoMarshal(b *testing7.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -991,12 +1121,12 @@ func BenchmarkWriteResponseProtoMarshal(b *testing7.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkWriteResponseProtoUnmarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkWriteResponseProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(NewPopulatedWriteResponse(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedWriteResponse(popr, false)) if err != nil { panic(err) } @@ -1006,37 +1136,50 @@ func BenchmarkWriteResponseProtoUnmarshal(b *testing7.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto4.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestLearnedMessageProto(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestLearnedMessageProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedLearnedMessage(popr, false) - data, err := github_com_gogo_protobuf_proto4.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &LearnedMessage{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestLearnedMessageMarshalTo(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestLearnedMessageMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedLearnedMessage(popr, false) size := p.Size() data := make([]byte, size) @@ -1045,25 +1188,25 @@ func TestLearnedMessageMarshalTo(t *testing7.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &LearnedMessage{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkLearnedMessageProtoMarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkLearnedMessageProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*LearnedMessage, 10000) for i := 0; i < 10000; i++ { @@ -1071,7 +1214,7 @@ func BenchmarkLearnedMessageProtoMarshal(b *testing7.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -1080,12 +1223,12 @@ func BenchmarkLearnedMessageProtoMarshal(b *testing7.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkLearnedMessageProtoUnmarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkLearnedMessageProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(NewPopulatedLearnedMessage(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedLearnedMessage(popr, false)) if err != nil { panic(err) } @@ -1095,37 +1238,50 @@ func BenchmarkLearnedMessageProtoUnmarshal(b *testing7.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto4.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestRecoverRequestProto(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestRecoverRequestProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecoverRequest(popr, false) - data, err := github_com_gogo_protobuf_proto4.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RecoverRequest{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestRecoverRequestMarshalTo(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestRecoverRequestMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecoverRequest(popr, false) size := p.Size() data := make([]byte, size) @@ -1134,25 +1290,25 @@ func TestRecoverRequestMarshalTo(t *testing7.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RecoverRequest{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkRecoverRequestProtoMarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkRecoverRequestProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*RecoverRequest, 10000) for i := 0; i < 10000; i++ { @@ -1160,7 +1316,7 @@ func BenchmarkRecoverRequestProtoMarshal(b *testing7.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -1169,12 +1325,12 @@ func BenchmarkRecoverRequestProtoMarshal(b *testing7.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkRecoverRequestProtoUnmarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkRecoverRequestProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(NewPopulatedRecoverRequest(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedRecoverRequest(popr, false)) if err != nil { panic(err) } @@ -1184,37 +1340,50 @@ func BenchmarkRecoverRequestProtoUnmarshal(b *testing7.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto4.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestRecoverResponseProto(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestRecoverResponseProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecoverResponse(popr, false) - data, err := github_com_gogo_protobuf_proto4.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RecoverResponse{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestRecoverResponseMarshalTo(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestRecoverResponseMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecoverResponse(popr, false) size := p.Size() data := make([]byte, size) @@ -1223,25 +1392,25 @@ func TestRecoverResponseMarshalTo(t *testing7.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RecoverResponse{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkRecoverResponseProtoMarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkRecoverResponseProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*RecoverResponse, 10000) for i := 0; i < 10000; i++ { @@ -1249,7 +1418,7 @@ func BenchmarkRecoverResponseProtoMarshal(b *testing7.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -1258,12 +1427,12 @@ func BenchmarkRecoverResponseProtoMarshal(b *testing7.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkRecoverResponseProtoUnmarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkRecoverResponseProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(NewPopulatedRecoverResponse(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedRecoverResponse(popr, false)) if err != nil { panic(err) } @@ -1273,876 +1442,1199 @@ func BenchmarkRecoverResponseProtoUnmarshal(b *testing7.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto4.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestPromiseJSON(t *testing8.T) { - popr := math_rand8.New(math_rand8.NewSource(time8.Now().UnixNano())) +func TestPromiseJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromise(popr, true) - jsondata, err := encoding_json1.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Promise{} - err = encoding_json1.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestActionJSON(t *testing8.T) { - popr := math_rand8.New(math_rand8.NewSource(time8.Now().UnixNano())) +func TestActionJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction(popr, true) - jsondata, err := encoding_json1.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Action{} - err = encoding_json1.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestAction_NopJSON(t *testing8.T) { - popr := math_rand8.New(math_rand8.NewSource(time8.Now().UnixNano())) +func TestAction_NopJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Nop(popr, true) - jsondata, err := encoding_json1.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Action_Nop{} - err = encoding_json1.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestAction_AppendJSON(t *testing8.T) { - popr := math_rand8.New(math_rand8.NewSource(time8.Now().UnixNano())) +func TestAction_AppendJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Append(popr, true) - jsondata, err := encoding_json1.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Action_Append{} - err = encoding_json1.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestAction_TruncateJSON(t *testing8.T) { - popr := math_rand8.New(math_rand8.NewSource(time8.Now().UnixNano())) +func TestAction_TruncateJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Truncate(popr, true) - jsondata, err := encoding_json1.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Action_Truncate{} - err = encoding_json1.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestMetadataJSON(t *testing8.T) { - popr := math_rand8.New(math_rand8.NewSource(time8.Now().UnixNano())) +func TestMetadataJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedMetadata(popr, true) - jsondata, err := encoding_json1.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Metadata{} - err = encoding_json1.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestRecordJSON(t *testing8.T) { - popr := math_rand8.New(math_rand8.NewSource(time8.Now().UnixNano())) +func TestRecordJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecord(popr, true) - jsondata, err := encoding_json1.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Record{} - err = encoding_json1.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestPromiseRequestJSON(t *testing8.T) { - popr := math_rand8.New(math_rand8.NewSource(time8.Now().UnixNano())) +func TestPromiseRequestJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromiseRequest(popr, true) - jsondata, err := encoding_json1.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &PromiseRequest{} - err = encoding_json1.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestPromiseResponseJSON(t *testing8.T) { - popr := math_rand8.New(math_rand8.NewSource(time8.Now().UnixNano())) +func TestPromiseResponseJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromiseResponse(popr, true) - jsondata, err := encoding_json1.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &PromiseResponse{} - err = encoding_json1.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestWriteRequestJSON(t *testing8.T) { - popr := math_rand8.New(math_rand8.NewSource(time8.Now().UnixNano())) +func TestWriteRequestJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedWriteRequest(popr, true) - jsondata, err := encoding_json1.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &WriteRequest{} - err = encoding_json1.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestWriteResponseJSON(t *testing8.T) { - popr := math_rand8.New(math_rand8.NewSource(time8.Now().UnixNano())) +func TestWriteResponseJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedWriteResponse(popr, true) - jsondata, err := encoding_json1.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &WriteResponse{} - err = encoding_json1.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestLearnedMessageJSON(t *testing8.T) { - popr := math_rand8.New(math_rand8.NewSource(time8.Now().UnixNano())) +func TestLearnedMessageJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedLearnedMessage(popr, true) - jsondata, err := encoding_json1.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &LearnedMessage{} - err = encoding_json1.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestRecoverRequestJSON(t *testing8.T) { - popr := math_rand8.New(math_rand8.NewSource(time8.Now().UnixNano())) +func TestRecoverRequestJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecoverRequest(popr, true) - jsondata, err := encoding_json1.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RecoverRequest{} - err = encoding_json1.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestRecoverResponseJSON(t *testing8.T) { - popr := math_rand8.New(math_rand8.NewSource(time8.Now().UnixNano())) +func TestRecoverResponseJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecoverResponse(popr, true) - jsondata, err := encoding_json1.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RecoverResponse{} - err = encoding_json1.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestPromiseProtoText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestPromiseProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromise(popr, true) - data := github_com_gogo_protobuf_proto5.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &Promise{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestPromiseProtoCompactText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestPromiseProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromise(popr, true) - data := github_com_gogo_protobuf_proto5.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &Promise{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestActionProtoText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestActionProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction(popr, true) - data := github_com_gogo_protobuf_proto5.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &Action{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestActionProtoCompactText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestActionProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction(popr, true) - data := github_com_gogo_protobuf_proto5.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &Action{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestAction_NopProtoText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestAction_NopProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Nop(popr, true) - data := github_com_gogo_protobuf_proto5.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &Action_Nop{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestAction_NopProtoCompactText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestAction_NopProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Nop(popr, true) - data := github_com_gogo_protobuf_proto5.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &Action_Nop{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestAction_AppendProtoText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestAction_AppendProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Append(popr, true) - data := github_com_gogo_protobuf_proto5.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &Action_Append{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestAction_AppendProtoCompactText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestAction_AppendProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Append(popr, true) - data := github_com_gogo_protobuf_proto5.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &Action_Append{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestAction_TruncateProtoText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestAction_TruncateProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Truncate(popr, true) - data := github_com_gogo_protobuf_proto5.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &Action_Truncate{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestAction_TruncateProtoCompactText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestAction_TruncateProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Truncate(popr, true) - data := github_com_gogo_protobuf_proto5.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &Action_Truncate{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestMetadataProtoText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestMetadataProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedMetadata(popr, true) - data := github_com_gogo_protobuf_proto5.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &Metadata{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestMetadataProtoCompactText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestMetadataProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedMetadata(popr, true) - data := github_com_gogo_protobuf_proto5.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &Metadata{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestRecordProtoText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestRecordProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecord(popr, true) - data := github_com_gogo_protobuf_proto5.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &Record{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestRecordProtoCompactText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestRecordProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecord(popr, true) - data := github_com_gogo_protobuf_proto5.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &Record{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestPromiseRequestProtoText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestPromiseRequestProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromiseRequest(popr, true) - data := github_com_gogo_protobuf_proto5.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &PromiseRequest{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestPromiseRequestProtoCompactText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestPromiseRequestProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromiseRequest(popr, true) - data := github_com_gogo_protobuf_proto5.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &PromiseRequest{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestPromiseResponseProtoText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestPromiseResponseProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromiseResponse(popr, true) - data := github_com_gogo_protobuf_proto5.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &PromiseResponse{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestPromiseResponseProtoCompactText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestPromiseResponseProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromiseResponse(popr, true) - data := github_com_gogo_protobuf_proto5.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &PromiseResponse{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestWriteRequestProtoText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestWriteRequestProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedWriteRequest(popr, true) - data := github_com_gogo_protobuf_proto5.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &WriteRequest{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestWriteRequestProtoCompactText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestWriteRequestProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedWriteRequest(popr, true) - data := github_com_gogo_protobuf_proto5.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &WriteRequest{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestWriteResponseProtoText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestWriteResponseProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedWriteResponse(popr, true) - data := github_com_gogo_protobuf_proto5.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &WriteResponse{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestWriteResponseProtoCompactText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestWriteResponseProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedWriteResponse(popr, true) - data := github_com_gogo_protobuf_proto5.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &WriteResponse{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestLearnedMessageProtoText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestLearnedMessageProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedLearnedMessage(popr, true) - data := github_com_gogo_protobuf_proto5.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &LearnedMessage{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestLearnedMessageProtoCompactText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestLearnedMessageProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedLearnedMessage(popr, true) - data := github_com_gogo_protobuf_proto5.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &LearnedMessage{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestRecoverRequestProtoText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestRecoverRequestProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecoverRequest(popr, true) - data := github_com_gogo_protobuf_proto5.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &RecoverRequest{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestRecoverRequestProtoCompactText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestRecoverRequestProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecoverRequest(popr, true) - data := github_com_gogo_protobuf_proto5.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &RecoverRequest{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestRecoverResponseProtoText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestRecoverResponseProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecoverResponse(popr, true) - data := github_com_gogo_protobuf_proto5.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &RecoverResponse{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestRecoverResponseProtoCompactText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestRecoverResponseProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecoverResponse(popr, true) - data := github_com_gogo_protobuf_proto5.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &RecoverResponse{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestPromiseStringer(t *testing10.T) { - popr := math_rand10.New(math_rand10.NewSource(time10.Now().UnixNano())) +func TestPromiseVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedPromise(popr, false) - s1 := p.String() - s2 := fmt2.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Promise{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestActionStringer(t *testing10.T) { - popr := math_rand10.New(math_rand10.NewSource(time10.Now().UnixNano())) +func TestActionVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedAction(popr, false) - s1 := p.String() - s2 := fmt2.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Action{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestAction_NopStringer(t *testing10.T) { - popr := math_rand10.New(math_rand10.NewSource(time10.Now().UnixNano())) +func TestAction_NopVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedAction_Nop(popr, false) - s1 := p.String() - s2 := fmt2.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Action_Nop{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestAction_AppendStringer(t *testing10.T) { - popr := math_rand10.New(math_rand10.NewSource(time10.Now().UnixNano())) +func TestAction_AppendVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedAction_Append(popr, false) - s1 := p.String() - s2 := fmt2.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Action_Append{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestAction_TruncateStringer(t *testing10.T) { - popr := math_rand10.New(math_rand10.NewSource(time10.Now().UnixNano())) +func TestAction_TruncateVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedAction_Truncate(popr, false) - s1 := p.String() - s2 := fmt2.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Action_Truncate{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestMetadataStringer(t *testing10.T) { - popr := math_rand10.New(math_rand10.NewSource(time10.Now().UnixNano())) +func TestMetadataVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedMetadata(popr, false) - s1 := p.String() - s2 := fmt2.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Metadata{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestRecordStringer(t *testing10.T) { - popr := math_rand10.New(math_rand10.NewSource(time10.Now().UnixNano())) +func TestRecordVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedRecord(popr, false) - s1 := p.String() - s2 := fmt2.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Record{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestPromiseRequestStringer(t *testing10.T) { - popr := math_rand10.New(math_rand10.NewSource(time10.Now().UnixNano())) +func TestPromiseRequestVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedPromiseRequest(popr, false) - s1 := p.String() - s2 := fmt2.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &PromiseRequest{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestPromiseResponseStringer(t *testing10.T) { - popr := math_rand10.New(math_rand10.NewSource(time10.Now().UnixNano())) +func TestPromiseResponseVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedPromiseResponse(popr, false) - s1 := p.String() - s2 := fmt2.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &PromiseResponse{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestWriteRequestStringer(t *testing10.T) { - popr := math_rand10.New(math_rand10.NewSource(time10.Now().UnixNano())) +func TestWriteRequestVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedWriteRequest(popr, false) - s1 := p.String() - s2 := fmt2.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &WriteRequest{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestWriteResponseStringer(t *testing10.T) { - popr := math_rand10.New(math_rand10.NewSource(time10.Now().UnixNano())) +func TestWriteResponseVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedWriteResponse(popr, false) - s1 := p.String() - s2 := fmt2.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) } -} -func TestLearnedMessageStringer(t *testing10.T) { - popr := math_rand10.New(math_rand10.NewSource(time10.Now().UnixNano())) + msg := &WriteResponse{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestLearnedMessageVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedLearnedMessage(popr, false) - s1 := p.String() - s2 := fmt2.Sprintf("%v", p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &LearnedMessage{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestRecoverRequestVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedRecoverRequest(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &RecoverRequest{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestRecoverResponseVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedRecoverResponse(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &RecoverResponse{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestPromiseGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedPromise(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) } } -func TestRecoverRequestStringer(t *testing10.T) { - popr := math_rand10.New(math_rand10.NewSource(time10.Now().UnixNano())) +func TestActionGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedAction(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestAction_NopGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedAction_Nop(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestAction_AppendGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedAction_Append(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestAction_TruncateGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedAction_Truncate(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestMetadataGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedMetadata(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestRecordGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedRecord(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestPromiseRequestGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedPromiseRequest(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestPromiseResponseGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedPromiseResponse(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestWriteRequestGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedWriteRequest(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestWriteResponseGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedWriteResponse(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestLearnedMessageGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedLearnedMessage(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestRecoverRequestGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedRecoverRequest(popr, false) - s1 := p.String() - s2 := fmt2.Sprintf("%v", p) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) } } -func TestRecoverResponseStringer(t *testing10.T) { - popr := math_rand10.New(math_rand10.NewSource(time10.Now().UnixNano())) +func TestRecoverResponseGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedRecoverResponse(popr, false) - s1 := p.String() - s2 := fmt2.Sprintf("%v", p) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) } } -func TestPromiseSize(t *testing11.T) { - popr := math_rand11.New(math_rand11.NewSource(time11.Now().UnixNano())) +func TestPromiseSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromise(popr, true) - size2 := github_com_gogo_protobuf_proto6.Size(p) - data, err := github_com_gogo_protobuf_proto6.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto6.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkPromiseSize(b *testing11.B) { - popr := math_rand11.New(math_rand11.NewSource(616)) +func BenchmarkPromiseSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Promise, 1000) for i := 0; i < 1000; i++ { @@ -2155,29 +2647,30 @@ func BenchmarkPromiseSize(b *testing11.B) { b.SetBytes(int64(total / b.N)) } -func TestActionSize(t *testing11.T) { - popr := math_rand11.New(math_rand11.NewSource(time11.Now().UnixNano())) +func TestActionSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction(popr, true) - size2 := github_com_gogo_protobuf_proto6.Size(p) - data, err := github_com_gogo_protobuf_proto6.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto6.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkActionSize(b *testing11.B) { - popr := math_rand11.New(math_rand11.NewSource(616)) +func BenchmarkActionSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Action, 1000) for i := 0; i < 1000; i++ { @@ -2190,29 +2683,30 @@ func BenchmarkActionSize(b *testing11.B) { b.SetBytes(int64(total / b.N)) } -func TestAction_NopSize(t *testing11.T) { - popr := math_rand11.New(math_rand11.NewSource(time11.Now().UnixNano())) +func TestAction_NopSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Nop(popr, true) - size2 := github_com_gogo_protobuf_proto6.Size(p) - data, err := github_com_gogo_protobuf_proto6.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto6.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkAction_NopSize(b *testing11.B) { - popr := math_rand11.New(math_rand11.NewSource(616)) +func BenchmarkAction_NopSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Action_Nop, 1000) for i := 0; i < 1000; i++ { @@ -2225,29 +2719,30 @@ func BenchmarkAction_NopSize(b *testing11.B) { b.SetBytes(int64(total / b.N)) } -func TestAction_AppendSize(t *testing11.T) { - popr := math_rand11.New(math_rand11.NewSource(time11.Now().UnixNano())) +func TestAction_AppendSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Append(popr, true) - size2 := github_com_gogo_protobuf_proto6.Size(p) - data, err := github_com_gogo_protobuf_proto6.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto6.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkAction_AppendSize(b *testing11.B) { - popr := math_rand11.New(math_rand11.NewSource(616)) +func BenchmarkAction_AppendSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Action_Append, 1000) for i := 0; i < 1000; i++ { @@ -2260,29 +2755,30 @@ func BenchmarkAction_AppendSize(b *testing11.B) { b.SetBytes(int64(total / b.N)) } -func TestAction_TruncateSize(t *testing11.T) { - popr := math_rand11.New(math_rand11.NewSource(time11.Now().UnixNano())) +func TestAction_TruncateSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Truncate(popr, true) - size2 := github_com_gogo_protobuf_proto6.Size(p) - data, err := github_com_gogo_protobuf_proto6.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto6.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkAction_TruncateSize(b *testing11.B) { - popr := math_rand11.New(math_rand11.NewSource(616)) +func BenchmarkAction_TruncateSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Action_Truncate, 1000) for i := 0; i < 1000; i++ { @@ -2295,29 +2791,30 @@ func BenchmarkAction_TruncateSize(b *testing11.B) { b.SetBytes(int64(total / b.N)) } -func TestMetadataSize(t *testing11.T) { - popr := math_rand11.New(math_rand11.NewSource(time11.Now().UnixNano())) +func TestMetadataSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedMetadata(popr, true) - size2 := github_com_gogo_protobuf_proto6.Size(p) - data, err := github_com_gogo_protobuf_proto6.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto6.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkMetadataSize(b *testing11.B) { - popr := math_rand11.New(math_rand11.NewSource(616)) +func BenchmarkMetadataSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Metadata, 1000) for i := 0; i < 1000; i++ { @@ -2330,29 +2827,30 @@ func BenchmarkMetadataSize(b *testing11.B) { b.SetBytes(int64(total / b.N)) } -func TestRecordSize(t *testing11.T) { - popr := math_rand11.New(math_rand11.NewSource(time11.Now().UnixNano())) +func TestRecordSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecord(popr, true) - size2 := github_com_gogo_protobuf_proto6.Size(p) - data, err := github_com_gogo_protobuf_proto6.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto6.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkRecordSize(b *testing11.B) { - popr := math_rand11.New(math_rand11.NewSource(616)) +func BenchmarkRecordSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Record, 1000) for i := 0; i < 1000; i++ { @@ -2365,29 +2863,30 @@ func BenchmarkRecordSize(b *testing11.B) { b.SetBytes(int64(total / b.N)) } -func TestPromiseRequestSize(t *testing11.T) { - popr := math_rand11.New(math_rand11.NewSource(time11.Now().UnixNano())) +func TestPromiseRequestSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromiseRequest(popr, true) - size2 := github_com_gogo_protobuf_proto6.Size(p) - data, err := github_com_gogo_protobuf_proto6.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto6.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkPromiseRequestSize(b *testing11.B) { - popr := math_rand11.New(math_rand11.NewSource(616)) +func BenchmarkPromiseRequestSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*PromiseRequest, 1000) for i := 0; i < 1000; i++ { @@ -2400,29 +2899,30 @@ func BenchmarkPromiseRequestSize(b *testing11.B) { b.SetBytes(int64(total / b.N)) } -func TestPromiseResponseSize(t *testing11.T) { - popr := math_rand11.New(math_rand11.NewSource(time11.Now().UnixNano())) +func TestPromiseResponseSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromiseResponse(popr, true) - size2 := github_com_gogo_protobuf_proto6.Size(p) - data, err := github_com_gogo_protobuf_proto6.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto6.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkPromiseResponseSize(b *testing11.B) { - popr := math_rand11.New(math_rand11.NewSource(616)) +func BenchmarkPromiseResponseSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*PromiseResponse, 1000) for i := 0; i < 1000; i++ { @@ -2435,29 +2935,30 @@ func BenchmarkPromiseResponseSize(b *testing11.B) { b.SetBytes(int64(total / b.N)) } -func TestWriteRequestSize(t *testing11.T) { - popr := math_rand11.New(math_rand11.NewSource(time11.Now().UnixNano())) +func TestWriteRequestSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedWriteRequest(popr, true) - size2 := github_com_gogo_protobuf_proto6.Size(p) - data, err := github_com_gogo_protobuf_proto6.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto6.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkWriteRequestSize(b *testing11.B) { - popr := math_rand11.New(math_rand11.NewSource(616)) +func BenchmarkWriteRequestSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*WriteRequest, 1000) for i := 0; i < 1000; i++ { @@ -2470,29 +2971,30 @@ func BenchmarkWriteRequestSize(b *testing11.B) { b.SetBytes(int64(total / b.N)) } -func TestWriteResponseSize(t *testing11.T) { - popr := math_rand11.New(math_rand11.NewSource(time11.Now().UnixNano())) +func TestWriteResponseSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedWriteResponse(popr, true) - size2 := github_com_gogo_protobuf_proto6.Size(p) - data, err := github_com_gogo_protobuf_proto6.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto6.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkWriteResponseSize(b *testing11.B) { - popr := math_rand11.New(math_rand11.NewSource(616)) +func BenchmarkWriteResponseSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*WriteResponse, 1000) for i := 0; i < 1000; i++ { @@ -2505,29 +3007,30 @@ func BenchmarkWriteResponseSize(b *testing11.B) { b.SetBytes(int64(total / b.N)) } -func TestLearnedMessageSize(t *testing11.T) { - popr := math_rand11.New(math_rand11.NewSource(time11.Now().UnixNano())) +func TestLearnedMessageSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedLearnedMessage(popr, true) - size2 := github_com_gogo_protobuf_proto6.Size(p) - data, err := github_com_gogo_protobuf_proto6.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto6.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkLearnedMessageSize(b *testing11.B) { - popr := math_rand11.New(math_rand11.NewSource(616)) +func BenchmarkLearnedMessageSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*LearnedMessage, 1000) for i := 0; i < 1000; i++ { @@ -2540,29 +3043,30 @@ func BenchmarkLearnedMessageSize(b *testing11.B) { b.SetBytes(int64(total / b.N)) } -func TestRecoverRequestSize(t *testing11.T) { - popr := math_rand11.New(math_rand11.NewSource(time11.Now().UnixNano())) +func TestRecoverRequestSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecoverRequest(popr, true) - size2 := github_com_gogo_protobuf_proto6.Size(p) - data, err := github_com_gogo_protobuf_proto6.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto6.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkRecoverRequestSize(b *testing11.B) { - popr := math_rand11.New(math_rand11.NewSource(616)) +func BenchmarkRecoverRequestSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*RecoverRequest, 1000) for i := 0; i < 1000; i++ { @@ -2575,29 +3079,30 @@ func BenchmarkRecoverRequestSize(b *testing11.B) { b.SetBytes(int64(total / b.N)) } -func TestRecoverResponseSize(t *testing11.T) { - popr := math_rand11.New(math_rand11.NewSource(time11.Now().UnixNano())) +func TestRecoverResponseSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecoverResponse(popr, true) - size2 := github_com_gogo_protobuf_proto6.Size(p) - data, err := github_com_gogo_protobuf_proto6.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto6.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkRecoverResponseSize(b *testing11.B) { - popr := math_rand11.New(math_rand11.NewSource(616)) +func BenchmarkRecoverResponseSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*RecoverResponse, 1000) for i := 0; i < 1000; i++ { @@ -2610,396 +3115,130 @@ func BenchmarkRecoverResponseSize(b *testing11.B) { b.SetBytes(int64(total / b.N)) } -func TestPromiseGoString(t *testing12.T) { - popr := math_rand12.New(math_rand12.NewSource(time12.Now().UnixNano())) +func TestPromiseStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedPromise(popr, false) - s1 := p.GoString() - s2 := fmt3.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser1.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestActionGoString(t *testing12.T) { - popr := math_rand12.New(math_rand12.NewSource(time12.Now().UnixNano())) +func TestActionStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedAction(popr, false) - s1 := p.GoString() - s2 := fmt3.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser1.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestAction_NopGoString(t *testing12.T) { - popr := math_rand12.New(math_rand12.NewSource(time12.Now().UnixNano())) +func TestAction_NopStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedAction_Nop(popr, false) - s1 := p.GoString() - s2 := fmt3.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser1.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestAction_AppendGoString(t *testing12.T) { - popr := math_rand12.New(math_rand12.NewSource(time12.Now().UnixNano())) +func TestAction_AppendStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedAction_Append(popr, false) - s1 := p.GoString() - s2 := fmt3.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser1.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestAction_TruncateGoString(t *testing12.T) { - popr := math_rand12.New(math_rand12.NewSource(time12.Now().UnixNano())) +func TestAction_TruncateStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedAction_Truncate(popr, false) - s1 := p.GoString() - s2 := fmt3.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser1.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestMetadataGoString(t *testing12.T) { - popr := math_rand12.New(math_rand12.NewSource(time12.Now().UnixNano())) +func TestMetadataStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedMetadata(popr, false) - s1 := p.GoString() - s2 := fmt3.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser1.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestRecordGoString(t *testing12.T) { - popr := math_rand12.New(math_rand12.NewSource(time12.Now().UnixNano())) +func TestRecordStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedRecord(popr, false) - s1 := p.GoString() - s2 := fmt3.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser1.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestPromiseRequestGoString(t *testing12.T) { - popr := math_rand12.New(math_rand12.NewSource(time12.Now().UnixNano())) +func TestPromiseRequestStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedPromiseRequest(popr, false) - s1 := p.GoString() - s2 := fmt3.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser1.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestPromiseResponseGoString(t *testing12.T) { - popr := math_rand12.New(math_rand12.NewSource(time12.Now().UnixNano())) +func TestPromiseResponseStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedPromiseResponse(popr, false) - s1 := p.GoString() - s2 := fmt3.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser1.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestWriteRequestGoString(t *testing12.T) { - popr := math_rand12.New(math_rand12.NewSource(time12.Now().UnixNano())) +func TestWriteRequestStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedWriteRequest(popr, false) - s1 := p.GoString() - s2 := fmt3.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser1.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestWriteResponseGoString(t *testing12.T) { - popr := math_rand12.New(math_rand12.NewSource(time12.Now().UnixNano())) +func TestWriteResponseStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedWriteResponse(popr, false) - s1 := p.GoString() - s2 := fmt3.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser1.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestLearnedMessageGoString(t *testing12.T) { - popr := math_rand12.New(math_rand12.NewSource(time12.Now().UnixNano())) +func TestLearnedMessageStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedLearnedMessage(popr, false) - s1 := p.GoString() - s2 := fmt3.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser1.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestRecoverRequestGoString(t *testing12.T) { - popr := math_rand12.New(math_rand12.NewSource(time12.Now().UnixNano())) +func TestRecoverRequestStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedRecoverRequest(popr, false) - s1 := p.GoString() - s2 := fmt3.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser1.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestRecoverResponseGoString(t *testing12.T) { - popr := math_rand12.New(math_rand12.NewSource(time12.Now().UnixNano())) +func TestRecoverResponseStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedRecoverResponse(popr, false) - s1 := p.GoString() - s2 := fmt3.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser1.ParseExpr(s1) - if err != nil { - panic(err) - } -} -func TestPromiseVerboseEqual(t *testing13.T) { - popr := math_rand13.New(math_rand13.NewSource(time13.Now().UnixNano())) - p := NewPopulatedPromise(popr, false) - data, err := github_com_gogo_protobuf_proto7.Marshal(p) - if err != nil { - panic(err) - } - msg := &Promise{} - if err := github_com_gogo_protobuf_proto7.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestActionVerboseEqual(t *testing13.T) { - popr := math_rand13.New(math_rand13.NewSource(time13.Now().UnixNano())) - p := NewPopulatedAction(popr, false) - data, err := github_com_gogo_protobuf_proto7.Marshal(p) - if err != nil { - panic(err) - } - msg := &Action{} - if err := github_com_gogo_protobuf_proto7.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestAction_NopVerboseEqual(t *testing13.T) { - popr := math_rand13.New(math_rand13.NewSource(time13.Now().UnixNano())) - p := NewPopulatedAction_Nop(popr, false) - data, err := github_com_gogo_protobuf_proto7.Marshal(p) - if err != nil { - panic(err) - } - msg := &Action_Nop{} - if err := github_com_gogo_protobuf_proto7.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestAction_AppendVerboseEqual(t *testing13.T) { - popr := math_rand13.New(math_rand13.NewSource(time13.Now().UnixNano())) - p := NewPopulatedAction_Append(popr, false) - data, err := github_com_gogo_protobuf_proto7.Marshal(p) - if err != nil { - panic(err) - } - msg := &Action_Append{} - if err := github_com_gogo_protobuf_proto7.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestAction_TruncateVerboseEqual(t *testing13.T) { - popr := math_rand13.New(math_rand13.NewSource(time13.Now().UnixNano())) - p := NewPopulatedAction_Truncate(popr, false) - data, err := github_com_gogo_protobuf_proto7.Marshal(p) - if err != nil { - panic(err) - } - msg := &Action_Truncate{} - if err := github_com_gogo_protobuf_proto7.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestMetadataVerboseEqual(t *testing13.T) { - popr := math_rand13.New(math_rand13.NewSource(time13.Now().UnixNano())) - p := NewPopulatedMetadata(popr, false) - data, err := github_com_gogo_protobuf_proto7.Marshal(p) - if err != nil { - panic(err) - } - msg := &Metadata{} - if err := github_com_gogo_protobuf_proto7.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestRecordVerboseEqual(t *testing13.T) { - popr := math_rand13.New(math_rand13.NewSource(time13.Now().UnixNano())) - p := NewPopulatedRecord(popr, false) - data, err := github_com_gogo_protobuf_proto7.Marshal(p) - if err != nil { - panic(err) - } - msg := &Record{} - if err := github_com_gogo_protobuf_proto7.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestPromiseRequestVerboseEqual(t *testing13.T) { - popr := math_rand13.New(math_rand13.NewSource(time13.Now().UnixNano())) - p := NewPopulatedPromiseRequest(popr, false) - data, err := github_com_gogo_protobuf_proto7.Marshal(p) - if err != nil { - panic(err) - } - msg := &PromiseRequest{} - if err := github_com_gogo_protobuf_proto7.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestPromiseResponseVerboseEqual(t *testing13.T) { - popr := math_rand13.New(math_rand13.NewSource(time13.Now().UnixNano())) - p := NewPopulatedPromiseResponse(popr, false) - data, err := github_com_gogo_protobuf_proto7.Marshal(p) - if err != nil { - panic(err) - } - msg := &PromiseResponse{} - if err := github_com_gogo_protobuf_proto7.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestWriteRequestVerboseEqual(t *testing13.T) { - popr := math_rand13.New(math_rand13.NewSource(time13.Now().UnixNano())) - p := NewPopulatedWriteRequest(popr, false) - data, err := github_com_gogo_protobuf_proto7.Marshal(p) - if err != nil { - panic(err) - } - msg := &WriteRequest{} - if err := github_com_gogo_protobuf_proto7.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestWriteResponseVerboseEqual(t *testing13.T) { - popr := math_rand13.New(math_rand13.NewSource(time13.Now().UnixNano())) - p := NewPopulatedWriteResponse(popr, false) - data, err := github_com_gogo_protobuf_proto7.Marshal(p) - if err != nil { - panic(err) - } - msg := &WriteResponse{} - if err := github_com_gogo_protobuf_proto7.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestLearnedMessageVerboseEqual(t *testing13.T) { - popr := math_rand13.New(math_rand13.NewSource(time13.Now().UnixNano())) - p := NewPopulatedLearnedMessage(popr, false) - data, err := github_com_gogo_protobuf_proto7.Marshal(p) - if err != nil { - panic(err) - } - msg := &LearnedMessage{} - if err := github_com_gogo_protobuf_proto7.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestRecoverRequestVerboseEqual(t *testing13.T) { - popr := math_rand13.New(math_rand13.NewSource(time13.Now().UnixNano())) - p := NewPopulatedRecoverRequest(popr, false) - data, err := github_com_gogo_protobuf_proto7.Marshal(p) - if err != nil { - panic(err) - } - msg := &RecoverRequest{} - if err := github_com_gogo_protobuf_proto7.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestRecoverResponseVerboseEqual(t *testing13.T) { - popr := math_rand13.New(math_rand13.NewSource(time13.Now().UnixNano())) - p := NewPopulatedRecoverResponse(popr, false) - data, err := github_com_gogo_protobuf_proto7.Marshal(p) - if err != nil { - panic(err) - } - msg := &RecoverResponse{} - if err := github_com_gogo_protobuf_proto7.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + t.Fatalf("String want %v got %v", s1, s2) } } diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/mesos.pb.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/mesos.pb.go index a39d1cc6c8c0e..007d24d3fdb40 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/mesos.pb.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/mesos.pb.go @@ -5,33 +5,24 @@ package mesosproto import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" import math "math" -// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto/gogo.pb" +// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" -import io "io" -import math1 "math" -import fmt "fmt" -import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" +import bytes "bytes" -import fmt1 "fmt" import strings "strings" -import reflect "reflect" - -import math2 "math" - -import fmt2 "fmt" -import strings1 "strings" -import github_com_gogo_protobuf_proto1 "github.com/gogo/protobuf/proto" +import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" import sort "sort" import strconv "strconv" -import reflect1 "reflect" +import reflect "reflect" -import fmt3 "fmt" -import bytes "bytes" +import io "io" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal +var _ = fmt.Errorf var _ = math.Inf // * @@ -92,9 +83,7 @@ const ( TaskState_TASK_FAILED TaskState = 3 TaskState_TASK_KILLED TaskState = 4 TaskState_TASK_LOST TaskState = 5 - // TASK_ERROR is currently unused but will be introduced in 0.22.0. - // TODO(dhamon): Start using TASK_ERROR. - TaskState_TASK_ERROR TaskState = 7 + TaskState_TASK_ERROR TaskState = 7 ) var TaskState_name = map[int32]string{ @@ -135,6 +124,39 @@ func (x *TaskState) UnmarshalJSON(data []byte) error { return nil } +type FrameworkInfo_Capability_Type int32 + +const ( + // Receive offers with revocable resources. See 'Resource' + // message for details. + // TODO(vinod): This is currently a no-op. + FrameworkInfo_Capability_REVOCABLE_RESOURCES FrameworkInfo_Capability_Type = 1 +) + +var FrameworkInfo_Capability_Type_name = map[int32]string{ + 1: "REVOCABLE_RESOURCES", +} +var FrameworkInfo_Capability_Type_value = map[string]int32{ + "REVOCABLE_RESOURCES": 1, +} + +func (x FrameworkInfo_Capability_Type) Enum() *FrameworkInfo_Capability_Type { + p := new(FrameworkInfo_Capability_Type) + *p = x + return p +} +func (x FrameworkInfo_Capability_Type) String() string { + return proto.EnumName(FrameworkInfo_Capability_Type_name, int32(x)) +} +func (x *FrameworkInfo_Capability_Type) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(FrameworkInfo_Capability_Type_value, data, "FrameworkInfo_Capability_Type") + if err != nil { + return err + } + *x = FrameworkInfo_Capability_Type(value) + return nil +} + type Value_Type int32 const ( @@ -174,7 +196,49 @@ func (x *Value_Type) UnmarshalJSON(data []byte) error { return nil } -// * Describes the source of the task status update. +type Offer_Operation_Type int32 + +const ( + Offer_Operation_LAUNCH Offer_Operation_Type = 1 + Offer_Operation_RESERVE Offer_Operation_Type = 2 + Offer_Operation_UNRESERVE Offer_Operation_Type = 3 + Offer_Operation_CREATE Offer_Operation_Type = 4 + Offer_Operation_DESTROY Offer_Operation_Type = 5 +) + +var Offer_Operation_Type_name = map[int32]string{ + 1: "LAUNCH", + 2: "RESERVE", + 3: "UNRESERVE", + 4: "CREATE", + 5: "DESTROY", +} +var Offer_Operation_Type_value = map[string]int32{ + "LAUNCH": 1, + "RESERVE": 2, + "UNRESERVE": 3, + "CREATE": 4, + "DESTROY": 5, +} + +func (x Offer_Operation_Type) Enum() *Offer_Operation_Type { + p := new(Offer_Operation_Type) + *p = x + return p +} +func (x Offer_Operation_Type) String() string { + return proto.EnumName(Offer_Operation_Type_name, int32(x)) +} +func (x *Offer_Operation_Type) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(Offer_Operation_Type_value, data, "Offer_Operation_Type") + if err != nil { + return err + } + *x = Offer_Operation_Type(value) + return nil +} + +// Describes the source of the task status update. type TaskStatus_Source int32 const ( @@ -211,11 +275,15 @@ func (x *TaskStatus_Source) UnmarshalJSON(data []byte) error { return nil } -// * Detailed reason for the task status update. +// Detailed reason for the task status update. +// +// TODO(bmahler): Differentiate between slave removal reasons +// (e.g. unhealthy vs. unregistered for maintenance). type TaskStatus_Reason int32 const ( TaskStatus_REASON_COMMAND_EXECUTOR_FAILED TaskStatus_Reason = 0 + TaskStatus_REASON_EXECUTOR_PREEMPTED TaskStatus_Reason = 17 TaskStatus_REASON_EXECUTOR_TERMINATED TaskStatus_Reason = 1 TaskStatus_REASON_EXECUTOR_UNREGISTERED TaskStatus_Reason = 2 TaskStatus_REASON_FRAMEWORK_REMOVED TaskStatus_Reason = 3 @@ -225,6 +293,7 @@ const ( TaskStatus_REASON_MASTER_DISCONNECTED TaskStatus_Reason = 7 TaskStatus_REASON_MEMORY_LIMIT TaskStatus_Reason = 8 TaskStatus_REASON_RECONCILIATION TaskStatus_Reason = 9 + TaskStatus_REASON_RESOURCES_UNKNOWN TaskStatus_Reason = 18 TaskStatus_REASON_SLAVE_DISCONNECTED TaskStatus_Reason = 10 TaskStatus_REASON_SLAVE_REMOVED TaskStatus_Reason = 11 TaskStatus_REASON_SLAVE_RESTARTED TaskStatus_Reason = 12 @@ -236,6 +305,7 @@ const ( var TaskStatus_Reason_name = map[int32]string{ 0: "REASON_COMMAND_EXECUTOR_FAILED", + 17: "REASON_EXECUTOR_PREEMPTED", 1: "REASON_EXECUTOR_TERMINATED", 2: "REASON_EXECUTOR_UNREGISTERED", 3: "REASON_FRAMEWORK_REMOVED", @@ -245,6 +315,7 @@ var TaskStatus_Reason_name = map[int32]string{ 7: "REASON_MASTER_DISCONNECTED", 8: "REASON_MEMORY_LIMIT", 9: "REASON_RECONCILIATION", + 18: "REASON_RESOURCES_UNKNOWN", 10: "REASON_SLAVE_DISCONNECTED", 11: "REASON_SLAVE_REMOVED", 12: "REASON_SLAVE_RESTARTED", @@ -255,6 +326,7 @@ var TaskStatus_Reason_name = map[int32]string{ } var TaskStatus_Reason_value = map[string]int32{ "REASON_COMMAND_EXECUTOR_FAILED": 0, + "REASON_EXECUTOR_PREEMPTED": 17, "REASON_EXECUTOR_TERMINATED": 1, "REASON_EXECUTOR_UNREGISTERED": 2, "REASON_FRAMEWORK_REMOVED": 3, @@ -264,6 +336,7 @@ var TaskStatus_Reason_value = map[string]int32{ "REASON_MASTER_DISCONNECTED": 7, "REASON_MEMORY_LIMIT": 8, "REASON_RECONCILIATION": 9, + "REASON_RESOURCES_UNKNOWN": 18, "REASON_SLAVE_DISCONNECTED": 10, "REASON_SLAVE_REMOVED": 11, "REASON_SLAVE_RESTARTED": 12, @@ -430,6 +503,42 @@ func (x *ContainerInfo_DockerInfo_Network) UnmarshalJSON(data []byte) error { return nil } +type DiscoveryInfo_Visibility int32 + +const ( + DiscoveryInfo_FRAMEWORK DiscoveryInfo_Visibility = 0 + DiscoveryInfo_CLUSTER DiscoveryInfo_Visibility = 1 + DiscoveryInfo_EXTERNAL DiscoveryInfo_Visibility = 2 +) + +var DiscoveryInfo_Visibility_name = map[int32]string{ + 0: "FRAMEWORK", + 1: "CLUSTER", + 2: "EXTERNAL", +} +var DiscoveryInfo_Visibility_value = map[string]int32{ + "FRAMEWORK": 0, + "CLUSTER": 1, + "EXTERNAL": 2, +} + +func (x DiscoveryInfo_Visibility) Enum() *DiscoveryInfo_Visibility { + p := new(DiscoveryInfo_Visibility) + *p = x + return p +} +func (x DiscoveryInfo_Visibility) String() string { + return proto.EnumName(DiscoveryInfo_Visibility_name, int32(x)) +} +func (x *DiscoveryInfo_Visibility) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(DiscoveryInfo_Visibility_value, data, "DiscoveryInfo_Visibility") + if err != nil { + return err + } + *x = DiscoveryInfo_Visibility(value) + return nil +} + // * // A unique ID assigned to a framework. A framework can reuse this ID // in order to do failover (see MesosSchedulerDriver). @@ -544,41 +653,51 @@ func (m *ContainerID) GetValue() string { } // * -// Describes a framework. The user field is used to determine the -// Unix user that an executor/task should be launched as. If the user -// field is set to an empty string Mesos will automagically set it -// to the current user. Note that the ID is only available after a -// framework has registered, however, it is included here in order to -// facilitate scheduler failover (i.e., if it is set then the -// MesosSchedulerDriver expects the scheduler is performing failover). -// The amount of time that the master will wait for the scheduler to -// failover before removing the framework is specified by -// failover_timeout. If checkpoint is set, framework pid, executor -// pids and status updates are checkpointed to disk by the slaves. -// Checkpointing allows a restarted slave to reconnect with old -// executors and recover status updates, at the cost of disk I/O. -// The role field is used to group frameworks for allocation -// decisions, depending on the allocation policy being used. -// If the hostname field is set to an empty string Mesos will -// automagically set it to the current hostname. -// The principal field should match the credential the framework uses -// in authentication. This field is used for framework API rate -// exporting and limiting and should be set even if authentication is -// not enabled if these features are desired. -// The webui_url field allows a framework to advertise its web UI, so -// that the Mesos web UI can link to it. It is expected to be a full -// URL, for example http://my-scheduler.example.com:8080/. +// Describes a framework. type FrameworkInfo struct { - User *string `protobuf:"bytes,1,req,name=user" json:"user,omitempty"` - Name *string `protobuf:"bytes,2,req,name=name" json:"name,omitempty"` - Id *FrameworkID `protobuf:"bytes,3,opt,name=id" json:"id,omitempty"` - FailoverTimeout *float64 `protobuf:"fixed64,4,opt,name=failover_timeout,def=0" json:"failover_timeout,omitempty"` - Checkpoint *bool `protobuf:"varint,5,opt,name=checkpoint,def=0" json:"checkpoint,omitempty"` - Role *string `protobuf:"bytes,6,opt,name=role,def=*" json:"role,omitempty"` - Hostname *string `protobuf:"bytes,7,opt,name=hostname" json:"hostname,omitempty"` - Principal *string `protobuf:"bytes,8,opt,name=principal" json:"principal,omitempty"` - WebuiUrl *string `protobuf:"bytes,9,opt,name=webui_url" json:"webui_url,omitempty"` - XXX_unrecognized []byte `json:"-"` + // Used to determine the Unix user that an executor or task should + // be launched as. If the user field is set to an empty string Mesos + // will automagically set it to the current user. + User *string `protobuf:"bytes,1,req,name=user" json:"user,omitempty"` + // Name of the framework that shows up in the Mesos Web UI. + Name *string `protobuf:"bytes,2,req,name=name" json:"name,omitempty"` + // Note that 'id' is only available after a framework has + // registered, however, it is included here in order to facilitate + // scheduler failover (i.e., if it is set then the + // MesosSchedulerDriver expects the scheduler is performing + // failover). + Id *FrameworkID `protobuf:"bytes,3,opt,name=id" json:"id,omitempty"` + // The amount of time that the master will wait for the scheduler to + // failover before it tears down the framework by killing all its + // tasks/executors. This should be non-zero if a framework expects + // to reconnect after a failover and not lose its tasks/executors. + FailoverTimeout *float64 `protobuf:"fixed64,4,opt,name=failover_timeout,def=0" json:"failover_timeout,omitempty"` + // If set, framework pid, executor pids and status updates are + // checkpointed to disk by the slaves. Checkpointing allows a + // restarted slave to reconnect with old executors and recover + // status updates, at the cost of disk I/O. + Checkpoint *bool `protobuf:"varint,5,opt,name=checkpoint,def=0" json:"checkpoint,omitempty"` + // Used to group frameworks for allocation decisions, depending on + // the allocation policy being used. + Role *string `protobuf:"bytes,6,opt,name=role,def=*" json:"role,omitempty"` + // Used to indicate the current host from which the scheduler is + // registered in the Mesos Web UI. If set to an empty string Mesos + // will automagically set it to the current hostname. + Hostname *string `protobuf:"bytes,7,opt,name=hostname" json:"hostname,omitempty"` + // This field should match the credential's principal the framework + // uses for authentication. This field is used for framework API + // rate limiting and dynamic reservations. It should be set even + // if authentication is not enabled if these features are desired. + Principal *string `protobuf:"bytes,8,opt,name=principal" json:"principal,omitempty"` + // This field allows a framework to advertise its web UI, so that + // the Mesos web UI can link to it. It is expected to be a full URL, + // for example http://my-scheduler.example.com:8080/. + WebuiUrl *string `protobuf:"bytes,9,opt,name=webui_url" json:"webui_url,omitempty"` + // This field allows a framework to advertise its set of + // capabilities (e.g., ability to receive offers for revocable + // resources). + Capabilities []*FrameworkInfo_Capability `protobuf:"bytes,10,rep,name=capabilities" json:"capabilities,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *FrameworkInfo) Reset() { *m = FrameworkInfo{} } @@ -651,12 +770,35 @@ func (m *FrameworkInfo) GetWebuiUrl() string { return "" } +func (m *FrameworkInfo) GetCapabilities() []*FrameworkInfo_Capability { + if m != nil { + return m.Capabilities + } + return nil +} + +type FrameworkInfo_Capability struct { + Type *FrameworkInfo_Capability_Type `protobuf:"varint,1,req,name=type,enum=mesosproto.FrameworkInfo_Capability_Type" json:"type,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *FrameworkInfo_Capability) Reset() { *m = FrameworkInfo_Capability{} } +func (*FrameworkInfo_Capability) ProtoMessage() {} + +func (m *FrameworkInfo_Capability) GetType() FrameworkInfo_Capability_Type { + if m != nil && m.Type != nil { + return *m.Type + } + return FrameworkInfo_Capability_REVOCABLE_RESOURCES +} + // * // Describes a health check for a task or executor (or any arbitrary // process/command). A "strategy" is picked by specifying one of the -// optional fields, currently only 'http' and 'command' are -// supported. Specifying more than one strategy is an error. +// optional fields; currently only 'command' is supported. +// Specifying more than one strategy is an error. type HealthCheck struct { + // HTTP health check - not yet recommended for use, see MESOS-2533. Http *HealthCheck_HTTP `protobuf:"bytes,1,opt,name=http" json:"http,omitempty"` // Amount of time to wait until starting the health checks. DelaySeconds *float64 `protobuf:"fixed64,2,opt,name=delay_seconds,def=15" json:"delay_seconds,omitempty"` @@ -731,7 +873,8 @@ func (m *HealthCheck) GetCommand() *CommandInfo { return nil } -// Describes an HTTP health check. +// Describes an HTTP health check. This is not fully implemented and not +// recommended for use - see MESOS-2533. type HealthCheck_HTTP struct { // Port to send the HTTP request. Port *uint32 `protobuf:"varint,1,req,name=port" json:"port,omitempty"` @@ -862,10 +1005,25 @@ func (m *CommandInfo) GetUser() string { } type CommandInfo_URI struct { - Value *string `protobuf:"bytes,1,req,name=value" json:"value,omitempty"` - Executable *bool `protobuf:"varint,2,opt,name=executable" json:"executable,omitempty"` - Extract *bool `protobuf:"varint,3,opt,name=extract,def=1" json:"extract,omitempty"` - XXX_unrecognized []byte `json:"-"` + Value *string `protobuf:"bytes,1,req,name=value" json:"value,omitempty"` + Executable *bool `protobuf:"varint,2,opt,name=executable" json:"executable,omitempty"` + // In case the fetched file is recognized as an archive, extract + // its contents into the sandbox. Note that a cached archive is + // not copied from the cache to the sandbox in case extraction + // originates from an archive in the cache. + Extract *bool `protobuf:"varint,3,opt,name=extract,def=1" json:"extract,omitempty"` + // If this field is "true", the fetcher cache will be used. If not, + // fetching bypasses the cache and downloads directly into the + // sandbox directory, no matter whether a suitable cache file is + // available or not. The former directs the fetcher to download to + // the file cache, then copy from there to the sandbox. Subsequent + // fetch attempts with the same URI will omit downloading and copy + // from the cache as long as the file is resident there. Cache files + // may get evicted at any time, which then leads to renewed + // downloading. See also "docs/fetcher.md" and + // "docs/fetcher-cache-internals.md". + Cache *bool `protobuf:"varint,4,opt,name=cache" json:"cache,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *CommandInfo_URI) Reset() { *m = CommandInfo_URI{} } @@ -894,6 +1052,13 @@ func (m *CommandInfo_URI) GetExtract() bool { return Default_CommandInfo_URI_Extract } +func (m *CommandInfo_URI) GetCache() bool { + if m != nil && m.Cache != nil { + return *m.Cache + } + return false +} + // Describes a container. // Not all containerizers currently implement ContainerInfo, so it // is possible that a launched task will fail due to supplying this @@ -947,9 +1112,14 @@ type ExecutorInfo struct { // NOTE: Source is exposed alongside the resource usage of the // executor via JSON on the slave. This allows users to import // usage information into a time series database for monitoring. - Source *string `protobuf:"bytes,10,opt,name=source" json:"source,omitempty"` - Data []byte `protobuf:"bytes,4,opt,name=data" json:"data,omitempty"` - XXX_unrecognized []byte `json:"-"` + Source *string `protobuf:"bytes,10,opt,name=source" json:"source,omitempty"` + Data []byte `protobuf:"bytes,4,opt,name=data" json:"data,omitempty"` + // Service discovery information for the executor. It is not + // interpreted or acted upon by Mesos. It is up to a service + // discovery system to use this information as needed and to handle + // executors without service discovery information. + Discovery *DiscoveryInfo `protobuf:"bytes,12,opt,name=discovery" json:"discovery,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *ExecutorInfo) Reset() { *m = ExecutorInfo{} } @@ -1011,6 +1181,13 @@ func (m *ExecutorInfo) GetData() []byte { return nil } +func (m *ExecutorInfo) GetDiscovery() *DiscoveryInfo { + if m != nil { + return m.Discovery + } + return nil +} + // * // Describes a master. This will probably have more fields in the // future which might be used, for example, to link a framework webui @@ -1021,6 +1198,7 @@ type MasterInfo struct { Port *uint32 `protobuf:"varint,3,req,name=port,def=5050" json:"port,omitempty"` Pid *string `protobuf:"bytes,4,opt,name=pid" json:"pid,omitempty"` Hostname *string `protobuf:"bytes,5,opt,name=hostname" json:"hostname,omitempty"` + Version *string `protobuf:"bytes,6,opt,name=version" json:"version,omitempty"` XXX_unrecognized []byte `json:"-"` } @@ -1064,6 +1242,13 @@ func (m *MasterInfo) GetHostname() string { return "" } +func (m *MasterInfo) GetVersion() string { + if m != nil && m.Version != nil { + return *m.Version + } + return "" +} + // * // Describes a slave. Note that the 'id' field is only available after // a slave is registered with the master, and is made available here @@ -1071,13 +1256,15 @@ func (m *MasterInfo) GetHostname() string { // checkpointing its own information and potentially frameworks' // information (if a framework has checkpointing enabled). type SlaveInfo struct { - Hostname *string `protobuf:"bytes,1,req,name=hostname" json:"hostname,omitempty"` - Port *int32 `protobuf:"varint,8,opt,name=port,def=5051" json:"port,omitempty"` - Resources []*Resource `protobuf:"bytes,3,rep,name=resources" json:"resources,omitempty"` - Attributes []*Attribute `protobuf:"bytes,5,rep,name=attributes" json:"attributes,omitempty"` - Id *SlaveID `protobuf:"bytes,6,opt,name=id" json:"id,omitempty"` - Checkpoint *bool `protobuf:"varint,7,opt,name=checkpoint,def=0" json:"checkpoint,omitempty"` - XXX_unrecognized []byte `json:"-"` + Hostname *string `protobuf:"bytes,1,req,name=hostname" json:"hostname,omitempty"` + Port *int32 `protobuf:"varint,8,opt,name=port,def=5051" json:"port,omitempty"` + Resources []*Resource `protobuf:"bytes,3,rep,name=resources" json:"resources,omitempty"` + Attributes []*Attribute `protobuf:"bytes,5,rep,name=attributes" json:"attributes,omitempty"` + Id *SlaveID `protobuf:"bytes,6,opt,name=id" json:"id,omitempty"` + // TODO(joerg84): Remove checkpoint field as with 0.22.0 + // slave checkpointing is enabled for all slaves (MESOS-2317). + Checkpoint *bool `protobuf:"varint,7,opt,name=checkpoint,def=0" json:"checkpoint,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *SlaveInfo) Reset() { *m = SlaveInfo{} } @@ -1329,13 +1516,25 @@ func (m *Attribute) GetText() *Value_Text { // TODO(benh): Add better support for "expected" resources (e.g., // cpus, memory, disk, network). type Resource struct { - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - Type *Value_Type `protobuf:"varint,2,req,name=type,enum=mesosproto.Value_Type" json:"type,omitempty"` - Scalar *Value_Scalar `protobuf:"bytes,3,opt,name=scalar" json:"scalar,omitempty"` - Ranges *Value_Ranges `protobuf:"bytes,4,opt,name=ranges" json:"ranges,omitempty"` - Set *Value_Set `protobuf:"bytes,5,opt,name=set" json:"set,omitempty"` - Role *string `protobuf:"bytes,6,opt,name=role,def=*" json:"role,omitempty"` - XXX_unrecognized []byte `json:"-"` + Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` + Type *Value_Type `protobuf:"varint,2,req,name=type,enum=mesosproto.Value_Type" json:"type,omitempty"` + Scalar *Value_Scalar `protobuf:"bytes,3,opt,name=scalar" json:"scalar,omitempty"` + Ranges *Value_Ranges `protobuf:"bytes,4,opt,name=ranges" json:"ranges,omitempty"` + Set *Value_Set `protobuf:"bytes,5,opt,name=set" json:"set,omitempty"` + Role *string `protobuf:"bytes,6,opt,name=role,def=*" json:"role,omitempty"` + // If this is set, this resource was dynamically reserved by an + // operator or a framework. Otherwise, this resource is either unreserved + // or statically reserved by an operator via the --resources flag. + Reservation *Resource_ReservationInfo `protobuf:"bytes,8,opt,name=reservation" json:"reservation,omitempty"` + Disk *Resource_DiskInfo `protobuf:"bytes,7,opt,name=disk" json:"disk,omitempty"` + // If this is set, the resources are revocable, i.e., any tasks or + // executors launched using these resources could get preempted or + // throttled at any time. This could be used by frameworks to run + // best effort tasks that do not need strict uptime or performance + // guarantees. Note that if this is set, 'disk' or 'reservation' + // cannot be set. + Revocable *Resource_RevocableInfo `protobuf:"bytes,9,opt,name=revocable" json:"revocable,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *Resource) Reset() { *m = Resource{} } @@ -1385,10 +1584,232 @@ func (m *Resource) GetRole() string { return Default_Resource_Role } +func (m *Resource) GetReservation() *Resource_ReservationInfo { + if m != nil { + return m.Reservation + } + return nil +} + +func (m *Resource) GetDisk() *Resource_DiskInfo { + if m != nil { + return m.Disk + } + return nil +} + +func (m *Resource) GetRevocable() *Resource_RevocableInfo { + if m != nil { + return m.Revocable + } + return nil +} + +type Resource_ReservationInfo struct { + // This field indicates the principal of the operator or framework + // that reserved this resource. It is used in conjunction with the + // "unreserve" ACL to determine whether the entity attempting to + // unreserve this resource is permitted to do so. + // NOTE: This field should match the FrameworkInfo.principal of + // the framework that reserved this resource. + Principal *string `protobuf:"bytes,1,req,name=principal" json:"principal,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Resource_ReservationInfo) Reset() { *m = Resource_ReservationInfo{} } +func (*Resource_ReservationInfo) ProtoMessage() {} + +func (m *Resource_ReservationInfo) GetPrincipal() string { + if m != nil && m.Principal != nil { + return *m.Principal + } + return "" +} + +type Resource_DiskInfo struct { + Persistence *Resource_DiskInfo_Persistence `protobuf:"bytes,1,opt,name=persistence" json:"persistence,omitempty"` + // Describes how this disk resource will be mounted in the + // container. If not set, the disk resource will be used as the + // sandbox. Otherwise, it will be mounted according to the + // 'container_path' inside 'volume'. The 'host_path' inside + // 'volume' is ignored. + // NOTE: If 'volume' is set but 'persistence' is not set, the + // volume will be automatically garbage collected after + // task/executor terminates. Currently, if 'persistence' is set, + // 'volume' must be set. + Volume *Volume `protobuf:"bytes,2,opt,name=volume" json:"volume,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Resource_DiskInfo) Reset() { *m = Resource_DiskInfo{} } +func (*Resource_DiskInfo) ProtoMessage() {} + +func (m *Resource_DiskInfo) GetPersistence() *Resource_DiskInfo_Persistence { + if m != nil { + return m.Persistence + } + return nil +} + +func (m *Resource_DiskInfo) GetVolume() *Volume { + if m != nil { + return m.Volume + } + return nil +} + +// Describes a persistent disk volume. +// A persistent disk volume will not be automatically garbage +// collected if the task/executor/slave terminates, but is +// re-offered to the framework(s) belonging to the 'role'. +// A framework can set the ID (if it is not set yet) to express +// the intention to create a new persistent disk volume from a +// regular disk resource. To reuse a previously created volume, a +// framework can launch a task/executor when it receives an offer +// with a persistent volume, i.e., ID is set. +// NOTE: Currently, we do not allow a persistent disk volume +// without a reservation (i.e., 'role' should not be '*'). +type Resource_DiskInfo_Persistence struct { + // A unique ID for the persistent disk volume. + // NOTE: The ID needs to be unique per role on each slave. + Id *string `protobuf:"bytes,1,req,name=id" json:"id,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Resource_DiskInfo_Persistence) Reset() { *m = Resource_DiskInfo_Persistence{} } +func (*Resource_DiskInfo_Persistence) ProtoMessage() {} + +func (m *Resource_DiskInfo_Persistence) GetId() string { + if m != nil && m.Id != nil { + return *m.Id + } + return "" +} + +type Resource_RevocableInfo struct { + XXX_unrecognized []byte `json:"-"` +} + +func (m *Resource_RevocableInfo) Reset() { *m = Resource_RevocableInfo{} } +func (*Resource_RevocableInfo) ProtoMessage() {} + +// * +// When the network bandwidth caps are enabled and the container +// is over its limit, outbound packets may be either delayed or +// dropped completely either because it exceeds the maximum bandwidth +// allocation for a single container (the cap) or because the combined +// network traffic of multiple containers on the host exceeds the +// transmit capacity of the host (the share). We can report the +// following statistics for each of these conditions exported directly +// from the Linux Traffic Control Queueing Discipline. // +// id : name of the limiter, e.g. 'tx_bw_cap' +// backlog : number of packets currently delayed +// bytes : total bytes seen +// drops : number of packets dropped in total +// overlimits : number of packets which exceeded allocation +// packets : total packets seen +// qlen : number of packets currently queued +// rate_bps : throughput in bytes/sec +// rate_pps : throughput in packets/sec +// requeues : number of times a packet has been delayed due to +// locking or device contention issues +// +// More information on the operation of Linux Traffic Control can be +// found at http://www.lartc.org/lartc.html. +type TrafficControlStatistics struct { + Id *string `protobuf:"bytes,1,req,name=id" json:"id,omitempty"` + Backlog *uint64 `protobuf:"varint,2,opt,name=backlog" json:"backlog,omitempty"` + Bytes *uint64 `protobuf:"varint,3,opt,name=bytes" json:"bytes,omitempty"` + Drops *uint64 `protobuf:"varint,4,opt,name=drops" json:"drops,omitempty"` + Overlimits *uint64 `protobuf:"varint,5,opt,name=overlimits" json:"overlimits,omitempty"` + Packets *uint64 `protobuf:"varint,6,opt,name=packets" json:"packets,omitempty"` + Qlen *uint64 `protobuf:"varint,7,opt,name=qlen" json:"qlen,omitempty"` + Ratebps *uint64 `protobuf:"varint,8,opt,name=ratebps" json:"ratebps,omitempty"` + Ratepps *uint64 `protobuf:"varint,9,opt,name=ratepps" json:"ratepps,omitempty"` + Requeues *uint64 `protobuf:"varint,10,opt,name=requeues" json:"requeues,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *TrafficControlStatistics) Reset() { *m = TrafficControlStatistics{} } +func (*TrafficControlStatistics) ProtoMessage() {} + +func (m *TrafficControlStatistics) GetId() string { + if m != nil && m.Id != nil { + return *m.Id + } + return "" +} + +func (m *TrafficControlStatistics) GetBacklog() uint64 { + if m != nil && m.Backlog != nil { + return *m.Backlog + } + return 0 +} + +func (m *TrafficControlStatistics) GetBytes() uint64 { + if m != nil && m.Bytes != nil { + return *m.Bytes + } + return 0 +} + +func (m *TrafficControlStatistics) GetDrops() uint64 { + if m != nil && m.Drops != nil { + return *m.Drops + } + return 0 +} + +func (m *TrafficControlStatistics) GetOverlimits() uint64 { + if m != nil && m.Overlimits != nil { + return *m.Overlimits + } + return 0 +} + +func (m *TrafficControlStatistics) GetPackets() uint64 { + if m != nil && m.Packets != nil { + return *m.Packets + } + return 0 +} + +func (m *TrafficControlStatistics) GetQlen() uint64 { + if m != nil && m.Qlen != nil { + return *m.Qlen + } + return 0 +} + +func (m *TrafficControlStatistics) GetRatebps() uint64 { + if m != nil && m.Ratebps != nil { + return *m.Ratebps + } + return 0 +} + +func (m *TrafficControlStatistics) GetRatepps() uint64 { + if m != nil && m.Ratepps != nil { + return *m.Ratepps + } + return 0 +} + +func (m *TrafficControlStatistics) GetRequeues() uint64 { + if m != nil && m.Requeues != nil { + return *m.Requeues + } + return 0 +} + +// * // A snapshot of resource usage statistics. type ResourceStatistics struct { Timestamp *float64 `protobuf:"fixed64,1,req,name=timestamp" json:"timestamp,omitempty"` + Processes *uint32 `protobuf:"varint,30,opt,name=processes" json:"processes,omitempty"` + Threads *uint32 `protobuf:"varint,31,opt,name=threads" json:"threads,omitempty"` // CPU Usage Information: // Total CPU time spent in user mode, and kernel mode. CpusUserTimeSecs *float64 `protobuf:"fixed64,2,opt,name=cpus_user_time_secs" json:"cpus_user_time_secs,omitempty"` @@ -1399,14 +1820,42 @@ type ResourceStatistics struct { CpusNrPeriods *uint32 `protobuf:"varint,7,opt,name=cpus_nr_periods" json:"cpus_nr_periods,omitempty"` CpusNrThrottled *uint32 `protobuf:"varint,8,opt,name=cpus_nr_throttled" json:"cpus_nr_throttled,omitempty"` CpusThrottledTimeSecs *float64 `protobuf:"fixed64,9,opt,name=cpus_throttled_time_secs" json:"cpus_throttled_time_secs,omitempty"` - // Memory Usage Information: - MemRssBytes *uint64 `protobuf:"varint,5,opt,name=mem_rss_bytes" json:"mem_rss_bytes,omitempty"` - // Amount of memory resources allocated. + // mem_total_bytes was added in 0.23.0 to represent the total memory + // of a process in RAM (as opposed to in Swap). This was previously + // reported as mem_rss_bytes, which was also changed in 0.23.0 to + // represent only the anonymous memory usage, to keep in sync with + // Linux kernel's (arguably erroneous) use of terminology. + MemTotalBytes *uint64 `protobuf:"varint,36,opt,name=mem_total_bytes" json:"mem_total_bytes,omitempty"` + // Total memory + swap usage. This is set if swap is enabled. + MemTotalMemswBytes *uint64 `protobuf:"varint,37,opt,name=mem_total_memsw_bytes" json:"mem_total_memsw_bytes,omitempty"` + // Hard memory limit for a container. MemLimitBytes *uint64 `protobuf:"varint,6,opt,name=mem_limit_bytes" json:"mem_limit_bytes,omitempty"` - // Broken out memory usage information (files, anonymous, and mmaped files) - MemFileBytes *uint64 `protobuf:"varint,10,opt,name=mem_file_bytes" json:"mem_file_bytes,omitempty"` - MemAnonBytes *uint64 `protobuf:"varint,11,opt,name=mem_anon_bytes" json:"mem_anon_bytes,omitempty"` + // Soft memory limit for a container. + MemSoftLimitBytes *uint64 `protobuf:"varint,38,opt,name=mem_soft_limit_bytes" json:"mem_soft_limit_bytes,omitempty"` + // TODO(chzhcn) mem_file_bytes and mem_anon_bytes are deprecated in + // 0.23.0 and will be removed in 0.24.0. + MemFileBytes *uint64 `protobuf:"varint,10,opt,name=mem_file_bytes" json:"mem_file_bytes,omitempty"` + MemAnonBytes *uint64 `protobuf:"varint,11,opt,name=mem_anon_bytes" json:"mem_anon_bytes,omitempty"` + // mem_cache_bytes is added in 0.23.0 to represent page cache usage. + MemCacheBytes *uint64 `protobuf:"varint,39,opt,name=mem_cache_bytes" json:"mem_cache_bytes,omitempty"` + // Since 0.23.0, mem_rss_bytes is changed to represent only + // anonymous memory usage. Note that neither its requiredness, type, + // name nor numeric tag has been changed. + MemRssBytes *uint64 `protobuf:"varint,5,opt,name=mem_rss_bytes" json:"mem_rss_bytes,omitempty"` MemMappedFileBytes *uint64 `protobuf:"varint,12,opt,name=mem_mapped_file_bytes" json:"mem_mapped_file_bytes,omitempty"` + // This is only set if swap is enabled. + MemSwapBytes *uint64 `protobuf:"varint,40,opt,name=mem_swap_bytes" json:"mem_swap_bytes,omitempty"` + // Number of occurrences of different levels of memory pressure + // events reported by memory cgroup. Pressure listening (re)starts + // with these values set to 0 when slave (re)starts. See + // https://www.kernel.org/doc/Documentation/cgroups/memory.txt for + // more details. + MemLowPressureCounter *uint64 `protobuf:"varint,32,opt,name=mem_low_pressure_counter" json:"mem_low_pressure_counter,omitempty"` + MemMediumPressureCounter *uint64 `protobuf:"varint,33,opt,name=mem_medium_pressure_counter" json:"mem_medium_pressure_counter,omitempty"` + MemCriticalPressureCounter *uint64 `protobuf:"varint,34,opt,name=mem_critical_pressure_counter" json:"mem_critical_pressure_counter,omitempty"` + // Disk Usage Information for executor working directory. + DiskLimitBytes *uint64 `protobuf:"varint,26,opt,name=disk_limit_bytes" json:"disk_limit_bytes,omitempty"` + DiskUsedBytes *uint64 `protobuf:"varint,27,opt,name=disk_used_bytes" json:"disk_used_bytes,omitempty"` // Perf statistics. Perf *PerfStatistics `protobuf:"bytes,13,opt,name=perf" json:"perf,omitempty"` // Network Usage Information: @@ -1420,11 +1869,17 @@ type ResourceStatistics struct { NetTxDropped *uint64 `protobuf:"varint,21,opt,name=net_tx_dropped" json:"net_tx_dropped,omitempty"` // The kernel keeps track of RTT (round-trip time) for its TCP // sockets. RTT is a way to tell the latency of a container. - NetTcpRttMicrosecsP50 *float64 `protobuf:"fixed64,22,opt,name=net_tcp_rtt_microsecs_p50" json:"net_tcp_rtt_microsecs_p50,omitempty"` - NetTcpRttMicrosecsP90 *float64 `protobuf:"fixed64,23,opt,name=net_tcp_rtt_microsecs_p90" json:"net_tcp_rtt_microsecs_p90,omitempty"` - NetTcpRttMicrosecsP95 *float64 `protobuf:"fixed64,24,opt,name=net_tcp_rtt_microsecs_p95" json:"net_tcp_rtt_microsecs_p95,omitempty"` - NetTcpRttMicrosecsP99 *float64 `protobuf:"fixed64,25,opt,name=net_tcp_rtt_microsecs_p99" json:"net_tcp_rtt_microsecs_p99,omitempty"` - XXX_unrecognized []byte `json:"-"` + NetTcpRttMicrosecsP50 *float64 `protobuf:"fixed64,22,opt,name=net_tcp_rtt_microsecs_p50" json:"net_tcp_rtt_microsecs_p50,omitempty"` + NetTcpRttMicrosecsP90 *float64 `protobuf:"fixed64,23,opt,name=net_tcp_rtt_microsecs_p90" json:"net_tcp_rtt_microsecs_p90,omitempty"` + NetTcpRttMicrosecsP95 *float64 `protobuf:"fixed64,24,opt,name=net_tcp_rtt_microsecs_p95" json:"net_tcp_rtt_microsecs_p95,omitempty"` + NetTcpRttMicrosecsP99 *float64 `protobuf:"fixed64,25,opt,name=net_tcp_rtt_microsecs_p99" json:"net_tcp_rtt_microsecs_p99,omitempty"` + NetTcpActiveConnections *float64 `protobuf:"fixed64,28,opt,name=net_tcp_active_connections" json:"net_tcp_active_connections,omitempty"` + NetTcpTimeWaitConnections *float64 `protobuf:"fixed64,29,opt,name=net_tcp_time_wait_connections" json:"net_tcp_time_wait_connections,omitempty"` + // Network traffic flowing into or out of a container can be delayed + // or dropped due to congestion or policy inside and outside the + // container. + NetTrafficControlStatistics []*TrafficControlStatistics `protobuf:"bytes,35,rep,name=net_traffic_control_statistics" json:"net_traffic_control_statistics,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *ResourceStatistics) Reset() { *m = ResourceStatistics{} } @@ -1437,6 +1892,20 @@ func (m *ResourceStatistics) GetTimestamp() float64 { return 0 } +func (m *ResourceStatistics) GetProcesses() uint32 { + if m != nil && m.Processes != nil { + return *m.Processes + } + return 0 +} + +func (m *ResourceStatistics) GetThreads() uint32 { + if m != nil && m.Threads != nil { + return *m.Threads + } + return 0 +} + func (m *ResourceStatistics) GetCpusUserTimeSecs() float64 { if m != nil && m.CpusUserTimeSecs != nil { return *m.CpusUserTimeSecs @@ -1479,9 +1948,16 @@ func (m *ResourceStatistics) GetCpusThrottledTimeSecs() float64 { return 0 } -func (m *ResourceStatistics) GetMemRssBytes() uint64 { - if m != nil && m.MemRssBytes != nil { - return *m.MemRssBytes +func (m *ResourceStatistics) GetMemTotalBytes() uint64 { + if m != nil && m.MemTotalBytes != nil { + return *m.MemTotalBytes + } + return 0 +} + +func (m *ResourceStatistics) GetMemTotalMemswBytes() uint64 { + if m != nil && m.MemTotalMemswBytes != nil { + return *m.MemTotalMemswBytes } return 0 } @@ -1493,6 +1969,13 @@ func (m *ResourceStatistics) GetMemLimitBytes() uint64 { return 0 } +func (m *ResourceStatistics) GetMemSoftLimitBytes() uint64 { + if m != nil && m.MemSoftLimitBytes != nil { + return *m.MemSoftLimitBytes + } + return 0 +} + func (m *ResourceStatistics) GetMemFileBytes() uint64 { if m != nil && m.MemFileBytes != nil { return *m.MemFileBytes @@ -1507,6 +1990,20 @@ func (m *ResourceStatistics) GetMemAnonBytes() uint64 { return 0 } +func (m *ResourceStatistics) GetMemCacheBytes() uint64 { + if m != nil && m.MemCacheBytes != nil { + return *m.MemCacheBytes + } + return 0 +} + +func (m *ResourceStatistics) GetMemRssBytes() uint64 { + if m != nil && m.MemRssBytes != nil { + return *m.MemRssBytes + } + return 0 +} + func (m *ResourceStatistics) GetMemMappedFileBytes() uint64 { if m != nil && m.MemMappedFileBytes != nil { return *m.MemMappedFileBytes @@ -1514,37 +2011,79 @@ func (m *ResourceStatistics) GetMemMappedFileBytes() uint64 { return 0 } -func (m *ResourceStatistics) GetPerf() *PerfStatistics { - if m != nil { - return m.Perf +func (m *ResourceStatistics) GetMemSwapBytes() uint64 { + if m != nil && m.MemSwapBytes != nil { + return *m.MemSwapBytes } - return nil + return 0 } -func (m *ResourceStatistics) GetNetRxPackets() uint64 { - if m != nil && m.NetRxPackets != nil { - return *m.NetRxPackets +func (m *ResourceStatistics) GetMemLowPressureCounter() uint64 { + if m != nil && m.MemLowPressureCounter != nil { + return *m.MemLowPressureCounter } return 0 } -func (m *ResourceStatistics) GetNetRxBytes() uint64 { - if m != nil && m.NetRxBytes != nil { - return *m.NetRxBytes +func (m *ResourceStatistics) GetMemMediumPressureCounter() uint64 { + if m != nil && m.MemMediumPressureCounter != nil { + return *m.MemMediumPressureCounter } return 0 } -func (m *ResourceStatistics) GetNetRxErrors() uint64 { - if m != nil && m.NetRxErrors != nil { - return *m.NetRxErrors +func (m *ResourceStatistics) GetMemCriticalPressureCounter() uint64 { + if m != nil && m.MemCriticalPressureCounter != nil { + return *m.MemCriticalPressureCounter } return 0 } -func (m *ResourceStatistics) GetNetRxDropped() uint64 { - if m != nil && m.NetRxDropped != nil { - return *m.NetRxDropped +func (m *ResourceStatistics) GetDiskLimitBytes() uint64 { + if m != nil && m.DiskLimitBytes != nil { + return *m.DiskLimitBytes + } + return 0 +} + +func (m *ResourceStatistics) GetDiskUsedBytes() uint64 { + if m != nil && m.DiskUsedBytes != nil { + return *m.DiskUsedBytes + } + return 0 +} + +func (m *ResourceStatistics) GetPerf() *PerfStatistics { + if m != nil { + return m.Perf + } + return nil +} + +func (m *ResourceStatistics) GetNetRxPackets() uint64 { + if m != nil && m.NetRxPackets != nil { + return *m.NetRxPackets + } + return 0 +} + +func (m *ResourceStatistics) GetNetRxBytes() uint64 { + if m != nil && m.NetRxBytes != nil { + return *m.NetRxBytes + } + return 0 +} + +func (m *ResourceStatistics) GetNetRxErrors() uint64 { + if m != nil && m.NetRxErrors != nil { + return *m.NetRxErrors + } + return 0 +} + +func (m *ResourceStatistics) GetNetRxDropped() uint64 { + if m != nil && m.NetRxDropped != nil { + return *m.NetRxDropped } return 0 } @@ -1605,63 +2144,73 @@ func (m *ResourceStatistics) GetNetTcpRttMicrosecsP99() float64 { return 0 } +func (m *ResourceStatistics) GetNetTcpActiveConnections() float64 { + if m != nil && m.NetTcpActiveConnections != nil { + return *m.NetTcpActiveConnections + } + return 0 +} + +func (m *ResourceStatistics) GetNetTcpTimeWaitConnections() float64 { + if m != nil && m.NetTcpTimeWaitConnections != nil { + return *m.NetTcpTimeWaitConnections + } + return 0 +} + +func (m *ResourceStatistics) GetNetTrafficControlStatistics() []*TrafficControlStatistics { + if m != nil { + return m.NetTrafficControlStatistics + } + return nil +} + // * -// Describes a snapshot of the resource usage for an executor. -// -// TODO(bmahler): Note that we want to be sending this information -// to the master, and subsequently to the relevant scheduler. So -// this proto is designed to be easy for the scheduler to use, this -// is why we provide the slave id, executor info / task info. +// Describes a snapshot of the resource usage for executors. type ResourceUsage struct { - SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` - FrameworkId *FrameworkID `protobuf:"bytes,2,req,name=framework_id" json:"framework_id,omitempty"` - ExecutorId *ExecutorID `protobuf:"bytes,3,opt,name=executor_id" json:"executor_id,omitempty"` - ExecutorName *string `protobuf:"bytes,4,opt,name=executor_name" json:"executor_name,omitempty"` - TaskId *TaskID `protobuf:"bytes,5,opt,name=task_id" json:"task_id,omitempty"` - // If missing, the isolation module cannot provide resource usage. - Statistics *ResourceStatistics `protobuf:"bytes,6,opt,name=statistics" json:"statistics,omitempty"` - XXX_unrecognized []byte `json:"-"` + Executors []*ResourceUsage_Executor `protobuf:"bytes,1,rep,name=executors" json:"executors,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *ResourceUsage) Reset() { *m = ResourceUsage{} } func (*ResourceUsage) ProtoMessage() {} -func (m *ResourceUsage) GetSlaveId() *SlaveID { +func (m *ResourceUsage) GetExecutors() []*ResourceUsage_Executor { if m != nil { - return m.SlaveId + return m.Executors } return nil } -func (m *ResourceUsage) GetFrameworkId() *FrameworkID { - if m != nil { - return m.FrameworkId - } - return nil +type ResourceUsage_Executor struct { + ExecutorInfo *ExecutorInfo `protobuf:"bytes,1,req,name=executor_info" json:"executor_info,omitempty"` + // This includes resources used by the executor itself + // as well as its active tasks. + Allocated []*Resource `protobuf:"bytes,2,rep,name=allocated" json:"allocated,omitempty"` + // Current resource usage. If absent, the containerizer + // cannot provide resource usage. + Statistics *ResourceStatistics `protobuf:"bytes,3,opt,name=statistics" json:"statistics,omitempty"` + XXX_unrecognized []byte `json:"-"` } -func (m *ResourceUsage) GetExecutorId() *ExecutorID { +func (m *ResourceUsage_Executor) Reset() { *m = ResourceUsage_Executor{} } +func (*ResourceUsage_Executor) ProtoMessage() {} + +func (m *ResourceUsage_Executor) GetExecutorInfo() *ExecutorInfo { if m != nil { - return m.ExecutorId + return m.ExecutorInfo } return nil } -func (m *ResourceUsage) GetExecutorName() string { - if m != nil && m.ExecutorName != nil { - return *m.ExecutorName - } - return "" -} - -func (m *ResourceUsage) GetTaskId() *TaskID { +func (m *ResourceUsage_Executor) GetAllocated() []*Resource { if m != nil { - return m.TaskId + return m.Allocated } return nil } -func (m *ResourceUsage) GetStatistics() *ResourceStatistics { +func (m *ResourceUsage_Executor) GetStatistics() *ResourceStatistics { if m != nil { return m.Statistics } @@ -2118,6 +2667,8 @@ func (m *PerfStatistics) GetNodePrefetchMisses() uint64 { // to proactively influence the allocator. If 'slave_id' is provided // then this request is assumed to only apply to resources on that // slave. +// +// TODO(vinod): Remove this once the old driver is removed. type Request struct { SlaveId *SlaveID `protobuf:"bytes,1,opt,name=slave_id" json:"slave_id,omitempty"` Resources []*Resource `protobuf:"bytes,2,rep,name=resources" json:"resources,omitempty"` @@ -2207,6 +2758,137 @@ func (m *Offer) GetExecutorIds() []*ExecutorID { return nil } +// Defines an operation that can be performed against offers. +type Offer_Operation struct { + Type *Offer_Operation_Type `protobuf:"varint,1,req,name=type,enum=mesosproto.Offer_Operation_Type" json:"type,omitempty"` + Launch *Offer_Operation_Launch `protobuf:"bytes,2,opt,name=launch" json:"launch,omitempty"` + Reserve *Offer_Operation_Reserve `protobuf:"bytes,3,opt,name=reserve" json:"reserve,omitempty"` + Unreserve *Offer_Operation_Unreserve `protobuf:"bytes,4,opt,name=unreserve" json:"unreserve,omitempty"` + Create *Offer_Operation_Create `protobuf:"bytes,5,opt,name=create" json:"create,omitempty"` + Destroy *Offer_Operation_Destroy `protobuf:"bytes,6,opt,name=destroy" json:"destroy,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Offer_Operation) Reset() { *m = Offer_Operation{} } +func (*Offer_Operation) ProtoMessage() {} + +func (m *Offer_Operation) GetType() Offer_Operation_Type { + if m != nil && m.Type != nil { + return *m.Type + } + return Offer_Operation_LAUNCH +} + +func (m *Offer_Operation) GetLaunch() *Offer_Operation_Launch { + if m != nil { + return m.Launch + } + return nil +} + +func (m *Offer_Operation) GetReserve() *Offer_Operation_Reserve { + if m != nil { + return m.Reserve + } + return nil +} + +func (m *Offer_Operation) GetUnreserve() *Offer_Operation_Unreserve { + if m != nil { + return m.Unreserve + } + return nil +} + +func (m *Offer_Operation) GetCreate() *Offer_Operation_Create { + if m != nil { + return m.Create + } + return nil +} + +func (m *Offer_Operation) GetDestroy() *Offer_Operation_Destroy { + if m != nil { + return m.Destroy + } + return nil +} + +type Offer_Operation_Launch struct { + TaskInfos []*TaskInfo `protobuf:"bytes,1,rep,name=task_infos" json:"task_infos,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Offer_Operation_Launch) Reset() { *m = Offer_Operation_Launch{} } +func (*Offer_Operation_Launch) ProtoMessage() {} + +func (m *Offer_Operation_Launch) GetTaskInfos() []*TaskInfo { + if m != nil { + return m.TaskInfos + } + return nil +} + +type Offer_Operation_Reserve struct { + Resources []*Resource `protobuf:"bytes,1,rep,name=resources" json:"resources,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Offer_Operation_Reserve) Reset() { *m = Offer_Operation_Reserve{} } +func (*Offer_Operation_Reserve) ProtoMessage() {} + +func (m *Offer_Operation_Reserve) GetResources() []*Resource { + if m != nil { + return m.Resources + } + return nil +} + +type Offer_Operation_Unreserve struct { + Resources []*Resource `protobuf:"bytes,1,rep,name=resources" json:"resources,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Offer_Operation_Unreserve) Reset() { *m = Offer_Operation_Unreserve{} } +func (*Offer_Operation_Unreserve) ProtoMessage() {} + +func (m *Offer_Operation_Unreserve) GetResources() []*Resource { + if m != nil { + return m.Resources + } + return nil +} + +type Offer_Operation_Create struct { + Volumes []*Resource `protobuf:"bytes,1,rep,name=volumes" json:"volumes,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Offer_Operation_Create) Reset() { *m = Offer_Operation_Create{} } +func (*Offer_Operation_Create) ProtoMessage() {} + +func (m *Offer_Operation_Create) GetVolumes() []*Resource { + if m != nil { + return m.Volumes + } + return nil +} + +type Offer_Operation_Destroy struct { + Volumes []*Resource `protobuf:"bytes,1,rep,name=volumes" json:"volumes,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Offer_Operation_Destroy) Reset() { *m = Offer_Operation_Destroy{} } +func (*Offer_Operation_Destroy) ProtoMessage() {} + +func (m *Offer_Operation_Destroy) GetVolumes() []*Resource { + if m != nil { + return m.Volumes + } + return nil +} + // * // Describes a task. Passed from the scheduler all the way to an // executor (see SchedulerDriver::launchTasks and @@ -2226,8 +2908,19 @@ type TaskInfo struct { Data []byte `protobuf:"bytes,6,opt,name=data" json:"data,omitempty"` // A health check for the task (currently in *alpha* and initial // support will only be for TaskInfo's that have a CommandInfo). - HealthCheck *HealthCheck `protobuf:"bytes,8,opt,name=health_check" json:"health_check,omitempty"` - XXX_unrecognized []byte `json:"-"` + HealthCheck *HealthCheck `protobuf:"bytes,8,opt,name=health_check" json:"health_check,omitempty"` + // Labels are free-form key value pairs which are exposed through + // master and slave endpoints. Labels will not be interpreted or + // acted upon by Mesos itself. As opposed to the data field, labels + // will be kept in memory on master and slave processes. Therefore, + // labels should be used to tag tasks with light-weight meta-data. + Labels *Labels `protobuf:"bytes,10,opt,name=labels" json:"labels,omitempty"` + // Service discovery information for the task. It is not interpreted + // or acted upon by Mesos. It is up to a service discovery system + // to use this information as needed and to handle tasks without + // service discovery information. + Discovery *DiscoveryInfo `protobuf:"bytes,11,opt,name=discovery" json:"discovery,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *TaskInfo) Reset() { *m = TaskInfo{} } @@ -2296,6 +2989,20 @@ func (m *TaskInfo) GetHealthCheck() *HealthCheck { return nil } +func (m *TaskInfo) GetLabels() *Labels { + if m != nil { + return m.Labels + } + return nil +} + +func (m *TaskInfo) GetDiscovery() *DiscoveryInfo { + if m != nil { + return m.Discovery + } + return nil +} + // * // Describes the current status of a task. type TaskStatus struct { @@ -2308,6 +3015,16 @@ type TaskStatus struct { SlaveId *SlaveID `protobuf:"bytes,5,opt,name=slave_id" json:"slave_id,omitempty"` ExecutorId *ExecutorID `protobuf:"bytes,7,opt,name=executor_id" json:"executor_id,omitempty"` Timestamp *float64 `protobuf:"fixed64,6,opt,name=timestamp" json:"timestamp,omitempty"` + // Statuses that are delivered reliably to the scheduler will + // include a 'uuid'. The status is considered delivered once + // it is acknowledged by the scheduler. Schedulers can choose + // to either explicitly acknowledge statuses or let the scheduler + // driver implicitly acknowledge (default). + // + // TODO(bmahler): This is currently overwritten in the scheduler + // driver and executor driver, but executors will need to set this + // to a valid RFC-4122 UUID if using the HTTP API. + Uuid []byte `protobuf:"bytes,11,opt,name=uuid" json:"uuid,omitempty"` // Describes whether the task has been determined to be healthy // (true) or unhealthy (false) according to the HealthCheck field in // the command info. @@ -2381,6 +3098,13 @@ func (m *TaskStatus) GetTimestamp() float64 { return 0 } +func (m *TaskStatus) GetUuid() []byte { + if m != nil { + return m.Uuid + } + return nil +} + func (m *TaskStatus) GetHealthy() bool { if m != nil && m.Healthy != nil { return *m.Healthy @@ -2895,11 +3619,15 @@ type ContainerInfo_DockerInfo struct { PortMappings []*ContainerInfo_DockerInfo_PortMapping `protobuf:"bytes,3,rep,name=port_mappings" json:"port_mappings,omitempty"` Privileged *bool `protobuf:"varint,4,opt,name=privileged,def=0" json:"privileged,omitempty"` // Allowing arbitrary parameters to be passed to docker CLI. - // Note that anything passed to this field is not guranteed + // Note that anything passed to this field is not guaranteed // to be supported moving forward, as we might move away from // the docker CLI. - Parameters []*Parameter `protobuf:"bytes,5,rep,name=parameters" json:"parameters,omitempty"` - XXX_unrecognized []byte `json:"-"` + Parameters []*Parameter `protobuf:"bytes,5,rep,name=parameters" json:"parameters,omitempty"` + // With this flag set to true, the docker containerizer will + // pull the docker image from the registry even if the image + // is already downloaded on the slave. + ForcePullImage *bool `protobuf:"varint,6,opt,name=force_pull_image" json:"force_pull_image,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *ContainerInfo_DockerInfo) Reset() { *m = ContainerInfo_DockerInfo{} } @@ -2943,6 +3671,13 @@ func (m *ContainerInfo_DockerInfo) GetParameters() []*Parameter { return nil } +func (m *ContainerInfo_DockerInfo) GetForcePullImage() bool { + if m != nil && m.ForcePullImage != nil { + return *m.ForcePullImage + } + return false +} + type ContainerInfo_DockerInfo_PortMapping struct { HostPort *uint32 `protobuf:"varint,1,req,name=host_port" json:"host_port,omitempty"` ContainerPort *uint32 `protobuf:"varint,2,req,name=container_port" json:"container_port,omitempty"` @@ -2975,10588 +3710,11961 @@ func (m *ContainerInfo_DockerInfo_PortMapping) GetProtocol() string { return "" } -func init() { - proto.RegisterEnum("mesosproto.Status", Status_name, Status_value) - proto.RegisterEnum("mesosproto.TaskState", TaskState_name, TaskState_value) - proto.RegisterEnum("mesosproto.Value_Type", Value_Type_name, Value_Type_value) - proto.RegisterEnum("mesosproto.TaskStatus_Source", TaskStatus_Source_name, TaskStatus_Source_value) - proto.RegisterEnum("mesosproto.TaskStatus_Reason", TaskStatus_Reason_name, TaskStatus_Reason_value) - proto.RegisterEnum("mesosproto.ACL_Entity_Type", ACL_Entity_Type_name, ACL_Entity_Type_value) - proto.RegisterEnum("mesosproto.Volume_Mode", Volume_Mode_name, Volume_Mode_value) - proto.RegisterEnum("mesosproto.ContainerInfo_Type", ContainerInfo_Type_name, ContainerInfo_Type_value) - proto.RegisterEnum("mesosproto.ContainerInfo_DockerInfo_Network", ContainerInfo_DockerInfo_Network_name, ContainerInfo_DockerInfo_Network_value) +// * +// Collection of labels. +type Labels struct { + Labels []*Label `protobuf:"bytes,1,rep,name=labels" json:"labels,omitempty"` + XXX_unrecognized []byte `json:"-"` } -func (m *FrameworkID) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Value = &s - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy - } + +func (m *Labels) Reset() { *m = Labels{} } +func (*Labels) ProtoMessage() {} + +func (m *Labels) GetLabels() []*Label { + if m != nil { + return m.Labels } return nil } -func (m *OfferID) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Value = &s - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy - } + +// * +// Key, value pair used to store free form user-data. +type Label struct { + Key *string `protobuf:"bytes,1,req,name=key" json:"key,omitempty"` + Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Label) Reset() { *m = Label{} } +func (*Label) ProtoMessage() {} + +func (m *Label) GetKey() string { + if m != nil && m.Key != nil { + return *m.Key + } + return "" +} + +func (m *Label) GetValue() string { + if m != nil && m.Value != nil { + return *m.Value + } + return "" +} + +// * +// Named port used for service discovery. +type Port struct { + Number *uint32 `protobuf:"varint,1,req,name=number" json:"number,omitempty"` + Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` + Protocol *string `protobuf:"bytes,3,opt,name=protocol" json:"protocol,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Port) Reset() { *m = Port{} } +func (*Port) ProtoMessage() {} + +func (m *Port) GetNumber() uint32 { + if m != nil && m.Number != nil { + return *m.Number + } + return 0 +} + +func (m *Port) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +func (m *Port) GetProtocol() string { + if m != nil && m.Protocol != nil { + return *m.Protocol + } + return "" +} + +// * +// Collection of ports. +type Ports struct { + Ports []*Port `protobuf:"bytes,1,rep,name=ports" json:"ports,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Ports) Reset() { *m = Ports{} } +func (*Ports) ProtoMessage() {} + +func (m *Ports) GetPorts() []*Port { + if m != nil { + return m.Ports } return nil } -func (m *SlaveID) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Value = &s - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy - } + +// * +// Service discovery information. +// The visibility field restricts discovery within a framework +// (FRAMEWORK), within a Mesos cluster (CLUSTER), or places no +// restrictions (EXTERNAL). +// The environment, location, and version fields provide first class +// support for common attributes used to differentiate between +// similar services. The environment may receive values such as +// PROD/QA/DEV, the location field may receive values like +// EAST-US/WEST-US/EUROPE/AMEA, and the version field may receive +// values like v2.0/v0.9. The exact use of these fields is up to each +// service discovery system. +type DiscoveryInfo struct { + Visibility *DiscoveryInfo_Visibility `protobuf:"varint,1,req,name=visibility,enum=mesosproto.DiscoveryInfo_Visibility" json:"visibility,omitempty"` + Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` + Environment *string `protobuf:"bytes,3,opt,name=environment" json:"environment,omitempty"` + Location *string `protobuf:"bytes,4,opt,name=location" json:"location,omitempty"` + Version *string `protobuf:"bytes,5,opt,name=version" json:"version,omitempty"` + Ports *Ports `protobuf:"bytes,6,opt,name=ports" json:"ports,omitempty"` + Labels *Labels `protobuf:"bytes,7,opt,name=labels" json:"labels,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *DiscoveryInfo) Reset() { *m = DiscoveryInfo{} } +func (*DiscoveryInfo) ProtoMessage() {} + +func (m *DiscoveryInfo) GetVisibility() DiscoveryInfo_Visibility { + if m != nil && m.Visibility != nil { + return *m.Visibility + } + return DiscoveryInfo_FRAMEWORK +} + +func (m *DiscoveryInfo) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +func (m *DiscoveryInfo) GetEnvironment() string { + if m != nil && m.Environment != nil { + return *m.Environment + } + return "" +} + +func (m *DiscoveryInfo) GetLocation() string { + if m != nil && m.Location != nil { + return *m.Location + } + return "" +} + +func (m *DiscoveryInfo) GetVersion() string { + if m != nil && m.Version != nil { + return *m.Version + } + return "" +} + +func (m *DiscoveryInfo) GetPorts() *Ports { + if m != nil { + return m.Ports } return nil } -func (m *TaskID) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } + +func (m *DiscoveryInfo) GetLabels() *Labels { + if m != nil { + return m.Labels + } + return nil +} + +func init() { + proto.RegisterEnum("mesosproto.Status", Status_name, Status_value) + proto.RegisterEnum("mesosproto.TaskState", TaskState_name, TaskState_value) + proto.RegisterEnum("mesosproto.FrameworkInfo_Capability_Type", FrameworkInfo_Capability_Type_name, FrameworkInfo_Capability_Type_value) + proto.RegisterEnum("mesosproto.Value_Type", Value_Type_name, Value_Type_value) + proto.RegisterEnum("mesosproto.Offer_Operation_Type", Offer_Operation_Type_name, Offer_Operation_Type_value) + proto.RegisterEnum("mesosproto.TaskStatus_Source", TaskStatus_Source_name, TaskStatus_Source_value) + proto.RegisterEnum("mesosproto.TaskStatus_Reason", TaskStatus_Reason_name, TaskStatus_Reason_value) + proto.RegisterEnum("mesosproto.ACL_Entity_Type", ACL_Entity_Type_name, ACL_Entity_Type_value) + proto.RegisterEnum("mesosproto.Volume_Mode", Volume_Mode_name, Volume_Mode_value) + proto.RegisterEnum("mesosproto.ContainerInfo_Type", ContainerInfo_Type_name, ContainerInfo_Type_value) + proto.RegisterEnum("mesosproto.ContainerInfo_DockerInfo_Network", ContainerInfo_DockerInfo_Network_name, ContainerInfo_DockerInfo_Network_value) + proto.RegisterEnum("mesosproto.DiscoveryInfo_Visibility", DiscoveryInfo_Visibility_name, DiscoveryInfo_Visibility_value) +} +func (this *FrameworkID) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Value = &s - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*FrameworkID) + if !ok { + return fmt.Errorf("that is not of type *FrameworkID") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *FrameworkID but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *FrameworkIDbut is not nil && this == nil") + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) } + } else if this.Value != nil { + return fmt.Errorf("this.Value == nil && that.Value != nil") + } else if that1.Value != nil { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *ExecutorID) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *FrameworkID) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Value = &s - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return false + } + + that1, ok := that.(*FrameworkID) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return false + } + } else if this.Value != nil { + return false + } else if that1.Value != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *OfferID) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*OfferID) + if !ok { + return fmt.Errorf("that is not of type *OfferID") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *OfferID but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *OfferIDbut is not nil && this == nil") + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) } + } else if this.Value != nil { + return fmt.Errorf("this.Value == nil && that.Value != nil") + } else if that1.Value != nil { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *ContainerID) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *OfferID) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Value = &s - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return false + } + + that1, ok := that.(*OfferID) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return false + } + } else if this.Value != nil { + return false + } else if that1.Value != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *SlaveID) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*SlaveID) + if !ok { + return fmt.Errorf("that is not of type *SlaveID") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *SlaveID but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *SlaveIDbut is not nil && this == nil") + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) } + } else if this.Value != nil { + return fmt.Errorf("this.Value == nil && that.Value != nil") + } else if that1.Value != nil { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *FrameworkInfo) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *SlaveID) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.User = &s - index = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Name = &s - index = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Id == nil { - m.Id = &FrameworkID{} - } - if err := m.Id.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 4: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field FailoverTimeout", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.FailoverTimeout = &v2 - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Checkpoint", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Checkpoint = &b - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Role = &s - index = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Hostname = &s - index = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Principal", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Principal = &s - index = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field WebuiUrl", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.WebuiUrl = &s - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return false + } + + that1, ok := that.(*SlaveID) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true } + return false + } else if this == nil { + return false } - return nil + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return false + } + } else if this.Value != nil { + return false + } else if that1.Value != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true } -func (m *HealthCheck) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *TaskID) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Http", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Http == nil { - m.Http = &HealthCheck_HTTP{} - } - if err := m.Http.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field DelaySeconds", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.DelaySeconds = &v2 - case 3: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field IntervalSeconds", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.IntervalSeconds = &v2 - case 4: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeoutSeconds", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.TimeoutSeconds = &v2 - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsecutiveFailures", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.ConsecutiveFailures = &v - case 6: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field GracePeriodSeconds", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.GracePeriodSeconds = &v2 - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Command", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Command == nil { - m.Command = &CommandInfo{} - } - if err := m.Command.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*TaskID) + if !ok { + return fmt.Errorf("that is not of type *TaskID") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *TaskID but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *TaskIDbut is not nil && this == nil") + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) } + } else if this.Value != nil { + return fmt.Errorf("this.Value == nil && that.Value != nil") + } else if that1.Value != nil { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *HealthCheck_HTTP) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Port = &v - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Path = &s - index = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Statuses", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Statuses = append(m.Statuses, v) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy +func (this *TaskID) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } + return false } - return nil -} -func (m *CommandInfo) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } + + that1, ok := that.(*TaskID) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Container == nil { - m.Container = &CommandInfo_ContainerInfo{} - } - if err := m.Container.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Uris", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Uris = append(m.Uris, &CommandInfo_URI{}) - m.Uris[len(m.Uris)-1].Unmarshal(data[index:postIndex]) - index = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Environment", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Environment == nil { - m.Environment = &Environment{} - } - if err := m.Environment.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Shell", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Shell = &b - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Value = &s - index = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Arguments", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Arguments = append(m.Arguments, string(data[index:postIndex])) - index = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.User = &s - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return false + } else if this == nil { + return false + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return false } + } else if this.Value != nil { + return false + } else if that1.Value != nil { + return false } - return nil + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true } -func (m *CommandInfo_URI) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Value = &s - index = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Executable", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Executable = &b - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Extract", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Extract = &b - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy +func (this *ExecutorID) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*ExecutorID) + if !ok { + return fmt.Errorf("that is not of type *ExecutorID") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *ExecutorID but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *ExecutorIDbut is not nil && this == nil") + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) } + } else if this.Value != nil { + return fmt.Errorf("this.Value == nil && that.Value != nil") + } else if that1.Value != nil { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *CommandInfo_ContainerInfo) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *ExecutorID) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Image = &s - index = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Options = append(m.Options, string(data[index:postIndex])) - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return false + } + + that1, ok := that.(*ExecutorID) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return false + } + } else if this.Value != nil { + return false + } else if that1.Value != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *ContainerID) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*ContainerID) + if !ok { + return fmt.Errorf("that is not of type *ContainerID") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *ContainerID but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *ContainerIDbut is not nil && this == nil") + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) } + } else if this.Value != nil { + return fmt.Errorf("this.Value == nil && that.Value != nil") + } else if that1.Value != nil { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *ExecutorInfo) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *ContainerID) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutorId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutorId == nil { - m.ExecutorId = &ExecutorID{} - } - if err := m.ExecutorId.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Command", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Command == nil { - m.Command = &CommandInfo{} - } - if err := m.Command.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Container == nil { - m.Container = &ContainerInfo{} - } - if err := m.Container.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Resources = append(m.Resources, &Resource{}) - m.Resources[len(m.Resources)-1].Unmarshal(data[index:postIndex]) - index = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Name = &s - index = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Source = &s - index = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append([]byte{}, data[index:postIndex]...) - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return false + } + + that1, ok := that.(*ContainerID) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return false + } + } else if this.Value != nil { + return false + } else if that1.Value != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *FrameworkInfo) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*FrameworkInfo) + if !ok { + return fmt.Errorf("that is not of type *FrameworkInfo") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *FrameworkInfo but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *FrameworkInfobut is not nil && this == nil") + } + if this.User != nil && that1.User != nil { + if *this.User != *that1.User { + return fmt.Errorf("User this(%v) Not Equal that(%v)", *this.User, *that1.User) + } + } else if this.User != nil { + return fmt.Errorf("this.User == nil && that.User != nil") + } else if that1.User != nil { + return fmt.Errorf("User this(%v) Not Equal that(%v)", this.User, that1.User) + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) + } + } else if this.Name != nil { + return fmt.Errorf("this.Name == nil && that.Name != nil") + } else if that1.Name != nil { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) + } + if !this.Id.Equal(that1.Id) { + return fmt.Errorf("Id this(%v) Not Equal that(%v)", this.Id, that1.Id) + } + if this.FailoverTimeout != nil && that1.FailoverTimeout != nil { + if *this.FailoverTimeout != *that1.FailoverTimeout { + return fmt.Errorf("FailoverTimeout this(%v) Not Equal that(%v)", *this.FailoverTimeout, *that1.FailoverTimeout) + } + } else if this.FailoverTimeout != nil { + return fmt.Errorf("this.FailoverTimeout == nil && that.FailoverTimeout != nil") + } else if that1.FailoverTimeout != nil { + return fmt.Errorf("FailoverTimeout this(%v) Not Equal that(%v)", this.FailoverTimeout, that1.FailoverTimeout) + } + if this.Checkpoint != nil && that1.Checkpoint != nil { + if *this.Checkpoint != *that1.Checkpoint { + return fmt.Errorf("Checkpoint this(%v) Not Equal that(%v)", *this.Checkpoint, *that1.Checkpoint) } + } else if this.Checkpoint != nil { + return fmt.Errorf("this.Checkpoint == nil && that.Checkpoint != nil") + } else if that1.Checkpoint != nil { + return fmt.Errorf("Checkpoint this(%v) Not Equal that(%v)", this.Checkpoint, that1.Checkpoint) + } + if this.Role != nil && that1.Role != nil { + if *this.Role != *that1.Role { + return fmt.Errorf("Role this(%v) Not Equal that(%v)", *this.Role, *that1.Role) + } + } else if this.Role != nil { + return fmt.Errorf("this.Role == nil && that.Role != nil") + } else if that1.Role != nil { + return fmt.Errorf("Role this(%v) Not Equal that(%v)", this.Role, that1.Role) + } + if this.Hostname != nil && that1.Hostname != nil { + if *this.Hostname != *that1.Hostname { + return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", *this.Hostname, *that1.Hostname) + } + } else if this.Hostname != nil { + return fmt.Errorf("this.Hostname == nil && that.Hostname != nil") + } else if that1.Hostname != nil { + return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", this.Hostname, that1.Hostname) + } + if this.Principal != nil && that1.Principal != nil { + if *this.Principal != *that1.Principal { + return fmt.Errorf("Principal this(%v) Not Equal that(%v)", *this.Principal, *that1.Principal) + } + } else if this.Principal != nil { + return fmt.Errorf("this.Principal == nil && that.Principal != nil") + } else if that1.Principal != nil { + return fmt.Errorf("Principal this(%v) Not Equal that(%v)", this.Principal, that1.Principal) + } + if this.WebuiUrl != nil && that1.WebuiUrl != nil { + if *this.WebuiUrl != *that1.WebuiUrl { + return fmt.Errorf("WebuiUrl this(%v) Not Equal that(%v)", *this.WebuiUrl, *that1.WebuiUrl) + } + } else if this.WebuiUrl != nil { + return fmt.Errorf("this.WebuiUrl == nil && that.WebuiUrl != nil") + } else if that1.WebuiUrl != nil { + return fmt.Errorf("WebuiUrl this(%v) Not Equal that(%v)", this.WebuiUrl, that1.WebuiUrl) + } + if len(this.Capabilities) != len(that1.Capabilities) { + return fmt.Errorf("Capabilities this(%v) Not Equal that(%v)", len(this.Capabilities), len(that1.Capabilities)) + } + for i := range this.Capabilities { + if !this.Capabilities[i].Equal(that1.Capabilities[i]) { + return fmt.Errorf("Capabilities this[%v](%v) Not Equal that[%v](%v)", i, this.Capabilities[i], i, that1.Capabilities[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *MasterInfo) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *FrameworkInfo) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Id = &s - index = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Ip", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Ip = &v - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Port = &v - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Pid = &s - index = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Hostname = &s - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return false + } + + that1, ok := that.(*FrameworkInfo) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true } + return false + } else if this == nil { + return false } - return nil -} -func (m *SlaveInfo) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } + if this.User != nil && that1.User != nil { + if *this.User != *that1.User { + return false } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Hostname = &s - index = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (int32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Port = &v - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Resources = append(m.Resources, &Resource{}) - m.Resources[len(m.Resources)-1].Unmarshal(data[index:postIndex]) - index = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Attributes = append(m.Attributes, &Attribute{}) - m.Attributes[len(m.Attributes)-1].Unmarshal(data[index:postIndex]) - index = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Id == nil { - m.Id = &SlaveID{} - } - if err := m.Id.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Checkpoint", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Checkpoint = &b - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + } else if this.User != nil { + return false + } else if that1.User != nil { + return false + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return false } + } else if this.Name != nil { + return false + } else if that1.Name != nil { + return false } - return nil -} -func (m *Value) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } + if !this.Id.Equal(that1.Id) { + return false + } + if this.FailoverTimeout != nil && that1.FailoverTimeout != nil { + if *this.FailoverTimeout != *that1.FailoverTimeout { + return false } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v Value_Type - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (Value_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Scalar", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Scalar == nil { - m.Scalar = &Value_Scalar{} - } - if err := m.Scalar.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ranges", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Ranges == nil { - m.Ranges = &Value_Ranges{} - } - if err := m.Ranges.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Set", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Set == nil { - m.Set = &Value_Set{} - } - if err := m.Set.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Text", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Text == nil { - m.Text = &Value_Text{} - } - if err := m.Text.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + } else if this.FailoverTimeout != nil { + return false + } else if that1.FailoverTimeout != nil { + return false + } + if this.Checkpoint != nil && that1.Checkpoint != nil { + if *this.Checkpoint != *that1.Checkpoint { + return false } + } else if this.Checkpoint != nil { + return false + } else if that1.Checkpoint != nil { + return false } - return nil -} -func (m *Value_Scalar) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } + if this.Role != nil && that1.Role != nil { + if *this.Role != *that1.Role { + return false } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.Value = &v2 - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + } else if this.Role != nil { + return false + } else if that1.Role != nil { + return false + } + if this.Hostname != nil && that1.Hostname != nil { + if *this.Hostname != *that1.Hostname { + return false } + } else if this.Hostname != nil { + return false + } else if that1.Hostname != nil { + return false } - return nil -} -func (m *Value_Range) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } + if this.Principal != nil && that1.Principal != nil { + if *this.Principal != *that1.Principal { + return false } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Begin", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Begin = &v - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field End", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.End = &v - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + } else if this.Principal != nil { + return false + } else if that1.Principal != nil { + return false + } + if this.WebuiUrl != nil && that1.WebuiUrl != nil { + if *this.WebuiUrl != *that1.WebuiUrl { + return false } + } else if this.WebuiUrl != nil { + return false + } else if that1.WebuiUrl != nil { + return false } - return nil + if len(this.Capabilities) != len(that1.Capabilities) { + return false + } + for i := range this.Capabilities { + if !this.Capabilities[i].Equal(that1.Capabilities[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true } -func (m *Value_Ranges) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *FrameworkInfo_Capability) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Range", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Range = append(m.Range, &Value_Range{}) - m.Range[len(m.Range)-1].Unmarshal(data[index:postIndex]) - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*FrameworkInfo_Capability) + if !ok { + return fmt.Errorf("that is not of type *FrameworkInfo_Capability") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *FrameworkInfo_Capability but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *FrameworkInfo_Capabilitybut is not nil && this == nil") + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) } + } else if this.Type != nil { + return fmt.Errorf("this.Type == nil && that.Type != nil") + } else if that1.Type != nil { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *Value_Set) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *FrameworkInfo_Capability) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Item", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Item = append(m.Item, string(data[index:postIndex])) - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return false + } + + that1, ok := that.(*FrameworkInfo_Capability) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true } + return false + } else if this == nil { + return false } - return nil + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return false + } + } else if this.Type != nil { + return false + } else if that1.Type != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true } -func (m *Value_Text) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *HealthCheck) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Value = &s - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*HealthCheck) + if !ok { + return fmt.Errorf("that is not of type *HealthCheck") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *HealthCheck but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *HealthCheckbut is not nil && this == nil") + } + if !this.Http.Equal(that1.Http) { + return fmt.Errorf("Http this(%v) Not Equal that(%v)", this.Http, that1.Http) + } + if this.DelaySeconds != nil && that1.DelaySeconds != nil { + if *this.DelaySeconds != *that1.DelaySeconds { + return fmt.Errorf("DelaySeconds this(%v) Not Equal that(%v)", *this.DelaySeconds, *that1.DelaySeconds) + } + } else if this.DelaySeconds != nil { + return fmt.Errorf("this.DelaySeconds == nil && that.DelaySeconds != nil") + } else if that1.DelaySeconds != nil { + return fmt.Errorf("DelaySeconds this(%v) Not Equal that(%v)", this.DelaySeconds, that1.DelaySeconds) + } + if this.IntervalSeconds != nil && that1.IntervalSeconds != nil { + if *this.IntervalSeconds != *that1.IntervalSeconds { + return fmt.Errorf("IntervalSeconds this(%v) Not Equal that(%v)", *this.IntervalSeconds, *that1.IntervalSeconds) + } + } else if this.IntervalSeconds != nil { + return fmt.Errorf("this.IntervalSeconds == nil && that.IntervalSeconds != nil") + } else if that1.IntervalSeconds != nil { + return fmt.Errorf("IntervalSeconds this(%v) Not Equal that(%v)", this.IntervalSeconds, that1.IntervalSeconds) + } + if this.TimeoutSeconds != nil && that1.TimeoutSeconds != nil { + if *this.TimeoutSeconds != *that1.TimeoutSeconds { + return fmt.Errorf("TimeoutSeconds this(%v) Not Equal that(%v)", *this.TimeoutSeconds, *that1.TimeoutSeconds) + } + } else if this.TimeoutSeconds != nil { + return fmt.Errorf("this.TimeoutSeconds == nil && that.TimeoutSeconds != nil") + } else if that1.TimeoutSeconds != nil { + return fmt.Errorf("TimeoutSeconds this(%v) Not Equal that(%v)", this.TimeoutSeconds, that1.TimeoutSeconds) + } + if this.ConsecutiveFailures != nil && that1.ConsecutiveFailures != nil { + if *this.ConsecutiveFailures != *that1.ConsecutiveFailures { + return fmt.Errorf("ConsecutiveFailures this(%v) Not Equal that(%v)", *this.ConsecutiveFailures, *that1.ConsecutiveFailures) } + } else if this.ConsecutiveFailures != nil { + return fmt.Errorf("this.ConsecutiveFailures == nil && that.ConsecutiveFailures != nil") + } else if that1.ConsecutiveFailures != nil { + return fmt.Errorf("ConsecutiveFailures this(%v) Not Equal that(%v)", this.ConsecutiveFailures, that1.ConsecutiveFailures) + } + if this.GracePeriodSeconds != nil && that1.GracePeriodSeconds != nil { + if *this.GracePeriodSeconds != *that1.GracePeriodSeconds { + return fmt.Errorf("GracePeriodSeconds this(%v) Not Equal that(%v)", *this.GracePeriodSeconds, *that1.GracePeriodSeconds) + } + } else if this.GracePeriodSeconds != nil { + return fmt.Errorf("this.GracePeriodSeconds == nil && that.GracePeriodSeconds != nil") + } else if that1.GracePeriodSeconds != nil { + return fmt.Errorf("GracePeriodSeconds this(%v) Not Equal that(%v)", this.GracePeriodSeconds, that1.GracePeriodSeconds) + } + if !this.Command.Equal(that1.Command) { + return fmt.Errorf("Command this(%v) Not Equal that(%v)", this.Command, that1.Command) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *Attribute) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *HealthCheck) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Name = &s - index = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v Value_Type - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (Value_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Scalar", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Scalar == nil { - m.Scalar = &Value_Scalar{} - } - if err := m.Scalar.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ranges", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Ranges == nil { - m.Ranges = &Value_Ranges{} - } - if err := m.Ranges.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Set", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Set == nil { - m.Set = &Value_Set{} - } - if err := m.Set.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Text", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Text == nil { - m.Text = &Value_Text{} - } - if err := m.Text.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return false + } + + that1, ok := that.(*HealthCheck) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true } + return false + } else if this == nil { + return false + } + if !this.Http.Equal(that1.Http) { + return false + } + if this.DelaySeconds != nil && that1.DelaySeconds != nil { + if *this.DelaySeconds != *that1.DelaySeconds { + return false + } + } else if this.DelaySeconds != nil { + return false + } else if that1.DelaySeconds != nil { + return false + } + if this.IntervalSeconds != nil && that1.IntervalSeconds != nil { + if *this.IntervalSeconds != *that1.IntervalSeconds { + return false + } + } else if this.IntervalSeconds != nil { + return false + } else if that1.IntervalSeconds != nil { + return false + } + if this.TimeoutSeconds != nil && that1.TimeoutSeconds != nil { + if *this.TimeoutSeconds != *that1.TimeoutSeconds { + return false + } + } else if this.TimeoutSeconds != nil { + return false + } else if that1.TimeoutSeconds != nil { + return false + } + if this.ConsecutiveFailures != nil && that1.ConsecutiveFailures != nil { + if *this.ConsecutiveFailures != *that1.ConsecutiveFailures { + return false + } + } else if this.ConsecutiveFailures != nil { + return false + } else if that1.ConsecutiveFailures != nil { + return false + } + if this.GracePeriodSeconds != nil && that1.GracePeriodSeconds != nil { + if *this.GracePeriodSeconds != *that1.GracePeriodSeconds { + return false + } + } else if this.GracePeriodSeconds != nil { + return false + } else if that1.GracePeriodSeconds != nil { + return false + } + if !this.Command.Equal(that1.Command) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *HealthCheck_HTTP) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*HealthCheck_HTTP) + if !ok { + return fmt.Errorf("that is not of type *HealthCheck_HTTP") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *HealthCheck_HTTP but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *HealthCheck_HTTPbut is not nil && this == nil") + } + if this.Port != nil && that1.Port != nil { + if *this.Port != *that1.Port { + return fmt.Errorf("Port this(%v) Not Equal that(%v)", *this.Port, *that1.Port) + } + } else if this.Port != nil { + return fmt.Errorf("this.Port == nil && that.Port != nil") + } else if that1.Port != nil { + return fmt.Errorf("Port this(%v) Not Equal that(%v)", this.Port, that1.Port) + } + if this.Path != nil && that1.Path != nil { + if *this.Path != *that1.Path { + return fmt.Errorf("Path this(%v) Not Equal that(%v)", *this.Path, *that1.Path) + } + } else if this.Path != nil { + return fmt.Errorf("this.Path == nil && that.Path != nil") + } else if that1.Path != nil { + return fmt.Errorf("Path this(%v) Not Equal that(%v)", this.Path, that1.Path) + } + if len(this.Statuses) != len(that1.Statuses) { + return fmt.Errorf("Statuses this(%v) Not Equal that(%v)", len(this.Statuses), len(that1.Statuses)) + } + for i := range this.Statuses { + if this.Statuses[i] != that1.Statuses[i] { + return fmt.Errorf("Statuses this[%v](%v) Not Equal that[%v](%v)", i, this.Statuses[i], i, that1.Statuses[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *Resource) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *HealthCheck_HTTP) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Name = &s - index = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v Value_Type - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (Value_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Scalar", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Scalar == nil { - m.Scalar = &Value_Scalar{} - } - if err := m.Scalar.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ranges", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Ranges == nil { - m.Ranges = &Value_Ranges{} - } - if err := m.Ranges.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Set", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Set == nil { - m.Set = &Value_Set{} - } - if err := m.Set.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Role = &s - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return false + } + + that1, ok := that.(*HealthCheck_HTTP) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Port != nil && that1.Port != nil { + if *this.Port != *that1.Port { + return false + } + } else if this.Port != nil { + return false + } else if that1.Port != nil { + return false + } + if this.Path != nil && that1.Path != nil { + if *this.Path != *that1.Path { + return false + } + } else if this.Path != nil { + return false + } else if that1.Path != nil { + return false + } + if len(this.Statuses) != len(that1.Statuses) { + return false + } + for i := range this.Statuses { + if this.Statuses[i] != that1.Statuses[i] { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *CommandInfo) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*CommandInfo) + if !ok { + return fmt.Errorf("that is not of type *CommandInfo") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *CommandInfo but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *CommandInfobut is not nil && this == nil") + } + if !this.Container.Equal(that1.Container) { + return fmt.Errorf("Container this(%v) Not Equal that(%v)", this.Container, that1.Container) + } + if len(this.Uris) != len(that1.Uris) { + return fmt.Errorf("Uris this(%v) Not Equal that(%v)", len(this.Uris), len(that1.Uris)) + } + for i := range this.Uris { + if !this.Uris[i].Equal(that1.Uris[i]) { + return fmt.Errorf("Uris this[%v](%v) Not Equal that[%v](%v)", i, this.Uris[i], i, that1.Uris[i]) + } + } + if !this.Environment.Equal(that1.Environment) { + return fmt.Errorf("Environment this(%v) Not Equal that(%v)", this.Environment, that1.Environment) + } + if this.Shell != nil && that1.Shell != nil { + if *this.Shell != *that1.Shell { + return fmt.Errorf("Shell this(%v) Not Equal that(%v)", *this.Shell, *that1.Shell) + } + } else if this.Shell != nil { + return fmt.Errorf("this.Shell == nil && that.Shell != nil") + } else if that1.Shell != nil { + return fmt.Errorf("Shell this(%v) Not Equal that(%v)", this.Shell, that1.Shell) + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) + } + } else if this.Value != nil { + return fmt.Errorf("this.Value == nil && that.Value != nil") + } else if that1.Value != nil { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + } + if len(this.Arguments) != len(that1.Arguments) { + return fmt.Errorf("Arguments this(%v) Not Equal that(%v)", len(this.Arguments), len(that1.Arguments)) + } + for i := range this.Arguments { + if this.Arguments[i] != that1.Arguments[i] { + return fmt.Errorf("Arguments this[%v](%v) Not Equal that[%v](%v)", i, this.Arguments[i], i, that1.Arguments[i]) + } + } + if this.User != nil && that1.User != nil { + if *this.User != *that1.User { + return fmt.Errorf("User this(%v) Not Equal that(%v)", *this.User, *that1.User) } + } else if this.User != nil { + return fmt.Errorf("this.User == nil && that.User != nil") + } else if that1.User != nil { + return fmt.Errorf("User this(%v) Not Equal that(%v)", this.User, that1.User) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *ResourceStatistics) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *CommandInfo) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.Timestamp = &v2 - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field CpusUserTimeSecs", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.CpusUserTimeSecs = &v2 - case 3: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field CpusSystemTimeSecs", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.CpusSystemTimeSecs = &v2 - case 4: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field CpusLimit", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.CpusLimit = &v2 - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CpusNrPeriods", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.CpusNrPeriods = &v - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CpusNrThrottled", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.CpusNrThrottled = &v - case 9: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field CpusThrottledTimeSecs", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.CpusThrottledTimeSecs = &v2 - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemRssBytes", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MemRssBytes = &v - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemLimitBytes", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MemLimitBytes = &v - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemFileBytes", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MemFileBytes = &v - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemAnonBytes", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MemAnonBytes = &v - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemMappedFileBytes", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MemMappedFileBytes = &v - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Perf", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Perf == nil { - m.Perf = &PerfStatistics{} - } - if err := m.Perf.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 14: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NetRxPackets", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NetRxPackets = &v - case 15: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NetRxBytes", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NetRxBytes = &v - case 16: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NetRxErrors", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NetRxErrors = &v - case 17: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NetRxDropped", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NetRxDropped = &v - case 18: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NetTxPackets", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NetTxPackets = &v - case 19: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NetTxBytes", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NetTxBytes = &v - case 20: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NetTxErrors", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NetTxErrors = &v - case 21: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NetTxDropped", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NetTxDropped = &v - case 22: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field NetTcpRttMicrosecsP50", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.NetTcpRttMicrosecsP50 = &v2 - case 23: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field NetTcpRttMicrosecsP90", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.NetTcpRttMicrosecsP90 = &v2 - case 24: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field NetTcpRttMicrosecsP95", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.NetTcpRttMicrosecsP95 = &v2 - case 25: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field NetTcpRttMicrosecsP99", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.NetTcpRttMicrosecsP99 = &v2 - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy - } - } - return nil -} -func (m *ResourceUsage) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutorId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutorId == nil { - m.ExecutorId = &ExecutorID{} - } - if err := m.ExecutorId.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutorName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.ExecutorName = &s - index = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TaskId == nil { - m.TaskId = &TaskID{} - } - if err := m.TaskId.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Statistics", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Statistics == nil { - m.Statistics = &ResourceStatistics{} - } - if err := m.Statistics.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy - } - } - return nil -} -func (m *PerfStatistics) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.Timestamp = &v2 - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.Duration = &v2 - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Cycles", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Cycles = &v - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StalledCyclesFrontend", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.StalledCyclesFrontend = &v - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StalledCyclesBackend", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.StalledCyclesBackend = &v - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Instructions", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Instructions = &v - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CacheReferences", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.CacheReferences = &v - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CacheMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.CacheMisses = &v - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Branches", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Branches = &v - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BranchMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.BranchMisses = &v - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BusCycles", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.BusCycles = &v - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RefCycles", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.RefCycles = &v - case 13: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field CpuClock", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.CpuClock = &v2 - case 14: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskClock", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.TaskClock = &v2 - case 15: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PageFaults", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.PageFaults = &v - case 16: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinorFaults", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MinorFaults = &v - case 17: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MajorFaults", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MajorFaults = &v - case 18: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ContextSwitches", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.ContextSwitches = &v - case 19: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CpuMigrations", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.CpuMigrations = &v - case 20: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AlignmentFaults", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.AlignmentFaults = &v - case 21: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EmulationFaults", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.EmulationFaults = &v - case 22: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L1DcacheLoads", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.L1DcacheLoads = &v - case 23: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L1DcacheLoadMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.L1DcacheLoadMisses = &v - case 24: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L1DcacheStores", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.L1DcacheStores = &v - case 25: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L1DcacheStoreMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.L1DcacheStoreMisses = &v - case 26: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L1DcachePrefetches", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.L1DcachePrefetches = &v - case 27: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L1DcachePrefetchMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.L1DcachePrefetchMisses = &v - case 28: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L1IcacheLoads", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.L1IcacheLoads = &v - case 29: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L1IcacheLoadMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.L1IcacheLoadMisses = &v - case 30: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L1IcachePrefetches", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.L1IcachePrefetches = &v - case 31: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L1IcachePrefetchMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.L1IcachePrefetchMisses = &v - case 32: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LlcLoads", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.LlcLoads = &v - case 33: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LlcLoadMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.LlcLoadMisses = &v - case 34: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LlcStores", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.LlcStores = &v - case 35: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LlcStoreMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.LlcStoreMisses = &v - case 36: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LlcPrefetches", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.LlcPrefetches = &v - case 37: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LlcPrefetchMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.LlcPrefetchMisses = &v - case 38: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DtlbLoads", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.DtlbLoads = &v - case 39: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DtlbLoadMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.DtlbLoadMisses = &v - case 40: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DtlbStores", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.DtlbStores = &v - case 41: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DtlbStoreMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.DtlbStoreMisses = &v - case 42: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DtlbPrefetches", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.DtlbPrefetches = &v - case 43: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DtlbPrefetchMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.DtlbPrefetchMisses = &v - case 44: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ItlbLoads", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.ItlbLoads = &v - case 45: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ItlbLoadMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.ItlbLoadMisses = &v - case 46: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BranchLoads", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.BranchLoads = &v - case 47: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BranchLoadMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.BranchLoadMisses = &v - case 48: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeLoads", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NodeLoads = &v - case 49: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeLoadMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NodeLoadMisses = &v - case 50: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeStores", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NodeStores = &v - case 51: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeStoreMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NodeStoreMisses = &v - case 52: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NodePrefetches", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NodePrefetches = &v - case 53: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NodePrefetchMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NodePrefetchMisses = &v - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return false + } + + that1, ok := that.(*CommandInfo) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if !this.Container.Equal(that1.Container) { + return false + } + if len(this.Uris) != len(that1.Uris) { + return false + } + for i := range this.Uris { + if !this.Uris[i].Equal(that1.Uris[i]) { + return false + } + } + if !this.Environment.Equal(that1.Environment) { + return false + } + if this.Shell != nil && that1.Shell != nil { + if *this.Shell != *that1.Shell { + return false + } + } else if this.Shell != nil { + return false + } else if that1.Shell != nil { + return false + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return false + } + } else if this.Value != nil { + return false + } else if that1.Value != nil { + return false + } + if len(this.Arguments) != len(that1.Arguments) { + return false + } + for i := range this.Arguments { + if this.Arguments[i] != that1.Arguments[i] { + return false + } + } + if this.User != nil && that1.User != nil { + if *this.User != *that1.User { + return false + } + } else if this.User != nil { + return false + } else if that1.User != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *CommandInfo_URI) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*CommandInfo_URI) + if !ok { + return fmt.Errorf("that is not of type *CommandInfo_URI") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *CommandInfo_URI but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *CommandInfo_URIbut is not nil && this == nil") + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) + } + } else if this.Value != nil { + return fmt.Errorf("this.Value == nil && that.Value != nil") + } else if that1.Value != nil { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + } + if this.Executable != nil && that1.Executable != nil { + if *this.Executable != *that1.Executable { + return fmt.Errorf("Executable this(%v) Not Equal that(%v)", *this.Executable, *that1.Executable) + } + } else if this.Executable != nil { + return fmt.Errorf("this.Executable == nil && that.Executable != nil") + } else if that1.Executable != nil { + return fmt.Errorf("Executable this(%v) Not Equal that(%v)", this.Executable, that1.Executable) + } + if this.Extract != nil && that1.Extract != nil { + if *this.Extract != *that1.Extract { + return fmt.Errorf("Extract this(%v) Not Equal that(%v)", *this.Extract, *that1.Extract) + } + } else if this.Extract != nil { + return fmt.Errorf("this.Extract == nil && that.Extract != nil") + } else if that1.Extract != nil { + return fmt.Errorf("Extract this(%v) Not Equal that(%v)", this.Extract, that1.Extract) + } + if this.Cache != nil && that1.Cache != nil { + if *this.Cache != *that1.Cache { + return fmt.Errorf("Cache this(%v) Not Equal that(%v)", *this.Cache, *that1.Cache) + } + } else if this.Cache != nil { + return fmt.Errorf("this.Cache == nil && that.Cache != nil") + } else if that1.Cache != nil { + return fmt.Errorf("Cache this(%v) Not Equal that(%v)", this.Cache, that1.Cache) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *CommandInfo_URI) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*CommandInfo_URI) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return false + } + } else if this.Value != nil { + return false + } else if that1.Value != nil { + return false + } + if this.Executable != nil && that1.Executable != nil { + if *this.Executable != *that1.Executable { + return false + } + } else if this.Executable != nil { + return false + } else if that1.Executable != nil { + return false + } + if this.Extract != nil && that1.Extract != nil { + if *this.Extract != *that1.Extract { + return false + } + } else if this.Extract != nil { + return false + } else if that1.Extract != nil { + return false + } + if this.Cache != nil && that1.Cache != nil { + if *this.Cache != *that1.Cache { + return false + } + } else if this.Cache != nil { + return false + } else if that1.Cache != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *CommandInfo_ContainerInfo) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*CommandInfo_ContainerInfo) + if !ok { + return fmt.Errorf("that is not of type *CommandInfo_ContainerInfo") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *CommandInfo_ContainerInfo but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *CommandInfo_ContainerInfobut is not nil && this == nil") + } + if this.Image != nil && that1.Image != nil { + if *this.Image != *that1.Image { + return fmt.Errorf("Image this(%v) Not Equal that(%v)", *this.Image, *that1.Image) + } + } else if this.Image != nil { + return fmt.Errorf("this.Image == nil && that.Image != nil") + } else if that1.Image != nil { + return fmt.Errorf("Image this(%v) Not Equal that(%v)", this.Image, that1.Image) + } + if len(this.Options) != len(that1.Options) { + return fmt.Errorf("Options this(%v) Not Equal that(%v)", len(this.Options), len(that1.Options)) + } + for i := range this.Options { + if this.Options[i] != that1.Options[i] { + return fmt.Errorf("Options this[%v](%v) Not Equal that[%v](%v)", i, this.Options[i], i, that1.Options[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *CommandInfo_ContainerInfo) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*CommandInfo_ContainerInfo) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Image != nil && that1.Image != nil { + if *this.Image != *that1.Image { + return false + } + } else if this.Image != nil { + return false + } else if that1.Image != nil { + return false + } + if len(this.Options) != len(that1.Options) { + return false + } + for i := range this.Options { + if this.Options[i] != that1.Options[i] { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *ExecutorInfo) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*ExecutorInfo) + if !ok { + return fmt.Errorf("that is not of type *ExecutorInfo") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *ExecutorInfo but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *ExecutorInfobut is not nil && this == nil") + } + if !this.ExecutorId.Equal(that1.ExecutorId) { + return fmt.Errorf("ExecutorId this(%v) Not Equal that(%v)", this.ExecutorId, that1.ExecutorId) + } + if !this.FrameworkId.Equal(that1.FrameworkId) { + return fmt.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) + } + if !this.Command.Equal(that1.Command) { + return fmt.Errorf("Command this(%v) Not Equal that(%v)", this.Command, that1.Command) + } + if !this.Container.Equal(that1.Container) { + return fmt.Errorf("Container this(%v) Not Equal that(%v)", this.Container, that1.Container) + } + if len(this.Resources) != len(that1.Resources) { + return fmt.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) + } + for i := range this.Resources { + if !this.Resources[i].Equal(that1.Resources[i]) { + return fmt.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) + } + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) + } + } else if this.Name != nil { + return fmt.Errorf("this.Name == nil && that.Name != nil") + } else if that1.Name != nil { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) + } + if this.Source != nil && that1.Source != nil { + if *this.Source != *that1.Source { + return fmt.Errorf("Source this(%v) Not Equal that(%v)", *this.Source, *that1.Source) + } + } else if this.Source != nil { + return fmt.Errorf("this.Source == nil && that.Source != nil") + } else if that1.Source != nil { + return fmt.Errorf("Source this(%v) Not Equal that(%v)", this.Source, that1.Source) + } + if !bytes.Equal(this.Data, that1.Data) { + return fmt.Errorf("Data this(%v) Not Equal that(%v)", this.Data, that1.Data) + } + if !this.Discovery.Equal(that1.Discovery) { + return fmt.Errorf("Discovery this(%v) Not Equal that(%v)", this.Discovery, that1.Discovery) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *ExecutorInfo) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*ExecutorInfo) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if !this.ExecutorId.Equal(that1.ExecutorId) { + return false + } + if !this.FrameworkId.Equal(that1.FrameworkId) { + return false + } + if !this.Command.Equal(that1.Command) { + return false + } + if !this.Container.Equal(that1.Container) { + return false + } + if len(this.Resources) != len(that1.Resources) { + return false + } + for i := range this.Resources { + if !this.Resources[i].Equal(that1.Resources[i]) { + return false + } + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return false + } + } else if this.Name != nil { + return false + } else if that1.Name != nil { + return false + } + if this.Source != nil && that1.Source != nil { + if *this.Source != *that1.Source { + return false + } + } else if this.Source != nil { + return false + } else if that1.Source != nil { + return false + } + if !bytes.Equal(this.Data, that1.Data) { + return false + } + if !this.Discovery.Equal(that1.Discovery) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *MasterInfo) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*MasterInfo) + if !ok { + return fmt.Errorf("that is not of type *MasterInfo") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *MasterInfo but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *MasterInfobut is not nil && this == nil") + } + if this.Id != nil && that1.Id != nil { + if *this.Id != *that1.Id { + return fmt.Errorf("Id this(%v) Not Equal that(%v)", *this.Id, *that1.Id) + } + } else if this.Id != nil { + return fmt.Errorf("this.Id == nil && that.Id != nil") + } else if that1.Id != nil { + return fmt.Errorf("Id this(%v) Not Equal that(%v)", this.Id, that1.Id) + } + if this.Ip != nil && that1.Ip != nil { + if *this.Ip != *that1.Ip { + return fmt.Errorf("Ip this(%v) Not Equal that(%v)", *this.Ip, *that1.Ip) + } + } else if this.Ip != nil { + return fmt.Errorf("this.Ip == nil && that.Ip != nil") + } else if that1.Ip != nil { + return fmt.Errorf("Ip this(%v) Not Equal that(%v)", this.Ip, that1.Ip) + } + if this.Port != nil && that1.Port != nil { + if *this.Port != *that1.Port { + return fmt.Errorf("Port this(%v) Not Equal that(%v)", *this.Port, *that1.Port) + } + } else if this.Port != nil { + return fmt.Errorf("this.Port == nil && that.Port != nil") + } else if that1.Port != nil { + return fmt.Errorf("Port this(%v) Not Equal that(%v)", this.Port, that1.Port) + } + if this.Pid != nil && that1.Pid != nil { + if *this.Pid != *that1.Pid { + return fmt.Errorf("Pid this(%v) Not Equal that(%v)", *this.Pid, *that1.Pid) + } + } else if this.Pid != nil { + return fmt.Errorf("this.Pid == nil && that.Pid != nil") + } else if that1.Pid != nil { + return fmt.Errorf("Pid this(%v) Not Equal that(%v)", this.Pid, that1.Pid) + } + if this.Hostname != nil && that1.Hostname != nil { + if *this.Hostname != *that1.Hostname { + return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", *this.Hostname, *that1.Hostname) + } + } else if this.Hostname != nil { + return fmt.Errorf("this.Hostname == nil && that.Hostname != nil") + } else if that1.Hostname != nil { + return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", this.Hostname, that1.Hostname) + } + if this.Version != nil && that1.Version != nil { + if *this.Version != *that1.Version { + return fmt.Errorf("Version this(%v) Not Equal that(%v)", *this.Version, *that1.Version) + } + } else if this.Version != nil { + return fmt.Errorf("this.Version == nil && that.Version != nil") + } else if that1.Version != nil { + return fmt.Errorf("Version this(%v) Not Equal that(%v)", this.Version, that1.Version) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *MasterInfo) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*MasterInfo) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Id != nil && that1.Id != nil { + if *this.Id != *that1.Id { + return false + } + } else if this.Id != nil { + return false + } else if that1.Id != nil { + return false + } + if this.Ip != nil && that1.Ip != nil { + if *this.Ip != *that1.Ip { + return false + } + } else if this.Ip != nil { + return false + } else if that1.Ip != nil { + return false + } + if this.Port != nil && that1.Port != nil { + if *this.Port != *that1.Port { + return false + } + } else if this.Port != nil { + return false + } else if that1.Port != nil { + return false + } + if this.Pid != nil && that1.Pid != nil { + if *this.Pid != *that1.Pid { + return false + } + } else if this.Pid != nil { + return false + } else if that1.Pid != nil { + return false + } + if this.Hostname != nil && that1.Hostname != nil { + if *this.Hostname != *that1.Hostname { + return false + } + } else if this.Hostname != nil { + return false + } else if that1.Hostname != nil { + return false + } + if this.Version != nil && that1.Version != nil { + if *this.Version != *that1.Version { + return false + } + } else if this.Version != nil { + return false + } else if that1.Version != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *SlaveInfo) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*SlaveInfo) + if !ok { + return fmt.Errorf("that is not of type *SlaveInfo") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *SlaveInfo but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *SlaveInfobut is not nil && this == nil") + } + if this.Hostname != nil && that1.Hostname != nil { + if *this.Hostname != *that1.Hostname { + return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", *this.Hostname, *that1.Hostname) + } + } else if this.Hostname != nil { + return fmt.Errorf("this.Hostname == nil && that.Hostname != nil") + } else if that1.Hostname != nil { + return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", this.Hostname, that1.Hostname) + } + if this.Port != nil && that1.Port != nil { + if *this.Port != *that1.Port { + return fmt.Errorf("Port this(%v) Not Equal that(%v)", *this.Port, *that1.Port) + } + } else if this.Port != nil { + return fmt.Errorf("this.Port == nil && that.Port != nil") + } else if that1.Port != nil { + return fmt.Errorf("Port this(%v) Not Equal that(%v)", this.Port, that1.Port) + } + if len(this.Resources) != len(that1.Resources) { + return fmt.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) + } + for i := range this.Resources { + if !this.Resources[i].Equal(that1.Resources[i]) { + return fmt.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) + } + } + if len(this.Attributes) != len(that1.Attributes) { + return fmt.Errorf("Attributes this(%v) Not Equal that(%v)", len(this.Attributes), len(that1.Attributes)) + } + for i := range this.Attributes { + if !this.Attributes[i].Equal(that1.Attributes[i]) { + return fmt.Errorf("Attributes this[%v](%v) Not Equal that[%v](%v)", i, this.Attributes[i], i, that1.Attributes[i]) + } + } + if !this.Id.Equal(that1.Id) { + return fmt.Errorf("Id this(%v) Not Equal that(%v)", this.Id, that1.Id) + } + if this.Checkpoint != nil && that1.Checkpoint != nil { + if *this.Checkpoint != *that1.Checkpoint { + return fmt.Errorf("Checkpoint this(%v) Not Equal that(%v)", *this.Checkpoint, *that1.Checkpoint) + } + } else if this.Checkpoint != nil { + return fmt.Errorf("this.Checkpoint == nil && that.Checkpoint != nil") + } else if that1.Checkpoint != nil { + return fmt.Errorf("Checkpoint this(%v) Not Equal that(%v)", this.Checkpoint, that1.Checkpoint) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *SlaveInfo) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*SlaveInfo) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Hostname != nil && that1.Hostname != nil { + if *this.Hostname != *that1.Hostname { + return false + } + } else if this.Hostname != nil { + return false + } else if that1.Hostname != nil { + return false + } + if this.Port != nil && that1.Port != nil { + if *this.Port != *that1.Port { + return false + } + } else if this.Port != nil { + return false + } else if that1.Port != nil { + return false + } + if len(this.Resources) != len(that1.Resources) { + return false + } + for i := range this.Resources { + if !this.Resources[i].Equal(that1.Resources[i]) { + return false + } + } + if len(this.Attributes) != len(that1.Attributes) { + return false + } + for i := range this.Attributes { + if !this.Attributes[i].Equal(that1.Attributes[i]) { + return false + } + } + if !this.Id.Equal(that1.Id) { + return false + } + if this.Checkpoint != nil && that1.Checkpoint != nil { + if *this.Checkpoint != *that1.Checkpoint { + return false + } + } else if this.Checkpoint != nil { + return false + } else if that1.Checkpoint != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Value) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Value) + if !ok { + return fmt.Errorf("that is not of type *Value") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Value but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Valuebut is not nil && this == nil") + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) + } + } else if this.Type != nil { + return fmt.Errorf("this.Type == nil && that.Type != nil") + } else if that1.Type != nil { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) + } + if !this.Scalar.Equal(that1.Scalar) { + return fmt.Errorf("Scalar this(%v) Not Equal that(%v)", this.Scalar, that1.Scalar) + } + if !this.Ranges.Equal(that1.Ranges) { + return fmt.Errorf("Ranges this(%v) Not Equal that(%v)", this.Ranges, that1.Ranges) + } + if !this.Set.Equal(that1.Set) { + return fmt.Errorf("Set this(%v) Not Equal that(%v)", this.Set, that1.Set) + } + if !this.Text.Equal(that1.Text) { + return fmt.Errorf("Text this(%v) Not Equal that(%v)", this.Text, that1.Text) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Value) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Value) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return false + } + } else if this.Type != nil { + return false + } else if that1.Type != nil { + return false + } + if !this.Scalar.Equal(that1.Scalar) { + return false + } + if !this.Ranges.Equal(that1.Ranges) { + return false + } + if !this.Set.Equal(that1.Set) { + return false + } + if !this.Text.Equal(that1.Text) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Value_Scalar) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Value_Scalar) + if !ok { + return fmt.Errorf("that is not of type *Value_Scalar") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Value_Scalar but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Value_Scalarbut is not nil && this == nil") + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) + } + } else if this.Value != nil { + return fmt.Errorf("this.Value == nil && that.Value != nil") + } else if that1.Value != nil { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Value_Scalar) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Value_Scalar) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return false + } + } else if this.Value != nil { + return false + } else if that1.Value != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Value_Range) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Value_Range) + if !ok { + return fmt.Errorf("that is not of type *Value_Range") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Value_Range but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Value_Rangebut is not nil && this == nil") + } + if this.Begin != nil && that1.Begin != nil { + if *this.Begin != *that1.Begin { + return fmt.Errorf("Begin this(%v) Not Equal that(%v)", *this.Begin, *that1.Begin) + } + } else if this.Begin != nil { + return fmt.Errorf("this.Begin == nil && that.Begin != nil") + } else if that1.Begin != nil { + return fmt.Errorf("Begin this(%v) Not Equal that(%v)", this.Begin, that1.Begin) + } + if this.End != nil && that1.End != nil { + if *this.End != *that1.End { + return fmt.Errorf("End this(%v) Not Equal that(%v)", *this.End, *that1.End) + } + } else if this.End != nil { + return fmt.Errorf("this.End == nil && that.End != nil") + } else if that1.End != nil { + return fmt.Errorf("End this(%v) Not Equal that(%v)", this.End, that1.End) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Value_Range) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Value_Range) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Begin != nil && that1.Begin != nil { + if *this.Begin != *that1.Begin { + return false + } + } else if this.Begin != nil { + return false + } else if that1.Begin != nil { + return false + } + if this.End != nil && that1.End != nil { + if *this.End != *that1.End { + return false + } + } else if this.End != nil { + return false + } else if that1.End != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Value_Ranges) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Value_Ranges) + if !ok { + return fmt.Errorf("that is not of type *Value_Ranges") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Value_Ranges but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Value_Rangesbut is not nil && this == nil") + } + if len(this.Range) != len(that1.Range) { + return fmt.Errorf("Range this(%v) Not Equal that(%v)", len(this.Range), len(that1.Range)) + } + for i := range this.Range { + if !this.Range[i].Equal(that1.Range[i]) { + return fmt.Errorf("Range this[%v](%v) Not Equal that[%v](%v)", i, this.Range[i], i, that1.Range[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Value_Ranges) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Value_Ranges) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if len(this.Range) != len(that1.Range) { + return false + } + for i := range this.Range { + if !this.Range[i].Equal(that1.Range[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Value_Set) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Value_Set) + if !ok { + return fmt.Errorf("that is not of type *Value_Set") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Value_Set but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Value_Setbut is not nil && this == nil") + } + if len(this.Item) != len(that1.Item) { + return fmt.Errorf("Item this(%v) Not Equal that(%v)", len(this.Item), len(that1.Item)) + } + for i := range this.Item { + if this.Item[i] != that1.Item[i] { + return fmt.Errorf("Item this[%v](%v) Not Equal that[%v](%v)", i, this.Item[i], i, that1.Item[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Value_Set) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Value_Set) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if len(this.Item) != len(that1.Item) { + return false + } + for i := range this.Item { + if this.Item[i] != that1.Item[i] { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Value_Text) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Value_Text) + if !ok { + return fmt.Errorf("that is not of type *Value_Text") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Value_Text but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Value_Textbut is not nil && this == nil") + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) + } + } else if this.Value != nil { + return fmt.Errorf("this.Value == nil && that.Value != nil") + } else if that1.Value != nil { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Value_Text) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Value_Text) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return false + } + } else if this.Value != nil { + return false + } else if that1.Value != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Attribute) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Attribute) + if !ok { + return fmt.Errorf("that is not of type *Attribute") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Attribute but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Attributebut is not nil && this == nil") + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) + } + } else if this.Name != nil { + return fmt.Errorf("this.Name == nil && that.Name != nil") + } else if that1.Name != nil { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) + } + } else if this.Type != nil { + return fmt.Errorf("this.Type == nil && that.Type != nil") + } else if that1.Type != nil { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) + } + if !this.Scalar.Equal(that1.Scalar) { + return fmt.Errorf("Scalar this(%v) Not Equal that(%v)", this.Scalar, that1.Scalar) + } + if !this.Ranges.Equal(that1.Ranges) { + return fmt.Errorf("Ranges this(%v) Not Equal that(%v)", this.Ranges, that1.Ranges) + } + if !this.Set.Equal(that1.Set) { + return fmt.Errorf("Set this(%v) Not Equal that(%v)", this.Set, that1.Set) + } + if !this.Text.Equal(that1.Text) { + return fmt.Errorf("Text this(%v) Not Equal that(%v)", this.Text, that1.Text) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Attribute) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Attribute) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return false + } + } else if this.Name != nil { + return false + } else if that1.Name != nil { + return false + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return false + } + } else if this.Type != nil { + return false + } else if that1.Type != nil { + return false + } + if !this.Scalar.Equal(that1.Scalar) { + return false + } + if !this.Ranges.Equal(that1.Ranges) { + return false + } + if !this.Set.Equal(that1.Set) { + return false + } + if !this.Text.Equal(that1.Text) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Resource) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Resource) + if !ok { + return fmt.Errorf("that is not of type *Resource") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Resource but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Resourcebut is not nil && this == nil") + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) + } + } else if this.Name != nil { + return fmt.Errorf("this.Name == nil && that.Name != nil") + } else if that1.Name != nil { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) + } + } else if this.Type != nil { + return fmt.Errorf("this.Type == nil && that.Type != nil") + } else if that1.Type != nil { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) + } + if !this.Scalar.Equal(that1.Scalar) { + return fmt.Errorf("Scalar this(%v) Not Equal that(%v)", this.Scalar, that1.Scalar) + } + if !this.Ranges.Equal(that1.Ranges) { + return fmt.Errorf("Ranges this(%v) Not Equal that(%v)", this.Ranges, that1.Ranges) + } + if !this.Set.Equal(that1.Set) { + return fmt.Errorf("Set this(%v) Not Equal that(%v)", this.Set, that1.Set) + } + if this.Role != nil && that1.Role != nil { + if *this.Role != *that1.Role { + return fmt.Errorf("Role this(%v) Not Equal that(%v)", *this.Role, *that1.Role) + } + } else if this.Role != nil { + return fmt.Errorf("this.Role == nil && that.Role != nil") + } else if that1.Role != nil { + return fmt.Errorf("Role this(%v) Not Equal that(%v)", this.Role, that1.Role) + } + if !this.Reservation.Equal(that1.Reservation) { + return fmt.Errorf("Reservation this(%v) Not Equal that(%v)", this.Reservation, that1.Reservation) + } + if !this.Disk.Equal(that1.Disk) { + return fmt.Errorf("Disk this(%v) Not Equal that(%v)", this.Disk, that1.Disk) + } + if !this.Revocable.Equal(that1.Revocable) { + return fmt.Errorf("Revocable this(%v) Not Equal that(%v)", this.Revocable, that1.Revocable) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Resource) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Resource) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return false + } + } else if this.Name != nil { + return false + } else if that1.Name != nil { + return false + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return false + } + } else if this.Type != nil { + return false + } else if that1.Type != nil { + return false + } + if !this.Scalar.Equal(that1.Scalar) { + return false + } + if !this.Ranges.Equal(that1.Ranges) { + return false + } + if !this.Set.Equal(that1.Set) { + return false + } + if this.Role != nil && that1.Role != nil { + if *this.Role != *that1.Role { + return false + } + } else if this.Role != nil { + return false + } else if that1.Role != nil { + return false + } + if !this.Reservation.Equal(that1.Reservation) { + return false + } + if !this.Disk.Equal(that1.Disk) { + return false + } + if !this.Revocable.Equal(that1.Revocable) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Resource_ReservationInfo) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Resource_ReservationInfo) + if !ok { + return fmt.Errorf("that is not of type *Resource_ReservationInfo") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Resource_ReservationInfo but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Resource_ReservationInfobut is not nil && this == nil") + } + if this.Principal != nil && that1.Principal != nil { + if *this.Principal != *that1.Principal { + return fmt.Errorf("Principal this(%v) Not Equal that(%v)", *this.Principal, *that1.Principal) + } + } else if this.Principal != nil { + return fmt.Errorf("this.Principal == nil && that.Principal != nil") + } else if that1.Principal != nil { + return fmt.Errorf("Principal this(%v) Not Equal that(%v)", this.Principal, that1.Principal) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Resource_ReservationInfo) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Resource_ReservationInfo) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Principal != nil && that1.Principal != nil { + if *this.Principal != *that1.Principal { + return false + } + } else if this.Principal != nil { + return false + } else if that1.Principal != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Resource_DiskInfo) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Resource_DiskInfo) + if !ok { + return fmt.Errorf("that is not of type *Resource_DiskInfo") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Resource_DiskInfo but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Resource_DiskInfobut is not nil && this == nil") + } + if !this.Persistence.Equal(that1.Persistence) { + return fmt.Errorf("Persistence this(%v) Not Equal that(%v)", this.Persistence, that1.Persistence) + } + if !this.Volume.Equal(that1.Volume) { + return fmt.Errorf("Volume this(%v) Not Equal that(%v)", this.Volume, that1.Volume) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Resource_DiskInfo) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Resource_DiskInfo) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if !this.Persistence.Equal(that1.Persistence) { + return false + } + if !this.Volume.Equal(that1.Volume) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Resource_DiskInfo_Persistence) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Resource_DiskInfo_Persistence) + if !ok { + return fmt.Errorf("that is not of type *Resource_DiskInfo_Persistence") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Resource_DiskInfo_Persistence but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Resource_DiskInfo_Persistencebut is not nil && this == nil") + } + if this.Id != nil && that1.Id != nil { + if *this.Id != *that1.Id { + return fmt.Errorf("Id this(%v) Not Equal that(%v)", *this.Id, *that1.Id) + } + } else if this.Id != nil { + return fmt.Errorf("this.Id == nil && that.Id != nil") + } else if that1.Id != nil { + return fmt.Errorf("Id this(%v) Not Equal that(%v)", this.Id, that1.Id) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Resource_DiskInfo_Persistence) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Resource_DiskInfo_Persistence) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Id != nil && that1.Id != nil { + if *this.Id != *that1.Id { + return false + } + } else if this.Id != nil { + return false + } else if that1.Id != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Resource_RevocableInfo) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Resource_RevocableInfo) + if !ok { + return fmt.Errorf("that is not of type *Resource_RevocableInfo") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Resource_RevocableInfo but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Resource_RevocableInfobut is not nil && this == nil") + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Resource_RevocableInfo) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Resource_RevocableInfo) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *TrafficControlStatistics) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*TrafficControlStatistics) + if !ok { + return fmt.Errorf("that is not of type *TrafficControlStatistics") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *TrafficControlStatistics but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *TrafficControlStatisticsbut is not nil && this == nil") + } + if this.Id != nil && that1.Id != nil { + if *this.Id != *that1.Id { + return fmt.Errorf("Id this(%v) Not Equal that(%v)", *this.Id, *that1.Id) + } + } else if this.Id != nil { + return fmt.Errorf("this.Id == nil && that.Id != nil") + } else if that1.Id != nil { + return fmt.Errorf("Id this(%v) Not Equal that(%v)", this.Id, that1.Id) + } + if this.Backlog != nil && that1.Backlog != nil { + if *this.Backlog != *that1.Backlog { + return fmt.Errorf("Backlog this(%v) Not Equal that(%v)", *this.Backlog, *that1.Backlog) + } + } else if this.Backlog != nil { + return fmt.Errorf("this.Backlog == nil && that.Backlog != nil") + } else if that1.Backlog != nil { + return fmt.Errorf("Backlog this(%v) Not Equal that(%v)", this.Backlog, that1.Backlog) + } + if this.Bytes != nil && that1.Bytes != nil { + if *this.Bytes != *that1.Bytes { + return fmt.Errorf("Bytes this(%v) Not Equal that(%v)", *this.Bytes, *that1.Bytes) + } + } else if this.Bytes != nil { + return fmt.Errorf("this.Bytes == nil && that.Bytes != nil") + } else if that1.Bytes != nil { + return fmt.Errorf("Bytes this(%v) Not Equal that(%v)", this.Bytes, that1.Bytes) + } + if this.Drops != nil && that1.Drops != nil { + if *this.Drops != *that1.Drops { + return fmt.Errorf("Drops this(%v) Not Equal that(%v)", *this.Drops, *that1.Drops) + } + } else if this.Drops != nil { + return fmt.Errorf("this.Drops == nil && that.Drops != nil") + } else if that1.Drops != nil { + return fmt.Errorf("Drops this(%v) Not Equal that(%v)", this.Drops, that1.Drops) + } + if this.Overlimits != nil && that1.Overlimits != nil { + if *this.Overlimits != *that1.Overlimits { + return fmt.Errorf("Overlimits this(%v) Not Equal that(%v)", *this.Overlimits, *that1.Overlimits) + } + } else if this.Overlimits != nil { + return fmt.Errorf("this.Overlimits == nil && that.Overlimits != nil") + } else if that1.Overlimits != nil { + return fmt.Errorf("Overlimits this(%v) Not Equal that(%v)", this.Overlimits, that1.Overlimits) + } + if this.Packets != nil && that1.Packets != nil { + if *this.Packets != *that1.Packets { + return fmt.Errorf("Packets this(%v) Not Equal that(%v)", *this.Packets, *that1.Packets) + } + } else if this.Packets != nil { + return fmt.Errorf("this.Packets == nil && that.Packets != nil") + } else if that1.Packets != nil { + return fmt.Errorf("Packets this(%v) Not Equal that(%v)", this.Packets, that1.Packets) + } + if this.Qlen != nil && that1.Qlen != nil { + if *this.Qlen != *that1.Qlen { + return fmt.Errorf("Qlen this(%v) Not Equal that(%v)", *this.Qlen, *that1.Qlen) + } + } else if this.Qlen != nil { + return fmt.Errorf("this.Qlen == nil && that.Qlen != nil") + } else if that1.Qlen != nil { + return fmt.Errorf("Qlen this(%v) Not Equal that(%v)", this.Qlen, that1.Qlen) + } + if this.Ratebps != nil && that1.Ratebps != nil { + if *this.Ratebps != *that1.Ratebps { + return fmt.Errorf("Ratebps this(%v) Not Equal that(%v)", *this.Ratebps, *that1.Ratebps) + } + } else if this.Ratebps != nil { + return fmt.Errorf("this.Ratebps == nil && that.Ratebps != nil") + } else if that1.Ratebps != nil { + return fmt.Errorf("Ratebps this(%v) Not Equal that(%v)", this.Ratebps, that1.Ratebps) + } + if this.Ratepps != nil && that1.Ratepps != nil { + if *this.Ratepps != *that1.Ratepps { + return fmt.Errorf("Ratepps this(%v) Not Equal that(%v)", *this.Ratepps, *that1.Ratepps) + } + } else if this.Ratepps != nil { + return fmt.Errorf("this.Ratepps == nil && that.Ratepps != nil") + } else if that1.Ratepps != nil { + return fmt.Errorf("Ratepps this(%v) Not Equal that(%v)", this.Ratepps, that1.Ratepps) + } + if this.Requeues != nil && that1.Requeues != nil { + if *this.Requeues != *that1.Requeues { + return fmt.Errorf("Requeues this(%v) Not Equal that(%v)", *this.Requeues, *that1.Requeues) + } + } else if this.Requeues != nil { + return fmt.Errorf("this.Requeues == nil && that.Requeues != nil") + } else if that1.Requeues != nil { + return fmt.Errorf("Requeues this(%v) Not Equal that(%v)", this.Requeues, that1.Requeues) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *TrafficControlStatistics) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*TrafficControlStatistics) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Id != nil && that1.Id != nil { + if *this.Id != *that1.Id { + return false + } + } else if this.Id != nil { + return false + } else if that1.Id != nil { + return false + } + if this.Backlog != nil && that1.Backlog != nil { + if *this.Backlog != *that1.Backlog { + return false + } + } else if this.Backlog != nil { + return false + } else if that1.Backlog != nil { + return false + } + if this.Bytes != nil && that1.Bytes != nil { + if *this.Bytes != *that1.Bytes { + return false + } + } else if this.Bytes != nil { + return false + } else if that1.Bytes != nil { + return false + } + if this.Drops != nil && that1.Drops != nil { + if *this.Drops != *that1.Drops { + return false + } + } else if this.Drops != nil { + return false + } else if that1.Drops != nil { + return false + } + if this.Overlimits != nil && that1.Overlimits != nil { + if *this.Overlimits != *that1.Overlimits { + return false + } + } else if this.Overlimits != nil { + return false + } else if that1.Overlimits != nil { + return false + } + if this.Packets != nil && that1.Packets != nil { + if *this.Packets != *that1.Packets { + return false + } + } else if this.Packets != nil { + return false + } else if that1.Packets != nil { + return false + } + if this.Qlen != nil && that1.Qlen != nil { + if *this.Qlen != *that1.Qlen { + return false + } + } else if this.Qlen != nil { + return false + } else if that1.Qlen != nil { + return false + } + if this.Ratebps != nil && that1.Ratebps != nil { + if *this.Ratebps != *that1.Ratebps { + return false + } + } else if this.Ratebps != nil { + return false + } else if that1.Ratebps != nil { + return false + } + if this.Ratepps != nil && that1.Ratepps != nil { + if *this.Ratepps != *that1.Ratepps { + return false + } + } else if this.Ratepps != nil { + return false + } else if that1.Ratepps != nil { + return false + } + if this.Requeues != nil && that1.Requeues != nil { + if *this.Requeues != *that1.Requeues { + return false + } + } else if this.Requeues != nil { + return false + } else if that1.Requeues != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *ResourceStatistics) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*ResourceStatistics) + if !ok { + return fmt.Errorf("that is not of type *ResourceStatistics") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *ResourceStatistics but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *ResourceStatisticsbut is not nil && this == nil") + } + if this.Timestamp != nil && that1.Timestamp != nil { + if *this.Timestamp != *that1.Timestamp { + return fmt.Errorf("Timestamp this(%v) Not Equal that(%v)", *this.Timestamp, *that1.Timestamp) + } + } else if this.Timestamp != nil { + return fmt.Errorf("this.Timestamp == nil && that.Timestamp != nil") + } else if that1.Timestamp != nil { + return fmt.Errorf("Timestamp this(%v) Not Equal that(%v)", this.Timestamp, that1.Timestamp) + } + if this.Processes != nil && that1.Processes != nil { + if *this.Processes != *that1.Processes { + return fmt.Errorf("Processes this(%v) Not Equal that(%v)", *this.Processes, *that1.Processes) + } + } else if this.Processes != nil { + return fmt.Errorf("this.Processes == nil && that.Processes != nil") + } else if that1.Processes != nil { + return fmt.Errorf("Processes this(%v) Not Equal that(%v)", this.Processes, that1.Processes) + } + if this.Threads != nil && that1.Threads != nil { + if *this.Threads != *that1.Threads { + return fmt.Errorf("Threads this(%v) Not Equal that(%v)", *this.Threads, *that1.Threads) + } + } else if this.Threads != nil { + return fmt.Errorf("this.Threads == nil && that.Threads != nil") + } else if that1.Threads != nil { + return fmt.Errorf("Threads this(%v) Not Equal that(%v)", this.Threads, that1.Threads) + } + if this.CpusUserTimeSecs != nil && that1.CpusUserTimeSecs != nil { + if *this.CpusUserTimeSecs != *that1.CpusUserTimeSecs { + return fmt.Errorf("CpusUserTimeSecs this(%v) Not Equal that(%v)", *this.CpusUserTimeSecs, *that1.CpusUserTimeSecs) + } + } else if this.CpusUserTimeSecs != nil { + return fmt.Errorf("this.CpusUserTimeSecs == nil && that.CpusUserTimeSecs != nil") + } else if that1.CpusUserTimeSecs != nil { + return fmt.Errorf("CpusUserTimeSecs this(%v) Not Equal that(%v)", this.CpusUserTimeSecs, that1.CpusUserTimeSecs) + } + if this.CpusSystemTimeSecs != nil && that1.CpusSystemTimeSecs != nil { + if *this.CpusSystemTimeSecs != *that1.CpusSystemTimeSecs { + return fmt.Errorf("CpusSystemTimeSecs this(%v) Not Equal that(%v)", *this.CpusSystemTimeSecs, *that1.CpusSystemTimeSecs) + } + } else if this.CpusSystemTimeSecs != nil { + return fmt.Errorf("this.CpusSystemTimeSecs == nil && that.CpusSystemTimeSecs != nil") + } else if that1.CpusSystemTimeSecs != nil { + return fmt.Errorf("CpusSystemTimeSecs this(%v) Not Equal that(%v)", this.CpusSystemTimeSecs, that1.CpusSystemTimeSecs) + } + if this.CpusLimit != nil && that1.CpusLimit != nil { + if *this.CpusLimit != *that1.CpusLimit { + return fmt.Errorf("CpusLimit this(%v) Not Equal that(%v)", *this.CpusLimit, *that1.CpusLimit) + } + } else if this.CpusLimit != nil { + return fmt.Errorf("this.CpusLimit == nil && that.CpusLimit != nil") + } else if that1.CpusLimit != nil { + return fmt.Errorf("CpusLimit this(%v) Not Equal that(%v)", this.CpusLimit, that1.CpusLimit) + } + if this.CpusNrPeriods != nil && that1.CpusNrPeriods != nil { + if *this.CpusNrPeriods != *that1.CpusNrPeriods { + return fmt.Errorf("CpusNrPeriods this(%v) Not Equal that(%v)", *this.CpusNrPeriods, *that1.CpusNrPeriods) + } + } else if this.CpusNrPeriods != nil { + return fmt.Errorf("this.CpusNrPeriods == nil && that.CpusNrPeriods != nil") + } else if that1.CpusNrPeriods != nil { + return fmt.Errorf("CpusNrPeriods this(%v) Not Equal that(%v)", this.CpusNrPeriods, that1.CpusNrPeriods) + } + if this.CpusNrThrottled != nil && that1.CpusNrThrottled != nil { + if *this.CpusNrThrottled != *that1.CpusNrThrottled { + return fmt.Errorf("CpusNrThrottled this(%v) Not Equal that(%v)", *this.CpusNrThrottled, *that1.CpusNrThrottled) + } + } else if this.CpusNrThrottled != nil { + return fmt.Errorf("this.CpusNrThrottled == nil && that.CpusNrThrottled != nil") + } else if that1.CpusNrThrottled != nil { + return fmt.Errorf("CpusNrThrottled this(%v) Not Equal that(%v)", this.CpusNrThrottled, that1.CpusNrThrottled) + } + if this.CpusThrottledTimeSecs != nil && that1.CpusThrottledTimeSecs != nil { + if *this.CpusThrottledTimeSecs != *that1.CpusThrottledTimeSecs { + return fmt.Errorf("CpusThrottledTimeSecs this(%v) Not Equal that(%v)", *this.CpusThrottledTimeSecs, *that1.CpusThrottledTimeSecs) + } + } else if this.CpusThrottledTimeSecs != nil { + return fmt.Errorf("this.CpusThrottledTimeSecs == nil && that.CpusThrottledTimeSecs != nil") + } else if that1.CpusThrottledTimeSecs != nil { + return fmt.Errorf("CpusThrottledTimeSecs this(%v) Not Equal that(%v)", this.CpusThrottledTimeSecs, that1.CpusThrottledTimeSecs) + } + if this.MemTotalBytes != nil && that1.MemTotalBytes != nil { + if *this.MemTotalBytes != *that1.MemTotalBytes { + return fmt.Errorf("MemTotalBytes this(%v) Not Equal that(%v)", *this.MemTotalBytes, *that1.MemTotalBytes) + } + } else if this.MemTotalBytes != nil { + return fmt.Errorf("this.MemTotalBytes == nil && that.MemTotalBytes != nil") + } else if that1.MemTotalBytes != nil { + return fmt.Errorf("MemTotalBytes this(%v) Not Equal that(%v)", this.MemTotalBytes, that1.MemTotalBytes) + } + if this.MemTotalMemswBytes != nil && that1.MemTotalMemswBytes != nil { + if *this.MemTotalMemswBytes != *that1.MemTotalMemswBytes { + return fmt.Errorf("MemTotalMemswBytes this(%v) Not Equal that(%v)", *this.MemTotalMemswBytes, *that1.MemTotalMemswBytes) + } + } else if this.MemTotalMemswBytes != nil { + return fmt.Errorf("this.MemTotalMemswBytes == nil && that.MemTotalMemswBytes != nil") + } else if that1.MemTotalMemswBytes != nil { + return fmt.Errorf("MemTotalMemswBytes this(%v) Not Equal that(%v)", this.MemTotalMemswBytes, that1.MemTotalMemswBytes) + } + if this.MemLimitBytes != nil && that1.MemLimitBytes != nil { + if *this.MemLimitBytes != *that1.MemLimitBytes { + return fmt.Errorf("MemLimitBytes this(%v) Not Equal that(%v)", *this.MemLimitBytes, *that1.MemLimitBytes) + } + } else if this.MemLimitBytes != nil { + return fmt.Errorf("this.MemLimitBytes == nil && that.MemLimitBytes != nil") + } else if that1.MemLimitBytes != nil { + return fmt.Errorf("MemLimitBytes this(%v) Not Equal that(%v)", this.MemLimitBytes, that1.MemLimitBytes) + } + if this.MemSoftLimitBytes != nil && that1.MemSoftLimitBytes != nil { + if *this.MemSoftLimitBytes != *that1.MemSoftLimitBytes { + return fmt.Errorf("MemSoftLimitBytes this(%v) Not Equal that(%v)", *this.MemSoftLimitBytes, *that1.MemSoftLimitBytes) + } + } else if this.MemSoftLimitBytes != nil { + return fmt.Errorf("this.MemSoftLimitBytes == nil && that.MemSoftLimitBytes != nil") + } else if that1.MemSoftLimitBytes != nil { + return fmt.Errorf("MemSoftLimitBytes this(%v) Not Equal that(%v)", this.MemSoftLimitBytes, that1.MemSoftLimitBytes) + } + if this.MemFileBytes != nil && that1.MemFileBytes != nil { + if *this.MemFileBytes != *that1.MemFileBytes { + return fmt.Errorf("MemFileBytes this(%v) Not Equal that(%v)", *this.MemFileBytes, *that1.MemFileBytes) + } + } else if this.MemFileBytes != nil { + return fmt.Errorf("this.MemFileBytes == nil && that.MemFileBytes != nil") + } else if that1.MemFileBytes != nil { + return fmt.Errorf("MemFileBytes this(%v) Not Equal that(%v)", this.MemFileBytes, that1.MemFileBytes) + } + if this.MemAnonBytes != nil && that1.MemAnonBytes != nil { + if *this.MemAnonBytes != *that1.MemAnonBytes { + return fmt.Errorf("MemAnonBytes this(%v) Not Equal that(%v)", *this.MemAnonBytes, *that1.MemAnonBytes) + } + } else if this.MemAnonBytes != nil { + return fmt.Errorf("this.MemAnonBytes == nil && that.MemAnonBytes != nil") + } else if that1.MemAnonBytes != nil { + return fmt.Errorf("MemAnonBytes this(%v) Not Equal that(%v)", this.MemAnonBytes, that1.MemAnonBytes) + } + if this.MemCacheBytes != nil && that1.MemCacheBytes != nil { + if *this.MemCacheBytes != *that1.MemCacheBytes { + return fmt.Errorf("MemCacheBytes this(%v) Not Equal that(%v)", *this.MemCacheBytes, *that1.MemCacheBytes) + } + } else if this.MemCacheBytes != nil { + return fmt.Errorf("this.MemCacheBytes == nil && that.MemCacheBytes != nil") + } else if that1.MemCacheBytes != nil { + return fmt.Errorf("MemCacheBytes this(%v) Not Equal that(%v)", this.MemCacheBytes, that1.MemCacheBytes) + } + if this.MemRssBytes != nil && that1.MemRssBytes != nil { + if *this.MemRssBytes != *that1.MemRssBytes { + return fmt.Errorf("MemRssBytes this(%v) Not Equal that(%v)", *this.MemRssBytes, *that1.MemRssBytes) + } + } else if this.MemRssBytes != nil { + return fmt.Errorf("this.MemRssBytes == nil && that.MemRssBytes != nil") + } else if that1.MemRssBytes != nil { + return fmt.Errorf("MemRssBytes this(%v) Not Equal that(%v)", this.MemRssBytes, that1.MemRssBytes) + } + if this.MemMappedFileBytes != nil && that1.MemMappedFileBytes != nil { + if *this.MemMappedFileBytes != *that1.MemMappedFileBytes { + return fmt.Errorf("MemMappedFileBytes this(%v) Not Equal that(%v)", *this.MemMappedFileBytes, *that1.MemMappedFileBytes) + } + } else if this.MemMappedFileBytes != nil { + return fmt.Errorf("this.MemMappedFileBytes == nil && that.MemMappedFileBytes != nil") + } else if that1.MemMappedFileBytes != nil { + return fmt.Errorf("MemMappedFileBytes this(%v) Not Equal that(%v)", this.MemMappedFileBytes, that1.MemMappedFileBytes) + } + if this.MemSwapBytes != nil && that1.MemSwapBytes != nil { + if *this.MemSwapBytes != *that1.MemSwapBytes { + return fmt.Errorf("MemSwapBytes this(%v) Not Equal that(%v)", *this.MemSwapBytes, *that1.MemSwapBytes) + } + } else if this.MemSwapBytes != nil { + return fmt.Errorf("this.MemSwapBytes == nil && that.MemSwapBytes != nil") + } else if that1.MemSwapBytes != nil { + return fmt.Errorf("MemSwapBytes this(%v) Not Equal that(%v)", this.MemSwapBytes, that1.MemSwapBytes) + } + if this.MemLowPressureCounter != nil && that1.MemLowPressureCounter != nil { + if *this.MemLowPressureCounter != *that1.MemLowPressureCounter { + return fmt.Errorf("MemLowPressureCounter this(%v) Not Equal that(%v)", *this.MemLowPressureCounter, *that1.MemLowPressureCounter) + } + } else if this.MemLowPressureCounter != nil { + return fmt.Errorf("this.MemLowPressureCounter == nil && that.MemLowPressureCounter != nil") + } else if that1.MemLowPressureCounter != nil { + return fmt.Errorf("MemLowPressureCounter this(%v) Not Equal that(%v)", this.MemLowPressureCounter, that1.MemLowPressureCounter) + } + if this.MemMediumPressureCounter != nil && that1.MemMediumPressureCounter != nil { + if *this.MemMediumPressureCounter != *that1.MemMediumPressureCounter { + return fmt.Errorf("MemMediumPressureCounter this(%v) Not Equal that(%v)", *this.MemMediumPressureCounter, *that1.MemMediumPressureCounter) + } + } else if this.MemMediumPressureCounter != nil { + return fmt.Errorf("this.MemMediumPressureCounter == nil && that.MemMediumPressureCounter != nil") + } else if that1.MemMediumPressureCounter != nil { + return fmt.Errorf("MemMediumPressureCounter this(%v) Not Equal that(%v)", this.MemMediumPressureCounter, that1.MemMediumPressureCounter) + } + if this.MemCriticalPressureCounter != nil && that1.MemCriticalPressureCounter != nil { + if *this.MemCriticalPressureCounter != *that1.MemCriticalPressureCounter { + return fmt.Errorf("MemCriticalPressureCounter this(%v) Not Equal that(%v)", *this.MemCriticalPressureCounter, *that1.MemCriticalPressureCounter) + } + } else if this.MemCriticalPressureCounter != nil { + return fmt.Errorf("this.MemCriticalPressureCounter == nil && that.MemCriticalPressureCounter != nil") + } else if that1.MemCriticalPressureCounter != nil { + return fmt.Errorf("MemCriticalPressureCounter this(%v) Not Equal that(%v)", this.MemCriticalPressureCounter, that1.MemCriticalPressureCounter) + } + if this.DiskLimitBytes != nil && that1.DiskLimitBytes != nil { + if *this.DiskLimitBytes != *that1.DiskLimitBytes { + return fmt.Errorf("DiskLimitBytes this(%v) Not Equal that(%v)", *this.DiskLimitBytes, *that1.DiskLimitBytes) + } + } else if this.DiskLimitBytes != nil { + return fmt.Errorf("this.DiskLimitBytes == nil && that.DiskLimitBytes != nil") + } else if that1.DiskLimitBytes != nil { + return fmt.Errorf("DiskLimitBytes this(%v) Not Equal that(%v)", this.DiskLimitBytes, that1.DiskLimitBytes) + } + if this.DiskUsedBytes != nil && that1.DiskUsedBytes != nil { + if *this.DiskUsedBytes != *that1.DiskUsedBytes { + return fmt.Errorf("DiskUsedBytes this(%v) Not Equal that(%v)", *this.DiskUsedBytes, *that1.DiskUsedBytes) + } + } else if this.DiskUsedBytes != nil { + return fmt.Errorf("this.DiskUsedBytes == nil && that.DiskUsedBytes != nil") + } else if that1.DiskUsedBytes != nil { + return fmt.Errorf("DiskUsedBytes this(%v) Not Equal that(%v)", this.DiskUsedBytes, that1.DiskUsedBytes) + } + if !this.Perf.Equal(that1.Perf) { + return fmt.Errorf("Perf this(%v) Not Equal that(%v)", this.Perf, that1.Perf) + } + if this.NetRxPackets != nil && that1.NetRxPackets != nil { + if *this.NetRxPackets != *that1.NetRxPackets { + return fmt.Errorf("NetRxPackets this(%v) Not Equal that(%v)", *this.NetRxPackets, *that1.NetRxPackets) + } + } else if this.NetRxPackets != nil { + return fmt.Errorf("this.NetRxPackets == nil && that.NetRxPackets != nil") + } else if that1.NetRxPackets != nil { + return fmt.Errorf("NetRxPackets this(%v) Not Equal that(%v)", this.NetRxPackets, that1.NetRxPackets) + } + if this.NetRxBytes != nil && that1.NetRxBytes != nil { + if *this.NetRxBytes != *that1.NetRxBytes { + return fmt.Errorf("NetRxBytes this(%v) Not Equal that(%v)", *this.NetRxBytes, *that1.NetRxBytes) + } + } else if this.NetRxBytes != nil { + return fmt.Errorf("this.NetRxBytes == nil && that.NetRxBytes != nil") + } else if that1.NetRxBytes != nil { + return fmt.Errorf("NetRxBytes this(%v) Not Equal that(%v)", this.NetRxBytes, that1.NetRxBytes) + } + if this.NetRxErrors != nil && that1.NetRxErrors != nil { + if *this.NetRxErrors != *that1.NetRxErrors { + return fmt.Errorf("NetRxErrors this(%v) Not Equal that(%v)", *this.NetRxErrors, *that1.NetRxErrors) + } + } else if this.NetRxErrors != nil { + return fmt.Errorf("this.NetRxErrors == nil && that.NetRxErrors != nil") + } else if that1.NetRxErrors != nil { + return fmt.Errorf("NetRxErrors this(%v) Not Equal that(%v)", this.NetRxErrors, that1.NetRxErrors) + } + if this.NetRxDropped != nil && that1.NetRxDropped != nil { + if *this.NetRxDropped != *that1.NetRxDropped { + return fmt.Errorf("NetRxDropped this(%v) Not Equal that(%v)", *this.NetRxDropped, *that1.NetRxDropped) + } + } else if this.NetRxDropped != nil { + return fmt.Errorf("this.NetRxDropped == nil && that.NetRxDropped != nil") + } else if that1.NetRxDropped != nil { + return fmt.Errorf("NetRxDropped this(%v) Not Equal that(%v)", this.NetRxDropped, that1.NetRxDropped) + } + if this.NetTxPackets != nil && that1.NetTxPackets != nil { + if *this.NetTxPackets != *that1.NetTxPackets { + return fmt.Errorf("NetTxPackets this(%v) Not Equal that(%v)", *this.NetTxPackets, *that1.NetTxPackets) + } + } else if this.NetTxPackets != nil { + return fmt.Errorf("this.NetTxPackets == nil && that.NetTxPackets != nil") + } else if that1.NetTxPackets != nil { + return fmt.Errorf("NetTxPackets this(%v) Not Equal that(%v)", this.NetTxPackets, that1.NetTxPackets) + } + if this.NetTxBytes != nil && that1.NetTxBytes != nil { + if *this.NetTxBytes != *that1.NetTxBytes { + return fmt.Errorf("NetTxBytes this(%v) Not Equal that(%v)", *this.NetTxBytes, *that1.NetTxBytes) + } + } else if this.NetTxBytes != nil { + return fmt.Errorf("this.NetTxBytes == nil && that.NetTxBytes != nil") + } else if that1.NetTxBytes != nil { + return fmt.Errorf("NetTxBytes this(%v) Not Equal that(%v)", this.NetTxBytes, that1.NetTxBytes) + } + if this.NetTxErrors != nil && that1.NetTxErrors != nil { + if *this.NetTxErrors != *that1.NetTxErrors { + return fmt.Errorf("NetTxErrors this(%v) Not Equal that(%v)", *this.NetTxErrors, *that1.NetTxErrors) + } + } else if this.NetTxErrors != nil { + return fmt.Errorf("this.NetTxErrors == nil && that.NetTxErrors != nil") + } else if that1.NetTxErrors != nil { + return fmt.Errorf("NetTxErrors this(%v) Not Equal that(%v)", this.NetTxErrors, that1.NetTxErrors) + } + if this.NetTxDropped != nil && that1.NetTxDropped != nil { + if *this.NetTxDropped != *that1.NetTxDropped { + return fmt.Errorf("NetTxDropped this(%v) Not Equal that(%v)", *this.NetTxDropped, *that1.NetTxDropped) + } + } else if this.NetTxDropped != nil { + return fmt.Errorf("this.NetTxDropped == nil && that.NetTxDropped != nil") + } else if that1.NetTxDropped != nil { + return fmt.Errorf("NetTxDropped this(%v) Not Equal that(%v)", this.NetTxDropped, that1.NetTxDropped) + } + if this.NetTcpRttMicrosecsP50 != nil && that1.NetTcpRttMicrosecsP50 != nil { + if *this.NetTcpRttMicrosecsP50 != *that1.NetTcpRttMicrosecsP50 { + return fmt.Errorf("NetTcpRttMicrosecsP50 this(%v) Not Equal that(%v)", *this.NetTcpRttMicrosecsP50, *that1.NetTcpRttMicrosecsP50) + } + } else if this.NetTcpRttMicrosecsP50 != nil { + return fmt.Errorf("this.NetTcpRttMicrosecsP50 == nil && that.NetTcpRttMicrosecsP50 != nil") + } else if that1.NetTcpRttMicrosecsP50 != nil { + return fmt.Errorf("NetTcpRttMicrosecsP50 this(%v) Not Equal that(%v)", this.NetTcpRttMicrosecsP50, that1.NetTcpRttMicrosecsP50) + } + if this.NetTcpRttMicrosecsP90 != nil && that1.NetTcpRttMicrosecsP90 != nil { + if *this.NetTcpRttMicrosecsP90 != *that1.NetTcpRttMicrosecsP90 { + return fmt.Errorf("NetTcpRttMicrosecsP90 this(%v) Not Equal that(%v)", *this.NetTcpRttMicrosecsP90, *that1.NetTcpRttMicrosecsP90) + } + } else if this.NetTcpRttMicrosecsP90 != nil { + return fmt.Errorf("this.NetTcpRttMicrosecsP90 == nil && that.NetTcpRttMicrosecsP90 != nil") + } else if that1.NetTcpRttMicrosecsP90 != nil { + return fmt.Errorf("NetTcpRttMicrosecsP90 this(%v) Not Equal that(%v)", this.NetTcpRttMicrosecsP90, that1.NetTcpRttMicrosecsP90) + } + if this.NetTcpRttMicrosecsP95 != nil && that1.NetTcpRttMicrosecsP95 != nil { + if *this.NetTcpRttMicrosecsP95 != *that1.NetTcpRttMicrosecsP95 { + return fmt.Errorf("NetTcpRttMicrosecsP95 this(%v) Not Equal that(%v)", *this.NetTcpRttMicrosecsP95, *that1.NetTcpRttMicrosecsP95) + } + } else if this.NetTcpRttMicrosecsP95 != nil { + return fmt.Errorf("this.NetTcpRttMicrosecsP95 == nil && that.NetTcpRttMicrosecsP95 != nil") + } else if that1.NetTcpRttMicrosecsP95 != nil { + return fmt.Errorf("NetTcpRttMicrosecsP95 this(%v) Not Equal that(%v)", this.NetTcpRttMicrosecsP95, that1.NetTcpRttMicrosecsP95) + } + if this.NetTcpRttMicrosecsP99 != nil && that1.NetTcpRttMicrosecsP99 != nil { + if *this.NetTcpRttMicrosecsP99 != *that1.NetTcpRttMicrosecsP99 { + return fmt.Errorf("NetTcpRttMicrosecsP99 this(%v) Not Equal that(%v)", *this.NetTcpRttMicrosecsP99, *that1.NetTcpRttMicrosecsP99) + } + } else if this.NetTcpRttMicrosecsP99 != nil { + return fmt.Errorf("this.NetTcpRttMicrosecsP99 == nil && that.NetTcpRttMicrosecsP99 != nil") + } else if that1.NetTcpRttMicrosecsP99 != nil { + return fmt.Errorf("NetTcpRttMicrosecsP99 this(%v) Not Equal that(%v)", this.NetTcpRttMicrosecsP99, that1.NetTcpRttMicrosecsP99) + } + if this.NetTcpActiveConnections != nil && that1.NetTcpActiveConnections != nil { + if *this.NetTcpActiveConnections != *that1.NetTcpActiveConnections { + return fmt.Errorf("NetTcpActiveConnections this(%v) Not Equal that(%v)", *this.NetTcpActiveConnections, *that1.NetTcpActiveConnections) + } + } else if this.NetTcpActiveConnections != nil { + return fmt.Errorf("this.NetTcpActiveConnections == nil && that.NetTcpActiveConnections != nil") + } else if that1.NetTcpActiveConnections != nil { + return fmt.Errorf("NetTcpActiveConnections this(%v) Not Equal that(%v)", this.NetTcpActiveConnections, that1.NetTcpActiveConnections) + } + if this.NetTcpTimeWaitConnections != nil && that1.NetTcpTimeWaitConnections != nil { + if *this.NetTcpTimeWaitConnections != *that1.NetTcpTimeWaitConnections { + return fmt.Errorf("NetTcpTimeWaitConnections this(%v) Not Equal that(%v)", *this.NetTcpTimeWaitConnections, *that1.NetTcpTimeWaitConnections) + } + } else if this.NetTcpTimeWaitConnections != nil { + return fmt.Errorf("this.NetTcpTimeWaitConnections == nil && that.NetTcpTimeWaitConnections != nil") + } else if that1.NetTcpTimeWaitConnections != nil { + return fmt.Errorf("NetTcpTimeWaitConnections this(%v) Not Equal that(%v)", this.NetTcpTimeWaitConnections, that1.NetTcpTimeWaitConnections) + } + if len(this.NetTrafficControlStatistics) != len(that1.NetTrafficControlStatistics) { + return fmt.Errorf("NetTrafficControlStatistics this(%v) Not Equal that(%v)", len(this.NetTrafficControlStatistics), len(that1.NetTrafficControlStatistics)) + } + for i := range this.NetTrafficControlStatistics { + if !this.NetTrafficControlStatistics[i].Equal(that1.NetTrafficControlStatistics[i]) { + return fmt.Errorf("NetTrafficControlStatistics this[%v](%v) Not Equal that[%v](%v)", i, this.NetTrafficControlStatistics[i], i, that1.NetTrafficControlStatistics[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *ResourceStatistics) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*ResourceStatistics) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Timestamp != nil && that1.Timestamp != nil { + if *this.Timestamp != *that1.Timestamp { + return false + } + } else if this.Timestamp != nil { + return false + } else if that1.Timestamp != nil { + return false + } + if this.Processes != nil && that1.Processes != nil { + if *this.Processes != *that1.Processes { + return false + } + } else if this.Processes != nil { + return false + } else if that1.Processes != nil { + return false + } + if this.Threads != nil && that1.Threads != nil { + if *this.Threads != *that1.Threads { + return false + } + } else if this.Threads != nil { + return false + } else if that1.Threads != nil { + return false + } + if this.CpusUserTimeSecs != nil && that1.CpusUserTimeSecs != nil { + if *this.CpusUserTimeSecs != *that1.CpusUserTimeSecs { + return false + } + } else if this.CpusUserTimeSecs != nil { + return false + } else if that1.CpusUserTimeSecs != nil { + return false + } + if this.CpusSystemTimeSecs != nil && that1.CpusSystemTimeSecs != nil { + if *this.CpusSystemTimeSecs != *that1.CpusSystemTimeSecs { + return false + } + } else if this.CpusSystemTimeSecs != nil { + return false + } else if that1.CpusSystemTimeSecs != nil { + return false + } + if this.CpusLimit != nil && that1.CpusLimit != nil { + if *this.CpusLimit != *that1.CpusLimit { + return false + } + } else if this.CpusLimit != nil { + return false + } else if that1.CpusLimit != nil { + return false + } + if this.CpusNrPeriods != nil && that1.CpusNrPeriods != nil { + if *this.CpusNrPeriods != *that1.CpusNrPeriods { + return false + } + } else if this.CpusNrPeriods != nil { + return false + } else if that1.CpusNrPeriods != nil { + return false + } + if this.CpusNrThrottled != nil && that1.CpusNrThrottled != nil { + if *this.CpusNrThrottled != *that1.CpusNrThrottled { + return false + } + } else if this.CpusNrThrottled != nil { + return false + } else if that1.CpusNrThrottled != nil { + return false + } + if this.CpusThrottledTimeSecs != nil && that1.CpusThrottledTimeSecs != nil { + if *this.CpusThrottledTimeSecs != *that1.CpusThrottledTimeSecs { + return false + } + } else if this.CpusThrottledTimeSecs != nil { + return false + } else if that1.CpusThrottledTimeSecs != nil { + return false + } + if this.MemTotalBytes != nil && that1.MemTotalBytes != nil { + if *this.MemTotalBytes != *that1.MemTotalBytes { + return false + } + } else if this.MemTotalBytes != nil { + return false + } else if that1.MemTotalBytes != nil { + return false + } + if this.MemTotalMemswBytes != nil && that1.MemTotalMemswBytes != nil { + if *this.MemTotalMemswBytes != *that1.MemTotalMemswBytes { + return false + } + } else if this.MemTotalMemswBytes != nil { + return false + } else if that1.MemTotalMemswBytes != nil { + return false + } + if this.MemLimitBytes != nil && that1.MemLimitBytes != nil { + if *this.MemLimitBytes != *that1.MemLimitBytes { + return false + } + } else if this.MemLimitBytes != nil { + return false + } else if that1.MemLimitBytes != nil { + return false + } + if this.MemSoftLimitBytes != nil && that1.MemSoftLimitBytes != nil { + if *this.MemSoftLimitBytes != *that1.MemSoftLimitBytes { + return false + } + } else if this.MemSoftLimitBytes != nil { + return false + } else if that1.MemSoftLimitBytes != nil { + return false + } + if this.MemFileBytes != nil && that1.MemFileBytes != nil { + if *this.MemFileBytes != *that1.MemFileBytes { + return false + } + } else if this.MemFileBytes != nil { + return false + } else if that1.MemFileBytes != nil { + return false + } + if this.MemAnonBytes != nil && that1.MemAnonBytes != nil { + if *this.MemAnonBytes != *that1.MemAnonBytes { + return false + } + } else if this.MemAnonBytes != nil { + return false + } else if that1.MemAnonBytes != nil { + return false + } + if this.MemCacheBytes != nil && that1.MemCacheBytes != nil { + if *this.MemCacheBytes != *that1.MemCacheBytes { + return false + } + } else if this.MemCacheBytes != nil { + return false + } else if that1.MemCacheBytes != nil { + return false + } + if this.MemRssBytes != nil && that1.MemRssBytes != nil { + if *this.MemRssBytes != *that1.MemRssBytes { + return false + } + } else if this.MemRssBytes != nil { + return false + } else if that1.MemRssBytes != nil { + return false + } + if this.MemMappedFileBytes != nil && that1.MemMappedFileBytes != nil { + if *this.MemMappedFileBytes != *that1.MemMappedFileBytes { + return false + } + } else if this.MemMappedFileBytes != nil { + return false + } else if that1.MemMappedFileBytes != nil { + return false + } + if this.MemSwapBytes != nil && that1.MemSwapBytes != nil { + if *this.MemSwapBytes != *that1.MemSwapBytes { + return false + } + } else if this.MemSwapBytes != nil { + return false + } else if that1.MemSwapBytes != nil { + return false + } + if this.MemLowPressureCounter != nil && that1.MemLowPressureCounter != nil { + if *this.MemLowPressureCounter != *that1.MemLowPressureCounter { + return false + } + } else if this.MemLowPressureCounter != nil { + return false + } else if that1.MemLowPressureCounter != nil { + return false + } + if this.MemMediumPressureCounter != nil && that1.MemMediumPressureCounter != nil { + if *this.MemMediumPressureCounter != *that1.MemMediumPressureCounter { + return false + } + } else if this.MemMediumPressureCounter != nil { + return false + } else if that1.MemMediumPressureCounter != nil { + return false + } + if this.MemCriticalPressureCounter != nil && that1.MemCriticalPressureCounter != nil { + if *this.MemCriticalPressureCounter != *that1.MemCriticalPressureCounter { + return false + } + } else if this.MemCriticalPressureCounter != nil { + return false + } else if that1.MemCriticalPressureCounter != nil { + return false + } + if this.DiskLimitBytes != nil && that1.DiskLimitBytes != nil { + if *this.DiskLimitBytes != *that1.DiskLimitBytes { + return false + } + } else if this.DiskLimitBytes != nil { + return false + } else if that1.DiskLimitBytes != nil { + return false + } + if this.DiskUsedBytes != nil && that1.DiskUsedBytes != nil { + if *this.DiskUsedBytes != *that1.DiskUsedBytes { + return false + } + } else if this.DiskUsedBytes != nil { + return false + } else if that1.DiskUsedBytes != nil { + return false + } + if !this.Perf.Equal(that1.Perf) { + return false + } + if this.NetRxPackets != nil && that1.NetRxPackets != nil { + if *this.NetRxPackets != *that1.NetRxPackets { + return false + } + } else if this.NetRxPackets != nil { + return false + } else if that1.NetRxPackets != nil { + return false + } + if this.NetRxBytes != nil && that1.NetRxBytes != nil { + if *this.NetRxBytes != *that1.NetRxBytes { + return false + } + } else if this.NetRxBytes != nil { + return false + } else if that1.NetRxBytes != nil { + return false + } + if this.NetRxErrors != nil && that1.NetRxErrors != nil { + if *this.NetRxErrors != *that1.NetRxErrors { + return false + } + } else if this.NetRxErrors != nil { + return false + } else if that1.NetRxErrors != nil { + return false + } + if this.NetRxDropped != nil && that1.NetRxDropped != nil { + if *this.NetRxDropped != *that1.NetRxDropped { + return false + } + } else if this.NetRxDropped != nil { + return false + } else if that1.NetRxDropped != nil { + return false + } + if this.NetTxPackets != nil && that1.NetTxPackets != nil { + if *this.NetTxPackets != *that1.NetTxPackets { + return false + } + } else if this.NetTxPackets != nil { + return false + } else if that1.NetTxPackets != nil { + return false + } + if this.NetTxBytes != nil && that1.NetTxBytes != nil { + if *this.NetTxBytes != *that1.NetTxBytes { + return false + } + } else if this.NetTxBytes != nil { + return false + } else if that1.NetTxBytes != nil { + return false + } + if this.NetTxErrors != nil && that1.NetTxErrors != nil { + if *this.NetTxErrors != *that1.NetTxErrors { + return false + } + } else if this.NetTxErrors != nil { + return false + } else if that1.NetTxErrors != nil { + return false + } + if this.NetTxDropped != nil && that1.NetTxDropped != nil { + if *this.NetTxDropped != *that1.NetTxDropped { + return false + } + } else if this.NetTxDropped != nil { + return false + } else if that1.NetTxDropped != nil { + return false + } + if this.NetTcpRttMicrosecsP50 != nil && that1.NetTcpRttMicrosecsP50 != nil { + if *this.NetTcpRttMicrosecsP50 != *that1.NetTcpRttMicrosecsP50 { + return false + } + } else if this.NetTcpRttMicrosecsP50 != nil { + return false + } else if that1.NetTcpRttMicrosecsP50 != nil { + return false + } + if this.NetTcpRttMicrosecsP90 != nil && that1.NetTcpRttMicrosecsP90 != nil { + if *this.NetTcpRttMicrosecsP90 != *that1.NetTcpRttMicrosecsP90 { + return false + } + } else if this.NetTcpRttMicrosecsP90 != nil { + return false + } else if that1.NetTcpRttMicrosecsP90 != nil { + return false + } + if this.NetTcpRttMicrosecsP95 != nil && that1.NetTcpRttMicrosecsP95 != nil { + if *this.NetTcpRttMicrosecsP95 != *that1.NetTcpRttMicrosecsP95 { + return false + } + } else if this.NetTcpRttMicrosecsP95 != nil { + return false + } else if that1.NetTcpRttMicrosecsP95 != nil { + return false + } + if this.NetTcpRttMicrosecsP99 != nil && that1.NetTcpRttMicrosecsP99 != nil { + if *this.NetTcpRttMicrosecsP99 != *that1.NetTcpRttMicrosecsP99 { + return false + } + } else if this.NetTcpRttMicrosecsP99 != nil { + return false + } else if that1.NetTcpRttMicrosecsP99 != nil { + return false + } + if this.NetTcpActiveConnections != nil && that1.NetTcpActiveConnections != nil { + if *this.NetTcpActiveConnections != *that1.NetTcpActiveConnections { + return false + } + } else if this.NetTcpActiveConnections != nil { + return false + } else if that1.NetTcpActiveConnections != nil { + return false + } + if this.NetTcpTimeWaitConnections != nil && that1.NetTcpTimeWaitConnections != nil { + if *this.NetTcpTimeWaitConnections != *that1.NetTcpTimeWaitConnections { + return false + } + } else if this.NetTcpTimeWaitConnections != nil { + return false + } else if that1.NetTcpTimeWaitConnections != nil { + return false + } + if len(this.NetTrafficControlStatistics) != len(that1.NetTrafficControlStatistics) { + return false + } + for i := range this.NetTrafficControlStatistics { + if !this.NetTrafficControlStatistics[i].Equal(that1.NetTrafficControlStatistics[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *ResourceUsage) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*ResourceUsage) + if !ok { + return fmt.Errorf("that is not of type *ResourceUsage") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *ResourceUsage but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *ResourceUsagebut is not nil && this == nil") + } + if len(this.Executors) != len(that1.Executors) { + return fmt.Errorf("Executors this(%v) Not Equal that(%v)", len(this.Executors), len(that1.Executors)) + } + for i := range this.Executors { + if !this.Executors[i].Equal(that1.Executors[i]) { + return fmt.Errorf("Executors this[%v](%v) Not Equal that[%v](%v)", i, this.Executors[i], i, that1.Executors[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *ResourceUsage) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*ResourceUsage) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if len(this.Executors) != len(that1.Executors) { + return false + } + for i := range this.Executors { + if !this.Executors[i].Equal(that1.Executors[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *ResourceUsage_Executor) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*ResourceUsage_Executor) + if !ok { + return fmt.Errorf("that is not of type *ResourceUsage_Executor") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *ResourceUsage_Executor but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *ResourceUsage_Executorbut is not nil && this == nil") + } + if !this.ExecutorInfo.Equal(that1.ExecutorInfo) { + return fmt.Errorf("ExecutorInfo this(%v) Not Equal that(%v)", this.ExecutorInfo, that1.ExecutorInfo) + } + if len(this.Allocated) != len(that1.Allocated) { + return fmt.Errorf("Allocated this(%v) Not Equal that(%v)", len(this.Allocated), len(that1.Allocated)) + } + for i := range this.Allocated { + if !this.Allocated[i].Equal(that1.Allocated[i]) { + return fmt.Errorf("Allocated this[%v](%v) Not Equal that[%v](%v)", i, this.Allocated[i], i, that1.Allocated[i]) + } + } + if !this.Statistics.Equal(that1.Statistics) { + return fmt.Errorf("Statistics this(%v) Not Equal that(%v)", this.Statistics, that1.Statistics) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *ResourceUsage_Executor) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*ResourceUsage_Executor) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if !this.ExecutorInfo.Equal(that1.ExecutorInfo) { + return false + } + if len(this.Allocated) != len(that1.Allocated) { + return false + } + for i := range this.Allocated { + if !this.Allocated[i].Equal(that1.Allocated[i]) { + return false + } + } + if !this.Statistics.Equal(that1.Statistics) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *PerfStatistics) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*PerfStatistics) + if !ok { + return fmt.Errorf("that is not of type *PerfStatistics") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *PerfStatistics but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *PerfStatisticsbut is not nil && this == nil") + } + if this.Timestamp != nil && that1.Timestamp != nil { + if *this.Timestamp != *that1.Timestamp { + return fmt.Errorf("Timestamp this(%v) Not Equal that(%v)", *this.Timestamp, *that1.Timestamp) + } + } else if this.Timestamp != nil { + return fmt.Errorf("this.Timestamp == nil && that.Timestamp != nil") + } else if that1.Timestamp != nil { + return fmt.Errorf("Timestamp this(%v) Not Equal that(%v)", this.Timestamp, that1.Timestamp) + } + if this.Duration != nil && that1.Duration != nil { + if *this.Duration != *that1.Duration { + return fmt.Errorf("Duration this(%v) Not Equal that(%v)", *this.Duration, *that1.Duration) + } + } else if this.Duration != nil { + return fmt.Errorf("this.Duration == nil && that.Duration != nil") + } else if that1.Duration != nil { + return fmt.Errorf("Duration this(%v) Not Equal that(%v)", this.Duration, that1.Duration) + } + if this.Cycles != nil && that1.Cycles != nil { + if *this.Cycles != *that1.Cycles { + return fmt.Errorf("Cycles this(%v) Not Equal that(%v)", *this.Cycles, *that1.Cycles) + } + } else if this.Cycles != nil { + return fmt.Errorf("this.Cycles == nil && that.Cycles != nil") + } else if that1.Cycles != nil { + return fmt.Errorf("Cycles this(%v) Not Equal that(%v)", this.Cycles, that1.Cycles) + } + if this.StalledCyclesFrontend != nil && that1.StalledCyclesFrontend != nil { + if *this.StalledCyclesFrontend != *that1.StalledCyclesFrontend { + return fmt.Errorf("StalledCyclesFrontend this(%v) Not Equal that(%v)", *this.StalledCyclesFrontend, *that1.StalledCyclesFrontend) + } + } else if this.StalledCyclesFrontend != nil { + return fmt.Errorf("this.StalledCyclesFrontend == nil && that.StalledCyclesFrontend != nil") + } else if that1.StalledCyclesFrontend != nil { + return fmt.Errorf("StalledCyclesFrontend this(%v) Not Equal that(%v)", this.StalledCyclesFrontend, that1.StalledCyclesFrontend) + } + if this.StalledCyclesBackend != nil && that1.StalledCyclesBackend != nil { + if *this.StalledCyclesBackend != *that1.StalledCyclesBackend { + return fmt.Errorf("StalledCyclesBackend this(%v) Not Equal that(%v)", *this.StalledCyclesBackend, *that1.StalledCyclesBackend) + } + } else if this.StalledCyclesBackend != nil { + return fmt.Errorf("this.StalledCyclesBackend == nil && that.StalledCyclesBackend != nil") + } else if that1.StalledCyclesBackend != nil { + return fmt.Errorf("StalledCyclesBackend this(%v) Not Equal that(%v)", this.StalledCyclesBackend, that1.StalledCyclesBackend) + } + if this.Instructions != nil && that1.Instructions != nil { + if *this.Instructions != *that1.Instructions { + return fmt.Errorf("Instructions this(%v) Not Equal that(%v)", *this.Instructions, *that1.Instructions) + } + } else if this.Instructions != nil { + return fmt.Errorf("this.Instructions == nil && that.Instructions != nil") + } else if that1.Instructions != nil { + return fmt.Errorf("Instructions this(%v) Not Equal that(%v)", this.Instructions, that1.Instructions) + } + if this.CacheReferences != nil && that1.CacheReferences != nil { + if *this.CacheReferences != *that1.CacheReferences { + return fmt.Errorf("CacheReferences this(%v) Not Equal that(%v)", *this.CacheReferences, *that1.CacheReferences) + } + } else if this.CacheReferences != nil { + return fmt.Errorf("this.CacheReferences == nil && that.CacheReferences != nil") + } else if that1.CacheReferences != nil { + return fmt.Errorf("CacheReferences this(%v) Not Equal that(%v)", this.CacheReferences, that1.CacheReferences) + } + if this.CacheMisses != nil && that1.CacheMisses != nil { + if *this.CacheMisses != *that1.CacheMisses { + return fmt.Errorf("CacheMisses this(%v) Not Equal that(%v)", *this.CacheMisses, *that1.CacheMisses) + } + } else if this.CacheMisses != nil { + return fmt.Errorf("this.CacheMisses == nil && that.CacheMisses != nil") + } else if that1.CacheMisses != nil { + return fmt.Errorf("CacheMisses this(%v) Not Equal that(%v)", this.CacheMisses, that1.CacheMisses) + } + if this.Branches != nil && that1.Branches != nil { + if *this.Branches != *that1.Branches { + return fmt.Errorf("Branches this(%v) Not Equal that(%v)", *this.Branches, *that1.Branches) + } + } else if this.Branches != nil { + return fmt.Errorf("this.Branches == nil && that.Branches != nil") + } else if that1.Branches != nil { + return fmt.Errorf("Branches this(%v) Not Equal that(%v)", this.Branches, that1.Branches) + } + if this.BranchMisses != nil && that1.BranchMisses != nil { + if *this.BranchMisses != *that1.BranchMisses { + return fmt.Errorf("BranchMisses this(%v) Not Equal that(%v)", *this.BranchMisses, *that1.BranchMisses) + } + } else if this.BranchMisses != nil { + return fmt.Errorf("this.BranchMisses == nil && that.BranchMisses != nil") + } else if that1.BranchMisses != nil { + return fmt.Errorf("BranchMisses this(%v) Not Equal that(%v)", this.BranchMisses, that1.BranchMisses) + } + if this.BusCycles != nil && that1.BusCycles != nil { + if *this.BusCycles != *that1.BusCycles { + return fmt.Errorf("BusCycles this(%v) Not Equal that(%v)", *this.BusCycles, *that1.BusCycles) + } + } else if this.BusCycles != nil { + return fmt.Errorf("this.BusCycles == nil && that.BusCycles != nil") + } else if that1.BusCycles != nil { + return fmt.Errorf("BusCycles this(%v) Not Equal that(%v)", this.BusCycles, that1.BusCycles) + } + if this.RefCycles != nil && that1.RefCycles != nil { + if *this.RefCycles != *that1.RefCycles { + return fmt.Errorf("RefCycles this(%v) Not Equal that(%v)", *this.RefCycles, *that1.RefCycles) + } + } else if this.RefCycles != nil { + return fmt.Errorf("this.RefCycles == nil && that.RefCycles != nil") + } else if that1.RefCycles != nil { + return fmt.Errorf("RefCycles this(%v) Not Equal that(%v)", this.RefCycles, that1.RefCycles) + } + if this.CpuClock != nil && that1.CpuClock != nil { + if *this.CpuClock != *that1.CpuClock { + return fmt.Errorf("CpuClock this(%v) Not Equal that(%v)", *this.CpuClock, *that1.CpuClock) + } + } else if this.CpuClock != nil { + return fmt.Errorf("this.CpuClock == nil && that.CpuClock != nil") + } else if that1.CpuClock != nil { + return fmt.Errorf("CpuClock this(%v) Not Equal that(%v)", this.CpuClock, that1.CpuClock) + } + if this.TaskClock != nil && that1.TaskClock != nil { + if *this.TaskClock != *that1.TaskClock { + return fmt.Errorf("TaskClock this(%v) Not Equal that(%v)", *this.TaskClock, *that1.TaskClock) + } + } else if this.TaskClock != nil { + return fmt.Errorf("this.TaskClock == nil && that.TaskClock != nil") + } else if that1.TaskClock != nil { + return fmt.Errorf("TaskClock this(%v) Not Equal that(%v)", this.TaskClock, that1.TaskClock) + } + if this.PageFaults != nil && that1.PageFaults != nil { + if *this.PageFaults != *that1.PageFaults { + return fmt.Errorf("PageFaults this(%v) Not Equal that(%v)", *this.PageFaults, *that1.PageFaults) + } + } else if this.PageFaults != nil { + return fmt.Errorf("this.PageFaults == nil && that.PageFaults != nil") + } else if that1.PageFaults != nil { + return fmt.Errorf("PageFaults this(%v) Not Equal that(%v)", this.PageFaults, that1.PageFaults) + } + if this.MinorFaults != nil && that1.MinorFaults != nil { + if *this.MinorFaults != *that1.MinorFaults { + return fmt.Errorf("MinorFaults this(%v) Not Equal that(%v)", *this.MinorFaults, *that1.MinorFaults) + } + } else if this.MinorFaults != nil { + return fmt.Errorf("this.MinorFaults == nil && that.MinorFaults != nil") + } else if that1.MinorFaults != nil { + return fmt.Errorf("MinorFaults this(%v) Not Equal that(%v)", this.MinorFaults, that1.MinorFaults) + } + if this.MajorFaults != nil && that1.MajorFaults != nil { + if *this.MajorFaults != *that1.MajorFaults { + return fmt.Errorf("MajorFaults this(%v) Not Equal that(%v)", *this.MajorFaults, *that1.MajorFaults) + } + } else if this.MajorFaults != nil { + return fmt.Errorf("this.MajorFaults == nil && that.MajorFaults != nil") + } else if that1.MajorFaults != nil { + return fmt.Errorf("MajorFaults this(%v) Not Equal that(%v)", this.MajorFaults, that1.MajorFaults) + } + if this.ContextSwitches != nil && that1.ContextSwitches != nil { + if *this.ContextSwitches != *that1.ContextSwitches { + return fmt.Errorf("ContextSwitches this(%v) Not Equal that(%v)", *this.ContextSwitches, *that1.ContextSwitches) + } + } else if this.ContextSwitches != nil { + return fmt.Errorf("this.ContextSwitches == nil && that.ContextSwitches != nil") + } else if that1.ContextSwitches != nil { + return fmt.Errorf("ContextSwitches this(%v) Not Equal that(%v)", this.ContextSwitches, that1.ContextSwitches) + } + if this.CpuMigrations != nil && that1.CpuMigrations != nil { + if *this.CpuMigrations != *that1.CpuMigrations { + return fmt.Errorf("CpuMigrations this(%v) Not Equal that(%v)", *this.CpuMigrations, *that1.CpuMigrations) + } + } else if this.CpuMigrations != nil { + return fmt.Errorf("this.CpuMigrations == nil && that.CpuMigrations != nil") + } else if that1.CpuMigrations != nil { + return fmt.Errorf("CpuMigrations this(%v) Not Equal that(%v)", this.CpuMigrations, that1.CpuMigrations) + } + if this.AlignmentFaults != nil && that1.AlignmentFaults != nil { + if *this.AlignmentFaults != *that1.AlignmentFaults { + return fmt.Errorf("AlignmentFaults this(%v) Not Equal that(%v)", *this.AlignmentFaults, *that1.AlignmentFaults) + } + } else if this.AlignmentFaults != nil { + return fmt.Errorf("this.AlignmentFaults == nil && that.AlignmentFaults != nil") + } else if that1.AlignmentFaults != nil { + return fmt.Errorf("AlignmentFaults this(%v) Not Equal that(%v)", this.AlignmentFaults, that1.AlignmentFaults) + } + if this.EmulationFaults != nil && that1.EmulationFaults != nil { + if *this.EmulationFaults != *that1.EmulationFaults { + return fmt.Errorf("EmulationFaults this(%v) Not Equal that(%v)", *this.EmulationFaults, *that1.EmulationFaults) + } + } else if this.EmulationFaults != nil { + return fmt.Errorf("this.EmulationFaults == nil && that.EmulationFaults != nil") + } else if that1.EmulationFaults != nil { + return fmt.Errorf("EmulationFaults this(%v) Not Equal that(%v)", this.EmulationFaults, that1.EmulationFaults) + } + if this.L1DcacheLoads != nil && that1.L1DcacheLoads != nil { + if *this.L1DcacheLoads != *that1.L1DcacheLoads { + return fmt.Errorf("L1DcacheLoads this(%v) Not Equal that(%v)", *this.L1DcacheLoads, *that1.L1DcacheLoads) + } + } else if this.L1DcacheLoads != nil { + return fmt.Errorf("this.L1DcacheLoads == nil && that.L1DcacheLoads != nil") + } else if that1.L1DcacheLoads != nil { + return fmt.Errorf("L1DcacheLoads this(%v) Not Equal that(%v)", this.L1DcacheLoads, that1.L1DcacheLoads) + } + if this.L1DcacheLoadMisses != nil && that1.L1DcacheLoadMisses != nil { + if *this.L1DcacheLoadMisses != *that1.L1DcacheLoadMisses { + return fmt.Errorf("L1DcacheLoadMisses this(%v) Not Equal that(%v)", *this.L1DcacheLoadMisses, *that1.L1DcacheLoadMisses) + } + } else if this.L1DcacheLoadMisses != nil { + return fmt.Errorf("this.L1DcacheLoadMisses == nil && that.L1DcacheLoadMisses != nil") + } else if that1.L1DcacheLoadMisses != nil { + return fmt.Errorf("L1DcacheLoadMisses this(%v) Not Equal that(%v)", this.L1DcacheLoadMisses, that1.L1DcacheLoadMisses) + } + if this.L1DcacheStores != nil && that1.L1DcacheStores != nil { + if *this.L1DcacheStores != *that1.L1DcacheStores { + return fmt.Errorf("L1DcacheStores this(%v) Not Equal that(%v)", *this.L1DcacheStores, *that1.L1DcacheStores) + } + } else if this.L1DcacheStores != nil { + return fmt.Errorf("this.L1DcacheStores == nil && that.L1DcacheStores != nil") + } else if that1.L1DcacheStores != nil { + return fmt.Errorf("L1DcacheStores this(%v) Not Equal that(%v)", this.L1DcacheStores, that1.L1DcacheStores) + } + if this.L1DcacheStoreMisses != nil && that1.L1DcacheStoreMisses != nil { + if *this.L1DcacheStoreMisses != *that1.L1DcacheStoreMisses { + return fmt.Errorf("L1DcacheStoreMisses this(%v) Not Equal that(%v)", *this.L1DcacheStoreMisses, *that1.L1DcacheStoreMisses) + } + } else if this.L1DcacheStoreMisses != nil { + return fmt.Errorf("this.L1DcacheStoreMisses == nil && that.L1DcacheStoreMisses != nil") + } else if that1.L1DcacheStoreMisses != nil { + return fmt.Errorf("L1DcacheStoreMisses this(%v) Not Equal that(%v)", this.L1DcacheStoreMisses, that1.L1DcacheStoreMisses) + } + if this.L1DcachePrefetches != nil && that1.L1DcachePrefetches != nil { + if *this.L1DcachePrefetches != *that1.L1DcachePrefetches { + return fmt.Errorf("L1DcachePrefetches this(%v) Not Equal that(%v)", *this.L1DcachePrefetches, *that1.L1DcachePrefetches) + } + } else if this.L1DcachePrefetches != nil { + return fmt.Errorf("this.L1DcachePrefetches == nil && that.L1DcachePrefetches != nil") + } else if that1.L1DcachePrefetches != nil { + return fmt.Errorf("L1DcachePrefetches this(%v) Not Equal that(%v)", this.L1DcachePrefetches, that1.L1DcachePrefetches) + } + if this.L1DcachePrefetchMisses != nil && that1.L1DcachePrefetchMisses != nil { + if *this.L1DcachePrefetchMisses != *that1.L1DcachePrefetchMisses { + return fmt.Errorf("L1DcachePrefetchMisses this(%v) Not Equal that(%v)", *this.L1DcachePrefetchMisses, *that1.L1DcachePrefetchMisses) + } + } else if this.L1DcachePrefetchMisses != nil { + return fmt.Errorf("this.L1DcachePrefetchMisses == nil && that.L1DcachePrefetchMisses != nil") + } else if that1.L1DcachePrefetchMisses != nil { + return fmt.Errorf("L1DcachePrefetchMisses this(%v) Not Equal that(%v)", this.L1DcachePrefetchMisses, that1.L1DcachePrefetchMisses) + } + if this.L1IcacheLoads != nil && that1.L1IcacheLoads != nil { + if *this.L1IcacheLoads != *that1.L1IcacheLoads { + return fmt.Errorf("L1IcacheLoads this(%v) Not Equal that(%v)", *this.L1IcacheLoads, *that1.L1IcacheLoads) + } + } else if this.L1IcacheLoads != nil { + return fmt.Errorf("this.L1IcacheLoads == nil && that.L1IcacheLoads != nil") + } else if that1.L1IcacheLoads != nil { + return fmt.Errorf("L1IcacheLoads this(%v) Not Equal that(%v)", this.L1IcacheLoads, that1.L1IcacheLoads) + } + if this.L1IcacheLoadMisses != nil && that1.L1IcacheLoadMisses != nil { + if *this.L1IcacheLoadMisses != *that1.L1IcacheLoadMisses { + return fmt.Errorf("L1IcacheLoadMisses this(%v) Not Equal that(%v)", *this.L1IcacheLoadMisses, *that1.L1IcacheLoadMisses) + } + } else if this.L1IcacheLoadMisses != nil { + return fmt.Errorf("this.L1IcacheLoadMisses == nil && that.L1IcacheLoadMisses != nil") + } else if that1.L1IcacheLoadMisses != nil { + return fmt.Errorf("L1IcacheLoadMisses this(%v) Not Equal that(%v)", this.L1IcacheLoadMisses, that1.L1IcacheLoadMisses) + } + if this.L1IcachePrefetches != nil && that1.L1IcachePrefetches != nil { + if *this.L1IcachePrefetches != *that1.L1IcachePrefetches { + return fmt.Errorf("L1IcachePrefetches this(%v) Not Equal that(%v)", *this.L1IcachePrefetches, *that1.L1IcachePrefetches) + } + } else if this.L1IcachePrefetches != nil { + return fmt.Errorf("this.L1IcachePrefetches == nil && that.L1IcachePrefetches != nil") + } else if that1.L1IcachePrefetches != nil { + return fmt.Errorf("L1IcachePrefetches this(%v) Not Equal that(%v)", this.L1IcachePrefetches, that1.L1IcachePrefetches) + } + if this.L1IcachePrefetchMisses != nil && that1.L1IcachePrefetchMisses != nil { + if *this.L1IcachePrefetchMisses != *that1.L1IcachePrefetchMisses { + return fmt.Errorf("L1IcachePrefetchMisses this(%v) Not Equal that(%v)", *this.L1IcachePrefetchMisses, *that1.L1IcachePrefetchMisses) + } + } else if this.L1IcachePrefetchMisses != nil { + return fmt.Errorf("this.L1IcachePrefetchMisses == nil && that.L1IcachePrefetchMisses != nil") + } else if that1.L1IcachePrefetchMisses != nil { + return fmt.Errorf("L1IcachePrefetchMisses this(%v) Not Equal that(%v)", this.L1IcachePrefetchMisses, that1.L1IcachePrefetchMisses) + } + if this.LlcLoads != nil && that1.LlcLoads != nil { + if *this.LlcLoads != *that1.LlcLoads { + return fmt.Errorf("LlcLoads this(%v) Not Equal that(%v)", *this.LlcLoads, *that1.LlcLoads) + } + } else if this.LlcLoads != nil { + return fmt.Errorf("this.LlcLoads == nil && that.LlcLoads != nil") + } else if that1.LlcLoads != nil { + return fmt.Errorf("LlcLoads this(%v) Not Equal that(%v)", this.LlcLoads, that1.LlcLoads) + } + if this.LlcLoadMisses != nil && that1.LlcLoadMisses != nil { + if *this.LlcLoadMisses != *that1.LlcLoadMisses { + return fmt.Errorf("LlcLoadMisses this(%v) Not Equal that(%v)", *this.LlcLoadMisses, *that1.LlcLoadMisses) + } + } else if this.LlcLoadMisses != nil { + return fmt.Errorf("this.LlcLoadMisses == nil && that.LlcLoadMisses != nil") + } else if that1.LlcLoadMisses != nil { + return fmt.Errorf("LlcLoadMisses this(%v) Not Equal that(%v)", this.LlcLoadMisses, that1.LlcLoadMisses) + } + if this.LlcStores != nil && that1.LlcStores != nil { + if *this.LlcStores != *that1.LlcStores { + return fmt.Errorf("LlcStores this(%v) Not Equal that(%v)", *this.LlcStores, *that1.LlcStores) + } + } else if this.LlcStores != nil { + return fmt.Errorf("this.LlcStores == nil && that.LlcStores != nil") + } else if that1.LlcStores != nil { + return fmt.Errorf("LlcStores this(%v) Not Equal that(%v)", this.LlcStores, that1.LlcStores) + } + if this.LlcStoreMisses != nil && that1.LlcStoreMisses != nil { + if *this.LlcStoreMisses != *that1.LlcStoreMisses { + return fmt.Errorf("LlcStoreMisses this(%v) Not Equal that(%v)", *this.LlcStoreMisses, *that1.LlcStoreMisses) + } + } else if this.LlcStoreMisses != nil { + return fmt.Errorf("this.LlcStoreMisses == nil && that.LlcStoreMisses != nil") + } else if that1.LlcStoreMisses != nil { + return fmt.Errorf("LlcStoreMisses this(%v) Not Equal that(%v)", this.LlcStoreMisses, that1.LlcStoreMisses) + } + if this.LlcPrefetches != nil && that1.LlcPrefetches != nil { + if *this.LlcPrefetches != *that1.LlcPrefetches { + return fmt.Errorf("LlcPrefetches this(%v) Not Equal that(%v)", *this.LlcPrefetches, *that1.LlcPrefetches) + } + } else if this.LlcPrefetches != nil { + return fmt.Errorf("this.LlcPrefetches == nil && that.LlcPrefetches != nil") + } else if that1.LlcPrefetches != nil { + return fmt.Errorf("LlcPrefetches this(%v) Not Equal that(%v)", this.LlcPrefetches, that1.LlcPrefetches) + } + if this.LlcPrefetchMisses != nil && that1.LlcPrefetchMisses != nil { + if *this.LlcPrefetchMisses != *that1.LlcPrefetchMisses { + return fmt.Errorf("LlcPrefetchMisses this(%v) Not Equal that(%v)", *this.LlcPrefetchMisses, *that1.LlcPrefetchMisses) + } + } else if this.LlcPrefetchMisses != nil { + return fmt.Errorf("this.LlcPrefetchMisses == nil && that.LlcPrefetchMisses != nil") + } else if that1.LlcPrefetchMisses != nil { + return fmt.Errorf("LlcPrefetchMisses this(%v) Not Equal that(%v)", this.LlcPrefetchMisses, that1.LlcPrefetchMisses) + } + if this.DtlbLoads != nil && that1.DtlbLoads != nil { + if *this.DtlbLoads != *that1.DtlbLoads { + return fmt.Errorf("DtlbLoads this(%v) Not Equal that(%v)", *this.DtlbLoads, *that1.DtlbLoads) + } + } else if this.DtlbLoads != nil { + return fmt.Errorf("this.DtlbLoads == nil && that.DtlbLoads != nil") + } else if that1.DtlbLoads != nil { + return fmt.Errorf("DtlbLoads this(%v) Not Equal that(%v)", this.DtlbLoads, that1.DtlbLoads) + } + if this.DtlbLoadMisses != nil && that1.DtlbLoadMisses != nil { + if *this.DtlbLoadMisses != *that1.DtlbLoadMisses { + return fmt.Errorf("DtlbLoadMisses this(%v) Not Equal that(%v)", *this.DtlbLoadMisses, *that1.DtlbLoadMisses) + } + } else if this.DtlbLoadMisses != nil { + return fmt.Errorf("this.DtlbLoadMisses == nil && that.DtlbLoadMisses != nil") + } else if that1.DtlbLoadMisses != nil { + return fmt.Errorf("DtlbLoadMisses this(%v) Not Equal that(%v)", this.DtlbLoadMisses, that1.DtlbLoadMisses) + } + if this.DtlbStores != nil && that1.DtlbStores != nil { + if *this.DtlbStores != *that1.DtlbStores { + return fmt.Errorf("DtlbStores this(%v) Not Equal that(%v)", *this.DtlbStores, *that1.DtlbStores) + } + } else if this.DtlbStores != nil { + return fmt.Errorf("this.DtlbStores == nil && that.DtlbStores != nil") + } else if that1.DtlbStores != nil { + return fmt.Errorf("DtlbStores this(%v) Not Equal that(%v)", this.DtlbStores, that1.DtlbStores) + } + if this.DtlbStoreMisses != nil && that1.DtlbStoreMisses != nil { + if *this.DtlbStoreMisses != *that1.DtlbStoreMisses { + return fmt.Errorf("DtlbStoreMisses this(%v) Not Equal that(%v)", *this.DtlbStoreMisses, *that1.DtlbStoreMisses) + } + } else if this.DtlbStoreMisses != nil { + return fmt.Errorf("this.DtlbStoreMisses == nil && that.DtlbStoreMisses != nil") + } else if that1.DtlbStoreMisses != nil { + return fmt.Errorf("DtlbStoreMisses this(%v) Not Equal that(%v)", this.DtlbStoreMisses, that1.DtlbStoreMisses) + } + if this.DtlbPrefetches != nil && that1.DtlbPrefetches != nil { + if *this.DtlbPrefetches != *that1.DtlbPrefetches { + return fmt.Errorf("DtlbPrefetches this(%v) Not Equal that(%v)", *this.DtlbPrefetches, *that1.DtlbPrefetches) + } + } else if this.DtlbPrefetches != nil { + return fmt.Errorf("this.DtlbPrefetches == nil && that.DtlbPrefetches != nil") + } else if that1.DtlbPrefetches != nil { + return fmt.Errorf("DtlbPrefetches this(%v) Not Equal that(%v)", this.DtlbPrefetches, that1.DtlbPrefetches) + } + if this.DtlbPrefetchMisses != nil && that1.DtlbPrefetchMisses != nil { + if *this.DtlbPrefetchMisses != *that1.DtlbPrefetchMisses { + return fmt.Errorf("DtlbPrefetchMisses this(%v) Not Equal that(%v)", *this.DtlbPrefetchMisses, *that1.DtlbPrefetchMisses) + } + } else if this.DtlbPrefetchMisses != nil { + return fmt.Errorf("this.DtlbPrefetchMisses == nil && that.DtlbPrefetchMisses != nil") + } else if that1.DtlbPrefetchMisses != nil { + return fmt.Errorf("DtlbPrefetchMisses this(%v) Not Equal that(%v)", this.DtlbPrefetchMisses, that1.DtlbPrefetchMisses) + } + if this.ItlbLoads != nil && that1.ItlbLoads != nil { + if *this.ItlbLoads != *that1.ItlbLoads { + return fmt.Errorf("ItlbLoads this(%v) Not Equal that(%v)", *this.ItlbLoads, *that1.ItlbLoads) + } + } else if this.ItlbLoads != nil { + return fmt.Errorf("this.ItlbLoads == nil && that.ItlbLoads != nil") + } else if that1.ItlbLoads != nil { + return fmt.Errorf("ItlbLoads this(%v) Not Equal that(%v)", this.ItlbLoads, that1.ItlbLoads) + } + if this.ItlbLoadMisses != nil && that1.ItlbLoadMisses != nil { + if *this.ItlbLoadMisses != *that1.ItlbLoadMisses { + return fmt.Errorf("ItlbLoadMisses this(%v) Not Equal that(%v)", *this.ItlbLoadMisses, *that1.ItlbLoadMisses) + } + } else if this.ItlbLoadMisses != nil { + return fmt.Errorf("this.ItlbLoadMisses == nil && that.ItlbLoadMisses != nil") + } else if that1.ItlbLoadMisses != nil { + return fmt.Errorf("ItlbLoadMisses this(%v) Not Equal that(%v)", this.ItlbLoadMisses, that1.ItlbLoadMisses) + } + if this.BranchLoads != nil && that1.BranchLoads != nil { + if *this.BranchLoads != *that1.BranchLoads { + return fmt.Errorf("BranchLoads this(%v) Not Equal that(%v)", *this.BranchLoads, *that1.BranchLoads) + } + } else if this.BranchLoads != nil { + return fmt.Errorf("this.BranchLoads == nil && that.BranchLoads != nil") + } else if that1.BranchLoads != nil { + return fmt.Errorf("BranchLoads this(%v) Not Equal that(%v)", this.BranchLoads, that1.BranchLoads) + } + if this.BranchLoadMisses != nil && that1.BranchLoadMisses != nil { + if *this.BranchLoadMisses != *that1.BranchLoadMisses { + return fmt.Errorf("BranchLoadMisses this(%v) Not Equal that(%v)", *this.BranchLoadMisses, *that1.BranchLoadMisses) + } + } else if this.BranchLoadMisses != nil { + return fmt.Errorf("this.BranchLoadMisses == nil && that.BranchLoadMisses != nil") + } else if that1.BranchLoadMisses != nil { + return fmt.Errorf("BranchLoadMisses this(%v) Not Equal that(%v)", this.BranchLoadMisses, that1.BranchLoadMisses) + } + if this.NodeLoads != nil && that1.NodeLoads != nil { + if *this.NodeLoads != *that1.NodeLoads { + return fmt.Errorf("NodeLoads this(%v) Not Equal that(%v)", *this.NodeLoads, *that1.NodeLoads) + } + } else if this.NodeLoads != nil { + return fmt.Errorf("this.NodeLoads == nil && that.NodeLoads != nil") + } else if that1.NodeLoads != nil { + return fmt.Errorf("NodeLoads this(%v) Not Equal that(%v)", this.NodeLoads, that1.NodeLoads) + } + if this.NodeLoadMisses != nil && that1.NodeLoadMisses != nil { + if *this.NodeLoadMisses != *that1.NodeLoadMisses { + return fmt.Errorf("NodeLoadMisses this(%v) Not Equal that(%v)", *this.NodeLoadMisses, *that1.NodeLoadMisses) + } + } else if this.NodeLoadMisses != nil { + return fmt.Errorf("this.NodeLoadMisses == nil && that.NodeLoadMisses != nil") + } else if that1.NodeLoadMisses != nil { + return fmt.Errorf("NodeLoadMisses this(%v) Not Equal that(%v)", this.NodeLoadMisses, that1.NodeLoadMisses) + } + if this.NodeStores != nil && that1.NodeStores != nil { + if *this.NodeStores != *that1.NodeStores { + return fmt.Errorf("NodeStores this(%v) Not Equal that(%v)", *this.NodeStores, *that1.NodeStores) + } + } else if this.NodeStores != nil { + return fmt.Errorf("this.NodeStores == nil && that.NodeStores != nil") + } else if that1.NodeStores != nil { + return fmt.Errorf("NodeStores this(%v) Not Equal that(%v)", this.NodeStores, that1.NodeStores) + } + if this.NodeStoreMisses != nil && that1.NodeStoreMisses != nil { + if *this.NodeStoreMisses != *that1.NodeStoreMisses { + return fmt.Errorf("NodeStoreMisses this(%v) Not Equal that(%v)", *this.NodeStoreMisses, *that1.NodeStoreMisses) + } + } else if this.NodeStoreMisses != nil { + return fmt.Errorf("this.NodeStoreMisses == nil && that.NodeStoreMisses != nil") + } else if that1.NodeStoreMisses != nil { + return fmt.Errorf("NodeStoreMisses this(%v) Not Equal that(%v)", this.NodeStoreMisses, that1.NodeStoreMisses) + } + if this.NodePrefetches != nil && that1.NodePrefetches != nil { + if *this.NodePrefetches != *that1.NodePrefetches { + return fmt.Errorf("NodePrefetches this(%v) Not Equal that(%v)", *this.NodePrefetches, *that1.NodePrefetches) + } + } else if this.NodePrefetches != nil { + return fmt.Errorf("this.NodePrefetches == nil && that.NodePrefetches != nil") + } else if that1.NodePrefetches != nil { + return fmt.Errorf("NodePrefetches this(%v) Not Equal that(%v)", this.NodePrefetches, that1.NodePrefetches) + } + if this.NodePrefetchMisses != nil && that1.NodePrefetchMisses != nil { + if *this.NodePrefetchMisses != *that1.NodePrefetchMisses { + return fmt.Errorf("NodePrefetchMisses this(%v) Not Equal that(%v)", *this.NodePrefetchMisses, *that1.NodePrefetchMisses) + } + } else if this.NodePrefetchMisses != nil { + return fmt.Errorf("this.NodePrefetchMisses == nil && that.NodePrefetchMisses != nil") + } else if that1.NodePrefetchMisses != nil { + return fmt.Errorf("NodePrefetchMisses this(%v) Not Equal that(%v)", this.NodePrefetchMisses, that1.NodePrefetchMisses) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *PerfStatistics) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*PerfStatistics) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Timestamp != nil && that1.Timestamp != nil { + if *this.Timestamp != *that1.Timestamp { + return false + } + } else if this.Timestamp != nil { + return false + } else if that1.Timestamp != nil { + return false + } + if this.Duration != nil && that1.Duration != nil { + if *this.Duration != *that1.Duration { + return false + } + } else if this.Duration != nil { + return false + } else if that1.Duration != nil { + return false + } + if this.Cycles != nil && that1.Cycles != nil { + if *this.Cycles != *that1.Cycles { + return false + } + } else if this.Cycles != nil { + return false + } else if that1.Cycles != nil { + return false + } + if this.StalledCyclesFrontend != nil && that1.StalledCyclesFrontend != nil { + if *this.StalledCyclesFrontend != *that1.StalledCyclesFrontend { + return false + } + } else if this.StalledCyclesFrontend != nil { + return false + } else if that1.StalledCyclesFrontend != nil { + return false + } + if this.StalledCyclesBackend != nil && that1.StalledCyclesBackend != nil { + if *this.StalledCyclesBackend != *that1.StalledCyclesBackend { + return false + } + } else if this.StalledCyclesBackend != nil { + return false + } else if that1.StalledCyclesBackend != nil { + return false + } + if this.Instructions != nil && that1.Instructions != nil { + if *this.Instructions != *that1.Instructions { + return false + } + } else if this.Instructions != nil { + return false + } else if that1.Instructions != nil { + return false + } + if this.CacheReferences != nil && that1.CacheReferences != nil { + if *this.CacheReferences != *that1.CacheReferences { + return false + } + } else if this.CacheReferences != nil { + return false + } else if that1.CacheReferences != nil { + return false + } + if this.CacheMisses != nil && that1.CacheMisses != nil { + if *this.CacheMisses != *that1.CacheMisses { + return false + } + } else if this.CacheMisses != nil { + return false + } else if that1.CacheMisses != nil { + return false + } + if this.Branches != nil && that1.Branches != nil { + if *this.Branches != *that1.Branches { + return false + } + } else if this.Branches != nil { + return false + } else if that1.Branches != nil { + return false + } + if this.BranchMisses != nil && that1.BranchMisses != nil { + if *this.BranchMisses != *that1.BranchMisses { + return false + } + } else if this.BranchMisses != nil { + return false + } else if that1.BranchMisses != nil { + return false + } + if this.BusCycles != nil && that1.BusCycles != nil { + if *this.BusCycles != *that1.BusCycles { + return false + } + } else if this.BusCycles != nil { + return false + } else if that1.BusCycles != nil { + return false + } + if this.RefCycles != nil && that1.RefCycles != nil { + if *this.RefCycles != *that1.RefCycles { + return false + } + } else if this.RefCycles != nil { + return false + } else if that1.RefCycles != nil { + return false + } + if this.CpuClock != nil && that1.CpuClock != nil { + if *this.CpuClock != *that1.CpuClock { + return false + } + } else if this.CpuClock != nil { + return false + } else if that1.CpuClock != nil { + return false + } + if this.TaskClock != nil && that1.TaskClock != nil { + if *this.TaskClock != *that1.TaskClock { + return false + } + } else if this.TaskClock != nil { + return false + } else if that1.TaskClock != nil { + return false + } + if this.PageFaults != nil && that1.PageFaults != nil { + if *this.PageFaults != *that1.PageFaults { + return false + } + } else if this.PageFaults != nil { + return false + } else if that1.PageFaults != nil { + return false + } + if this.MinorFaults != nil && that1.MinorFaults != nil { + if *this.MinorFaults != *that1.MinorFaults { + return false + } + } else if this.MinorFaults != nil { + return false + } else if that1.MinorFaults != nil { + return false + } + if this.MajorFaults != nil && that1.MajorFaults != nil { + if *this.MajorFaults != *that1.MajorFaults { + return false + } + } else if this.MajorFaults != nil { + return false + } else if that1.MajorFaults != nil { + return false + } + if this.ContextSwitches != nil && that1.ContextSwitches != nil { + if *this.ContextSwitches != *that1.ContextSwitches { + return false + } + } else if this.ContextSwitches != nil { + return false + } else if that1.ContextSwitches != nil { + return false + } + if this.CpuMigrations != nil && that1.CpuMigrations != nil { + if *this.CpuMigrations != *that1.CpuMigrations { + return false + } + } else if this.CpuMigrations != nil { + return false + } else if that1.CpuMigrations != nil { + return false + } + if this.AlignmentFaults != nil && that1.AlignmentFaults != nil { + if *this.AlignmentFaults != *that1.AlignmentFaults { + return false + } + } else if this.AlignmentFaults != nil { + return false + } else if that1.AlignmentFaults != nil { + return false + } + if this.EmulationFaults != nil && that1.EmulationFaults != nil { + if *this.EmulationFaults != *that1.EmulationFaults { + return false + } + } else if this.EmulationFaults != nil { + return false + } else if that1.EmulationFaults != nil { + return false + } + if this.L1DcacheLoads != nil && that1.L1DcacheLoads != nil { + if *this.L1DcacheLoads != *that1.L1DcacheLoads { + return false + } + } else if this.L1DcacheLoads != nil { + return false + } else if that1.L1DcacheLoads != nil { + return false + } + if this.L1DcacheLoadMisses != nil && that1.L1DcacheLoadMisses != nil { + if *this.L1DcacheLoadMisses != *that1.L1DcacheLoadMisses { + return false + } + } else if this.L1DcacheLoadMisses != nil { + return false + } else if that1.L1DcacheLoadMisses != nil { + return false + } + if this.L1DcacheStores != nil && that1.L1DcacheStores != nil { + if *this.L1DcacheStores != *that1.L1DcacheStores { + return false + } + } else if this.L1DcacheStores != nil { + return false + } else if that1.L1DcacheStores != nil { + return false + } + if this.L1DcacheStoreMisses != nil && that1.L1DcacheStoreMisses != nil { + if *this.L1DcacheStoreMisses != *that1.L1DcacheStoreMisses { + return false + } + } else if this.L1DcacheStoreMisses != nil { + return false + } else if that1.L1DcacheStoreMisses != nil { + return false + } + if this.L1DcachePrefetches != nil && that1.L1DcachePrefetches != nil { + if *this.L1DcachePrefetches != *that1.L1DcachePrefetches { + return false + } + } else if this.L1DcachePrefetches != nil { + return false + } else if that1.L1DcachePrefetches != nil { + return false + } + if this.L1DcachePrefetchMisses != nil && that1.L1DcachePrefetchMisses != nil { + if *this.L1DcachePrefetchMisses != *that1.L1DcachePrefetchMisses { + return false + } + } else if this.L1DcachePrefetchMisses != nil { + return false + } else if that1.L1DcachePrefetchMisses != nil { + return false + } + if this.L1IcacheLoads != nil && that1.L1IcacheLoads != nil { + if *this.L1IcacheLoads != *that1.L1IcacheLoads { + return false + } + } else if this.L1IcacheLoads != nil { + return false + } else if that1.L1IcacheLoads != nil { + return false + } + if this.L1IcacheLoadMisses != nil && that1.L1IcacheLoadMisses != nil { + if *this.L1IcacheLoadMisses != *that1.L1IcacheLoadMisses { + return false + } + } else if this.L1IcacheLoadMisses != nil { + return false + } else if that1.L1IcacheLoadMisses != nil { + return false + } + if this.L1IcachePrefetches != nil && that1.L1IcachePrefetches != nil { + if *this.L1IcachePrefetches != *that1.L1IcachePrefetches { + return false + } + } else if this.L1IcachePrefetches != nil { + return false + } else if that1.L1IcachePrefetches != nil { + return false + } + if this.L1IcachePrefetchMisses != nil && that1.L1IcachePrefetchMisses != nil { + if *this.L1IcachePrefetchMisses != *that1.L1IcachePrefetchMisses { + return false + } + } else if this.L1IcachePrefetchMisses != nil { + return false + } else if that1.L1IcachePrefetchMisses != nil { + return false + } + if this.LlcLoads != nil && that1.LlcLoads != nil { + if *this.LlcLoads != *that1.LlcLoads { + return false + } + } else if this.LlcLoads != nil { + return false + } else if that1.LlcLoads != nil { + return false + } + if this.LlcLoadMisses != nil && that1.LlcLoadMisses != nil { + if *this.LlcLoadMisses != *that1.LlcLoadMisses { + return false + } + } else if this.LlcLoadMisses != nil { + return false + } else if that1.LlcLoadMisses != nil { + return false + } + if this.LlcStores != nil && that1.LlcStores != nil { + if *this.LlcStores != *that1.LlcStores { + return false + } + } else if this.LlcStores != nil { + return false + } else if that1.LlcStores != nil { + return false + } + if this.LlcStoreMisses != nil && that1.LlcStoreMisses != nil { + if *this.LlcStoreMisses != *that1.LlcStoreMisses { + return false + } + } else if this.LlcStoreMisses != nil { + return false + } else if that1.LlcStoreMisses != nil { + return false + } + if this.LlcPrefetches != nil && that1.LlcPrefetches != nil { + if *this.LlcPrefetches != *that1.LlcPrefetches { + return false + } + } else if this.LlcPrefetches != nil { + return false + } else if that1.LlcPrefetches != nil { + return false + } + if this.LlcPrefetchMisses != nil && that1.LlcPrefetchMisses != nil { + if *this.LlcPrefetchMisses != *that1.LlcPrefetchMisses { + return false + } + } else if this.LlcPrefetchMisses != nil { + return false + } else if that1.LlcPrefetchMisses != nil { + return false + } + if this.DtlbLoads != nil && that1.DtlbLoads != nil { + if *this.DtlbLoads != *that1.DtlbLoads { + return false + } + } else if this.DtlbLoads != nil { + return false + } else if that1.DtlbLoads != nil { + return false + } + if this.DtlbLoadMisses != nil && that1.DtlbLoadMisses != nil { + if *this.DtlbLoadMisses != *that1.DtlbLoadMisses { + return false + } + } else if this.DtlbLoadMisses != nil { + return false + } else if that1.DtlbLoadMisses != nil { + return false + } + if this.DtlbStores != nil && that1.DtlbStores != nil { + if *this.DtlbStores != *that1.DtlbStores { + return false + } + } else if this.DtlbStores != nil { + return false + } else if that1.DtlbStores != nil { + return false + } + if this.DtlbStoreMisses != nil && that1.DtlbStoreMisses != nil { + if *this.DtlbStoreMisses != *that1.DtlbStoreMisses { + return false + } + } else if this.DtlbStoreMisses != nil { + return false + } else if that1.DtlbStoreMisses != nil { + return false + } + if this.DtlbPrefetches != nil && that1.DtlbPrefetches != nil { + if *this.DtlbPrefetches != *that1.DtlbPrefetches { + return false + } + } else if this.DtlbPrefetches != nil { + return false + } else if that1.DtlbPrefetches != nil { + return false + } + if this.DtlbPrefetchMisses != nil && that1.DtlbPrefetchMisses != nil { + if *this.DtlbPrefetchMisses != *that1.DtlbPrefetchMisses { + return false + } + } else if this.DtlbPrefetchMisses != nil { + return false + } else if that1.DtlbPrefetchMisses != nil { + return false + } + if this.ItlbLoads != nil && that1.ItlbLoads != nil { + if *this.ItlbLoads != *that1.ItlbLoads { + return false + } + } else if this.ItlbLoads != nil { + return false + } else if that1.ItlbLoads != nil { + return false + } + if this.ItlbLoadMisses != nil && that1.ItlbLoadMisses != nil { + if *this.ItlbLoadMisses != *that1.ItlbLoadMisses { + return false + } + } else if this.ItlbLoadMisses != nil { + return false + } else if that1.ItlbLoadMisses != nil { + return false + } + if this.BranchLoads != nil && that1.BranchLoads != nil { + if *this.BranchLoads != *that1.BranchLoads { + return false + } + } else if this.BranchLoads != nil { + return false + } else if that1.BranchLoads != nil { + return false + } + if this.BranchLoadMisses != nil && that1.BranchLoadMisses != nil { + if *this.BranchLoadMisses != *that1.BranchLoadMisses { + return false + } + } else if this.BranchLoadMisses != nil { + return false + } else if that1.BranchLoadMisses != nil { + return false + } + if this.NodeLoads != nil && that1.NodeLoads != nil { + if *this.NodeLoads != *that1.NodeLoads { + return false + } + } else if this.NodeLoads != nil { + return false + } else if that1.NodeLoads != nil { + return false + } + if this.NodeLoadMisses != nil && that1.NodeLoadMisses != nil { + if *this.NodeLoadMisses != *that1.NodeLoadMisses { + return false + } + } else if this.NodeLoadMisses != nil { + return false + } else if that1.NodeLoadMisses != nil { + return false + } + if this.NodeStores != nil && that1.NodeStores != nil { + if *this.NodeStores != *that1.NodeStores { + return false + } + } else if this.NodeStores != nil { + return false + } else if that1.NodeStores != nil { + return false + } + if this.NodeStoreMisses != nil && that1.NodeStoreMisses != nil { + if *this.NodeStoreMisses != *that1.NodeStoreMisses { + return false + } + } else if this.NodeStoreMisses != nil { + return false + } else if that1.NodeStoreMisses != nil { + return false + } + if this.NodePrefetches != nil && that1.NodePrefetches != nil { + if *this.NodePrefetches != *that1.NodePrefetches { + return false + } + } else if this.NodePrefetches != nil { + return false + } else if that1.NodePrefetches != nil { + return false + } + if this.NodePrefetchMisses != nil && that1.NodePrefetchMisses != nil { + if *this.NodePrefetchMisses != *that1.NodePrefetchMisses { + return false + } + } else if this.NodePrefetchMisses != nil { + return false + } else if that1.NodePrefetchMisses != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Request) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Request) + if !ok { + return fmt.Errorf("that is not of type *Request") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Request but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Requestbut is not nil && this == nil") + } + if !this.SlaveId.Equal(that1.SlaveId) { + return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) + } + if len(this.Resources) != len(that1.Resources) { + return fmt.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) + } + for i := range this.Resources { + if !this.Resources[i].Equal(that1.Resources[i]) { + return fmt.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Request) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Request) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if !this.SlaveId.Equal(that1.SlaveId) { + return false + } + if len(this.Resources) != len(that1.Resources) { + return false + } + for i := range this.Resources { + if !this.Resources[i].Equal(that1.Resources[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Offer) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Offer) + if !ok { + return fmt.Errorf("that is not of type *Offer") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Offer but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Offerbut is not nil && this == nil") + } + if !this.Id.Equal(that1.Id) { + return fmt.Errorf("Id this(%v) Not Equal that(%v)", this.Id, that1.Id) + } + if !this.FrameworkId.Equal(that1.FrameworkId) { + return fmt.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) + } + if !this.SlaveId.Equal(that1.SlaveId) { + return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) + } + if this.Hostname != nil && that1.Hostname != nil { + if *this.Hostname != *that1.Hostname { + return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", *this.Hostname, *that1.Hostname) + } + } else if this.Hostname != nil { + return fmt.Errorf("this.Hostname == nil && that.Hostname != nil") + } else if that1.Hostname != nil { + return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", this.Hostname, that1.Hostname) + } + if len(this.Resources) != len(that1.Resources) { + return fmt.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) + } + for i := range this.Resources { + if !this.Resources[i].Equal(that1.Resources[i]) { + return fmt.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) + } + } + if len(this.Attributes) != len(that1.Attributes) { + return fmt.Errorf("Attributes this(%v) Not Equal that(%v)", len(this.Attributes), len(that1.Attributes)) + } + for i := range this.Attributes { + if !this.Attributes[i].Equal(that1.Attributes[i]) { + return fmt.Errorf("Attributes this[%v](%v) Not Equal that[%v](%v)", i, this.Attributes[i], i, that1.Attributes[i]) + } + } + if len(this.ExecutorIds) != len(that1.ExecutorIds) { + return fmt.Errorf("ExecutorIds this(%v) Not Equal that(%v)", len(this.ExecutorIds), len(that1.ExecutorIds)) + } + for i := range this.ExecutorIds { + if !this.ExecutorIds[i].Equal(that1.ExecutorIds[i]) { + return fmt.Errorf("ExecutorIds this[%v](%v) Not Equal that[%v](%v)", i, this.ExecutorIds[i], i, that1.ExecutorIds[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Offer) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Offer) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if !this.Id.Equal(that1.Id) { + return false + } + if !this.FrameworkId.Equal(that1.FrameworkId) { + return false + } + if !this.SlaveId.Equal(that1.SlaveId) { + return false + } + if this.Hostname != nil && that1.Hostname != nil { + if *this.Hostname != *that1.Hostname { + return false + } + } else if this.Hostname != nil { + return false + } else if that1.Hostname != nil { + return false + } + if len(this.Resources) != len(that1.Resources) { + return false + } + for i := range this.Resources { + if !this.Resources[i].Equal(that1.Resources[i]) { + return false + } + } + if len(this.Attributes) != len(that1.Attributes) { + return false + } + for i := range this.Attributes { + if !this.Attributes[i].Equal(that1.Attributes[i]) { + return false + } + } + if len(this.ExecutorIds) != len(that1.ExecutorIds) { + return false + } + for i := range this.ExecutorIds { + if !this.ExecutorIds[i].Equal(that1.ExecutorIds[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Offer_Operation) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Offer_Operation) + if !ok { + return fmt.Errorf("that is not of type *Offer_Operation") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Offer_Operation but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Offer_Operationbut is not nil && this == nil") + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) + } + } else if this.Type != nil { + return fmt.Errorf("this.Type == nil && that.Type != nil") + } else if that1.Type != nil { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) + } + if !this.Launch.Equal(that1.Launch) { + return fmt.Errorf("Launch this(%v) Not Equal that(%v)", this.Launch, that1.Launch) + } + if !this.Reserve.Equal(that1.Reserve) { + return fmt.Errorf("Reserve this(%v) Not Equal that(%v)", this.Reserve, that1.Reserve) + } + if !this.Unreserve.Equal(that1.Unreserve) { + return fmt.Errorf("Unreserve this(%v) Not Equal that(%v)", this.Unreserve, that1.Unreserve) + } + if !this.Create.Equal(that1.Create) { + return fmt.Errorf("Create this(%v) Not Equal that(%v)", this.Create, that1.Create) + } + if !this.Destroy.Equal(that1.Destroy) { + return fmt.Errorf("Destroy this(%v) Not Equal that(%v)", this.Destroy, that1.Destroy) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Offer_Operation) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Offer_Operation) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return false + } + } else if this.Type != nil { + return false + } else if that1.Type != nil { + return false + } + if !this.Launch.Equal(that1.Launch) { + return false + } + if !this.Reserve.Equal(that1.Reserve) { + return false + } + if !this.Unreserve.Equal(that1.Unreserve) { + return false + } + if !this.Create.Equal(that1.Create) { + return false + } + if !this.Destroy.Equal(that1.Destroy) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Offer_Operation_Launch) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Offer_Operation_Launch) + if !ok { + return fmt.Errorf("that is not of type *Offer_Operation_Launch") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Offer_Operation_Launch but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Offer_Operation_Launchbut is not nil && this == nil") + } + if len(this.TaskInfos) != len(that1.TaskInfos) { + return fmt.Errorf("TaskInfos this(%v) Not Equal that(%v)", len(this.TaskInfos), len(that1.TaskInfos)) + } + for i := range this.TaskInfos { + if !this.TaskInfos[i].Equal(that1.TaskInfos[i]) { + return fmt.Errorf("TaskInfos this[%v](%v) Not Equal that[%v](%v)", i, this.TaskInfos[i], i, that1.TaskInfos[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Offer_Operation_Launch) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Offer_Operation_Launch) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if len(this.TaskInfos) != len(that1.TaskInfos) { + return false + } + for i := range this.TaskInfos { + if !this.TaskInfos[i].Equal(that1.TaskInfos[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Offer_Operation_Reserve) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Offer_Operation_Reserve) + if !ok { + return fmt.Errorf("that is not of type *Offer_Operation_Reserve") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Offer_Operation_Reserve but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Offer_Operation_Reservebut is not nil && this == nil") + } + if len(this.Resources) != len(that1.Resources) { + return fmt.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) + } + for i := range this.Resources { + if !this.Resources[i].Equal(that1.Resources[i]) { + return fmt.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Offer_Operation_Reserve) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Offer_Operation_Reserve) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if len(this.Resources) != len(that1.Resources) { + return false + } + for i := range this.Resources { + if !this.Resources[i].Equal(that1.Resources[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Offer_Operation_Unreserve) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Offer_Operation_Unreserve) + if !ok { + return fmt.Errorf("that is not of type *Offer_Operation_Unreserve") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Offer_Operation_Unreserve but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Offer_Operation_Unreservebut is not nil && this == nil") + } + if len(this.Resources) != len(that1.Resources) { + return fmt.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) + } + for i := range this.Resources { + if !this.Resources[i].Equal(that1.Resources[i]) { + return fmt.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Offer_Operation_Unreserve) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Offer_Operation_Unreserve) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if len(this.Resources) != len(that1.Resources) { + return false + } + for i := range this.Resources { + if !this.Resources[i].Equal(that1.Resources[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Offer_Operation_Create) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Offer_Operation_Create) + if !ok { + return fmt.Errorf("that is not of type *Offer_Operation_Create") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Offer_Operation_Create but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Offer_Operation_Createbut is not nil && this == nil") + } + if len(this.Volumes) != len(that1.Volumes) { + return fmt.Errorf("Volumes this(%v) Not Equal that(%v)", len(this.Volumes), len(that1.Volumes)) + } + for i := range this.Volumes { + if !this.Volumes[i].Equal(that1.Volumes[i]) { + return fmt.Errorf("Volumes this[%v](%v) Not Equal that[%v](%v)", i, this.Volumes[i], i, that1.Volumes[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Offer_Operation_Create) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Offer_Operation_Create) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if len(this.Volumes) != len(that1.Volumes) { + return false + } + for i := range this.Volumes { + if !this.Volumes[i].Equal(that1.Volumes[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Offer_Operation_Destroy) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Offer_Operation_Destroy) + if !ok { + return fmt.Errorf("that is not of type *Offer_Operation_Destroy") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Offer_Operation_Destroy but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Offer_Operation_Destroybut is not nil && this == nil") + } + if len(this.Volumes) != len(that1.Volumes) { + return fmt.Errorf("Volumes this(%v) Not Equal that(%v)", len(this.Volumes), len(that1.Volumes)) + } + for i := range this.Volumes { + if !this.Volumes[i].Equal(that1.Volumes[i]) { + return fmt.Errorf("Volumes this[%v](%v) Not Equal that[%v](%v)", i, this.Volumes[i], i, that1.Volumes[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Offer_Operation_Destroy) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Offer_Operation_Destroy) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if len(this.Volumes) != len(that1.Volumes) { + return false + } + for i := range this.Volumes { + if !this.Volumes[i].Equal(that1.Volumes[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *TaskInfo) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*TaskInfo) + if !ok { + return fmt.Errorf("that is not of type *TaskInfo") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *TaskInfo but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *TaskInfobut is not nil && this == nil") + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) + } + } else if this.Name != nil { + return fmt.Errorf("this.Name == nil && that.Name != nil") + } else if that1.Name != nil { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) + } + if !this.TaskId.Equal(that1.TaskId) { + return fmt.Errorf("TaskId this(%v) Not Equal that(%v)", this.TaskId, that1.TaskId) + } + if !this.SlaveId.Equal(that1.SlaveId) { + return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) + } + if len(this.Resources) != len(that1.Resources) { + return fmt.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) + } + for i := range this.Resources { + if !this.Resources[i].Equal(that1.Resources[i]) { + return fmt.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) + } + } + if !this.Executor.Equal(that1.Executor) { + return fmt.Errorf("Executor this(%v) Not Equal that(%v)", this.Executor, that1.Executor) + } + if !this.Command.Equal(that1.Command) { + return fmt.Errorf("Command this(%v) Not Equal that(%v)", this.Command, that1.Command) + } + if !this.Container.Equal(that1.Container) { + return fmt.Errorf("Container this(%v) Not Equal that(%v)", this.Container, that1.Container) + } + if !bytes.Equal(this.Data, that1.Data) { + return fmt.Errorf("Data this(%v) Not Equal that(%v)", this.Data, that1.Data) + } + if !this.HealthCheck.Equal(that1.HealthCheck) { + return fmt.Errorf("HealthCheck this(%v) Not Equal that(%v)", this.HealthCheck, that1.HealthCheck) + } + if !this.Labels.Equal(that1.Labels) { + return fmt.Errorf("Labels this(%v) Not Equal that(%v)", this.Labels, that1.Labels) + } + if !this.Discovery.Equal(that1.Discovery) { + return fmt.Errorf("Discovery this(%v) Not Equal that(%v)", this.Discovery, that1.Discovery) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *TaskInfo) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*TaskInfo) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return false + } + } else if this.Name != nil { + return false + } else if that1.Name != nil { + return false + } + if !this.TaskId.Equal(that1.TaskId) { + return false + } + if !this.SlaveId.Equal(that1.SlaveId) { + return false + } + if len(this.Resources) != len(that1.Resources) { + return false + } + for i := range this.Resources { + if !this.Resources[i].Equal(that1.Resources[i]) { + return false + } + } + if !this.Executor.Equal(that1.Executor) { + return false + } + if !this.Command.Equal(that1.Command) { + return false + } + if !this.Container.Equal(that1.Container) { + return false + } + if !bytes.Equal(this.Data, that1.Data) { + return false + } + if !this.HealthCheck.Equal(that1.HealthCheck) { + return false + } + if !this.Labels.Equal(that1.Labels) { + return false + } + if !this.Discovery.Equal(that1.Discovery) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *TaskStatus) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*TaskStatus) + if !ok { + return fmt.Errorf("that is not of type *TaskStatus") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *TaskStatus but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *TaskStatusbut is not nil && this == nil") + } + if !this.TaskId.Equal(that1.TaskId) { + return fmt.Errorf("TaskId this(%v) Not Equal that(%v)", this.TaskId, that1.TaskId) + } + if this.State != nil && that1.State != nil { + if *this.State != *that1.State { + return fmt.Errorf("State this(%v) Not Equal that(%v)", *this.State, *that1.State) + } + } else if this.State != nil { + return fmt.Errorf("this.State == nil && that.State != nil") + } else if that1.State != nil { + return fmt.Errorf("State this(%v) Not Equal that(%v)", this.State, that1.State) + } + if this.Message != nil && that1.Message != nil { + if *this.Message != *that1.Message { + return fmt.Errorf("Message this(%v) Not Equal that(%v)", *this.Message, *that1.Message) + } + } else if this.Message != nil { + return fmt.Errorf("this.Message == nil && that.Message != nil") + } else if that1.Message != nil { + return fmt.Errorf("Message this(%v) Not Equal that(%v)", this.Message, that1.Message) + } + if this.Source != nil && that1.Source != nil { + if *this.Source != *that1.Source { + return fmt.Errorf("Source this(%v) Not Equal that(%v)", *this.Source, *that1.Source) + } + } else if this.Source != nil { + return fmt.Errorf("this.Source == nil && that.Source != nil") + } else if that1.Source != nil { + return fmt.Errorf("Source this(%v) Not Equal that(%v)", this.Source, that1.Source) + } + if this.Reason != nil && that1.Reason != nil { + if *this.Reason != *that1.Reason { + return fmt.Errorf("Reason this(%v) Not Equal that(%v)", *this.Reason, *that1.Reason) + } + } else if this.Reason != nil { + return fmt.Errorf("this.Reason == nil && that.Reason != nil") + } else if that1.Reason != nil { + return fmt.Errorf("Reason this(%v) Not Equal that(%v)", this.Reason, that1.Reason) + } + if !bytes.Equal(this.Data, that1.Data) { + return fmt.Errorf("Data this(%v) Not Equal that(%v)", this.Data, that1.Data) + } + if !this.SlaveId.Equal(that1.SlaveId) { + return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) + } + if !this.ExecutorId.Equal(that1.ExecutorId) { + return fmt.Errorf("ExecutorId this(%v) Not Equal that(%v)", this.ExecutorId, that1.ExecutorId) + } + if this.Timestamp != nil && that1.Timestamp != nil { + if *this.Timestamp != *that1.Timestamp { + return fmt.Errorf("Timestamp this(%v) Not Equal that(%v)", *this.Timestamp, *that1.Timestamp) + } + } else if this.Timestamp != nil { + return fmt.Errorf("this.Timestamp == nil && that.Timestamp != nil") + } else if that1.Timestamp != nil { + return fmt.Errorf("Timestamp this(%v) Not Equal that(%v)", this.Timestamp, that1.Timestamp) + } + if !bytes.Equal(this.Uuid, that1.Uuid) { + return fmt.Errorf("Uuid this(%v) Not Equal that(%v)", this.Uuid, that1.Uuid) + } + if this.Healthy != nil && that1.Healthy != nil { + if *this.Healthy != *that1.Healthy { + return fmt.Errorf("Healthy this(%v) Not Equal that(%v)", *this.Healthy, *that1.Healthy) + } + } else if this.Healthy != nil { + return fmt.Errorf("this.Healthy == nil && that.Healthy != nil") + } else if that1.Healthy != nil { + return fmt.Errorf("Healthy this(%v) Not Equal that(%v)", this.Healthy, that1.Healthy) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *TaskStatus) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*TaskStatus) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if !this.TaskId.Equal(that1.TaskId) { + return false + } + if this.State != nil && that1.State != nil { + if *this.State != *that1.State { + return false + } + } else if this.State != nil { + return false + } else if that1.State != nil { + return false + } + if this.Message != nil && that1.Message != nil { + if *this.Message != *that1.Message { + return false + } + } else if this.Message != nil { + return false + } else if that1.Message != nil { + return false + } + if this.Source != nil && that1.Source != nil { + if *this.Source != *that1.Source { + return false + } + } else if this.Source != nil { + return false + } else if that1.Source != nil { + return false + } + if this.Reason != nil && that1.Reason != nil { + if *this.Reason != *that1.Reason { + return false + } + } else if this.Reason != nil { + return false + } else if that1.Reason != nil { + return false + } + if !bytes.Equal(this.Data, that1.Data) { + return false + } + if !this.SlaveId.Equal(that1.SlaveId) { + return false + } + if !this.ExecutorId.Equal(that1.ExecutorId) { + return false + } + if this.Timestamp != nil && that1.Timestamp != nil { + if *this.Timestamp != *that1.Timestamp { + return false + } + } else if this.Timestamp != nil { + return false + } else if that1.Timestamp != nil { + return false + } + if !bytes.Equal(this.Uuid, that1.Uuid) { + return false + } + if this.Healthy != nil && that1.Healthy != nil { + if *this.Healthy != *that1.Healthy { + return false + } + } else if this.Healthy != nil { + return false + } else if that1.Healthy != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Filters) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Filters) + if !ok { + return fmt.Errorf("that is not of type *Filters") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Filters but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Filtersbut is not nil && this == nil") + } + if this.RefuseSeconds != nil && that1.RefuseSeconds != nil { + if *this.RefuseSeconds != *that1.RefuseSeconds { + return fmt.Errorf("RefuseSeconds this(%v) Not Equal that(%v)", *this.RefuseSeconds, *that1.RefuseSeconds) + } + } else if this.RefuseSeconds != nil { + return fmt.Errorf("this.RefuseSeconds == nil && that.RefuseSeconds != nil") + } else if that1.RefuseSeconds != nil { + return fmt.Errorf("RefuseSeconds this(%v) Not Equal that(%v)", this.RefuseSeconds, that1.RefuseSeconds) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Filters) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Filters) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.RefuseSeconds != nil && that1.RefuseSeconds != nil { + if *this.RefuseSeconds != *that1.RefuseSeconds { + return false + } + } else if this.RefuseSeconds != nil { + return false + } else if that1.RefuseSeconds != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Environment) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Environment) + if !ok { + return fmt.Errorf("that is not of type *Environment") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Environment but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Environmentbut is not nil && this == nil") + } + if len(this.Variables) != len(that1.Variables) { + return fmt.Errorf("Variables this(%v) Not Equal that(%v)", len(this.Variables), len(that1.Variables)) + } + for i := range this.Variables { + if !this.Variables[i].Equal(that1.Variables[i]) { + return fmt.Errorf("Variables this[%v](%v) Not Equal that[%v](%v)", i, this.Variables[i], i, that1.Variables[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Environment) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Environment) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if len(this.Variables) != len(that1.Variables) { + return false + } + for i := range this.Variables { + if !this.Variables[i].Equal(that1.Variables[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Environment_Variable) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Environment_Variable) + if !ok { + return fmt.Errorf("that is not of type *Environment_Variable") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Environment_Variable but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Environment_Variablebut is not nil && this == nil") + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) + } + } else if this.Name != nil { + return fmt.Errorf("this.Name == nil && that.Name != nil") + } else if that1.Name != nil { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) + } + } else if this.Value != nil { + return fmt.Errorf("this.Value == nil && that.Value != nil") + } else if that1.Value != nil { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Environment_Variable) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Environment_Variable) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return false + } + } else if this.Name != nil { + return false + } else if that1.Name != nil { + return false + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return false + } + } else if this.Value != nil { + return false + } else if that1.Value != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Parameter) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Parameter) + if !ok { + return fmt.Errorf("that is not of type *Parameter") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Parameter but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Parameterbut is not nil && this == nil") + } + if this.Key != nil && that1.Key != nil { + if *this.Key != *that1.Key { + return fmt.Errorf("Key this(%v) Not Equal that(%v)", *this.Key, *that1.Key) + } + } else if this.Key != nil { + return fmt.Errorf("this.Key == nil && that.Key != nil") + } else if that1.Key != nil { + return fmt.Errorf("Key this(%v) Not Equal that(%v)", this.Key, that1.Key) + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) + } + } else if this.Value != nil { + return fmt.Errorf("this.Value == nil && that.Value != nil") + } else if that1.Value != nil { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Parameter) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Parameter) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Key != nil && that1.Key != nil { + if *this.Key != *that1.Key { + return false + } + } else if this.Key != nil { + return false + } else if that1.Key != nil { + return false + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return false + } + } else if this.Value != nil { + return false + } else if that1.Value != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Parameters) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Parameters) + if !ok { + return fmt.Errorf("that is not of type *Parameters") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Parameters but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Parametersbut is not nil && this == nil") + } + if len(this.Parameter) != len(that1.Parameter) { + return fmt.Errorf("Parameter this(%v) Not Equal that(%v)", len(this.Parameter), len(that1.Parameter)) + } + for i := range this.Parameter { + if !this.Parameter[i].Equal(that1.Parameter[i]) { + return fmt.Errorf("Parameter this[%v](%v) Not Equal that[%v](%v)", i, this.Parameter[i], i, that1.Parameter[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Parameters) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Parameters) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if len(this.Parameter) != len(that1.Parameter) { + return false + } + for i := range this.Parameter { + if !this.Parameter[i].Equal(that1.Parameter[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Credential) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Credential) + if !ok { + return fmt.Errorf("that is not of type *Credential") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Credential but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Credentialbut is not nil && this == nil") + } + if this.Principal != nil && that1.Principal != nil { + if *this.Principal != *that1.Principal { + return fmt.Errorf("Principal this(%v) Not Equal that(%v)", *this.Principal, *that1.Principal) + } + } else if this.Principal != nil { + return fmt.Errorf("this.Principal == nil && that.Principal != nil") + } else if that1.Principal != nil { + return fmt.Errorf("Principal this(%v) Not Equal that(%v)", this.Principal, that1.Principal) + } + if !bytes.Equal(this.Secret, that1.Secret) { + return fmt.Errorf("Secret this(%v) Not Equal that(%v)", this.Secret, that1.Secret) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Credential) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Credential) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Principal != nil && that1.Principal != nil { + if *this.Principal != *that1.Principal { + return false + } + } else if this.Principal != nil { + return false + } else if that1.Principal != nil { + return false + } + if !bytes.Equal(this.Secret, that1.Secret) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Credentials) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Credentials) + if !ok { + return fmt.Errorf("that is not of type *Credentials") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Credentials but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Credentialsbut is not nil && this == nil") + } + if len(this.Credentials) != len(that1.Credentials) { + return fmt.Errorf("Credentials this(%v) Not Equal that(%v)", len(this.Credentials), len(that1.Credentials)) + } + for i := range this.Credentials { + if !this.Credentials[i].Equal(that1.Credentials[i]) { + return fmt.Errorf("Credentials this[%v](%v) Not Equal that[%v](%v)", i, this.Credentials[i], i, that1.Credentials[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Credentials) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Credentials) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if len(this.Credentials) != len(that1.Credentials) { + return false + } + for i := range this.Credentials { + if !this.Credentials[i].Equal(that1.Credentials[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *ACL) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*ACL) + if !ok { + return fmt.Errorf("that is not of type *ACL") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *ACL but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *ACLbut is not nil && this == nil") + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *ACL) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*ACL) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *ACL_Entity) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*ACL_Entity) + if !ok { + return fmt.Errorf("that is not of type *ACL_Entity") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *ACL_Entity but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *ACL_Entitybut is not nil && this == nil") + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) + } + } else if this.Type != nil { + return fmt.Errorf("this.Type == nil && that.Type != nil") + } else if that1.Type != nil { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) + } + if len(this.Values) != len(that1.Values) { + return fmt.Errorf("Values this(%v) Not Equal that(%v)", len(this.Values), len(that1.Values)) + } + for i := range this.Values { + if this.Values[i] != that1.Values[i] { + return fmt.Errorf("Values this[%v](%v) Not Equal that[%v](%v)", i, this.Values[i], i, that1.Values[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *ACL_Entity) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*ACL_Entity) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return false + } + } else if this.Type != nil { + return false + } else if that1.Type != nil { + return false + } + if len(this.Values) != len(that1.Values) { + return false + } + for i := range this.Values { + if this.Values[i] != that1.Values[i] { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *ACL_RegisterFramework) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*ACL_RegisterFramework) + if !ok { + return fmt.Errorf("that is not of type *ACL_RegisterFramework") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *ACL_RegisterFramework but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *ACL_RegisterFrameworkbut is not nil && this == nil") + } + if !this.Principals.Equal(that1.Principals) { + return fmt.Errorf("Principals this(%v) Not Equal that(%v)", this.Principals, that1.Principals) + } + if !this.Roles.Equal(that1.Roles) { + return fmt.Errorf("Roles this(%v) Not Equal that(%v)", this.Roles, that1.Roles) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *ACL_RegisterFramework) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*ACL_RegisterFramework) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if !this.Principals.Equal(that1.Principals) { + return false + } + if !this.Roles.Equal(that1.Roles) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *ACL_RunTask) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*ACL_RunTask) + if !ok { + return fmt.Errorf("that is not of type *ACL_RunTask") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *ACL_RunTask but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *ACL_RunTaskbut is not nil && this == nil") + } + if !this.Principals.Equal(that1.Principals) { + return fmt.Errorf("Principals this(%v) Not Equal that(%v)", this.Principals, that1.Principals) + } + if !this.Users.Equal(that1.Users) { + return fmt.Errorf("Users this(%v) Not Equal that(%v)", this.Users, that1.Users) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *ACL_RunTask) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*ACL_RunTask) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if !this.Principals.Equal(that1.Principals) { + return false + } + if !this.Users.Equal(that1.Users) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *ACL_ShutdownFramework) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*ACL_ShutdownFramework) + if !ok { + return fmt.Errorf("that is not of type *ACL_ShutdownFramework") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *ACL_ShutdownFramework but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *ACL_ShutdownFrameworkbut is not nil && this == nil") + } + if !this.Principals.Equal(that1.Principals) { + return fmt.Errorf("Principals this(%v) Not Equal that(%v)", this.Principals, that1.Principals) + } + if !this.FrameworkPrincipals.Equal(that1.FrameworkPrincipals) { + return fmt.Errorf("FrameworkPrincipals this(%v) Not Equal that(%v)", this.FrameworkPrincipals, that1.FrameworkPrincipals) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *ACL_ShutdownFramework) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*ACL_ShutdownFramework) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if !this.Principals.Equal(that1.Principals) { + return false + } + if !this.FrameworkPrincipals.Equal(that1.FrameworkPrincipals) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *ACLs) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*ACLs) + if !ok { + return fmt.Errorf("that is not of type *ACLs") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *ACLs but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *ACLsbut is not nil && this == nil") + } + if this.Permissive != nil && that1.Permissive != nil { + if *this.Permissive != *that1.Permissive { + return fmt.Errorf("Permissive this(%v) Not Equal that(%v)", *this.Permissive, *that1.Permissive) + } + } else if this.Permissive != nil { + return fmt.Errorf("this.Permissive == nil && that.Permissive != nil") + } else if that1.Permissive != nil { + return fmt.Errorf("Permissive this(%v) Not Equal that(%v)", this.Permissive, that1.Permissive) + } + if len(this.RegisterFrameworks) != len(that1.RegisterFrameworks) { + return fmt.Errorf("RegisterFrameworks this(%v) Not Equal that(%v)", len(this.RegisterFrameworks), len(that1.RegisterFrameworks)) + } + for i := range this.RegisterFrameworks { + if !this.RegisterFrameworks[i].Equal(that1.RegisterFrameworks[i]) { + return fmt.Errorf("RegisterFrameworks this[%v](%v) Not Equal that[%v](%v)", i, this.RegisterFrameworks[i], i, that1.RegisterFrameworks[i]) + } + } + if len(this.RunTasks) != len(that1.RunTasks) { + return fmt.Errorf("RunTasks this(%v) Not Equal that(%v)", len(this.RunTasks), len(that1.RunTasks)) + } + for i := range this.RunTasks { + if !this.RunTasks[i].Equal(that1.RunTasks[i]) { + return fmt.Errorf("RunTasks this[%v](%v) Not Equal that[%v](%v)", i, this.RunTasks[i], i, that1.RunTasks[i]) + } + } + if len(this.ShutdownFrameworks) != len(that1.ShutdownFrameworks) { + return fmt.Errorf("ShutdownFrameworks this(%v) Not Equal that(%v)", len(this.ShutdownFrameworks), len(that1.ShutdownFrameworks)) + } + for i := range this.ShutdownFrameworks { + if !this.ShutdownFrameworks[i].Equal(that1.ShutdownFrameworks[i]) { + return fmt.Errorf("ShutdownFrameworks this[%v](%v) Not Equal that[%v](%v)", i, this.ShutdownFrameworks[i], i, that1.ShutdownFrameworks[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *ACLs) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*ACLs) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Permissive != nil && that1.Permissive != nil { + if *this.Permissive != *that1.Permissive { + return false + } + } else if this.Permissive != nil { + return false + } else if that1.Permissive != nil { + return false + } + if len(this.RegisterFrameworks) != len(that1.RegisterFrameworks) { + return false + } + for i := range this.RegisterFrameworks { + if !this.RegisterFrameworks[i].Equal(that1.RegisterFrameworks[i]) { + return false + } + } + if len(this.RunTasks) != len(that1.RunTasks) { + return false + } + for i := range this.RunTasks { + if !this.RunTasks[i].Equal(that1.RunTasks[i]) { + return false + } + } + if len(this.ShutdownFrameworks) != len(that1.ShutdownFrameworks) { + return false + } + for i := range this.ShutdownFrameworks { + if !this.ShutdownFrameworks[i].Equal(that1.ShutdownFrameworks[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *RateLimit) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*RateLimit) + if !ok { + return fmt.Errorf("that is not of type *RateLimit") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *RateLimit but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *RateLimitbut is not nil && this == nil") + } + if this.Qps != nil && that1.Qps != nil { + if *this.Qps != *that1.Qps { + return fmt.Errorf("Qps this(%v) Not Equal that(%v)", *this.Qps, *that1.Qps) + } + } else if this.Qps != nil { + return fmt.Errorf("this.Qps == nil && that.Qps != nil") + } else if that1.Qps != nil { + return fmt.Errorf("Qps this(%v) Not Equal that(%v)", this.Qps, that1.Qps) + } + if this.Principal != nil && that1.Principal != nil { + if *this.Principal != *that1.Principal { + return fmt.Errorf("Principal this(%v) Not Equal that(%v)", *this.Principal, *that1.Principal) + } + } else if this.Principal != nil { + return fmt.Errorf("this.Principal == nil && that.Principal != nil") + } else if that1.Principal != nil { + return fmt.Errorf("Principal this(%v) Not Equal that(%v)", this.Principal, that1.Principal) + } + if this.Capacity != nil && that1.Capacity != nil { + if *this.Capacity != *that1.Capacity { + return fmt.Errorf("Capacity this(%v) Not Equal that(%v)", *this.Capacity, *that1.Capacity) + } + } else if this.Capacity != nil { + return fmt.Errorf("this.Capacity == nil && that.Capacity != nil") + } else if that1.Capacity != nil { + return fmt.Errorf("Capacity this(%v) Not Equal that(%v)", this.Capacity, that1.Capacity) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *RateLimit) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } + return false } - return nil -} -func (m *Request) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } + + that1, ok := that.(*RateLimit) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Resources = append(m.Resources, &Resource{}) - m.Resources[len(m.Resources)-1].Unmarshal(data[index:postIndex]) - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return false + } else if this == nil { + return false + } + if this.Qps != nil && that1.Qps != nil { + if *this.Qps != *that1.Qps { + return false } + } else if this.Qps != nil { + return false + } else if that1.Qps != nil { + return false } - return nil -} -func (m *Offer) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } + if this.Principal != nil && that1.Principal != nil { + if *this.Principal != *that1.Principal { + return false } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Id == nil { - m.Id = &OfferID{} - } - if err := m.Id.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Hostname = &s - index = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Resources = append(m.Resources, &Resource{}) - m.Resources[len(m.Resources)-1].Unmarshal(data[index:postIndex]) - index = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Attributes = append(m.Attributes, &Attribute{}) - m.Attributes[len(m.Attributes)-1].Unmarshal(data[index:postIndex]) - index = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutorIds", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ExecutorIds = append(m.ExecutorIds, &ExecutorID{}) - m.ExecutorIds[len(m.ExecutorIds)-1].Unmarshal(data[index:postIndex]) - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + } else if this.Principal != nil { + return false + } else if that1.Principal != nil { + return false + } + if this.Capacity != nil && that1.Capacity != nil { + if *this.Capacity != *that1.Capacity { + return false + } + } else if this.Capacity != nil { + return false + } else if that1.Capacity != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *RateLimits) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*RateLimits) + if !ok { + return fmt.Errorf("that is not of type *RateLimits") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *RateLimits but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *RateLimitsbut is not nil && this == nil") + } + if len(this.Limits) != len(that1.Limits) { + return fmt.Errorf("Limits this(%v) Not Equal that(%v)", len(this.Limits), len(that1.Limits)) + } + for i := range this.Limits { + if !this.Limits[i].Equal(that1.Limits[i]) { + return fmt.Errorf("Limits this[%v](%v) Not Equal that[%v](%v)", i, this.Limits[i], i, that1.Limits[i]) + } + } + if this.AggregateDefaultQps != nil && that1.AggregateDefaultQps != nil { + if *this.AggregateDefaultQps != *that1.AggregateDefaultQps { + return fmt.Errorf("AggregateDefaultQps this(%v) Not Equal that(%v)", *this.AggregateDefaultQps, *that1.AggregateDefaultQps) + } + } else if this.AggregateDefaultQps != nil { + return fmt.Errorf("this.AggregateDefaultQps == nil && that.AggregateDefaultQps != nil") + } else if that1.AggregateDefaultQps != nil { + return fmt.Errorf("AggregateDefaultQps this(%v) Not Equal that(%v)", this.AggregateDefaultQps, that1.AggregateDefaultQps) + } + if this.AggregateDefaultCapacity != nil && that1.AggregateDefaultCapacity != nil { + if *this.AggregateDefaultCapacity != *that1.AggregateDefaultCapacity { + return fmt.Errorf("AggregateDefaultCapacity this(%v) Not Equal that(%v)", *this.AggregateDefaultCapacity, *that1.AggregateDefaultCapacity) } + } else if this.AggregateDefaultCapacity != nil { + return fmt.Errorf("this.AggregateDefaultCapacity == nil && that.AggregateDefaultCapacity != nil") + } else if that1.AggregateDefaultCapacity != nil { + return fmt.Errorf("AggregateDefaultCapacity this(%v) Not Equal that(%v)", this.AggregateDefaultCapacity, that1.AggregateDefaultCapacity) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *TaskInfo) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *RateLimits) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Name = &s - index = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TaskId == nil { - m.TaskId = &TaskID{} - } - if err := m.TaskId.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Resources = append(m.Resources, &Resource{}) - m.Resources[len(m.Resources)-1].Unmarshal(data[index:postIndex]) - index = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Executor", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Executor == nil { - m.Executor = &ExecutorInfo{} - } - if err := m.Executor.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Command", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Command == nil { - m.Command = &CommandInfo{} - } - if err := m.Command.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Container == nil { - m.Container = &ContainerInfo{} - } - if err := m.Container.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append([]byte{}, data[index:postIndex]...) - index = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HealthCheck", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.HealthCheck == nil { - m.HealthCheck = &HealthCheck{} - } - if err := m.HealthCheck.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return false + } + + that1, ok := that.(*RateLimits) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true } + return false + } else if this == nil { + return false } - return nil + if len(this.Limits) != len(that1.Limits) { + return false + } + for i := range this.Limits { + if !this.Limits[i].Equal(that1.Limits[i]) { + return false + } + } + if this.AggregateDefaultQps != nil && that1.AggregateDefaultQps != nil { + if *this.AggregateDefaultQps != *that1.AggregateDefaultQps { + return false + } + } else if this.AggregateDefaultQps != nil { + return false + } else if that1.AggregateDefaultQps != nil { + return false + } + if this.AggregateDefaultCapacity != nil && that1.AggregateDefaultCapacity != nil { + if *this.AggregateDefaultCapacity != *that1.AggregateDefaultCapacity { + return false + } + } else if this.AggregateDefaultCapacity != nil { + return false + } else if that1.AggregateDefaultCapacity != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true } -func (m *TaskStatus) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *Volume) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TaskId == nil { - m.TaskId = &TaskID{} - } - if err := m.TaskId.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) - } - var v TaskState - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (TaskState(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.State = &v - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Message = &s - index = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) - } - var v TaskStatus_Source - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (TaskStatus_Source(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Source = &v - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) - } - var v TaskStatus_Reason - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (TaskStatus_Reason(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Reason = &v - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append([]byte{}, data[index:postIndex]...) - index = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutorId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutorId == nil { - m.ExecutorId = &ExecutorID{} - } - if err := m.ExecutorId.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 6: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.Timestamp = &v2 - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Healthy", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Healthy = &b - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Volume) + if !ok { + return fmt.Errorf("that is not of type *Volume") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Volume but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Volumebut is not nil && this == nil") + } + if this.ContainerPath != nil && that1.ContainerPath != nil { + if *this.ContainerPath != *that1.ContainerPath { + return fmt.Errorf("ContainerPath this(%v) Not Equal that(%v)", *this.ContainerPath, *that1.ContainerPath) + } + } else if this.ContainerPath != nil { + return fmt.Errorf("this.ContainerPath == nil && that.ContainerPath != nil") + } else if that1.ContainerPath != nil { + return fmt.Errorf("ContainerPath this(%v) Not Equal that(%v)", this.ContainerPath, that1.ContainerPath) + } + if this.HostPath != nil && that1.HostPath != nil { + if *this.HostPath != *that1.HostPath { + return fmt.Errorf("HostPath this(%v) Not Equal that(%v)", *this.HostPath, *that1.HostPath) + } + } else if this.HostPath != nil { + return fmt.Errorf("this.HostPath == nil && that.HostPath != nil") + } else if that1.HostPath != nil { + return fmt.Errorf("HostPath this(%v) Not Equal that(%v)", this.HostPath, that1.HostPath) + } + if this.Mode != nil && that1.Mode != nil { + if *this.Mode != *that1.Mode { + return fmt.Errorf("Mode this(%v) Not Equal that(%v)", *this.Mode, *that1.Mode) } + } else if this.Mode != nil { + return fmt.Errorf("this.Mode == nil && that.Mode != nil") + } else if that1.Mode != nil { + return fmt.Errorf("Mode this(%v) Not Equal that(%v)", this.Mode, that1.Mode) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *Filters) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field RefuseSeconds", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.RefuseSeconds = &v2 - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy +func (this *Volume) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } + return false } - return nil -} -func (m *Environment) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } + + that1, ok := that.(*Volume) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Variables", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Variables = append(m.Variables, &Environment_Variable{}) - m.Variables[len(m.Variables)-1].Unmarshal(data[index:postIndex]) - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return false + } else if this == nil { + return false + } + if this.ContainerPath != nil && that1.ContainerPath != nil { + if *this.ContainerPath != *that1.ContainerPath { + return false } + } else if this.ContainerPath != nil { + return false + } else if that1.ContainerPath != nil { + return false } - return nil -} -func (m *Environment_Variable) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } + if this.HostPath != nil && that1.HostPath != nil { + if *this.HostPath != *that1.HostPath { + return false } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Name = &s - index = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Value = &s - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + } else if this.HostPath != nil { + return false + } else if that1.HostPath != nil { + return false + } + if this.Mode != nil && that1.Mode != nil { + if *this.Mode != *that1.Mode { + return false } + } else if this.Mode != nil { + return false + } else if that1.Mode != nil { + return false } - return nil + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true } -func (m *Parameter) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Key = &s - index = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Value = &s - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy +func (this *ContainerInfo) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } + return fmt.Errorf("that == nil && this != nil") } - return nil -} -func (m *Parameters) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } + + that1, ok := that.(*ContainerInfo) + if !ok { + return fmt.Errorf("that is not of type *ContainerInfo") + } + if that1 == nil { + if this == nil { + return nil } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Parameter", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Parameter = append(m.Parameter, &Parameter{}) - m.Parameter[len(m.Parameter)-1].Unmarshal(data[index:postIndex]) - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return fmt.Errorf("that is type *ContainerInfo but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *ContainerInfobut is not nil && this == nil") + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) } + } else if this.Type != nil { + return fmt.Errorf("this.Type == nil && that.Type != nil") + } else if that1.Type != nil { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) } - return nil -} -func (m *Credential) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } + if len(this.Volumes) != len(that1.Volumes) { + return fmt.Errorf("Volumes this(%v) Not Equal that(%v)", len(this.Volumes), len(that1.Volumes)) + } + for i := range this.Volumes { + if !this.Volumes[i].Equal(that1.Volumes[i]) { + return fmt.Errorf("Volumes this[%v](%v) Not Equal that[%v](%v)", i, this.Volumes[i], i, that1.Volumes[i]) } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Principal", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Principal = &s - index = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Secret", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Secret = append([]byte{}, data[index:postIndex]...) - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + } + if this.Hostname != nil && that1.Hostname != nil { + if *this.Hostname != *that1.Hostname { + return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", *this.Hostname, *that1.Hostname) } + } else if this.Hostname != nil { + return fmt.Errorf("this.Hostname == nil && that.Hostname != nil") + } else if that1.Hostname != nil { + return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", this.Hostname, that1.Hostname) + } + if !this.Docker.Equal(that1.Docker) { + return fmt.Errorf("Docker this(%v) Not Equal that(%v)", this.Docker, that1.Docker) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *Credentials) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *ContainerInfo) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Credentials", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Credentials = append(m.Credentials, &Credential{}) - m.Credentials[len(m.Credentials)-1].Unmarshal(data[index:postIndex]) - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return false + } + + that1, ok := that.(*ContainerInfo) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true } + return false + } else if this == nil { + return false } - return nil + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return false + } + } else if this.Type != nil { + return false + } else if that1.Type != nil { + return false + } + if len(this.Volumes) != len(that1.Volumes) { + return false + } + for i := range this.Volumes { + if !this.Volumes[i].Equal(that1.Volumes[i]) { + return false + } + } + if this.Hostname != nil && that1.Hostname != nil { + if *this.Hostname != *that1.Hostname { + return false + } + } else if this.Hostname != nil { + return false + } else if that1.Hostname != nil { + return false + } + if !this.Docker.Equal(that1.Docker) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true } -func (m *ACL) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *ContainerInfo_DockerInfo) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*ContainerInfo_DockerInfo) + if !ok { + return fmt.Errorf("that is not of type *ContainerInfo_DockerInfo") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *ContainerInfo_DockerInfo but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *ContainerInfo_DockerInfobut is not nil && this == nil") + } + if this.Image != nil && that1.Image != nil { + if *this.Image != *that1.Image { + return fmt.Errorf("Image this(%v) Not Equal that(%v)", *this.Image, *that1.Image) } - fieldNum := int32(wire >> 3) - switch fieldNum { - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + } else if this.Image != nil { + return fmt.Errorf("this.Image == nil && that.Image != nil") + } else if that1.Image != nil { + return fmt.Errorf("Image this(%v) Not Equal that(%v)", this.Image, that1.Image) + } + if this.Network != nil && that1.Network != nil { + if *this.Network != *that1.Network { + return fmt.Errorf("Network this(%v) Not Equal that(%v)", *this.Network, *that1.Network) } + } else if this.Network != nil { + return fmt.Errorf("this.Network == nil && that.Network != nil") + } else if that1.Network != nil { + return fmt.Errorf("Network this(%v) Not Equal that(%v)", this.Network, that1.Network) } - return nil -} -func (m *ACL_Entity) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } + if len(this.PortMappings) != len(that1.PortMappings) { + return fmt.Errorf("PortMappings this(%v) Not Equal that(%v)", len(this.PortMappings), len(that1.PortMappings)) + } + for i := range this.PortMappings { + if !this.PortMappings[i].Equal(that1.PortMappings[i]) { + return fmt.Errorf("PortMappings this[%v](%v) Not Equal that[%v](%v)", i, this.PortMappings[i], i, that1.PortMappings[i]) } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v ACL_Entity_Type - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (ACL_Entity_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Values = append(m.Values, string(data[index:postIndex])) - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + } + if this.Privileged != nil && that1.Privileged != nil { + if *this.Privileged != *that1.Privileged { + return fmt.Errorf("Privileged this(%v) Not Equal that(%v)", *this.Privileged, *that1.Privileged) } + } else if this.Privileged != nil { + return fmt.Errorf("this.Privileged == nil && that.Privileged != nil") + } else if that1.Privileged != nil { + return fmt.Errorf("Privileged this(%v) Not Equal that(%v)", this.Privileged, that1.Privileged) } - return nil -} -func (m *ACL_RegisterFramework) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } + if len(this.Parameters) != len(that1.Parameters) { + return fmt.Errorf("Parameters this(%v) Not Equal that(%v)", len(this.Parameters), len(that1.Parameters)) + } + for i := range this.Parameters { + if !this.Parameters[i].Equal(that1.Parameters[i]) { + return fmt.Errorf("Parameters this[%v](%v) Not Equal that[%v](%v)", i, this.Parameters[i], i, that1.Parameters[i]) } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Principals", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Principals == nil { - m.Principals = &ACL_Entity{} - } - if err := m.Principals.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Roles == nil { - m.Roles = &ACL_Entity{} - } - if err := m.Roles.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + } + if this.ForcePullImage != nil && that1.ForcePullImage != nil { + if *this.ForcePullImage != *that1.ForcePullImage { + return fmt.Errorf("ForcePullImage this(%v) Not Equal that(%v)", *this.ForcePullImage, *that1.ForcePullImage) } + } else if this.ForcePullImage != nil { + return fmt.Errorf("this.ForcePullImage == nil && that.ForcePullImage != nil") + } else if that1.ForcePullImage != nil { + return fmt.Errorf("ForcePullImage this(%v) Not Equal that(%v)", this.ForcePullImage, that1.ForcePullImage) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *ACL_RunTask) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *ContainerInfo_DockerInfo) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Principals", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Principals == nil { - m.Principals = &ACL_Entity{} - } - if err := m.Principals.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Users", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Users == nil { - m.Users = &ACL_Entity{} - } - if err := m.Users.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return false + } + + that1, ok := that.(*ContainerInfo_DockerInfo) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true } + return false + } else if this == nil { + return false } - return nil + if this.Image != nil && that1.Image != nil { + if *this.Image != *that1.Image { + return false + } + } else if this.Image != nil { + return false + } else if that1.Image != nil { + return false + } + if this.Network != nil && that1.Network != nil { + if *this.Network != *that1.Network { + return false + } + } else if this.Network != nil { + return false + } else if that1.Network != nil { + return false + } + if len(this.PortMappings) != len(that1.PortMappings) { + return false + } + for i := range this.PortMappings { + if !this.PortMappings[i].Equal(that1.PortMappings[i]) { + return false + } + } + if this.Privileged != nil && that1.Privileged != nil { + if *this.Privileged != *that1.Privileged { + return false + } + } else if this.Privileged != nil { + return false + } else if that1.Privileged != nil { + return false + } + if len(this.Parameters) != len(that1.Parameters) { + return false + } + for i := range this.Parameters { + if !this.Parameters[i].Equal(that1.Parameters[i]) { + return false + } + } + if this.ForcePullImage != nil && that1.ForcePullImage != nil { + if *this.ForcePullImage != *that1.ForcePullImage { + return false + } + } else if this.ForcePullImage != nil { + return false + } else if that1.ForcePullImage != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true } -func (m *ACL_ShutdownFramework) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *ContainerInfo_DockerInfo_PortMapping) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Principals", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Principals == nil { - m.Principals = &ACL_Entity{} - } - if err := m.Principals.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkPrincipals", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkPrincipals == nil { - m.FrameworkPrincipals = &ACL_Entity{} - } - if err := m.FrameworkPrincipals.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*ContainerInfo_DockerInfo_PortMapping) + if !ok { + return fmt.Errorf("that is not of type *ContainerInfo_DockerInfo_PortMapping") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *ContainerInfo_DockerInfo_PortMapping but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *ContainerInfo_DockerInfo_PortMappingbut is not nil && this == nil") + } + if this.HostPort != nil && that1.HostPort != nil { + if *this.HostPort != *that1.HostPort { + return fmt.Errorf("HostPort this(%v) Not Equal that(%v)", *this.HostPort, *that1.HostPort) + } + } else if this.HostPort != nil { + return fmt.Errorf("this.HostPort == nil && that.HostPort != nil") + } else if that1.HostPort != nil { + return fmt.Errorf("HostPort this(%v) Not Equal that(%v)", this.HostPort, that1.HostPort) + } + if this.ContainerPort != nil && that1.ContainerPort != nil { + if *this.ContainerPort != *that1.ContainerPort { + return fmt.Errorf("ContainerPort this(%v) Not Equal that(%v)", *this.ContainerPort, *that1.ContainerPort) + } + } else if this.ContainerPort != nil { + return fmt.Errorf("this.ContainerPort == nil && that.ContainerPort != nil") + } else if that1.ContainerPort != nil { + return fmt.Errorf("ContainerPort this(%v) Not Equal that(%v)", this.ContainerPort, that1.ContainerPort) + } + if this.Protocol != nil && that1.Protocol != nil { + if *this.Protocol != *that1.Protocol { + return fmt.Errorf("Protocol this(%v) Not Equal that(%v)", *this.Protocol, *that1.Protocol) } + } else if this.Protocol != nil { + return fmt.Errorf("this.Protocol == nil && that.Protocol != nil") + } else if that1.Protocol != nil { + return fmt.Errorf("Protocol this(%v) Not Equal that(%v)", this.Protocol, that1.Protocol) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *ACLs) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Permissive", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Permissive = &b - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RegisterFrameworks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RegisterFrameworks = append(m.RegisterFrameworks, &ACL_RegisterFramework{}) - m.RegisterFrameworks[len(m.RegisterFrameworks)-1].Unmarshal(data[index:postIndex]) - index = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RunTasks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RunTasks = append(m.RunTasks, &ACL_RunTask{}) - m.RunTasks[len(m.RunTasks)-1].Unmarshal(data[index:postIndex]) - index = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ShutdownFrameworks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ShutdownFrameworks = append(m.ShutdownFrameworks, &ACL_ShutdownFramework{}) - m.ShutdownFrameworks[len(m.ShutdownFrameworks)-1].Unmarshal(data[index:postIndex]) - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy +func (this *ContainerInfo_DockerInfo_PortMapping) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } + return false + } + + that1, ok := that.(*ContainerInfo_DockerInfo_PortMapping) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.HostPort != nil && that1.HostPort != nil { + if *this.HostPort != *that1.HostPort { + return false + } + } else if this.HostPort != nil { + return false + } else if that1.HostPort != nil { + return false + } + if this.ContainerPort != nil && that1.ContainerPort != nil { + if *this.ContainerPort != *that1.ContainerPort { + return false + } + } else if this.ContainerPort != nil { + return false + } else if that1.ContainerPort != nil { + return false + } + if this.Protocol != nil && that1.Protocol != nil { + if *this.Protocol != *that1.Protocol { + return false + } + } else if this.Protocol != nil { + return false + } else if that1.Protocol != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Labels) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Labels) + if !ok { + return fmt.Errorf("that is not of type *Labels") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Labels but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Labelsbut is not nil && this == nil") + } + if len(this.Labels) != len(that1.Labels) { + return fmt.Errorf("Labels this(%v) Not Equal that(%v)", len(this.Labels), len(that1.Labels)) + } + for i := range this.Labels { + if !this.Labels[i].Equal(that1.Labels[i]) { + return fmt.Errorf("Labels this[%v](%v) Not Equal that[%v](%v)", i, this.Labels[i], i, that1.Labels[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *RateLimit) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *Labels) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Qps", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.Qps = &v2 - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Principal", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Principal = &s - index = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Capacity", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Capacity = &v - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return false + } + + that1, ok := that.(*Labels) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if len(this.Labels) != len(that1.Labels) { + return false + } + for i := range this.Labels { + if !this.Labels[i].Equal(that1.Labels[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Label) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Label) + if !ok { + return fmt.Errorf("that is not of type *Label") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Label but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Labelbut is not nil && this == nil") + } + if this.Key != nil && that1.Key != nil { + if *this.Key != *that1.Key { + return fmt.Errorf("Key this(%v) Not Equal that(%v)", *this.Key, *that1.Key) + } + } else if this.Key != nil { + return fmt.Errorf("this.Key == nil && that.Key != nil") + } else if that1.Key != nil { + return fmt.Errorf("Key this(%v) Not Equal that(%v)", this.Key, that1.Key) + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) } + } else if this.Value != nil { + return fmt.Errorf("this.Value == nil && that.Value != nil") + } else if that1.Value != nil { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *RateLimits) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *Label) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Limits", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Limits = append(m.Limits, &RateLimit{}) - m.Limits[len(m.Limits)-1].Unmarshal(data[index:postIndex]) - index = postIndex - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field AggregateDefaultQps", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.AggregateDefaultQps = &v2 - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AggregateDefaultCapacity", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.AggregateDefaultCapacity = &v - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return false + } + + that1, ok := that.(*Label) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true } + return false + } else if this == nil { + return false } - return nil + if this.Key != nil && that1.Key != nil { + if *this.Key != *that1.Key { + return false + } + } else if this.Key != nil { + return false + } else if that1.Key != nil { + return false + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return false + } + } else if this.Value != nil { + return false + } else if that1.Value != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true } -func (m *Volume) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *Port) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerPath", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.ContainerPath = &s - index = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HostPath", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.HostPath = &s - index = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Mode", wireType) - } - var v Volume_Mode - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (Volume_Mode(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Mode = &v - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Port) + if !ok { + return fmt.Errorf("that is not of type *Port") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Port but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Portbut is not nil && this == nil") + } + if this.Number != nil && that1.Number != nil { + if *this.Number != *that1.Number { + return fmt.Errorf("Number this(%v) Not Equal that(%v)", *this.Number, *that1.Number) + } + } else if this.Number != nil { + return fmt.Errorf("this.Number == nil && that.Number != nil") + } else if that1.Number != nil { + return fmt.Errorf("Number this(%v) Not Equal that(%v)", this.Number, that1.Number) + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) } + } else if this.Name != nil { + return fmt.Errorf("this.Name == nil && that.Name != nil") + } else if that1.Name != nil { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) + } + if this.Protocol != nil && that1.Protocol != nil { + if *this.Protocol != *that1.Protocol { + return fmt.Errorf("Protocol this(%v) Not Equal that(%v)", *this.Protocol, *that1.Protocol) + } + } else if this.Protocol != nil { + return fmt.Errorf("this.Protocol == nil && that.Protocol != nil") + } else if that1.Protocol != nil { + return fmt.Errorf("Protocol this(%v) Not Equal that(%v)", this.Protocol, that1.Protocol) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *ContainerInfo) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *Port) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v ContainerInfo_Type - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (ContainerInfo_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Volumes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Volumes = append(m.Volumes, &Volume{}) - m.Volumes[len(m.Volumes)-1].Unmarshal(data[index:postIndex]) - index = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Hostname = &s - index = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Docker", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Docker == nil { - m.Docker = &ContainerInfo_DockerInfo{} - } - if err := m.Docker.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return false + } + + that1, ok := that.(*Port) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Number != nil && that1.Number != nil { + if *this.Number != *that1.Number { + return false + } + } else if this.Number != nil { + return false + } else if that1.Number != nil { + return false + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return false + } + } else if this.Name != nil { + return false + } else if that1.Name != nil { + return false + } + if this.Protocol != nil && that1.Protocol != nil { + if *this.Protocol != *that1.Protocol { + return false } + } else if this.Protocol != nil { + return false + } else if that1.Protocol != nil { + return false } - return nil + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true } -func (m *ContainerInfo_DockerInfo) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *Ports) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Image = &s - index = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType) - } - var v ContainerInfo_DockerInfo_Network - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (ContainerInfo_DockerInfo_Network(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Network = &v - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PortMappings", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PortMappings = append(m.PortMappings, &ContainerInfo_DockerInfo_PortMapping{}) - m.PortMappings[len(m.PortMappings)-1].Unmarshal(data[index:postIndex]) - index = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Privileged", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Privileged = &b - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Parameters = append(m.Parameters, &Parameter{}) - m.Parameters[len(m.Parameters)-1].Unmarshal(data[index:postIndex]) - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Ports) + if !ok { + return fmt.Errorf("that is not of type *Ports") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Ports but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Portsbut is not nil && this == nil") + } + if len(this.Ports) != len(that1.Ports) { + return fmt.Errorf("Ports this(%v) Not Equal that(%v)", len(this.Ports), len(that1.Ports)) + } + for i := range this.Ports { + if !this.Ports[i].Equal(that1.Ports[i]) { + return fmt.Errorf("Ports this[%v](%v) Not Equal that[%v](%v)", i, this.Ports[i], i, that1.Ports[i]) } } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } return nil } -func (m *ContainerInfo_DockerInfo_PortMapping) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *Ports) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HostPort", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.HostPort = &v - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerPort", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.ContainerPort = &v - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Protocol = &s - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return false + } + + that1, ok := that.(*Ports) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true } + return false + } else if this == nil { + return false } - return nil + if len(this.Ports) != len(that1.Ports) { + return false + } + for i := range this.Ports { + if !this.Ports[i].Equal(that1.Ports[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true } -func (this *FrameworkID) String() string { - if this == nil { - return "nil" +func (this *DiscoveryInfo) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*DiscoveryInfo) + if !ok { + return fmt.Errorf("that is not of type *DiscoveryInfo") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *DiscoveryInfo but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *DiscoveryInfobut is not nil && this == nil") + } + if this.Visibility != nil && that1.Visibility != nil { + if *this.Visibility != *that1.Visibility { + return fmt.Errorf("Visibility this(%v) Not Equal that(%v)", *this.Visibility, *that1.Visibility) + } + } else if this.Visibility != nil { + return fmt.Errorf("this.Visibility == nil && that.Visibility != nil") + } else if that1.Visibility != nil { + return fmt.Errorf("Visibility this(%v) Not Equal that(%v)", this.Visibility, that1.Visibility) + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) + } + } else if this.Name != nil { + return fmt.Errorf("this.Name == nil && that.Name != nil") + } else if that1.Name != nil { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) } - s := strings.Join([]string{`&FrameworkID{`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *OfferID) String() string { - if this == nil { - return "nil" + if this.Environment != nil && that1.Environment != nil { + if *this.Environment != *that1.Environment { + return fmt.Errorf("Environment this(%v) Not Equal that(%v)", *this.Environment, *that1.Environment) + } + } else if this.Environment != nil { + return fmt.Errorf("this.Environment == nil && that.Environment != nil") + } else if that1.Environment != nil { + return fmt.Errorf("Environment this(%v) Not Equal that(%v)", this.Environment, that1.Environment) } - s := strings.Join([]string{`&OfferID{`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *SlaveID) String() string { - if this == nil { - return "nil" + if this.Location != nil && that1.Location != nil { + if *this.Location != *that1.Location { + return fmt.Errorf("Location this(%v) Not Equal that(%v)", *this.Location, *that1.Location) + } + } else if this.Location != nil { + return fmt.Errorf("this.Location == nil && that.Location != nil") + } else if that1.Location != nil { + return fmt.Errorf("Location this(%v) Not Equal that(%v)", this.Location, that1.Location) } - s := strings.Join([]string{`&SlaveID{`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *TaskID) String() string { - if this == nil { - return "nil" + if this.Version != nil && that1.Version != nil { + if *this.Version != *that1.Version { + return fmt.Errorf("Version this(%v) Not Equal that(%v)", *this.Version, *that1.Version) + } + } else if this.Version != nil { + return fmt.Errorf("this.Version == nil && that.Version != nil") + } else if that1.Version != nil { + return fmt.Errorf("Version this(%v) Not Equal that(%v)", this.Version, that1.Version) } - s := strings.Join([]string{`&TaskID{`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ExecutorID) String() string { - if this == nil { - return "nil" + if !this.Ports.Equal(that1.Ports) { + return fmt.Errorf("Ports this(%v) Not Equal that(%v)", this.Ports, that1.Ports) } - s := strings.Join([]string{`&ExecutorID{`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ContainerID) String() string { - if this == nil { - return "nil" + if !this.Labels.Equal(that1.Labels) { + return fmt.Errorf("Labels this(%v) Not Equal that(%v)", this.Labels, that1.Labels) } - s := strings.Join([]string{`&ContainerID{`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *FrameworkInfo) String() string { - if this == nil { - return "nil" + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } - s := strings.Join([]string{`&FrameworkInfo{`, - `User:` + valueToStringMesos(this.User) + `,`, - `Name:` + valueToStringMesos(this.Name) + `,`, - `Id:` + strings.Replace(fmt1.Sprintf("%v", this.Id), "FrameworkID", "FrameworkID", 1) + `,`, - `FailoverTimeout:` + valueToStringMesos(this.FailoverTimeout) + `,`, - `Checkpoint:` + valueToStringMesos(this.Checkpoint) + `,`, - `Role:` + valueToStringMesos(this.Role) + `,`, - `Hostname:` + valueToStringMesos(this.Hostname) + `,`, - `Principal:` + valueToStringMesos(this.Principal) + `,`, - `WebuiUrl:` + valueToStringMesos(this.WebuiUrl) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + return nil } -func (this *HealthCheck) String() string { - if this == nil { - return "nil" +func (this *DiscoveryInfo) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false } - s := strings.Join([]string{`&HealthCheck{`, - `Http:` + strings.Replace(fmt1.Sprintf("%v", this.Http), "HealthCheck_HTTP", "HealthCheck_HTTP", 1) + `,`, - `DelaySeconds:` + valueToStringMesos(this.DelaySeconds) + `,`, - `IntervalSeconds:` + valueToStringMesos(this.IntervalSeconds) + `,`, - `TimeoutSeconds:` + valueToStringMesos(this.TimeoutSeconds) + `,`, - `ConsecutiveFailures:` + valueToStringMesos(this.ConsecutiveFailures) + `,`, - `GracePeriodSeconds:` + valueToStringMesos(this.GracePeriodSeconds) + `,`, - `Command:` + strings.Replace(fmt1.Sprintf("%v", this.Command), "CommandInfo", "CommandInfo", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *HealthCheck_HTTP) String() string { - if this == nil { - return "nil" + + that1, ok := that.(*DiscoveryInfo) + if !ok { + return false } - s := strings.Join([]string{`&HealthCheck_HTTP{`, - `Port:` + valueToStringMesos(this.Port) + `,`, - `Path:` + valueToStringMesos(this.Path) + `,`, - `Statuses:` + fmt1.Sprintf("%v", this.Statuses) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *CommandInfo) String() string { - if this == nil { - return "nil" + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false } - s := strings.Join([]string{`&CommandInfo{`, - `Container:` + strings.Replace(fmt1.Sprintf("%v", this.Container), "CommandInfo_ContainerInfo", "CommandInfo_ContainerInfo", 1) + `,`, - `Uris:` + strings.Replace(fmt1.Sprintf("%v", this.Uris), "CommandInfo_URI", "CommandInfo_URI", 1) + `,`, - `Environment:` + strings.Replace(fmt1.Sprintf("%v", this.Environment), "Environment", "Environment", 1) + `,`, - `Shell:` + valueToStringMesos(this.Shell) + `,`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `Arguments:` + fmt1.Sprintf("%v", this.Arguments) + `,`, - `User:` + valueToStringMesos(this.User) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *CommandInfo_URI) String() string { - if this == nil { - return "nil" + if this.Visibility != nil && that1.Visibility != nil { + if *this.Visibility != *that1.Visibility { + return false + } + } else if this.Visibility != nil { + return false + } else if that1.Visibility != nil { + return false } - s := strings.Join([]string{`&CommandInfo_URI{`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `Executable:` + valueToStringMesos(this.Executable) + `,`, - `Extract:` + valueToStringMesos(this.Extract) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *CommandInfo_ContainerInfo) String() string { - if this == nil { - return "nil" + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return false + } + } else if this.Name != nil { + return false + } else if that1.Name != nil { + return false } - s := strings.Join([]string{`&CommandInfo_ContainerInfo{`, - `Image:` + valueToStringMesos(this.Image) + `,`, - `Options:` + fmt1.Sprintf("%v", this.Options) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ExecutorInfo) String() string { - if this == nil { - return "nil" + if this.Environment != nil && that1.Environment != nil { + if *this.Environment != *that1.Environment { + return false + } + } else if this.Environment != nil { + return false + } else if that1.Environment != nil { + return false } - s := strings.Join([]string{`&ExecutorInfo{`, - `ExecutorId:` + strings.Replace(fmt1.Sprintf("%v", this.ExecutorId), "ExecutorID", "ExecutorID", 1) + `,`, - `FrameworkId:` + strings.Replace(fmt1.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `Command:` + strings.Replace(fmt1.Sprintf("%v", this.Command), "CommandInfo", "CommandInfo", 1) + `,`, - `Container:` + strings.Replace(fmt1.Sprintf("%v", this.Container), "ContainerInfo", "ContainerInfo", 1) + `,`, - `Resources:` + strings.Replace(fmt1.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, - `Name:` + valueToStringMesos(this.Name) + `,`, - `Source:` + valueToStringMesos(this.Source) + `,`, - `Data:` + valueToStringMesos(this.Data) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *MasterInfo) String() string { - if this == nil { - return "nil" + if this.Location != nil && that1.Location != nil { + if *this.Location != *that1.Location { + return false + } + } else if this.Location != nil { + return false + } else if that1.Location != nil { + return false } - s := strings.Join([]string{`&MasterInfo{`, - `Id:` + valueToStringMesos(this.Id) + `,`, - `Ip:` + valueToStringMesos(this.Ip) + `,`, - `Port:` + valueToStringMesos(this.Port) + `,`, - `Pid:` + valueToStringMesos(this.Pid) + `,`, - `Hostname:` + valueToStringMesos(this.Hostname) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *SlaveInfo) String() string { - if this == nil { - return "nil" + if this.Version != nil && that1.Version != nil { + if *this.Version != *that1.Version { + return false + } + } else if this.Version != nil { + return false + } else if that1.Version != nil { + return false } - s := strings.Join([]string{`&SlaveInfo{`, - `Hostname:` + valueToStringMesos(this.Hostname) + `,`, - `Port:` + valueToStringMesos(this.Port) + `,`, - `Resources:` + strings.Replace(fmt1.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, - `Attributes:` + strings.Replace(fmt1.Sprintf("%v", this.Attributes), "Attribute", "Attribute", 1) + `,`, - `Id:` + strings.Replace(fmt1.Sprintf("%v", this.Id), "SlaveID", "SlaveID", 1) + `,`, - `Checkpoint:` + valueToStringMesos(this.Checkpoint) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Value) String() string { - if this == nil { - return "nil" + if !this.Ports.Equal(that1.Ports) { + return false } - s := strings.Join([]string{`&Value{`, - `Type:` + valueToStringMesos(this.Type) + `,`, - `Scalar:` + strings.Replace(fmt1.Sprintf("%v", this.Scalar), "Value_Scalar", "Value_Scalar", 1) + `,`, - `Ranges:` + strings.Replace(fmt1.Sprintf("%v", this.Ranges), "Value_Ranges", "Value_Ranges", 1) + `,`, - `Set:` + strings.Replace(fmt1.Sprintf("%v", this.Set), "Value_Set", "Value_Set", 1) + `,`, - `Text:` + strings.Replace(fmt1.Sprintf("%v", this.Text), "Value_Text", "Value_Text", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Value_Scalar) String() string { - if this == nil { - return "nil" + if !this.Labels.Equal(that1.Labels) { + return false } - s := strings.Join([]string{`&Value_Scalar{`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Value_Range) String() string { - if this == nil { - return "nil" + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false } - s := strings.Join([]string{`&Value_Range{`, - `Begin:` + valueToStringMesos(this.Begin) + `,`, - `End:` + valueToStringMesos(this.End) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + return true } -func (this *Value_Ranges) String() string { +func (this *FrameworkID) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&Value_Ranges{`, - `Range:` + strings.Replace(fmt1.Sprintf("%v", this.Range), "Value_Range", "Value_Range", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Value_Set) String() string { - if this == nil { - return "nil" + s := make([]string, 0, 5) + s = append(s, "&mesosproto.FrameworkID{") + if this.Value != nil { + s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") } - s := strings.Join([]string{`&Value_Set{`, - `Item:` + fmt1.Sprintf("%v", this.Item) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *Value_Text) String() string { +func (this *OfferID) GoString() string { if this == nil { - return "nil" - } - s := strings.Join([]string{`&Value_Text{`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&mesosproto.OfferID{") + if this.Value != nil { + s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *Attribute) String() string { +func (this *SlaveID) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&Attribute{`, - `Name:` + valueToStringMesos(this.Name) + `,`, - `Type:` + valueToStringMesos(this.Type) + `,`, - `Scalar:` + strings.Replace(fmt1.Sprintf("%v", this.Scalar), "Value_Scalar", "Value_Scalar", 1) + `,`, - `Ranges:` + strings.Replace(fmt1.Sprintf("%v", this.Ranges), "Value_Ranges", "Value_Ranges", 1) + `,`, - `Set:` + strings.Replace(fmt1.Sprintf("%v", this.Set), "Value_Set", "Value_Set", 1) + `,`, - `Text:` + strings.Replace(fmt1.Sprintf("%v", this.Text), "Value_Text", "Value_Text", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 5) + s = append(s, "&mesosproto.SlaveID{") + if this.Value != nil { + s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *Resource) String() string { +func (this *TaskID) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&Resource{`, - `Name:` + valueToStringMesos(this.Name) + `,`, - `Type:` + valueToStringMesos(this.Type) + `,`, - `Scalar:` + strings.Replace(fmt1.Sprintf("%v", this.Scalar), "Value_Scalar", "Value_Scalar", 1) + `,`, - `Ranges:` + strings.Replace(fmt1.Sprintf("%v", this.Ranges), "Value_Ranges", "Value_Ranges", 1) + `,`, - `Set:` + strings.Replace(fmt1.Sprintf("%v", this.Set), "Value_Set", "Value_Set", 1) + `,`, - `Role:` + valueToStringMesos(this.Role) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 5) + s = append(s, "&mesosproto.TaskID{") + if this.Value != nil { + s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *ResourceStatistics) String() string { +func (this *ExecutorID) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ResourceStatistics{`, - `Timestamp:` + valueToStringMesos(this.Timestamp) + `,`, - `CpusUserTimeSecs:` + valueToStringMesos(this.CpusUserTimeSecs) + `,`, - `CpusSystemTimeSecs:` + valueToStringMesos(this.CpusSystemTimeSecs) + `,`, - `CpusLimit:` + valueToStringMesos(this.CpusLimit) + `,`, - `CpusNrPeriods:` + valueToStringMesos(this.CpusNrPeriods) + `,`, - `CpusNrThrottled:` + valueToStringMesos(this.CpusNrThrottled) + `,`, - `CpusThrottledTimeSecs:` + valueToStringMesos(this.CpusThrottledTimeSecs) + `,`, - `MemRssBytes:` + valueToStringMesos(this.MemRssBytes) + `,`, - `MemLimitBytes:` + valueToStringMesos(this.MemLimitBytes) + `,`, - `MemFileBytes:` + valueToStringMesos(this.MemFileBytes) + `,`, - `MemAnonBytes:` + valueToStringMesos(this.MemAnonBytes) + `,`, - `MemMappedFileBytes:` + valueToStringMesos(this.MemMappedFileBytes) + `,`, - `Perf:` + strings.Replace(fmt1.Sprintf("%v", this.Perf), "PerfStatistics", "PerfStatistics", 1) + `,`, - `NetRxPackets:` + valueToStringMesos(this.NetRxPackets) + `,`, - `NetRxBytes:` + valueToStringMesos(this.NetRxBytes) + `,`, - `NetRxErrors:` + valueToStringMesos(this.NetRxErrors) + `,`, - `NetRxDropped:` + valueToStringMesos(this.NetRxDropped) + `,`, - `NetTxPackets:` + valueToStringMesos(this.NetTxPackets) + `,`, - `NetTxBytes:` + valueToStringMesos(this.NetTxBytes) + `,`, - `NetTxErrors:` + valueToStringMesos(this.NetTxErrors) + `,`, - `NetTxDropped:` + valueToStringMesos(this.NetTxDropped) + `,`, - `NetTcpRttMicrosecsP50:` + valueToStringMesos(this.NetTcpRttMicrosecsP50) + `,`, - `NetTcpRttMicrosecsP90:` + valueToStringMesos(this.NetTcpRttMicrosecsP90) + `,`, - `NetTcpRttMicrosecsP95:` + valueToStringMesos(this.NetTcpRttMicrosecsP95) + `,`, - `NetTcpRttMicrosecsP99:` + valueToStringMesos(this.NetTcpRttMicrosecsP99) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 5) + s = append(s, "&mesosproto.ExecutorID{") + if this.Value != nil { + s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *ResourceUsage) String() string { +func (this *ContainerID) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ResourceUsage{`, - `SlaveId:` + strings.Replace(fmt1.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `FrameworkId:` + strings.Replace(fmt1.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `ExecutorId:` + strings.Replace(fmt1.Sprintf("%v", this.ExecutorId), "ExecutorID", "ExecutorID", 1) + `,`, - `ExecutorName:` + valueToStringMesos(this.ExecutorName) + `,`, - `TaskId:` + strings.Replace(fmt1.Sprintf("%v", this.TaskId), "TaskID", "TaskID", 1) + `,`, - `Statistics:` + strings.Replace(fmt1.Sprintf("%v", this.Statistics), "ResourceStatistics", "ResourceStatistics", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 5) + s = append(s, "&mesosproto.ContainerID{") + if this.Value != nil { + s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *PerfStatistics) String() string { +func (this *FrameworkInfo) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&PerfStatistics{`, - `Timestamp:` + valueToStringMesos(this.Timestamp) + `,`, - `Duration:` + valueToStringMesos(this.Duration) + `,`, - `Cycles:` + valueToStringMesos(this.Cycles) + `,`, - `StalledCyclesFrontend:` + valueToStringMesos(this.StalledCyclesFrontend) + `,`, - `StalledCyclesBackend:` + valueToStringMesos(this.StalledCyclesBackend) + `,`, - `Instructions:` + valueToStringMesos(this.Instructions) + `,`, - `CacheReferences:` + valueToStringMesos(this.CacheReferences) + `,`, - `CacheMisses:` + valueToStringMesos(this.CacheMisses) + `,`, - `Branches:` + valueToStringMesos(this.Branches) + `,`, - `BranchMisses:` + valueToStringMesos(this.BranchMisses) + `,`, - `BusCycles:` + valueToStringMesos(this.BusCycles) + `,`, - `RefCycles:` + valueToStringMesos(this.RefCycles) + `,`, - `CpuClock:` + valueToStringMesos(this.CpuClock) + `,`, - `TaskClock:` + valueToStringMesos(this.TaskClock) + `,`, - `PageFaults:` + valueToStringMesos(this.PageFaults) + `,`, - `MinorFaults:` + valueToStringMesos(this.MinorFaults) + `,`, - `MajorFaults:` + valueToStringMesos(this.MajorFaults) + `,`, - `ContextSwitches:` + valueToStringMesos(this.ContextSwitches) + `,`, - `CpuMigrations:` + valueToStringMesos(this.CpuMigrations) + `,`, - `AlignmentFaults:` + valueToStringMesos(this.AlignmentFaults) + `,`, - `EmulationFaults:` + valueToStringMesos(this.EmulationFaults) + `,`, - `L1DcacheLoads:` + valueToStringMesos(this.L1DcacheLoads) + `,`, - `L1DcacheLoadMisses:` + valueToStringMesos(this.L1DcacheLoadMisses) + `,`, - `L1DcacheStores:` + valueToStringMesos(this.L1DcacheStores) + `,`, - `L1DcacheStoreMisses:` + valueToStringMesos(this.L1DcacheStoreMisses) + `,`, - `L1DcachePrefetches:` + valueToStringMesos(this.L1DcachePrefetches) + `,`, - `L1DcachePrefetchMisses:` + valueToStringMesos(this.L1DcachePrefetchMisses) + `,`, - `L1IcacheLoads:` + valueToStringMesos(this.L1IcacheLoads) + `,`, - `L1IcacheLoadMisses:` + valueToStringMesos(this.L1IcacheLoadMisses) + `,`, - `L1IcachePrefetches:` + valueToStringMesos(this.L1IcachePrefetches) + `,`, - `L1IcachePrefetchMisses:` + valueToStringMesos(this.L1IcachePrefetchMisses) + `,`, - `LlcLoads:` + valueToStringMesos(this.LlcLoads) + `,`, - `LlcLoadMisses:` + valueToStringMesos(this.LlcLoadMisses) + `,`, - `LlcStores:` + valueToStringMesos(this.LlcStores) + `,`, - `LlcStoreMisses:` + valueToStringMesos(this.LlcStoreMisses) + `,`, - `LlcPrefetches:` + valueToStringMesos(this.LlcPrefetches) + `,`, - `LlcPrefetchMisses:` + valueToStringMesos(this.LlcPrefetchMisses) + `,`, - `DtlbLoads:` + valueToStringMesos(this.DtlbLoads) + `,`, - `DtlbLoadMisses:` + valueToStringMesos(this.DtlbLoadMisses) + `,`, - `DtlbStores:` + valueToStringMesos(this.DtlbStores) + `,`, - `DtlbStoreMisses:` + valueToStringMesos(this.DtlbStoreMisses) + `,`, - `DtlbPrefetches:` + valueToStringMesos(this.DtlbPrefetches) + `,`, - `DtlbPrefetchMisses:` + valueToStringMesos(this.DtlbPrefetchMisses) + `,`, - `ItlbLoads:` + valueToStringMesos(this.ItlbLoads) + `,`, - `ItlbLoadMisses:` + valueToStringMesos(this.ItlbLoadMisses) + `,`, - `BranchLoads:` + valueToStringMesos(this.BranchLoads) + `,`, - `BranchLoadMisses:` + valueToStringMesos(this.BranchLoadMisses) + `,`, - `NodeLoads:` + valueToStringMesos(this.NodeLoads) + `,`, - `NodeLoadMisses:` + valueToStringMesos(this.NodeLoadMisses) + `,`, - `NodeStores:` + valueToStringMesos(this.NodeStores) + `,`, - `NodeStoreMisses:` + valueToStringMesos(this.NodeStoreMisses) + `,`, - `NodePrefetches:` + valueToStringMesos(this.NodePrefetches) + `,`, - `NodePrefetchMisses:` + valueToStringMesos(this.NodePrefetchMisses) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 14) + s = append(s, "&mesosproto.FrameworkInfo{") + if this.User != nil { + s = append(s, "User: "+valueToGoStringMesos(this.User, "string")+",\n") + } + if this.Name != nil { + s = append(s, "Name: "+valueToGoStringMesos(this.Name, "string")+",\n") + } + if this.Id != nil { + s = append(s, "Id: "+fmt.Sprintf("%#v", this.Id)+",\n") + } + if this.FailoverTimeout != nil { + s = append(s, "FailoverTimeout: "+valueToGoStringMesos(this.FailoverTimeout, "float64")+",\n") + } + if this.Checkpoint != nil { + s = append(s, "Checkpoint: "+valueToGoStringMesos(this.Checkpoint, "bool")+",\n") + } + if this.Role != nil { + s = append(s, "Role: "+valueToGoStringMesos(this.Role, "string")+",\n") + } + if this.Hostname != nil { + s = append(s, "Hostname: "+valueToGoStringMesos(this.Hostname, "string")+",\n") + } + if this.Principal != nil { + s = append(s, "Principal: "+valueToGoStringMesos(this.Principal, "string")+",\n") + } + if this.WebuiUrl != nil { + s = append(s, "WebuiUrl: "+valueToGoStringMesos(this.WebuiUrl, "string")+",\n") + } + if this.Capabilities != nil { + s = append(s, "Capabilities: "+fmt.Sprintf("%#v", this.Capabilities)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *Request) String() string { +func (this *FrameworkInfo_Capability) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&Request{`, - `SlaveId:` + strings.Replace(fmt1.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `Resources:` + strings.Replace(fmt1.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 5) + s = append(s, "&mesosproto.FrameworkInfo_Capability{") + if this.Type != nil { + s = append(s, "Type: "+valueToGoStringMesos(this.Type, "mesosproto.FrameworkInfo_Capability_Type")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *Offer) String() string { +func (this *HealthCheck) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&Offer{`, - `Id:` + strings.Replace(fmt1.Sprintf("%v", this.Id), "OfferID", "OfferID", 1) + `,`, - `FrameworkId:` + strings.Replace(fmt1.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `SlaveId:` + strings.Replace(fmt1.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `Hostname:` + valueToStringMesos(this.Hostname) + `,`, - `Resources:` + strings.Replace(fmt1.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, - `Attributes:` + strings.Replace(fmt1.Sprintf("%v", this.Attributes), "Attribute", "Attribute", 1) + `,`, - `ExecutorIds:` + strings.Replace(fmt1.Sprintf("%v", this.ExecutorIds), "ExecutorID", "ExecutorID", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 11) + s = append(s, "&mesosproto.HealthCheck{") + if this.Http != nil { + s = append(s, "Http: "+fmt.Sprintf("%#v", this.Http)+",\n") + } + if this.DelaySeconds != nil { + s = append(s, "DelaySeconds: "+valueToGoStringMesos(this.DelaySeconds, "float64")+",\n") + } + if this.IntervalSeconds != nil { + s = append(s, "IntervalSeconds: "+valueToGoStringMesos(this.IntervalSeconds, "float64")+",\n") + } + if this.TimeoutSeconds != nil { + s = append(s, "TimeoutSeconds: "+valueToGoStringMesos(this.TimeoutSeconds, "float64")+",\n") + } + if this.ConsecutiveFailures != nil { + s = append(s, "ConsecutiveFailures: "+valueToGoStringMesos(this.ConsecutiveFailures, "uint32")+",\n") + } + if this.GracePeriodSeconds != nil { + s = append(s, "GracePeriodSeconds: "+valueToGoStringMesos(this.GracePeriodSeconds, "float64")+",\n") + } + if this.Command != nil { + s = append(s, "Command: "+fmt.Sprintf("%#v", this.Command)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *TaskInfo) String() string { +func (this *HealthCheck_HTTP) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&TaskInfo{`, - `Name:` + valueToStringMesos(this.Name) + `,`, - `TaskId:` + strings.Replace(fmt1.Sprintf("%v", this.TaskId), "TaskID", "TaskID", 1) + `,`, - `SlaveId:` + strings.Replace(fmt1.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `Resources:` + strings.Replace(fmt1.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, - `Executor:` + strings.Replace(fmt1.Sprintf("%v", this.Executor), "ExecutorInfo", "ExecutorInfo", 1) + `,`, - `Command:` + strings.Replace(fmt1.Sprintf("%v", this.Command), "CommandInfo", "CommandInfo", 1) + `,`, - `Container:` + strings.Replace(fmt1.Sprintf("%v", this.Container), "ContainerInfo", "ContainerInfo", 1) + `,`, - `Data:` + valueToStringMesos(this.Data) + `,`, - `HealthCheck:` + strings.Replace(fmt1.Sprintf("%v", this.HealthCheck), "HealthCheck", "HealthCheck", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 7) + s = append(s, "&mesosproto.HealthCheck_HTTP{") + if this.Port != nil { + s = append(s, "Port: "+valueToGoStringMesos(this.Port, "uint32")+",\n") + } + if this.Path != nil { + s = append(s, "Path: "+valueToGoStringMesos(this.Path, "string")+",\n") + } + if this.Statuses != nil { + s = append(s, "Statuses: "+fmt.Sprintf("%#v", this.Statuses)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *TaskStatus) String() string { +func (this *CommandInfo) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&TaskStatus{`, - `TaskId:` + strings.Replace(fmt1.Sprintf("%v", this.TaskId), "TaskID", "TaskID", 1) + `,`, - `State:` + valueToStringMesos(this.State) + `,`, - `Message:` + valueToStringMesos(this.Message) + `,`, - `Source:` + valueToStringMesos(this.Source) + `,`, - `Reason:` + valueToStringMesos(this.Reason) + `,`, - `Data:` + valueToStringMesos(this.Data) + `,`, - `SlaveId:` + strings.Replace(fmt1.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `ExecutorId:` + strings.Replace(fmt1.Sprintf("%v", this.ExecutorId), "ExecutorID", "ExecutorID", 1) + `,`, - `Timestamp:` + valueToStringMesos(this.Timestamp) + `,`, - `Healthy:` + valueToStringMesos(this.Healthy) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 11) + s = append(s, "&mesosproto.CommandInfo{") + if this.Container != nil { + s = append(s, "Container: "+fmt.Sprintf("%#v", this.Container)+",\n") + } + if this.Uris != nil { + s = append(s, "Uris: "+fmt.Sprintf("%#v", this.Uris)+",\n") + } + if this.Environment != nil { + s = append(s, "Environment: "+fmt.Sprintf("%#v", this.Environment)+",\n") + } + if this.Shell != nil { + s = append(s, "Shell: "+valueToGoStringMesos(this.Shell, "bool")+",\n") + } + if this.Value != nil { + s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") + } + if this.Arguments != nil { + s = append(s, "Arguments: "+fmt.Sprintf("%#v", this.Arguments)+",\n") + } + if this.User != nil { + s = append(s, "User: "+valueToGoStringMesos(this.User, "string")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *Filters) String() string { +func (this *CommandInfo_URI) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&Filters{`, - `RefuseSeconds:` + valueToStringMesos(this.RefuseSeconds) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 8) + s = append(s, "&mesosproto.CommandInfo_URI{") + if this.Value != nil { + s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") + } + if this.Executable != nil { + s = append(s, "Executable: "+valueToGoStringMesos(this.Executable, "bool")+",\n") + } + if this.Extract != nil { + s = append(s, "Extract: "+valueToGoStringMesos(this.Extract, "bool")+",\n") + } + if this.Cache != nil { + s = append(s, "Cache: "+valueToGoStringMesos(this.Cache, "bool")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *Environment) String() string { +func (this *CommandInfo_ContainerInfo) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&Environment{`, - `Variables:` + strings.Replace(fmt1.Sprintf("%v", this.Variables), "Environment_Variable", "Environment_Variable", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 6) + s = append(s, "&mesosproto.CommandInfo_ContainerInfo{") + if this.Image != nil { + s = append(s, "Image: "+valueToGoStringMesos(this.Image, "string")+",\n") + } + if this.Options != nil { + s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *Environment_Variable) String() string { +func (this *ExecutorInfo) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&Environment_Variable{`, - `Name:` + valueToStringMesos(this.Name) + `,`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 13) + s = append(s, "&mesosproto.ExecutorInfo{") + if this.ExecutorId != nil { + s = append(s, "ExecutorId: "+fmt.Sprintf("%#v", this.ExecutorId)+",\n") + } + if this.FrameworkId != nil { + s = append(s, "FrameworkId: "+fmt.Sprintf("%#v", this.FrameworkId)+",\n") + } + if this.Command != nil { + s = append(s, "Command: "+fmt.Sprintf("%#v", this.Command)+",\n") + } + if this.Container != nil { + s = append(s, "Container: "+fmt.Sprintf("%#v", this.Container)+",\n") + } + if this.Resources != nil { + s = append(s, "Resources: "+fmt.Sprintf("%#v", this.Resources)+",\n") + } + if this.Name != nil { + s = append(s, "Name: "+valueToGoStringMesos(this.Name, "string")+",\n") + } + if this.Source != nil { + s = append(s, "Source: "+valueToGoStringMesos(this.Source, "string")+",\n") + } + if this.Data != nil { + s = append(s, "Data: "+valueToGoStringMesos(this.Data, "byte")+",\n") + } + if this.Discovery != nil { + s = append(s, "Discovery: "+fmt.Sprintf("%#v", this.Discovery)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *Parameter) String() string { +func (this *MasterInfo) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&Parameter{`, - `Key:` + valueToStringMesos(this.Key) + `,`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 10) + s = append(s, "&mesosproto.MasterInfo{") + if this.Id != nil { + s = append(s, "Id: "+valueToGoStringMesos(this.Id, "string")+",\n") + } + if this.Ip != nil { + s = append(s, "Ip: "+valueToGoStringMesos(this.Ip, "uint32")+",\n") + } + if this.Port != nil { + s = append(s, "Port: "+valueToGoStringMesos(this.Port, "uint32")+",\n") + } + if this.Pid != nil { + s = append(s, "Pid: "+valueToGoStringMesos(this.Pid, "string")+",\n") + } + if this.Hostname != nil { + s = append(s, "Hostname: "+valueToGoStringMesos(this.Hostname, "string")+",\n") + } + if this.Version != nil { + s = append(s, "Version: "+valueToGoStringMesos(this.Version, "string")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *Parameters) String() string { +func (this *SlaveInfo) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&Parameters{`, - `Parameter:` + strings.Replace(fmt1.Sprintf("%v", this.Parameter), "Parameter", "Parameter", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 10) + s = append(s, "&mesosproto.SlaveInfo{") + if this.Hostname != nil { + s = append(s, "Hostname: "+valueToGoStringMesos(this.Hostname, "string")+",\n") + } + if this.Port != nil { + s = append(s, "Port: "+valueToGoStringMesos(this.Port, "int32")+",\n") + } + if this.Resources != nil { + s = append(s, "Resources: "+fmt.Sprintf("%#v", this.Resources)+",\n") + } + if this.Attributes != nil { + s = append(s, "Attributes: "+fmt.Sprintf("%#v", this.Attributes)+",\n") + } + if this.Id != nil { + s = append(s, "Id: "+fmt.Sprintf("%#v", this.Id)+",\n") + } + if this.Checkpoint != nil { + s = append(s, "Checkpoint: "+valueToGoStringMesos(this.Checkpoint, "bool")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *Credential) String() string { +func (this *Value) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&Credential{`, - `Principal:` + valueToStringMesos(this.Principal) + `,`, - `Secret:` + valueToStringMesos(this.Secret) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 9) + s = append(s, "&mesosproto.Value{") + if this.Type != nil { + s = append(s, "Type: "+valueToGoStringMesos(this.Type, "mesosproto.Value_Type")+",\n") + } + if this.Scalar != nil { + s = append(s, "Scalar: "+fmt.Sprintf("%#v", this.Scalar)+",\n") + } + if this.Ranges != nil { + s = append(s, "Ranges: "+fmt.Sprintf("%#v", this.Ranges)+",\n") + } + if this.Set != nil { + s = append(s, "Set: "+fmt.Sprintf("%#v", this.Set)+",\n") + } + if this.Text != nil { + s = append(s, "Text: "+fmt.Sprintf("%#v", this.Text)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *Credentials) String() string { +func (this *Value_Scalar) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&Credentials{`, - `Credentials:` + strings.Replace(fmt1.Sprintf("%v", this.Credentials), "Credential", "Credential", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Value_Scalar{") + if this.Value != nil { + s = append(s, "Value: "+valueToGoStringMesos(this.Value, "float64")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *ACL) String() string { +func (this *Value_Range) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ACL{`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 6) + s = append(s, "&mesosproto.Value_Range{") + if this.Begin != nil { + s = append(s, "Begin: "+valueToGoStringMesos(this.Begin, "uint64")+",\n") + } + if this.End != nil { + s = append(s, "End: "+valueToGoStringMesos(this.End, "uint64")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *ACL_Entity) String() string { +func (this *Value_Ranges) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ACL_Entity{`, - `Type:` + valueToStringMesos(this.Type) + `,`, - `Values:` + fmt1.Sprintf("%v", this.Values) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Value_Ranges{") + if this.Range != nil { + s = append(s, "Range: "+fmt.Sprintf("%#v", this.Range)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *ACL_RegisterFramework) String() string { +func (this *Value_Set) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ACL_RegisterFramework{`, - `Principals:` + strings.Replace(fmt1.Sprintf("%v", this.Principals), "ACL_Entity", "ACL_Entity", 1) + `,`, - `Roles:` + strings.Replace(fmt1.Sprintf("%v", this.Roles), "ACL_Entity", "ACL_Entity", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Value_Set{") + if this.Item != nil { + s = append(s, "Item: "+fmt.Sprintf("%#v", this.Item)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *ACL_RunTask) String() string { +func (this *Value_Text) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ACL_RunTask{`, - `Principals:` + strings.Replace(fmt1.Sprintf("%v", this.Principals), "ACL_Entity", "ACL_Entity", 1) + `,`, - `Users:` + strings.Replace(fmt1.Sprintf("%v", this.Users), "ACL_Entity", "ACL_Entity", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Value_Text{") + if this.Value != nil { + s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *ACL_ShutdownFramework) String() string { +func (this *Attribute) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ACL_ShutdownFramework{`, - `Principals:` + strings.Replace(fmt1.Sprintf("%v", this.Principals), "ACL_Entity", "ACL_Entity", 1) + `,`, - `FrameworkPrincipals:` + strings.Replace(fmt1.Sprintf("%v", this.FrameworkPrincipals), "ACL_Entity", "ACL_Entity", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 10) + s = append(s, "&mesosproto.Attribute{") + if this.Name != nil { + s = append(s, "Name: "+valueToGoStringMesos(this.Name, "string")+",\n") + } + if this.Type != nil { + s = append(s, "Type: "+valueToGoStringMesos(this.Type, "mesosproto.Value_Type")+",\n") + } + if this.Scalar != nil { + s = append(s, "Scalar: "+fmt.Sprintf("%#v", this.Scalar)+",\n") + } + if this.Ranges != nil { + s = append(s, "Ranges: "+fmt.Sprintf("%#v", this.Ranges)+",\n") + } + if this.Set != nil { + s = append(s, "Set: "+fmt.Sprintf("%#v", this.Set)+",\n") + } + if this.Text != nil { + s = append(s, "Text: "+fmt.Sprintf("%#v", this.Text)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *ACLs) String() string { +func (this *Resource) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ACLs{`, - `Permissive:` + valueToStringMesos(this.Permissive) + `,`, - `RegisterFrameworks:` + strings.Replace(fmt1.Sprintf("%v", this.RegisterFrameworks), "ACL_RegisterFramework", "ACL_RegisterFramework", 1) + `,`, - `RunTasks:` + strings.Replace(fmt1.Sprintf("%v", this.RunTasks), "ACL_RunTask", "ACL_RunTask", 1) + `,`, - `ShutdownFrameworks:` + strings.Replace(fmt1.Sprintf("%v", this.ShutdownFrameworks), "ACL_ShutdownFramework", "ACL_ShutdownFramework", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 13) + s = append(s, "&mesosproto.Resource{") + if this.Name != nil { + s = append(s, "Name: "+valueToGoStringMesos(this.Name, "string")+",\n") + } + if this.Type != nil { + s = append(s, "Type: "+valueToGoStringMesos(this.Type, "mesosproto.Value_Type")+",\n") + } + if this.Scalar != nil { + s = append(s, "Scalar: "+fmt.Sprintf("%#v", this.Scalar)+",\n") + } + if this.Ranges != nil { + s = append(s, "Ranges: "+fmt.Sprintf("%#v", this.Ranges)+",\n") + } + if this.Set != nil { + s = append(s, "Set: "+fmt.Sprintf("%#v", this.Set)+",\n") + } + if this.Role != nil { + s = append(s, "Role: "+valueToGoStringMesos(this.Role, "string")+",\n") + } + if this.Reservation != nil { + s = append(s, "Reservation: "+fmt.Sprintf("%#v", this.Reservation)+",\n") + } + if this.Disk != nil { + s = append(s, "Disk: "+fmt.Sprintf("%#v", this.Disk)+",\n") + } + if this.Revocable != nil { + s = append(s, "Revocable: "+fmt.Sprintf("%#v", this.Revocable)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *RateLimit) String() string { +func (this *Resource_ReservationInfo) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&RateLimit{`, - `Qps:` + valueToStringMesos(this.Qps) + `,`, - `Principal:` + valueToStringMesos(this.Principal) + `,`, - `Capacity:` + valueToStringMesos(this.Capacity) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Resource_ReservationInfo{") + if this.Principal != nil { + s = append(s, "Principal: "+valueToGoStringMesos(this.Principal, "string")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *RateLimits) String() string { +func (this *Resource_DiskInfo) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&RateLimits{`, - `Limits:` + strings.Replace(fmt1.Sprintf("%v", this.Limits), "RateLimit", "RateLimit", 1) + `,`, - `AggregateDefaultQps:` + valueToStringMesos(this.AggregateDefaultQps) + `,`, - `AggregateDefaultCapacity:` + valueToStringMesos(this.AggregateDefaultCapacity) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 6) + s = append(s, "&mesosproto.Resource_DiskInfo{") + if this.Persistence != nil { + s = append(s, "Persistence: "+fmt.Sprintf("%#v", this.Persistence)+",\n") + } + if this.Volume != nil { + s = append(s, "Volume: "+fmt.Sprintf("%#v", this.Volume)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *Volume) String() string { +func (this *Resource_DiskInfo_Persistence) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&Volume{`, - `ContainerPath:` + valueToStringMesos(this.ContainerPath) + `,`, - `HostPath:` + valueToStringMesos(this.HostPath) + `,`, - `Mode:` + valueToStringMesos(this.Mode) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Resource_DiskInfo_Persistence{") + if this.Id != nil { + s = append(s, "Id: "+valueToGoStringMesos(this.Id, "string")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *ContainerInfo) String() string { +func (this *Resource_RevocableInfo) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ContainerInfo{`, - `Type:` + valueToStringMesos(this.Type) + `,`, - `Volumes:` + strings.Replace(fmt1.Sprintf("%v", this.Volumes), "Volume", "Volume", 1) + `,`, - `Hostname:` + valueToStringMesos(this.Hostname) + `,`, - `Docker:` + strings.Replace(fmt1.Sprintf("%v", this.Docker), "ContainerInfo_DockerInfo", "ContainerInfo_DockerInfo", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 4) + s = append(s, "&mesosproto.Resource_RevocableInfo{") + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *ContainerInfo_DockerInfo) String() string { +func (this *TrafficControlStatistics) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ContainerInfo_DockerInfo{`, - `Image:` + valueToStringMesos(this.Image) + `,`, - `Network:` + valueToStringMesos(this.Network) + `,`, - `PortMappings:` + strings.Replace(fmt1.Sprintf("%v", this.PortMappings), "ContainerInfo_DockerInfo_PortMapping", "ContainerInfo_DockerInfo_PortMapping", 1) + `,`, - `Privileged:` + valueToStringMesos(this.Privileged) + `,`, - `Parameters:` + strings.Replace(fmt1.Sprintf("%v", this.Parameters), "Parameter", "Parameter", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 14) + s = append(s, "&mesosproto.TrafficControlStatistics{") + if this.Id != nil { + s = append(s, "Id: "+valueToGoStringMesos(this.Id, "string")+",\n") + } + if this.Backlog != nil { + s = append(s, "Backlog: "+valueToGoStringMesos(this.Backlog, "uint64")+",\n") + } + if this.Bytes != nil { + s = append(s, "Bytes: "+valueToGoStringMesos(this.Bytes, "uint64")+",\n") + } + if this.Drops != nil { + s = append(s, "Drops: "+valueToGoStringMesos(this.Drops, "uint64")+",\n") + } + if this.Overlimits != nil { + s = append(s, "Overlimits: "+valueToGoStringMesos(this.Overlimits, "uint64")+",\n") + } + if this.Packets != nil { + s = append(s, "Packets: "+valueToGoStringMesos(this.Packets, "uint64")+",\n") + } + if this.Qlen != nil { + s = append(s, "Qlen: "+valueToGoStringMesos(this.Qlen, "uint64")+",\n") + } + if this.Ratebps != nil { + s = append(s, "Ratebps: "+valueToGoStringMesos(this.Ratebps, "uint64")+",\n") + } + if this.Ratepps != nil { + s = append(s, "Ratepps: "+valueToGoStringMesos(this.Ratepps, "uint64")+",\n") + } + if this.Requeues != nil { + s = append(s, "Requeues: "+valueToGoStringMesos(this.Requeues, "uint64")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *ContainerInfo_DockerInfo_PortMapping) String() string { +func (this *ResourceStatistics) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ContainerInfo_DockerInfo_PortMapping{`, - `HostPort:` + valueToStringMesos(this.HostPort) + `,`, - `ContainerPort:` + valueToStringMesos(this.ContainerPort) + `,`, - `Protocol:` + valueToStringMesos(this.Protocol) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func valueToStringMesos(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" + s := make([]string, 0, 44) + s = append(s, "&mesosproto.ResourceStatistics{") + if this.Timestamp != nil { + s = append(s, "Timestamp: "+valueToGoStringMesos(this.Timestamp, "float64")+",\n") } - pv := reflect.Indirect(rv).Interface() - return fmt1.Sprintf("*%v", pv) -} -func (m *FrameworkID) Size() (n int) { - var l int - _ = l - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) + if this.Processes != nil { + s = append(s, "Processes: "+valueToGoStringMesos(this.Processes, "uint32")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.Threads != nil { + s = append(s, "Threads: "+valueToGoStringMesos(this.Threads, "uint32")+",\n") } - return n -} - -func (m *OfferID) Size() (n int) { - var l int - _ = l - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) + if this.CpusUserTimeSecs != nil { + s = append(s, "CpusUserTimeSecs: "+valueToGoStringMesos(this.CpusUserTimeSecs, "float64")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.CpusSystemTimeSecs != nil { + s = append(s, "CpusSystemTimeSecs: "+valueToGoStringMesos(this.CpusSystemTimeSecs, "float64")+",\n") } - return n + if this.CpusLimit != nil { + s = append(s, "CpusLimit: "+valueToGoStringMesos(this.CpusLimit, "float64")+",\n") + } + if this.CpusNrPeriods != nil { + s = append(s, "CpusNrPeriods: "+valueToGoStringMesos(this.CpusNrPeriods, "uint32")+",\n") + } + if this.CpusNrThrottled != nil { + s = append(s, "CpusNrThrottled: "+valueToGoStringMesos(this.CpusNrThrottled, "uint32")+",\n") + } + if this.CpusThrottledTimeSecs != nil { + s = append(s, "CpusThrottledTimeSecs: "+valueToGoStringMesos(this.CpusThrottledTimeSecs, "float64")+",\n") + } + if this.MemTotalBytes != nil { + s = append(s, "MemTotalBytes: "+valueToGoStringMesos(this.MemTotalBytes, "uint64")+",\n") + } + if this.MemTotalMemswBytes != nil { + s = append(s, "MemTotalMemswBytes: "+valueToGoStringMesos(this.MemTotalMemswBytes, "uint64")+",\n") + } + if this.MemLimitBytes != nil { + s = append(s, "MemLimitBytes: "+valueToGoStringMesos(this.MemLimitBytes, "uint64")+",\n") + } + if this.MemSoftLimitBytes != nil { + s = append(s, "MemSoftLimitBytes: "+valueToGoStringMesos(this.MemSoftLimitBytes, "uint64")+",\n") + } + if this.MemFileBytes != nil { + s = append(s, "MemFileBytes: "+valueToGoStringMesos(this.MemFileBytes, "uint64")+",\n") + } + if this.MemAnonBytes != nil { + s = append(s, "MemAnonBytes: "+valueToGoStringMesos(this.MemAnonBytes, "uint64")+",\n") + } + if this.MemCacheBytes != nil { + s = append(s, "MemCacheBytes: "+valueToGoStringMesos(this.MemCacheBytes, "uint64")+",\n") + } + if this.MemRssBytes != nil { + s = append(s, "MemRssBytes: "+valueToGoStringMesos(this.MemRssBytes, "uint64")+",\n") + } + if this.MemMappedFileBytes != nil { + s = append(s, "MemMappedFileBytes: "+valueToGoStringMesos(this.MemMappedFileBytes, "uint64")+",\n") + } + if this.MemSwapBytes != nil { + s = append(s, "MemSwapBytes: "+valueToGoStringMesos(this.MemSwapBytes, "uint64")+",\n") + } + if this.MemLowPressureCounter != nil { + s = append(s, "MemLowPressureCounter: "+valueToGoStringMesos(this.MemLowPressureCounter, "uint64")+",\n") + } + if this.MemMediumPressureCounter != nil { + s = append(s, "MemMediumPressureCounter: "+valueToGoStringMesos(this.MemMediumPressureCounter, "uint64")+",\n") + } + if this.MemCriticalPressureCounter != nil { + s = append(s, "MemCriticalPressureCounter: "+valueToGoStringMesos(this.MemCriticalPressureCounter, "uint64")+",\n") + } + if this.DiskLimitBytes != nil { + s = append(s, "DiskLimitBytes: "+valueToGoStringMesos(this.DiskLimitBytes, "uint64")+",\n") + } + if this.DiskUsedBytes != nil { + s = append(s, "DiskUsedBytes: "+valueToGoStringMesos(this.DiskUsedBytes, "uint64")+",\n") + } + if this.Perf != nil { + s = append(s, "Perf: "+fmt.Sprintf("%#v", this.Perf)+",\n") + } + if this.NetRxPackets != nil { + s = append(s, "NetRxPackets: "+valueToGoStringMesos(this.NetRxPackets, "uint64")+",\n") + } + if this.NetRxBytes != nil { + s = append(s, "NetRxBytes: "+valueToGoStringMesos(this.NetRxBytes, "uint64")+",\n") + } + if this.NetRxErrors != nil { + s = append(s, "NetRxErrors: "+valueToGoStringMesos(this.NetRxErrors, "uint64")+",\n") + } + if this.NetRxDropped != nil { + s = append(s, "NetRxDropped: "+valueToGoStringMesos(this.NetRxDropped, "uint64")+",\n") + } + if this.NetTxPackets != nil { + s = append(s, "NetTxPackets: "+valueToGoStringMesos(this.NetTxPackets, "uint64")+",\n") + } + if this.NetTxBytes != nil { + s = append(s, "NetTxBytes: "+valueToGoStringMesos(this.NetTxBytes, "uint64")+",\n") + } + if this.NetTxErrors != nil { + s = append(s, "NetTxErrors: "+valueToGoStringMesos(this.NetTxErrors, "uint64")+",\n") + } + if this.NetTxDropped != nil { + s = append(s, "NetTxDropped: "+valueToGoStringMesos(this.NetTxDropped, "uint64")+",\n") + } + if this.NetTcpRttMicrosecsP50 != nil { + s = append(s, "NetTcpRttMicrosecsP50: "+valueToGoStringMesos(this.NetTcpRttMicrosecsP50, "float64")+",\n") + } + if this.NetTcpRttMicrosecsP90 != nil { + s = append(s, "NetTcpRttMicrosecsP90: "+valueToGoStringMesos(this.NetTcpRttMicrosecsP90, "float64")+",\n") + } + if this.NetTcpRttMicrosecsP95 != nil { + s = append(s, "NetTcpRttMicrosecsP95: "+valueToGoStringMesos(this.NetTcpRttMicrosecsP95, "float64")+",\n") + } + if this.NetTcpRttMicrosecsP99 != nil { + s = append(s, "NetTcpRttMicrosecsP99: "+valueToGoStringMesos(this.NetTcpRttMicrosecsP99, "float64")+",\n") + } + if this.NetTcpActiveConnections != nil { + s = append(s, "NetTcpActiveConnections: "+valueToGoStringMesos(this.NetTcpActiveConnections, "float64")+",\n") + } + if this.NetTcpTimeWaitConnections != nil { + s = append(s, "NetTcpTimeWaitConnections: "+valueToGoStringMesos(this.NetTcpTimeWaitConnections, "float64")+",\n") + } + if this.NetTrafficControlStatistics != nil { + s = append(s, "NetTrafficControlStatistics: "+fmt.Sprintf("%#v", this.NetTrafficControlStatistics)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func (m *SlaveID) Size() (n int) { - var l int - _ = l - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) +func (this *ResourceUsage) GoString() string { + if this == nil { + return "nil" } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + s := make([]string, 0, 5) + s = append(s, "&mesosproto.ResourceUsage{") + if this.Executors != nil { + s = append(s, "Executors: "+fmt.Sprintf("%#v", this.Executors)+",\n") } - return n + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func (m *TaskID) Size() (n int) { - var l int - _ = l - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) +func (this *ResourceUsage_Executor) GoString() string { + if this == nil { + return "nil" } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + s := make([]string, 0, 7) + s = append(s, "&mesosproto.ResourceUsage_Executor{") + if this.ExecutorInfo != nil { + s = append(s, "ExecutorInfo: "+fmt.Sprintf("%#v", this.ExecutorInfo)+",\n") } - return n + if this.Allocated != nil { + s = append(s, "Allocated: "+fmt.Sprintf("%#v", this.Allocated)+",\n") + } + if this.Statistics != nil { + s = append(s, "Statistics: "+fmt.Sprintf("%#v", this.Statistics)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func (m *ExecutorID) Size() (n int) { - var l int - _ = l - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) +func (this *PerfStatistics) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 57) + s = append(s, "&mesosproto.PerfStatistics{") + if this.Timestamp != nil { + s = append(s, "Timestamp: "+valueToGoStringMesos(this.Timestamp, "float64")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.Duration != nil { + s = append(s, "Duration: "+valueToGoStringMesos(this.Duration, "float64")+",\n") } - return n -} - -func (m *ContainerID) Size() (n int) { - var l int - _ = l - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) + if this.Cycles != nil { + s = append(s, "Cycles: "+valueToGoStringMesos(this.Cycles, "uint64")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.StalledCyclesFrontend != nil { + s = append(s, "StalledCyclesFrontend: "+valueToGoStringMesos(this.StalledCyclesFrontend, "uint64")+",\n") } - return n -} - -func (m *FrameworkInfo) Size() (n int) { - var l int - _ = l - if m.User != nil { - l = len(*m.User) - n += 1 + l + sovMesos(uint64(l)) + if this.StalledCyclesBackend != nil { + s = append(s, "StalledCyclesBackend: "+valueToGoStringMesos(this.StalledCyclesBackend, "uint64")+",\n") } - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovMesos(uint64(l)) + if this.Instructions != nil { + s = append(s, "Instructions: "+valueToGoStringMesos(this.Instructions, "uint64")+",\n") } - if m.Id != nil { - l = m.Id.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.CacheReferences != nil { + s = append(s, "CacheReferences: "+valueToGoStringMesos(this.CacheReferences, "uint64")+",\n") } - if m.FailoverTimeout != nil { - n += 9 + if this.CacheMisses != nil { + s = append(s, "CacheMisses: "+valueToGoStringMesos(this.CacheMisses, "uint64")+",\n") } - if m.Checkpoint != nil { - n += 2 + if this.Branches != nil { + s = append(s, "Branches: "+valueToGoStringMesos(this.Branches, "uint64")+",\n") } - if m.Role != nil { - l = len(*m.Role) - n += 1 + l + sovMesos(uint64(l)) + if this.BranchMisses != nil { + s = append(s, "BranchMisses: "+valueToGoStringMesos(this.BranchMisses, "uint64")+",\n") } - if m.Hostname != nil { - l = len(*m.Hostname) - n += 1 + l + sovMesos(uint64(l)) + if this.BusCycles != nil { + s = append(s, "BusCycles: "+valueToGoStringMesos(this.BusCycles, "uint64")+",\n") } - if m.Principal != nil { - l = len(*m.Principal) - n += 1 + l + sovMesos(uint64(l)) + if this.RefCycles != nil { + s = append(s, "RefCycles: "+valueToGoStringMesos(this.RefCycles, "uint64")+",\n") } - if m.WebuiUrl != nil { - l = len(*m.WebuiUrl) - n += 1 + l + sovMesos(uint64(l)) + if this.CpuClock != nil { + s = append(s, "CpuClock: "+valueToGoStringMesos(this.CpuClock, "float64")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.TaskClock != nil { + s = append(s, "TaskClock: "+valueToGoStringMesos(this.TaskClock, "float64")+",\n") } - return n -} - -func (m *HealthCheck) Size() (n int) { - var l int - _ = l - if m.Http != nil { - l = m.Http.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.PageFaults != nil { + s = append(s, "PageFaults: "+valueToGoStringMesos(this.PageFaults, "uint64")+",\n") } - if m.DelaySeconds != nil { - n += 9 + if this.MinorFaults != nil { + s = append(s, "MinorFaults: "+valueToGoStringMesos(this.MinorFaults, "uint64")+",\n") } - if m.IntervalSeconds != nil { - n += 9 + if this.MajorFaults != nil { + s = append(s, "MajorFaults: "+valueToGoStringMesos(this.MajorFaults, "uint64")+",\n") } - if m.TimeoutSeconds != nil { - n += 9 + if this.ContextSwitches != nil { + s = append(s, "ContextSwitches: "+valueToGoStringMesos(this.ContextSwitches, "uint64")+",\n") } - if m.ConsecutiveFailures != nil { - n += 1 + sovMesos(uint64(*m.ConsecutiveFailures)) + if this.CpuMigrations != nil { + s = append(s, "CpuMigrations: "+valueToGoStringMesos(this.CpuMigrations, "uint64")+",\n") } - if m.GracePeriodSeconds != nil { - n += 9 + if this.AlignmentFaults != nil { + s = append(s, "AlignmentFaults: "+valueToGoStringMesos(this.AlignmentFaults, "uint64")+",\n") } - if m.Command != nil { - l = m.Command.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.EmulationFaults != nil { + s = append(s, "EmulationFaults: "+valueToGoStringMesos(this.EmulationFaults, "uint64")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.L1DcacheLoads != nil { + s = append(s, "L1DcacheLoads: "+valueToGoStringMesos(this.L1DcacheLoads, "uint64")+",\n") } - return n -} - -func (m *HealthCheck_HTTP) Size() (n int) { - var l int - _ = l - if m.Port != nil { - n += 1 + sovMesos(uint64(*m.Port)) + if this.L1DcacheLoadMisses != nil { + s = append(s, "L1DcacheLoadMisses: "+valueToGoStringMesos(this.L1DcacheLoadMisses, "uint64")+",\n") } - if m.Path != nil { - l = len(*m.Path) - n += 1 + l + sovMesos(uint64(l)) + if this.L1DcacheStores != nil { + s = append(s, "L1DcacheStores: "+valueToGoStringMesos(this.L1DcacheStores, "uint64")+",\n") } - if len(m.Statuses) > 0 { - for _, e := range m.Statuses { - n += 1 + sovMesos(uint64(e)) - } + if this.L1DcacheStoreMisses != nil { + s = append(s, "L1DcacheStoreMisses: "+valueToGoStringMesos(this.L1DcacheStoreMisses, "uint64")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.L1DcachePrefetches != nil { + s = append(s, "L1DcachePrefetches: "+valueToGoStringMesos(this.L1DcachePrefetches, "uint64")+",\n") } - return n -} - -func (m *CommandInfo) Size() (n int) { - var l int - _ = l - if m.Container != nil { - l = m.Container.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.L1DcachePrefetchMisses != nil { + s = append(s, "L1DcachePrefetchMisses: "+valueToGoStringMesos(this.L1DcachePrefetchMisses, "uint64")+",\n") } - if len(m.Uris) > 0 { - for _, e := range m.Uris { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } + if this.L1IcacheLoads != nil { + s = append(s, "L1IcacheLoads: "+valueToGoStringMesos(this.L1IcacheLoads, "uint64")+",\n") } - if m.Environment != nil { - l = m.Environment.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.L1IcacheLoadMisses != nil { + s = append(s, "L1IcacheLoadMisses: "+valueToGoStringMesos(this.L1IcacheLoadMisses, "uint64")+",\n") } - if m.Shell != nil { - n += 2 + if this.L1IcachePrefetches != nil { + s = append(s, "L1IcachePrefetches: "+valueToGoStringMesos(this.L1IcachePrefetches, "uint64")+",\n") } - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) + if this.L1IcachePrefetchMisses != nil { + s = append(s, "L1IcachePrefetchMisses: "+valueToGoStringMesos(this.L1IcachePrefetchMisses, "uint64")+",\n") } - if len(m.Arguments) > 0 { - for _, s := range m.Arguments { - l = len(s) - n += 1 + l + sovMesos(uint64(l)) - } + if this.LlcLoads != nil { + s = append(s, "LlcLoads: "+valueToGoStringMesos(this.LlcLoads, "uint64")+",\n") } - if m.User != nil { - l = len(*m.User) - n += 1 + l + sovMesos(uint64(l)) + if this.LlcLoadMisses != nil { + s = append(s, "LlcLoadMisses: "+valueToGoStringMesos(this.LlcLoadMisses, "uint64")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.LlcStores != nil { + s = append(s, "LlcStores: "+valueToGoStringMesos(this.LlcStores, "uint64")+",\n") } - return n -} - -func (m *CommandInfo_URI) Size() (n int) { - var l int - _ = l - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) + if this.LlcStoreMisses != nil { + s = append(s, "LlcStoreMisses: "+valueToGoStringMesos(this.LlcStoreMisses, "uint64")+",\n") } - if m.Executable != nil { - n += 2 + if this.LlcPrefetches != nil { + s = append(s, "LlcPrefetches: "+valueToGoStringMesos(this.LlcPrefetches, "uint64")+",\n") } - if m.Extract != nil { - n += 2 + if this.LlcPrefetchMisses != nil { + s = append(s, "LlcPrefetchMisses: "+valueToGoStringMesos(this.LlcPrefetchMisses, "uint64")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.DtlbLoads != nil { + s = append(s, "DtlbLoads: "+valueToGoStringMesos(this.DtlbLoads, "uint64")+",\n") } - return n -} - -func (m *CommandInfo_ContainerInfo) Size() (n int) { - var l int - _ = l - if m.Image != nil { - l = len(*m.Image) - n += 1 + l + sovMesos(uint64(l)) + if this.DtlbLoadMisses != nil { + s = append(s, "DtlbLoadMisses: "+valueToGoStringMesos(this.DtlbLoadMisses, "uint64")+",\n") } - if len(m.Options) > 0 { - for _, s := range m.Options { - l = len(s) - n += 1 + l + sovMesos(uint64(l)) - } + if this.DtlbStores != nil { + s = append(s, "DtlbStores: "+valueToGoStringMesos(this.DtlbStores, "uint64")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.DtlbStoreMisses != nil { + s = append(s, "DtlbStoreMisses: "+valueToGoStringMesos(this.DtlbStoreMisses, "uint64")+",\n") } - return n -} - -func (m *ExecutorInfo) Size() (n int) { - var l int - _ = l - if m.ExecutorId != nil { - l = m.ExecutorId.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.DtlbPrefetches != nil { + s = append(s, "DtlbPrefetches: "+valueToGoStringMesos(this.DtlbPrefetches, "uint64")+",\n") } - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.DtlbPrefetchMisses != nil { + s = append(s, "DtlbPrefetchMisses: "+valueToGoStringMesos(this.DtlbPrefetchMisses, "uint64")+",\n") } - if m.Command != nil { - l = m.Command.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.ItlbLoads != nil { + s = append(s, "ItlbLoads: "+valueToGoStringMesos(this.ItlbLoads, "uint64")+",\n") } - if m.Container != nil { - l = m.Container.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.ItlbLoadMisses != nil { + s = append(s, "ItlbLoadMisses: "+valueToGoStringMesos(this.ItlbLoadMisses, "uint64")+",\n") } - if len(m.Resources) > 0 { - for _, e := range m.Resources { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } + if this.BranchLoads != nil { + s = append(s, "BranchLoads: "+valueToGoStringMesos(this.BranchLoads, "uint64")+",\n") } - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovMesos(uint64(l)) + if this.BranchLoadMisses != nil { + s = append(s, "BranchLoadMisses: "+valueToGoStringMesos(this.BranchLoadMisses, "uint64")+",\n") } - if m.Source != nil { - l = len(*m.Source) - n += 1 + l + sovMesos(uint64(l)) + if this.NodeLoads != nil { + s = append(s, "NodeLoads: "+valueToGoStringMesos(this.NodeLoads, "uint64")+",\n") } - if m.Data != nil { - l = len(m.Data) - n += 1 + l + sovMesos(uint64(l)) + if this.NodeLoadMisses != nil { + s = append(s, "NodeLoadMisses: "+valueToGoStringMesos(this.NodeLoadMisses, "uint64")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.NodeStores != nil { + s = append(s, "NodeStores: "+valueToGoStringMesos(this.NodeStores, "uint64")+",\n") } - return n -} - -func (m *MasterInfo) Size() (n int) { - var l int - _ = l - if m.Id != nil { - l = len(*m.Id) - n += 1 + l + sovMesos(uint64(l)) + if this.NodeStoreMisses != nil { + s = append(s, "NodeStoreMisses: "+valueToGoStringMesos(this.NodeStoreMisses, "uint64")+",\n") } - if m.Ip != nil { - n += 1 + sovMesos(uint64(*m.Ip)) + if this.NodePrefetches != nil { + s = append(s, "NodePrefetches: "+valueToGoStringMesos(this.NodePrefetches, "uint64")+",\n") } - if m.Port != nil { - n += 1 + sovMesos(uint64(*m.Port)) + if this.NodePrefetchMisses != nil { + s = append(s, "NodePrefetchMisses: "+valueToGoStringMesos(this.NodePrefetchMisses, "uint64")+",\n") } - if m.Pid != nil { - l = len(*m.Pid) - n += 1 + l + sovMesos(uint64(l)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.Hostname != nil { - l = len(*m.Hostname) - n += 1 + l + sovMesos(uint64(l)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Request) GoString() string { + if this == nil { + return "nil" } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + s := make([]string, 0, 6) + s = append(s, "&mesosproto.Request{") + if this.SlaveId != nil { + s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") } - return n + if this.Resources != nil { + s = append(s, "Resources: "+fmt.Sprintf("%#v", this.Resources)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func (m *SlaveInfo) Size() (n int) { - var l int - _ = l - if m.Hostname != nil { - l = len(*m.Hostname) - n += 1 + l + sovMesos(uint64(l)) +func (this *Offer) GoString() string { + if this == nil { + return "nil" } - if m.Port != nil { - n += 1 + sovMesos(uint64(*m.Port)) + s := make([]string, 0, 11) + s = append(s, "&mesosproto.Offer{") + if this.Id != nil { + s = append(s, "Id: "+fmt.Sprintf("%#v", this.Id)+",\n") } - if len(m.Resources) > 0 { - for _, e := range m.Resources { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } + if this.FrameworkId != nil { + s = append(s, "FrameworkId: "+fmt.Sprintf("%#v", this.FrameworkId)+",\n") } - if len(m.Attributes) > 0 { - for _, e := range m.Attributes { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } + if this.SlaveId != nil { + s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") } - if m.Id != nil { - l = m.Id.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.Hostname != nil { + s = append(s, "Hostname: "+valueToGoStringMesos(this.Hostname, "string")+",\n") } - if m.Checkpoint != nil { - n += 2 + if this.Resources != nil { + s = append(s, "Resources: "+fmt.Sprintf("%#v", this.Resources)+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.Attributes != nil { + s = append(s, "Attributes: "+fmt.Sprintf("%#v", this.Attributes)+",\n") } - return n + if this.ExecutorIds != nil { + s = append(s, "ExecutorIds: "+fmt.Sprintf("%#v", this.ExecutorIds)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func (m *Value) Size() (n int) { - var l int - _ = l - if m.Type != nil { - n += 1 + sovMesos(uint64(*m.Type)) +func (this *Offer_Operation) GoString() string { + if this == nil { + return "nil" } - if m.Scalar != nil { - l = m.Scalar.Size() - n += 1 + l + sovMesos(uint64(l)) + s := make([]string, 0, 10) + s = append(s, "&mesosproto.Offer_Operation{") + if this.Type != nil { + s = append(s, "Type: "+valueToGoStringMesos(this.Type, "mesosproto.Offer_Operation_Type")+",\n") + } + if this.Launch != nil { + s = append(s, "Launch: "+fmt.Sprintf("%#v", this.Launch)+",\n") } - if m.Ranges != nil { - l = m.Ranges.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.Reserve != nil { + s = append(s, "Reserve: "+fmt.Sprintf("%#v", this.Reserve)+",\n") } - if m.Set != nil { - l = m.Set.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.Unreserve != nil { + s = append(s, "Unreserve: "+fmt.Sprintf("%#v", this.Unreserve)+",\n") } - if m.Text != nil { - l = m.Text.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.Create != nil { + s = append(s, "Create: "+fmt.Sprintf("%#v", this.Create)+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.Destroy != nil { + s = append(s, "Destroy: "+fmt.Sprintf("%#v", this.Destroy)+",\n") } - return n + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func (m *Value_Scalar) Size() (n int) { - var l int - _ = l - if m.Value != nil { - n += 9 +func (this *Offer_Operation_Launch) GoString() string { + if this == nil { + return "nil" } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Offer_Operation_Launch{") + if this.TaskInfos != nil { + s = append(s, "TaskInfos: "+fmt.Sprintf("%#v", this.TaskInfos)+",\n") } - return n + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func (m *Value_Range) Size() (n int) { - var l int - _ = l - if m.Begin != nil { - n += 1 + sovMesos(uint64(*m.Begin)) +func (this *Offer_Operation_Reserve) GoString() string { + if this == nil { + return "nil" } - if m.End != nil { - n += 1 + sovMesos(uint64(*m.End)) + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Offer_Operation_Reserve{") + if this.Resources != nil { + s = append(s, "Resources: "+fmt.Sprintf("%#v", this.Resources)+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - return n + s = append(s, "}") + return strings.Join(s, "") } - -func (m *Value_Ranges) Size() (n int) { - var l int - _ = l - if len(m.Range) > 0 { - for _, e := range m.Range { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } +func (this *Offer_Operation_Unreserve) GoString() string { + if this == nil { + return "nil" } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Offer_Operation_Unreserve{") + if this.Resources != nil { + s = append(s, "Resources: "+fmt.Sprintf("%#v", this.Resources)+",\n") } - return n + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func (m *Value_Set) Size() (n int) { - var l int - _ = l - if len(m.Item) > 0 { - for _, s := range m.Item { - l = len(s) - n += 1 + l + sovMesos(uint64(l)) - } +func (this *Offer_Operation_Create) GoString() string { + if this == nil { + return "nil" } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Offer_Operation_Create{") + if this.Volumes != nil { + s = append(s, "Volumes: "+fmt.Sprintf("%#v", this.Volumes)+",\n") } - return n + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func (m *Value_Text) Size() (n int) { - var l int - _ = l - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) +func (this *Offer_Operation_Destroy) GoString() string { + if this == nil { + return "nil" } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Offer_Operation_Destroy{") + if this.Volumes != nil { + s = append(s, "Volumes: "+fmt.Sprintf("%#v", this.Volumes)+",\n") } - return n -} - -func (m *Attribute) Size() (n int) { - var l int - _ = l - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovMesos(uint64(l)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.Type != nil { - n += 1 + sovMesos(uint64(*m.Type)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *TaskInfo) GoString() string { + if this == nil { + return "nil" } - if m.Scalar != nil { - l = m.Scalar.Size() - n += 1 + l + sovMesos(uint64(l)) + s := make([]string, 0, 15) + s = append(s, "&mesosproto.TaskInfo{") + if this.Name != nil { + s = append(s, "Name: "+valueToGoStringMesos(this.Name, "string")+",\n") } - if m.Ranges != nil { - l = m.Ranges.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.TaskId != nil { + s = append(s, "TaskId: "+fmt.Sprintf("%#v", this.TaskId)+",\n") } - if m.Set != nil { - l = m.Set.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.SlaveId != nil { + s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") } - if m.Text != nil { - l = m.Text.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.Resources != nil { + s = append(s, "Resources: "+fmt.Sprintf("%#v", this.Resources)+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.Executor != nil { + s = append(s, "Executor: "+fmt.Sprintf("%#v", this.Executor)+",\n") } - return n -} - -func (m *Resource) Size() (n int) { - var l int - _ = l - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovMesos(uint64(l)) + if this.Command != nil { + s = append(s, "Command: "+fmt.Sprintf("%#v", this.Command)+",\n") } - if m.Type != nil { - n += 1 + sovMesos(uint64(*m.Type)) + if this.Container != nil { + s = append(s, "Container: "+fmt.Sprintf("%#v", this.Container)+",\n") } - if m.Scalar != nil { - l = m.Scalar.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.Data != nil { + s = append(s, "Data: "+valueToGoStringMesos(this.Data, "byte")+",\n") } - if m.Ranges != nil { - l = m.Ranges.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.HealthCheck != nil { + s = append(s, "HealthCheck: "+fmt.Sprintf("%#v", this.HealthCheck)+",\n") } - if m.Set != nil { - l = m.Set.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.Labels != nil { + s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") } - if m.Role != nil { - l = len(*m.Role) - n += 1 + l + sovMesos(uint64(l)) + if this.Discovery != nil { + s = append(s, "Discovery: "+fmt.Sprintf("%#v", this.Discovery)+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - return n + s = append(s, "}") + return strings.Join(s, "") } - -func (m *ResourceStatistics) Size() (n int) { - var l int - _ = l - if m.Timestamp != nil { - n += 9 +func (this *TaskStatus) GoString() string { + if this == nil { + return "nil" } - if m.CpusUserTimeSecs != nil { - n += 9 + s := make([]string, 0, 15) + s = append(s, "&mesosproto.TaskStatus{") + if this.TaskId != nil { + s = append(s, "TaskId: "+fmt.Sprintf("%#v", this.TaskId)+",\n") } - if m.CpusSystemTimeSecs != nil { - n += 9 + if this.State != nil { + s = append(s, "State: "+valueToGoStringMesos(this.State, "mesosproto.TaskState")+",\n") } - if m.CpusLimit != nil { - n += 9 + if this.Message != nil { + s = append(s, "Message: "+valueToGoStringMesos(this.Message, "string")+",\n") } - if m.CpusNrPeriods != nil { - n += 1 + sovMesos(uint64(*m.CpusNrPeriods)) + if this.Source != nil { + s = append(s, "Source: "+valueToGoStringMesos(this.Source, "mesosproto.TaskStatus_Source")+",\n") } - if m.CpusNrThrottled != nil { - n += 1 + sovMesos(uint64(*m.CpusNrThrottled)) + if this.Reason != nil { + s = append(s, "Reason: "+valueToGoStringMesos(this.Reason, "mesosproto.TaskStatus_Reason")+",\n") } - if m.CpusThrottledTimeSecs != nil { - n += 9 + if this.Data != nil { + s = append(s, "Data: "+valueToGoStringMesos(this.Data, "byte")+",\n") } - if m.MemRssBytes != nil { - n += 1 + sovMesos(uint64(*m.MemRssBytes)) + if this.SlaveId != nil { + s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") } - if m.MemLimitBytes != nil { - n += 1 + sovMesos(uint64(*m.MemLimitBytes)) + if this.ExecutorId != nil { + s = append(s, "ExecutorId: "+fmt.Sprintf("%#v", this.ExecutorId)+",\n") } - if m.MemFileBytes != nil { - n += 1 + sovMesos(uint64(*m.MemFileBytes)) + if this.Timestamp != nil { + s = append(s, "Timestamp: "+valueToGoStringMesos(this.Timestamp, "float64")+",\n") } - if m.MemAnonBytes != nil { - n += 1 + sovMesos(uint64(*m.MemAnonBytes)) + if this.Uuid != nil { + s = append(s, "Uuid: "+valueToGoStringMesos(this.Uuid, "byte")+",\n") } - if m.MemMappedFileBytes != nil { - n += 1 + sovMesos(uint64(*m.MemMappedFileBytes)) + if this.Healthy != nil { + s = append(s, "Healthy: "+valueToGoStringMesos(this.Healthy, "bool")+",\n") } - if m.Perf != nil { - l = m.Perf.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.NetRxPackets != nil { - n += 1 + sovMesos(uint64(*m.NetRxPackets)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Filters) GoString() string { + if this == nil { + return "nil" } - if m.NetRxBytes != nil { - n += 1 + sovMesos(uint64(*m.NetRxBytes)) + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Filters{") + if this.RefuseSeconds != nil { + s = append(s, "RefuseSeconds: "+valueToGoStringMesos(this.RefuseSeconds, "float64")+",\n") } - if m.NetRxErrors != nil { - n += 2 + sovMesos(uint64(*m.NetRxErrors)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.NetRxDropped != nil { - n += 2 + sovMesos(uint64(*m.NetRxDropped)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Environment) GoString() string { + if this == nil { + return "nil" } - if m.NetTxPackets != nil { - n += 2 + sovMesos(uint64(*m.NetTxPackets)) + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Environment{") + if this.Variables != nil { + s = append(s, "Variables: "+fmt.Sprintf("%#v", this.Variables)+",\n") } - if m.NetTxBytes != nil { - n += 2 + sovMesos(uint64(*m.NetTxBytes)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.NetTxErrors != nil { - n += 2 + sovMesos(uint64(*m.NetTxErrors)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Environment_Variable) GoString() string { + if this == nil { + return "nil" } - if m.NetTxDropped != nil { - n += 2 + sovMesos(uint64(*m.NetTxDropped)) + s := make([]string, 0, 6) + s = append(s, "&mesosproto.Environment_Variable{") + if this.Name != nil { + s = append(s, "Name: "+valueToGoStringMesos(this.Name, "string")+",\n") } - if m.NetTcpRttMicrosecsP50 != nil { - n += 10 + if this.Value != nil { + s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") } - if m.NetTcpRttMicrosecsP90 != nil { - n += 10 + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.NetTcpRttMicrosecsP95 != nil { - n += 10 + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Parameter) GoString() string { + if this == nil { + return "nil" } - if m.NetTcpRttMicrosecsP99 != nil { - n += 10 + s := make([]string, 0, 6) + s = append(s, "&mesosproto.Parameter{") + if this.Key != nil { + s = append(s, "Key: "+valueToGoStringMesos(this.Key, "string")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.Value != nil { + s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") } - return n + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func (m *ResourceUsage) Size() (n int) { - var l int - _ = l - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovMesos(uint64(l)) +func (this *Parameters) GoString() string { + if this == nil { + return "nil" } - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovMesos(uint64(l)) + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Parameters{") + if this.Parameter != nil { + s = append(s, "Parameter: "+fmt.Sprintf("%#v", this.Parameter)+",\n") } - if m.ExecutorId != nil { - l = m.ExecutorId.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.ExecutorName != nil { - l = len(*m.ExecutorName) - n += 1 + l + sovMesos(uint64(l)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Credential) GoString() string { + if this == nil { + return "nil" } - if m.TaskId != nil { - l = m.TaskId.Size() - n += 1 + l + sovMesos(uint64(l)) + s := make([]string, 0, 6) + s = append(s, "&mesosproto.Credential{") + if this.Principal != nil { + s = append(s, "Principal: "+valueToGoStringMesos(this.Principal, "string")+",\n") } - if m.Statistics != nil { - l = m.Statistics.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.Secret != nil { + s = append(s, "Secret: "+valueToGoStringMesos(this.Secret, "byte")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - return n + s = append(s, "}") + return strings.Join(s, "") } - -func (m *PerfStatistics) Size() (n int) { - var l int - _ = l - if m.Timestamp != nil { - n += 9 - } - if m.Duration != nil { - n += 9 +func (this *Credentials) GoString() string { + if this == nil { + return "nil" } - if m.Cycles != nil { - n += 1 + sovMesos(uint64(*m.Cycles)) + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Credentials{") + if this.Credentials != nil { + s = append(s, "Credentials: "+fmt.Sprintf("%#v", this.Credentials)+",\n") } - if m.StalledCyclesFrontend != nil { - n += 1 + sovMesos(uint64(*m.StalledCyclesFrontend)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.StalledCyclesBackend != nil { - n += 1 + sovMesos(uint64(*m.StalledCyclesBackend)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *ACL) GoString() string { + if this == nil { + return "nil" } - if m.Instructions != nil { - n += 1 + sovMesos(uint64(*m.Instructions)) + s := make([]string, 0, 4) + s = append(s, "&mesosproto.ACL{") + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.CacheReferences != nil { - n += 1 + sovMesos(uint64(*m.CacheReferences)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *ACL_Entity) GoString() string { + if this == nil { + return "nil" } - if m.CacheMisses != nil { - n += 1 + sovMesos(uint64(*m.CacheMisses)) + s := make([]string, 0, 6) + s = append(s, "&mesosproto.ACL_Entity{") + if this.Type != nil { + s = append(s, "Type: "+valueToGoStringMesos(this.Type, "mesosproto.ACL_Entity_Type")+",\n") } - if m.Branches != nil { - n += 1 + sovMesos(uint64(*m.Branches)) + if this.Values != nil { + s = append(s, "Values: "+fmt.Sprintf("%#v", this.Values)+",\n") } - if m.BranchMisses != nil { - n += 1 + sovMesos(uint64(*m.BranchMisses)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.BusCycles != nil { - n += 1 + sovMesos(uint64(*m.BusCycles)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *ACL_RegisterFramework) GoString() string { + if this == nil { + return "nil" } - if m.RefCycles != nil { - n += 1 + sovMesos(uint64(*m.RefCycles)) + s := make([]string, 0, 6) + s = append(s, "&mesosproto.ACL_RegisterFramework{") + if this.Principals != nil { + s = append(s, "Principals: "+fmt.Sprintf("%#v", this.Principals)+",\n") } - if m.CpuClock != nil { - n += 9 + if this.Roles != nil { + s = append(s, "Roles: "+fmt.Sprintf("%#v", this.Roles)+",\n") } - if m.TaskClock != nil { - n += 9 + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.PageFaults != nil { - n += 1 + sovMesos(uint64(*m.PageFaults)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *ACL_RunTask) GoString() string { + if this == nil { + return "nil" } - if m.MinorFaults != nil { - n += 2 + sovMesos(uint64(*m.MinorFaults)) + s := make([]string, 0, 6) + s = append(s, "&mesosproto.ACL_RunTask{") + if this.Principals != nil { + s = append(s, "Principals: "+fmt.Sprintf("%#v", this.Principals)+",\n") } - if m.MajorFaults != nil { - n += 2 + sovMesos(uint64(*m.MajorFaults)) + if this.Users != nil { + s = append(s, "Users: "+fmt.Sprintf("%#v", this.Users)+",\n") } - if m.ContextSwitches != nil { - n += 2 + sovMesos(uint64(*m.ContextSwitches)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.CpuMigrations != nil { - n += 2 + sovMesos(uint64(*m.CpuMigrations)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *ACL_ShutdownFramework) GoString() string { + if this == nil { + return "nil" } - if m.AlignmentFaults != nil { - n += 2 + sovMesos(uint64(*m.AlignmentFaults)) + s := make([]string, 0, 6) + s = append(s, "&mesosproto.ACL_ShutdownFramework{") + if this.Principals != nil { + s = append(s, "Principals: "+fmt.Sprintf("%#v", this.Principals)+",\n") } - if m.EmulationFaults != nil { - n += 2 + sovMesos(uint64(*m.EmulationFaults)) + if this.FrameworkPrincipals != nil { + s = append(s, "FrameworkPrincipals: "+fmt.Sprintf("%#v", this.FrameworkPrincipals)+",\n") } - if m.L1DcacheLoads != nil { - n += 2 + sovMesos(uint64(*m.L1DcacheLoads)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.L1DcacheLoadMisses != nil { - n += 2 + sovMesos(uint64(*m.L1DcacheLoadMisses)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *ACLs) GoString() string { + if this == nil { + return "nil" } - if m.L1DcacheStores != nil { - n += 2 + sovMesos(uint64(*m.L1DcacheStores)) + s := make([]string, 0, 8) + s = append(s, "&mesosproto.ACLs{") + if this.Permissive != nil { + s = append(s, "Permissive: "+valueToGoStringMesos(this.Permissive, "bool")+",\n") } - if m.L1DcacheStoreMisses != nil { - n += 2 + sovMesos(uint64(*m.L1DcacheStoreMisses)) + if this.RegisterFrameworks != nil { + s = append(s, "RegisterFrameworks: "+fmt.Sprintf("%#v", this.RegisterFrameworks)+",\n") } - if m.L1DcachePrefetches != nil { - n += 2 + sovMesos(uint64(*m.L1DcachePrefetches)) + if this.RunTasks != nil { + s = append(s, "RunTasks: "+fmt.Sprintf("%#v", this.RunTasks)+",\n") } - if m.L1DcachePrefetchMisses != nil { - n += 2 + sovMesos(uint64(*m.L1DcachePrefetchMisses)) + if this.ShutdownFrameworks != nil { + s = append(s, "ShutdownFrameworks: "+fmt.Sprintf("%#v", this.ShutdownFrameworks)+",\n") } - if m.L1IcacheLoads != nil { - n += 2 + sovMesos(uint64(*m.L1IcacheLoads)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.L1IcacheLoadMisses != nil { - n += 2 + sovMesos(uint64(*m.L1IcacheLoadMisses)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *RateLimit) GoString() string { + if this == nil { + return "nil" } - if m.L1IcachePrefetches != nil { - n += 2 + sovMesos(uint64(*m.L1IcachePrefetches)) + s := make([]string, 0, 7) + s = append(s, "&mesosproto.RateLimit{") + if this.Qps != nil { + s = append(s, "Qps: "+valueToGoStringMesos(this.Qps, "float64")+",\n") } - if m.L1IcachePrefetchMisses != nil { - n += 2 + sovMesos(uint64(*m.L1IcachePrefetchMisses)) + if this.Principal != nil { + s = append(s, "Principal: "+valueToGoStringMesos(this.Principal, "string")+",\n") } - if m.LlcLoads != nil { - n += 2 + sovMesos(uint64(*m.LlcLoads)) + if this.Capacity != nil { + s = append(s, "Capacity: "+valueToGoStringMesos(this.Capacity, "uint64")+",\n") } - if m.LlcLoadMisses != nil { - n += 2 + sovMesos(uint64(*m.LlcLoadMisses)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.LlcStores != nil { - n += 2 + sovMesos(uint64(*m.LlcStores)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *RateLimits) GoString() string { + if this == nil { + return "nil" } - if m.LlcStoreMisses != nil { - n += 2 + sovMesos(uint64(*m.LlcStoreMisses)) + s := make([]string, 0, 7) + s = append(s, "&mesosproto.RateLimits{") + if this.Limits != nil { + s = append(s, "Limits: "+fmt.Sprintf("%#v", this.Limits)+",\n") } - if m.LlcPrefetches != nil { - n += 2 + sovMesos(uint64(*m.LlcPrefetches)) + if this.AggregateDefaultQps != nil { + s = append(s, "AggregateDefaultQps: "+valueToGoStringMesos(this.AggregateDefaultQps, "float64")+",\n") } - if m.LlcPrefetchMisses != nil { - n += 2 + sovMesos(uint64(*m.LlcPrefetchMisses)) + if this.AggregateDefaultCapacity != nil { + s = append(s, "AggregateDefaultCapacity: "+valueToGoStringMesos(this.AggregateDefaultCapacity, "uint64")+",\n") } - if m.DtlbLoads != nil { - n += 2 + sovMesos(uint64(*m.DtlbLoads)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.DtlbLoadMisses != nil { - n += 2 + sovMesos(uint64(*m.DtlbLoadMisses)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Volume) GoString() string { + if this == nil { + return "nil" } - if m.DtlbStores != nil { - n += 2 + sovMesos(uint64(*m.DtlbStores)) + s := make([]string, 0, 7) + s = append(s, "&mesosproto.Volume{") + if this.ContainerPath != nil { + s = append(s, "ContainerPath: "+valueToGoStringMesos(this.ContainerPath, "string")+",\n") } - if m.DtlbStoreMisses != nil { - n += 2 + sovMesos(uint64(*m.DtlbStoreMisses)) + if this.HostPath != nil { + s = append(s, "HostPath: "+valueToGoStringMesos(this.HostPath, "string")+",\n") } - if m.DtlbPrefetches != nil { - n += 2 + sovMesos(uint64(*m.DtlbPrefetches)) + if this.Mode != nil { + s = append(s, "Mode: "+valueToGoStringMesos(this.Mode, "mesosproto.Volume_Mode")+",\n") } - if m.DtlbPrefetchMisses != nil { - n += 2 + sovMesos(uint64(*m.DtlbPrefetchMisses)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.ItlbLoads != nil { - n += 2 + sovMesos(uint64(*m.ItlbLoads)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *ContainerInfo) GoString() string { + if this == nil { + return "nil" } - if m.ItlbLoadMisses != nil { - n += 2 + sovMesos(uint64(*m.ItlbLoadMisses)) + s := make([]string, 0, 8) + s = append(s, "&mesosproto.ContainerInfo{") + if this.Type != nil { + s = append(s, "Type: "+valueToGoStringMesos(this.Type, "mesosproto.ContainerInfo_Type")+",\n") } - if m.BranchLoads != nil { - n += 2 + sovMesos(uint64(*m.BranchLoads)) + if this.Volumes != nil { + s = append(s, "Volumes: "+fmt.Sprintf("%#v", this.Volumes)+",\n") } - if m.BranchLoadMisses != nil { - n += 2 + sovMesos(uint64(*m.BranchLoadMisses)) + if this.Hostname != nil { + s = append(s, "Hostname: "+valueToGoStringMesos(this.Hostname, "string")+",\n") } - if m.NodeLoads != nil { - n += 2 + sovMesos(uint64(*m.NodeLoads)) + if this.Docker != nil { + s = append(s, "Docker: "+fmt.Sprintf("%#v", this.Docker)+",\n") } - if m.NodeLoadMisses != nil { - n += 2 + sovMesos(uint64(*m.NodeLoadMisses)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.NodeStores != nil { - n += 2 + sovMesos(uint64(*m.NodeStores)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *ContainerInfo_DockerInfo) GoString() string { + if this == nil { + return "nil" } - if m.NodeStoreMisses != nil { - n += 2 + sovMesos(uint64(*m.NodeStoreMisses)) + s := make([]string, 0, 10) + s = append(s, "&mesosproto.ContainerInfo_DockerInfo{") + if this.Image != nil { + s = append(s, "Image: "+valueToGoStringMesos(this.Image, "string")+",\n") } - if m.NodePrefetches != nil { - n += 2 + sovMesos(uint64(*m.NodePrefetches)) + if this.Network != nil { + s = append(s, "Network: "+valueToGoStringMesos(this.Network, "mesosproto.ContainerInfo_DockerInfo_Network")+",\n") } - if m.NodePrefetchMisses != nil { - n += 2 + sovMesos(uint64(*m.NodePrefetchMisses)) + if this.PortMappings != nil { + s = append(s, "PortMappings: "+fmt.Sprintf("%#v", this.PortMappings)+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.Privileged != nil { + s = append(s, "Privileged: "+valueToGoStringMesos(this.Privileged, "bool")+",\n") } - return n -} - -func (m *Request) Size() (n int) { - var l int - _ = l - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.Parameters != nil { + s = append(s, "Parameters: "+fmt.Sprintf("%#v", this.Parameters)+",\n") } - if len(m.Resources) > 0 { - for _, e := range m.Resources { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } + if this.ForcePullImage != nil { + s = append(s, "ForcePullImage: "+valueToGoStringMesos(this.ForcePullImage, "bool")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - return n + s = append(s, "}") + return strings.Join(s, "") } - -func (m *Offer) Size() (n int) { - var l int - _ = l - if m.Id != nil { - l = m.Id.Size() - n += 1 + l + sovMesos(uint64(l)) +func (this *ContainerInfo_DockerInfo_PortMapping) GoString() string { + if this == nil { + return "nil" } - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovMesos(uint64(l)) + s := make([]string, 0, 7) + s = append(s, "&mesosproto.ContainerInfo_DockerInfo_PortMapping{") + if this.HostPort != nil { + s = append(s, "HostPort: "+valueToGoStringMesos(this.HostPort, "uint32")+",\n") } - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.ContainerPort != nil { + s = append(s, "ContainerPort: "+valueToGoStringMesos(this.ContainerPort, "uint32")+",\n") } - if m.Hostname != nil { - l = len(*m.Hostname) - n += 1 + l + sovMesos(uint64(l)) + if this.Protocol != nil { + s = append(s, "Protocol: "+valueToGoStringMesos(this.Protocol, "string")+",\n") } - if len(m.Resources) > 0 { - for _, e := range m.Resources { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if len(m.Attributes) > 0 { - for _, e := range m.Attributes { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Labels) GoString() string { + if this == nil { + return "nil" } - if len(m.ExecutorIds) > 0 { - for _, e := range m.ExecutorIds { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Labels{") + if this.Labels != nil { + s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - return n + s = append(s, "}") + return strings.Join(s, "") } - -func (m *TaskInfo) Size() (n int) { - var l int - _ = l - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovMesos(uint64(l)) - } - if m.TaskId != nil { - l = m.TaskId.Size() - n += 1 + l + sovMesos(uint64(l)) +func (this *Label) GoString() string { + if this == nil { + return "nil" } - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovMesos(uint64(l)) + s := make([]string, 0, 6) + s = append(s, "&mesosproto.Label{") + if this.Key != nil { + s = append(s, "Key: "+valueToGoStringMesos(this.Key, "string")+",\n") } - if len(m.Resources) > 0 { - for _, e := range m.Resources { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } + if this.Value != nil { + s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") } - if m.Executor != nil { - l = m.Executor.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.Command != nil { - l = m.Command.Size() - n += 1 + l + sovMesos(uint64(l)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Port) GoString() string { + if this == nil { + return "nil" } - if m.Container != nil { - l = m.Container.Size() - n += 1 + l + sovMesos(uint64(l)) + s := make([]string, 0, 7) + s = append(s, "&mesosproto.Port{") + if this.Number != nil { + s = append(s, "Number: "+valueToGoStringMesos(this.Number, "uint32")+",\n") } - if m.Data != nil { - l = len(m.Data) - n += 1 + l + sovMesos(uint64(l)) + if this.Name != nil { + s = append(s, "Name: "+valueToGoStringMesos(this.Name, "string")+",\n") } - if m.HealthCheck != nil { - l = m.HealthCheck.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.Protocol != nil { + s = append(s, "Protocol: "+valueToGoStringMesos(this.Protocol, "string")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - return n + s = append(s, "}") + return strings.Join(s, "") } - -func (m *TaskStatus) Size() (n int) { - var l int - _ = l - if m.TaskId != nil { - l = m.TaskId.Size() - n += 1 + l + sovMesos(uint64(l)) +func (this *Ports) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Ports{") + if this.Ports != nil { + s = append(s, "Ports: "+fmt.Sprintf("%#v", this.Ports)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.State != nil { - n += 1 + sovMesos(uint64(*m.State)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *DiscoveryInfo) GoString() string { + if this == nil { + return "nil" } - if m.Message != nil { - l = len(*m.Message) - n += 1 + l + sovMesos(uint64(l)) + s := make([]string, 0, 11) + s = append(s, "&mesosproto.DiscoveryInfo{") + if this.Visibility != nil { + s = append(s, "Visibility: "+valueToGoStringMesos(this.Visibility, "mesosproto.DiscoveryInfo_Visibility")+",\n") } - if m.Source != nil { - n += 1 + sovMesos(uint64(*m.Source)) + if this.Name != nil { + s = append(s, "Name: "+valueToGoStringMesos(this.Name, "string")+",\n") } - if m.Reason != nil { - n += 1 + sovMesos(uint64(*m.Reason)) + if this.Environment != nil { + s = append(s, "Environment: "+valueToGoStringMesos(this.Environment, "string")+",\n") } - if m.Data != nil { - l = len(m.Data) - n += 1 + l + sovMesos(uint64(l)) + if this.Location != nil { + s = append(s, "Location: "+valueToGoStringMesos(this.Location, "string")+",\n") } - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.Version != nil { + s = append(s, "Version: "+valueToGoStringMesos(this.Version, "string")+",\n") } - if m.ExecutorId != nil { - l = m.ExecutorId.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.Ports != nil { + s = append(s, "Ports: "+fmt.Sprintf("%#v", this.Ports)+",\n") } - if m.Timestamp != nil { - n += 9 + if this.Labels != nil { + s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") } - if m.Healthy != nil { - n += 2 + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringMesos(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" } - return n + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) } - -func (m *Filters) Size() (n int) { - var l int - _ = l - if m.RefuseSeconds != nil { - n += 9 +func extensionToGoStringMesos(e map[int32]github_com_gogo_protobuf_proto.Extension) string { + if e == nil { + return "nil" } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + s := "map[int32]proto.Extension{" + keys := make([]int, 0, len(e)) + for k := range e { + keys = append(keys, int(k)) } - return n -} - -func (m *Environment) Size() (n int) { - var l int - _ = l - if len(m.Variables) > 0 { - for _, e := range m.Variables { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } + sort.Ints(keys) + ss := []string{} + for _, k := range keys { + ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString()) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + s += strings.Join(ss, ",") + "}" + return s +} +func (m *FrameworkID) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return n + return data[:n], nil } -func (m *Environment_Variable) Size() (n int) { +func (m *FrameworkID) MarshalTo(data []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) + if m.Value == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Value))) + i += copy(data[i:], *m.Value) } if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + i += copy(data[i:], m.XXX_unrecognized) } - return n + return i, nil } -func (m *Parameter) Size() (n int) { - var l int - _ = l - if m.Key != nil { - l = len(*m.Key) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) +func (m *OfferID) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return n + return data[:n], nil } -func (m *Parameters) Size() (n int) { +func (m *OfferID) MarshalTo(data []byte) (int, error) { + var i int + _ = i var l int _ = l - if len(m.Parameter) > 0 { - for _, e := range m.Parameter { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } + if m.Value == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Value))) + i += copy(data[i:], *m.Value) } if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + i += copy(data[i:], m.XXX_unrecognized) } - return n + return i, nil } -func (m *Credential) Size() (n int) { - var l int - _ = l - if m.Principal != nil { - l = len(*m.Principal) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Secret != nil { - l = len(m.Secret) - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) +func (m *SlaveID) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return n + return data[:n], nil } -func (m *Credentials) Size() (n int) { +func (m *SlaveID) MarshalTo(data []byte) (int, error) { + var i int + _ = i var l int _ = l - if len(m.Credentials) > 0 { - for _, e := range m.Credentials { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } + if m.Value == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Value))) + i += copy(data[i:], *m.Value) } if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + i += copy(data[i:], m.XXX_unrecognized) } - return n + return i, nil } -func (m *ACL) Size() (n int) { - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) +func (m *TaskID) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return n + return data[:n], nil } -func (m *ACL_Entity) Size() (n int) { +func (m *TaskID) MarshalTo(data []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.Type != nil { - n += 1 + sovMesos(uint64(*m.Type)) - } - if len(m.Values) > 0 { - for _, s := range m.Values { - l = len(s) - n += 1 + l + sovMesos(uint64(l)) - } + if m.Value == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Value))) + i += copy(data[i:], *m.Value) } if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + i += copy(data[i:], m.XXX_unrecognized) } - return n + return i, nil } -func (m *ACL_RegisterFramework) Size() (n int) { - var l int - _ = l - if m.Principals != nil { - l = m.Principals.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Roles != nil { - l = m.Roles.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) +func (m *ExecutorID) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return n + return data[:n], nil } -func (m *ACL_RunTask) Size() (n int) { +func (m *ExecutorID) MarshalTo(data []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.Principals != nil { - l = m.Principals.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Users != nil { - l = m.Users.Size() - n += 1 + l + sovMesos(uint64(l)) + if m.Value == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Value))) + i += copy(data[i:], *m.Value) } if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + i += copy(data[i:], m.XXX_unrecognized) } - return n + return i, nil } -func (m *ACL_ShutdownFramework) Size() (n int) { - var l int - _ = l - if m.Principals != nil { - l = m.Principals.Size() - n += 1 + l + sovMesos(uint64(l)) +func (m *ContainerID) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - if m.FrameworkPrincipals != nil { - l = m.FrameworkPrincipals.Size() - n += 1 + l + sovMesos(uint64(l)) + return data[:n], nil +} + +func (m *ContainerID) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Value == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Value))) + i += copy(data[i:], *m.Value) } if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + i += copy(data[i:], m.XXX_unrecognized) } - return n + return i, nil } -func (m *ACLs) Size() (n int) { +func (m *FrameworkInfo) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err + } + return data[:n], nil +} + +func (m *FrameworkInfo) MarshalTo(data []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.Permissive != nil { - n += 2 + if m.User == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("user") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.User))) + i += copy(data[i:], *m.User) } - if len(m.RegisterFrameworks) > 0 { - for _, e := range m.RegisterFrameworks { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } + if m.Name == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") + } else { + data[i] = 0x12 + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Name))) + i += copy(data[i:], *m.Name) } - if len(m.RunTasks) > 0 { - for _, e := range m.RunTasks { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) + if m.Id != nil { + data[i] = 0x1a + i++ + i = encodeVarintMesos(data, i, uint64(m.Id.Size())) + n1, err := m.Id.MarshalTo(data[i:]) + if err != nil { + return 0, err } + i += n1 } - if len(m.ShutdownFrameworks) > 0 { - for _, e := range m.ShutdownFrameworks { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) + if m.FailoverTimeout != nil { + data[i] = 0x21 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.FailoverTimeout))) + } + if m.Checkpoint != nil { + data[i] = 0x28 + i++ + if *m.Checkpoint { + data[i] = 1 + } else { + data[i] = 0 } + i++ } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if m.Role != nil { + data[i] = 0x32 + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Role))) + i += copy(data[i:], *m.Role) } - return n -} - -func (m *RateLimit) Size() (n int) { - var l int - _ = l - if m.Qps != nil { - n += 9 + if m.Hostname != nil { + data[i] = 0x3a + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Hostname))) + i += copy(data[i:], *m.Hostname) } if m.Principal != nil { - l = len(*m.Principal) - n += 1 + l + sovMesos(uint64(l)) + data[i] = 0x42 + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Principal))) + i += copy(data[i:], *m.Principal) } - if m.Capacity != nil { - n += 1 + sovMesos(uint64(*m.Capacity)) + if m.WebuiUrl != nil { + data[i] = 0x4a + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.WebuiUrl))) + i += copy(data[i:], *m.WebuiUrl) + } + if len(m.Capabilities) > 0 { + for _, msg := range m.Capabilities { + data[i] = 0x52 + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n + } } if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + i += copy(data[i:], m.XXX_unrecognized) } - return n + return i, nil } -func (m *RateLimits) Size() (n int) { - var l int - _ = l - if len(m.Limits) > 0 { - for _, e := range m.Limits { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.AggregateDefaultQps != nil { - n += 9 - } - if m.AggregateDefaultCapacity != nil { - n += 1 + sovMesos(uint64(*m.AggregateDefaultCapacity)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) +func (m *FrameworkInfo_Capability) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return n + return data[:n], nil } -func (m *Volume) Size() (n int) { +func (m *FrameworkInfo_Capability) MarshalTo(data []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.ContainerPath != nil { - l = len(*m.ContainerPath) - n += 1 + l + sovMesos(uint64(l)) - } - if m.HostPath != nil { - l = len(*m.HostPath) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Mode != nil { - n += 1 + sovMesos(uint64(*m.Mode)) + if m.Type == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") + } else { + data[i] = 0x8 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Type)) } if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + i += copy(data[i:], m.XXX_unrecognized) } - return n + return i, nil } -func (m *ContainerInfo) Size() (n int) { +func (m *HealthCheck) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err + } + return data[:n], nil +} + +func (m *HealthCheck) MarshalTo(data []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.Type != nil { - n += 1 + sovMesos(uint64(*m.Type)) - } - if len(m.Volumes) > 0 { - for _, e := range m.Volumes { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) + if m.Http != nil { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(m.Http.Size())) + n2, err := m.Http.MarshalTo(data[i:]) + if err != nil { + return 0, err } + i += n2 } - if m.Hostname != nil { - l = len(*m.Hostname) - n += 1 + l + sovMesos(uint64(l)) + if m.DelaySeconds != nil { + data[i] = 0x11 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.DelaySeconds))) } - if m.Docker != nil { - l = m.Docker.Size() - n += 1 + l + sovMesos(uint64(l)) + if m.IntervalSeconds != nil { + data[i] = 0x19 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.IntervalSeconds))) + } + if m.TimeoutSeconds != nil { + data[i] = 0x21 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.TimeoutSeconds))) + } + if m.ConsecutiveFailures != nil { + data[i] = 0x28 + i++ + i = encodeVarintMesos(data, i, uint64(*m.ConsecutiveFailures)) + } + if m.GracePeriodSeconds != nil { + data[i] = 0x31 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.GracePeriodSeconds))) + } + if m.Command != nil { + data[i] = 0x3a + i++ + i = encodeVarintMesos(data, i, uint64(m.Command.Size())) + n3, err := m.Command.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n3 } if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + i += copy(data[i:], m.XXX_unrecognized) } - return n + return i, nil } -func (m *ContainerInfo_DockerInfo) Size() (n int) { +func (m *HealthCheck_HTTP) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err + } + return data[:n], nil +} + +func (m *HealthCheck_HTTP) MarshalTo(data []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.Image != nil { - l = len(*m.Image) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Network != nil { - n += 1 + sovMesos(uint64(*m.Network)) - } - if len(m.PortMappings) > 0 { - for _, e := range m.PortMappings { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.Privileged != nil { - n += 2 + if m.Port == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("port") + } else { + data[i] = 0x8 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Port)) } - if len(m.Parameters) > 0 { - for _, e := range m.Parameters { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) + if m.Path != nil { + data[i] = 0x12 + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Path))) + i += copy(data[i:], *m.Path) + } + if len(m.Statuses) > 0 { + for _, num := range m.Statuses { + data[i] = 0x20 + i++ + i = encodeVarintMesos(data, i, uint64(num)) } } if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + i += copy(data[i:], m.XXX_unrecognized) } - return n + return i, nil } -func (m *ContainerInfo_DockerInfo_PortMapping) Size() (n int) { +func (m *CommandInfo) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err + } + return data[:n], nil +} + +func (m *CommandInfo) MarshalTo(data []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.HostPort != nil { - n += 1 + sovMesos(uint64(*m.HostPort)) - } - if m.ContainerPort != nil { - n += 1 + sovMesos(uint64(*m.ContainerPort)) + if len(m.Uris) > 0 { + for _, msg := range m.Uris { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n + } } - if m.Protocol != nil { - l = len(*m.Protocol) - n += 1 + l + sovMesos(uint64(l)) + if m.Environment != nil { + data[i] = 0x12 + i++ + i = encodeVarintMesos(data, i, uint64(m.Environment.Size())) + n4, err := m.Environment.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n4 } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if m.Value != nil { + data[i] = 0x1a + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Value))) + i += copy(data[i:], *m.Value) } - return n -} - -func sovMesos(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break + if m.Container != nil { + data[i] = 0x22 + i++ + i = encodeVarintMesos(data, i, uint64(m.Container.Size())) + n5, err := m.Container.MarshalTo(data[i:]) + if err != nil { + return 0, err } + i += n5 } - return n -} -func sozMesos(x uint64) (n int) { - return sovMesos(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func NewPopulatedFrameworkID(r randyMesos, easy bool) *FrameworkID { - this := &FrameworkID{} - v1 := randStringMesos(r) - this.Value = &v1 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + if m.User != nil { + data[i] = 0x2a + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.User))) + i += copy(data[i:], *m.User) } - return this -} - -func NewPopulatedOfferID(r randyMesos, easy bool) *OfferID { - this := &OfferID{} - v2 := randStringMesos(r) - this.Value = &v2 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + if m.Shell != nil { + data[i] = 0x30 + i++ + if *m.Shell { + data[i] = 1 + } else { + data[i] = 0 + } + i++ } - return this -} - -func NewPopulatedSlaveID(r randyMesos, easy bool) *SlaveID { - this := &SlaveID{} - v3 := randStringMesos(r) - this.Value = &v3 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + if len(m.Arguments) > 0 { + for _, s := range m.Arguments { + data[i] = 0x3a + i++ + l = len(s) + for l >= 1<<7 { + data[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + data[i] = uint8(l) + i++ + i += copy(data[i:], s) + } } - return this -} - -func NewPopulatedTaskID(r randyMesos, easy bool) *TaskID { - this := &TaskID{} - v4 := randStringMesos(r) - this.Value = &v4 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - return this + return i, nil } -func NewPopulatedExecutorID(r randyMesos, easy bool) *ExecutorID { - this := &ExecutorID{} - v5 := randStringMesos(r) - this.Value = &v5 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) +func (m *CommandInfo_URI) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return this + return data[:n], nil } -func NewPopulatedContainerID(r randyMesos, easy bool) *ContainerID { - this := &ContainerID{} - v6 := randStringMesos(r) - this.Value = &v6 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) +func (m *CommandInfo_URI) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Value == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Value))) + i += copy(data[i:], *m.Value) } - return this -} - -func NewPopulatedFrameworkInfo(r randyMesos, easy bool) *FrameworkInfo { - this := &FrameworkInfo{} - v7 := randStringMesos(r) - this.User = &v7 - v8 := randStringMesos(r) - this.Name = &v8 - if r.Intn(10) != 0 { - this.Id = NewPopulatedFrameworkID(r, easy) + if m.Executable != nil { + data[i] = 0x10 + i++ + if *m.Executable { + data[i] = 1 + } else { + data[i] = 0 + } + i++ } - if r.Intn(10) != 0 { - v9 := r.Float64() - if r.Intn(2) == 0 { - v9 *= -1 + if m.Extract != nil { + data[i] = 0x18 + i++ + if *m.Extract { + data[i] = 1 + } else { + data[i] = 0 } - this.FailoverTimeout = &v9 + i++ } - if r.Intn(10) != 0 { - v10 := bool(r.Intn(2) == 0) - this.Checkpoint = &v10 + if m.Cache != nil { + data[i] = 0x20 + i++ + if *m.Cache { + data[i] = 1 + } else { + data[i] = 0 + } + i++ } - if r.Intn(10) != 0 { - v11 := randStringMesos(r) - this.Role = &v11 + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - if r.Intn(10) != 0 { - v12 := randStringMesos(r) - this.Hostname = &v12 + return i, nil +} + +func (m *CommandInfo_ContainerInfo) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - if r.Intn(10) != 0 { - v13 := randStringMesos(r) - this.Principal = &v13 + return data[:n], nil +} + +func (m *CommandInfo_ContainerInfo) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Image == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("image") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Image))) + i += copy(data[i:], *m.Image) } - if r.Intn(10) != 0 { - v14 := randStringMesos(r) - this.WebuiUrl = &v14 + if len(m.Options) > 0 { + for _, s := range m.Options { + data[i] = 0x12 + i++ + l = len(s) + for l >= 1<<7 { + data[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + data[i] = uint8(l) + i++ + i += copy(data[i:], s) + } } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 10) + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - return this + return i, nil } -func NewPopulatedHealthCheck(r randyMesos, easy bool) *HealthCheck { - this := &HealthCheck{} - if r.Intn(10) != 0 { - this.Http = NewPopulatedHealthCheck_HTTP(r, easy) +func (m *ExecutorInfo) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - if r.Intn(10) != 0 { - v15 := r.Float64() - if r.Intn(2) == 0 { - v15 *= -1 + return data[:n], nil +} + +func (m *ExecutorInfo) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.ExecutorId == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("executor_id") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(m.ExecutorId.Size())) + n6, err := m.ExecutorId.MarshalTo(data[i:]) + if err != nil { + return 0, err } - this.DelaySeconds = &v15 + i += n6 } - if r.Intn(10) != 0 { - v16 := r.Float64() - if r.Intn(2) == 0 { - v16 *= -1 - } - this.IntervalSeconds = &v16 + if m.Data != nil { + data[i] = 0x22 + i++ + i = encodeVarintMesos(data, i, uint64(len(m.Data))) + i += copy(data[i:], m.Data) } - if r.Intn(10) != 0 { - v17 := r.Float64() - if r.Intn(2) == 0 { - v17 *= -1 + if len(m.Resources) > 0 { + for _, msg := range m.Resources { + data[i] = 0x2a + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n } - this.TimeoutSeconds = &v17 } - if r.Intn(10) != 0 { - v18 := r.Uint32() - this.ConsecutiveFailures = &v18 + if m.Command == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("command") + } else { + data[i] = 0x3a + i++ + i = encodeVarintMesos(data, i, uint64(m.Command.Size())) + n7, err := m.Command.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n7 } - if r.Intn(10) != 0 { - v19 := r.Float64() - if r.Intn(2) == 0 { - v19 *= -1 + if m.FrameworkId != nil { + data[i] = 0x42 + i++ + i = encodeVarintMesos(data, i, uint64(m.FrameworkId.Size())) + n8, err := m.FrameworkId.MarshalTo(data[i:]) + if err != nil { + return 0, err } - this.GracePeriodSeconds = &v19 + i += n8 } - if r.Intn(10) != 0 { - this.Command = NewPopulatedCommandInfo(r, easy) + if m.Name != nil { + data[i] = 0x4a + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Name))) + i += copy(data[i:], *m.Name) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 8) + if m.Source != nil { + data[i] = 0x52 + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Source))) + i += copy(data[i:], *m.Source) } - return this -} - -func NewPopulatedHealthCheck_HTTP(r randyMesos, easy bool) *HealthCheck_HTTP { - this := &HealthCheck_HTTP{} - v20 := r.Uint32() - this.Port = &v20 - if r.Intn(10) != 0 { - v21 := randStringMesos(r) - this.Path = &v21 + if m.Container != nil { + data[i] = 0x5a + i++ + i = encodeVarintMesos(data, i, uint64(m.Container.Size())) + n9, err := m.Container.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n9 } - if r.Intn(10) != 0 { - v22 := r.Intn(100) - this.Statuses = make([]uint32, v22) - for i := 0; i < v22; i++ { - this.Statuses[i] = r.Uint32() + if m.Discovery != nil { + data[i] = 0x62 + i++ + i = encodeVarintMesos(data, i, uint64(m.Discovery.Size())) + n10, err := m.Discovery.MarshalTo(data[i:]) + if err != nil { + return 0, err } + i += n10 } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 5) + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - return this + return i, nil } -func NewPopulatedCommandInfo(r randyMesos, easy bool) *CommandInfo { - this := &CommandInfo{} - if r.Intn(10) != 0 { - this.Container = NewPopulatedCommandInfo_ContainerInfo(r, easy) - } - if r.Intn(10) != 0 { - v23 := r.Intn(10) - this.Uris = make([]*CommandInfo_URI, v23) - for i := 0; i < v23; i++ { - this.Uris[i] = NewPopulatedCommandInfo_URI(r, easy) - } - } - if r.Intn(10) != 0 { - this.Environment = NewPopulatedEnvironment(r, easy) - } - if r.Intn(10) != 0 { - v24 := bool(r.Intn(2) == 0) - this.Shell = &v24 +func (m *MasterInfo) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - if r.Intn(10) != 0 { - v25 := randStringMesos(r) - this.Value = &v25 + return data[:n], nil +} + +func (m *MasterInfo) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Id == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("id") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Id))) + i += copy(data[i:], *m.Id) } - if r.Intn(10) != 0 { - v26 := r.Intn(10) - this.Arguments = make([]string, v26) - for i := 0; i < v26; i++ { - this.Arguments[i] = randStringMesos(r) - } + if m.Ip == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("ip") + } else { + data[i] = 0x10 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Ip)) } - if r.Intn(10) != 0 { - v27 := randStringMesos(r) - this.User = &v27 + if m.Port == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("port") + } else { + data[i] = 0x18 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Port)) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 8) + if m.Pid != nil { + data[i] = 0x22 + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Pid))) + i += copy(data[i:], *m.Pid) } - return this -} - -func NewPopulatedCommandInfo_URI(r randyMesos, easy bool) *CommandInfo_URI { - this := &CommandInfo_URI{} - v28 := randStringMesos(r) - this.Value = &v28 - if r.Intn(10) != 0 { - v29 := bool(r.Intn(2) == 0) - this.Executable = &v29 + if m.Hostname != nil { + data[i] = 0x2a + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Hostname))) + i += copy(data[i:], *m.Hostname) } - if r.Intn(10) != 0 { - v30 := bool(r.Intn(2) == 0) - this.Extract = &v30 + if m.Version != nil { + data[i] = 0x32 + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Version))) + i += copy(data[i:], *m.Version) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 4) + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - return this + return i, nil } -func NewPopulatedCommandInfo_ContainerInfo(r randyMesos, easy bool) *CommandInfo_ContainerInfo { - this := &CommandInfo_ContainerInfo{} - v31 := randStringMesos(r) - this.Image = &v31 - if r.Intn(10) != 0 { - v32 := r.Intn(10) - this.Options = make([]string, v32) - for i := 0; i < v32; i++ { - this.Options[i] = randStringMesos(r) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) +func (m *SlaveInfo) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return this + return data[:n], nil } -func NewPopulatedExecutorInfo(r randyMesos, easy bool) *ExecutorInfo { - this := &ExecutorInfo{} - this.ExecutorId = NewPopulatedExecutorID(r, easy) - if r.Intn(10) != 0 { - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - } - this.Command = NewPopulatedCommandInfo(r, easy) - if r.Intn(10) != 0 { - this.Container = NewPopulatedContainerInfo(r, easy) +func (m *SlaveInfo) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Hostname == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("hostname") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Hostname))) + i += copy(data[i:], *m.Hostname) } - if r.Intn(10) != 0 { - v33 := r.Intn(10) - this.Resources = make([]*Resource, v33) - for i := 0; i < v33; i++ { - this.Resources[i] = NewPopulatedResource(r, easy) + if len(m.Resources) > 0 { + for _, msg := range m.Resources { + data[i] = 0x1a + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n } } - if r.Intn(10) != 0 { - v34 := randStringMesos(r) - this.Name = &v34 + if len(m.Attributes) > 0 { + for _, msg := range m.Attributes { + data[i] = 0x2a + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n + } } - if r.Intn(10) != 0 { - v35 := randStringMesos(r) - this.Source = &v35 + if m.Id != nil { + data[i] = 0x32 + i++ + i = encodeVarintMesos(data, i, uint64(m.Id.Size())) + n11, err := m.Id.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n11 } - if r.Intn(10) != 0 { - v36 := r.Intn(100) - this.Data = make([]byte, v36) - for i := 0; i < v36; i++ { - this.Data[i] = byte(r.Intn(256)) + if m.Checkpoint != nil { + data[i] = 0x38 + i++ + if *m.Checkpoint { + data[i] = 1 + } else { + data[i] = 0 } + i++ } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 12) + if m.Port != nil { + data[i] = 0x40 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Port)) } - return this + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) + } + return i, nil } -func NewPopulatedMasterInfo(r randyMesos, easy bool) *MasterInfo { - this := &MasterInfo{} - v37 := randStringMesos(r) - this.Id = &v37 - v38 := r.Uint32() - this.Ip = &v38 - v39 := r.Uint32() - this.Port = &v39 - if r.Intn(10) != 0 { - v40 := randStringMesos(r) - this.Pid = &v40 - } - if r.Intn(10) != 0 { - v41 := randStringMesos(r) - this.Hostname = &v41 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 6) +func (m *Value) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return this + return data[:n], nil } -func NewPopulatedSlaveInfo(r randyMesos, easy bool) *SlaveInfo { - this := &SlaveInfo{} - v42 := randStringMesos(r) - this.Hostname = &v42 - if r.Intn(10) != 0 { - v43 := r.Int31() - if r.Intn(2) == 0 { - v43 *= -1 - } - this.Port = &v43 +func (m *Value) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Type == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") + } else { + data[i] = 0x8 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Type)) } - if r.Intn(10) != 0 { - v44 := r.Intn(10) - this.Resources = make([]*Resource, v44) - for i := 0; i < v44; i++ { - this.Resources[i] = NewPopulatedResource(r, easy) + if m.Scalar != nil { + data[i] = 0x12 + i++ + i = encodeVarintMesos(data, i, uint64(m.Scalar.Size())) + n12, err := m.Scalar.MarshalTo(data[i:]) + if err != nil { + return 0, err } + i += n12 } - if r.Intn(10) != 0 { - v45 := r.Intn(10) - this.Attributes = make([]*Attribute, v45) - for i := 0; i < v45; i++ { - this.Attributes[i] = NewPopulatedAttribute(r, easy) + if m.Ranges != nil { + data[i] = 0x1a + i++ + i = encodeVarintMesos(data, i, uint64(m.Ranges.Size())) + n13, err := m.Ranges.MarshalTo(data[i:]) + if err != nil { + return 0, err } + i += n13 } - if r.Intn(10) != 0 { - this.Id = NewPopulatedSlaveID(r, easy) + if m.Set != nil { + data[i] = 0x22 + i++ + i = encodeVarintMesos(data, i, uint64(m.Set.Size())) + n14, err := m.Set.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n14 } - if r.Intn(10) != 0 { - v46 := bool(r.Intn(2) == 0) - this.Checkpoint = &v46 + if m.Text != nil { + data[i] = 0x2a + i++ + i = encodeVarintMesos(data, i, uint64(m.Text.Size())) + n15, err := m.Text.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n15 } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 9) + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - return this + return i, nil } -func NewPopulatedValue(r randyMesos, easy bool) *Value { - this := &Value{} - v47 := Value_Type([]int32{0, 1, 2, 3}[r.Intn(4)]) - this.Type = &v47 - if r.Intn(10) != 0 { - this.Scalar = NewPopulatedValue_Scalar(r, easy) - } - if r.Intn(10) != 0 { - this.Ranges = NewPopulatedValue_Ranges(r, easy) - } - if r.Intn(10) != 0 { - this.Set = NewPopulatedValue_Set(r, easy) - } - if r.Intn(10) != 0 { - this.Text = NewPopulatedValue_Text(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 6) +func (m *Value_Scalar) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return this + return data[:n], nil } -func NewPopulatedValue_Scalar(r randyMesos, easy bool) *Value_Scalar { - this := &Value_Scalar{} - v48 := r.Float64() - if r.Intn(2) == 0 { - v48 *= -1 +func (m *Value_Scalar) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Value == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") + } else { + data[i] = 0x9 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.Value))) } - this.Value = &v48 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - return this + return i, nil } -func NewPopulatedValue_Range(r randyMesos, easy bool) *Value_Range { - this := &Value_Range{} - v49 := uint64(r.Uint32()) - this.Begin = &v49 - v50 := uint64(r.Uint32()) - this.End = &v50 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) +func (m *Value_Range) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return this + return data[:n], nil } -func NewPopulatedValue_Ranges(r randyMesos, easy bool) *Value_Ranges { - this := &Value_Ranges{} - if r.Intn(10) != 0 { - v51 := r.Intn(10) - this.Range = make([]*Value_Range, v51) - for i := 0; i < v51; i++ { - this.Range[i] = NewPopulatedValue_Range(r, easy) - } +func (m *Value_Range) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Begin == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("begin") + } else { + data[i] = 0x8 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Begin)) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + if m.End == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("end") + } else { + data[i] = 0x10 + i++ + i = encodeVarintMesos(data, i, uint64(*m.End)) } - return this + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) + } + return i, nil } -func NewPopulatedValue_Set(r randyMesos, easy bool) *Value_Set { - this := &Value_Set{} - if r.Intn(10) != 0 { - v52 := r.Intn(10) - this.Item = make([]string, v52) - for i := 0; i < v52; i++ { - this.Item[i] = randStringMesos(r) +func (m *Value_Ranges) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err + } + return data[:n], nil +} + +func (m *Value_Ranges) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Range) > 0 { + for _, msg := range m.Range { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n } } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - return this + return i, nil } -func NewPopulatedValue_Text(r randyMesos, easy bool) *Value_Text { - this := &Value_Text{} - v53 := randStringMesos(r) - this.Value = &v53 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) +func (m *Value_Set) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return this + return data[:n], nil } -func NewPopulatedAttribute(r randyMesos, easy bool) *Attribute { - this := &Attribute{} - v54 := randStringMesos(r) - this.Name = &v54 - v55 := Value_Type([]int32{0, 1, 2, 3}[r.Intn(4)]) - this.Type = &v55 - if r.Intn(10) != 0 { - this.Scalar = NewPopulatedValue_Scalar(r, easy) - } - if r.Intn(10) != 0 { - this.Ranges = NewPopulatedValue_Ranges(r, easy) - } - if r.Intn(10) != 0 { - this.Set = NewPopulatedValue_Set(r, easy) +func (m *Value_Set) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Item) > 0 { + for _, s := range m.Item { + data[i] = 0xa + i++ + l = len(s) + for l >= 1<<7 { + data[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + data[i] = uint8(l) + i++ + i += copy(data[i:], s) + } } - if r.Intn(10) != 0 { - this.Text = NewPopulatedValue_Text(r, easy) + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 7) + return i, nil +} + +func (m *Value_Text) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return this + return data[:n], nil } -func NewPopulatedResource(r randyMesos, easy bool) *Resource { - this := &Resource{} - v56 := randStringMesos(r) - this.Name = &v56 - v57 := Value_Type([]int32{0, 1, 2, 3}[r.Intn(4)]) - this.Type = &v57 - if r.Intn(10) != 0 { - this.Scalar = NewPopulatedValue_Scalar(r, easy) - } - if r.Intn(10) != 0 { - this.Ranges = NewPopulatedValue_Ranges(r, easy) - } - if r.Intn(10) != 0 { - this.Set = NewPopulatedValue_Set(r, easy) +func (m *Value_Text) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Value == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Value))) + i += copy(data[i:], *m.Value) } - if r.Intn(10) != 0 { - v58 := randStringMesos(r) - this.Role = &v58 + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 7) + return i, nil +} + +func (m *Attribute) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return this + return data[:n], nil } -func NewPopulatedResourceStatistics(r randyMesos, easy bool) *ResourceStatistics { - this := &ResourceStatistics{} - v59 := r.Float64() - if r.Intn(2) == 0 { - v59 *= -1 +func (m *Attribute) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Name == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Name))) + i += copy(data[i:], *m.Name) } - this.Timestamp = &v59 - if r.Intn(10) != 0 { - v60 := r.Float64() - if r.Intn(2) == 0 { - v60 *= -1 - } - this.CpusUserTimeSecs = &v60 + if m.Type == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") + } else { + data[i] = 0x10 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Type)) } - if r.Intn(10) != 0 { - v61 := r.Float64() - if r.Intn(2) == 0 { - v61 *= -1 + if m.Scalar != nil { + data[i] = 0x1a + i++ + i = encodeVarintMesos(data, i, uint64(m.Scalar.Size())) + n16, err := m.Scalar.MarshalTo(data[i:]) + if err != nil { + return 0, err } - this.CpusSystemTimeSecs = &v61 + i += n16 } - if r.Intn(10) != 0 { - v62 := r.Float64() - if r.Intn(2) == 0 { - v62 *= -1 + if m.Ranges != nil { + data[i] = 0x22 + i++ + i = encodeVarintMesos(data, i, uint64(m.Ranges.Size())) + n17, err := m.Ranges.MarshalTo(data[i:]) + if err != nil { + return 0, err } - this.CpusLimit = &v62 - } - if r.Intn(10) != 0 { - v63 := r.Uint32() - this.CpusNrPeriods = &v63 - } - if r.Intn(10) != 0 { - v64 := r.Uint32() - this.CpusNrThrottled = &v64 + i += n17 } - if r.Intn(10) != 0 { - v65 := r.Float64() - if r.Intn(2) == 0 { - v65 *= -1 + if m.Text != nil { + data[i] = 0x2a + i++ + i = encodeVarintMesos(data, i, uint64(m.Text.Size())) + n18, err := m.Text.MarshalTo(data[i:]) + if err != nil { + return 0, err } - this.CpusThrottledTimeSecs = &v65 - } - if r.Intn(10) != 0 { - v66 := uint64(r.Uint32()) - this.MemRssBytes = &v66 - } - if r.Intn(10) != 0 { - v67 := uint64(r.Uint32()) - this.MemLimitBytes = &v67 - } - if r.Intn(10) != 0 { - v68 := uint64(r.Uint32()) - this.MemFileBytes = &v68 - } - if r.Intn(10) != 0 { - v69 := uint64(r.Uint32()) - this.MemAnonBytes = &v69 - } - if r.Intn(10) != 0 { - v70 := uint64(r.Uint32()) - this.MemMappedFileBytes = &v70 - } - if r.Intn(10) != 0 { - this.Perf = NewPopulatedPerfStatistics(r, easy) - } - if r.Intn(10) != 0 { - v71 := uint64(r.Uint32()) - this.NetRxPackets = &v71 + i += n18 } - if r.Intn(10) != 0 { - v72 := uint64(r.Uint32()) - this.NetRxBytes = &v72 + if m.Set != nil { + data[i] = 0x32 + i++ + i = encodeVarintMesos(data, i, uint64(m.Set.Size())) + n19, err := m.Set.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n19 } - if r.Intn(10) != 0 { - v73 := uint64(r.Uint32()) - this.NetRxErrors = &v73 + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - if r.Intn(10) != 0 { - v74 := uint64(r.Uint32()) - this.NetRxDropped = &v74 + return i, nil +} + +func (m *Resource) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - if r.Intn(10) != 0 { - v75 := uint64(r.Uint32()) - this.NetTxPackets = &v75 + return data[:n], nil +} + +func (m *Resource) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Name == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Name))) + i += copy(data[i:], *m.Name) } - if r.Intn(10) != 0 { - v76 := uint64(r.Uint32()) - this.NetTxBytes = &v76 + if m.Type == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") + } else { + data[i] = 0x10 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Type)) } - if r.Intn(10) != 0 { - v77 := uint64(r.Uint32()) - this.NetTxErrors = &v77 + if m.Scalar != nil { + data[i] = 0x1a + i++ + i = encodeVarintMesos(data, i, uint64(m.Scalar.Size())) + n20, err := m.Scalar.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n20 } - if r.Intn(10) != 0 { - v78 := uint64(r.Uint32()) - this.NetTxDropped = &v78 + if m.Ranges != nil { + data[i] = 0x22 + i++ + i = encodeVarintMesos(data, i, uint64(m.Ranges.Size())) + n21, err := m.Ranges.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n21 } - if r.Intn(10) != 0 { - v79 := r.Float64() - if r.Intn(2) == 0 { - v79 *= -1 + if m.Set != nil { + data[i] = 0x2a + i++ + i = encodeVarintMesos(data, i, uint64(m.Set.Size())) + n22, err := m.Set.MarshalTo(data[i:]) + if err != nil { + return 0, err } - this.NetTcpRttMicrosecsP50 = &v79 + i += n22 } - if r.Intn(10) != 0 { - v80 := r.Float64() - if r.Intn(2) == 0 { - v80 *= -1 + if m.Role != nil { + data[i] = 0x32 + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Role))) + i += copy(data[i:], *m.Role) + } + if m.Disk != nil { + data[i] = 0x3a + i++ + i = encodeVarintMesos(data, i, uint64(m.Disk.Size())) + n23, err := m.Disk.MarshalTo(data[i:]) + if err != nil { + return 0, err } - this.NetTcpRttMicrosecsP90 = &v80 + i += n23 } - if r.Intn(10) != 0 { - v81 := r.Float64() - if r.Intn(2) == 0 { - v81 *= -1 + if m.Reservation != nil { + data[i] = 0x42 + i++ + i = encodeVarintMesos(data, i, uint64(m.Reservation.Size())) + n24, err := m.Reservation.MarshalTo(data[i:]) + if err != nil { + return 0, err } - this.NetTcpRttMicrosecsP95 = &v81 + i += n24 } - if r.Intn(10) != 0 { - v82 := r.Float64() - if r.Intn(2) == 0 { - v82 *= -1 + if m.Revocable != nil { + data[i] = 0x4a + i++ + i = encodeVarintMesos(data, i, uint64(m.Revocable.Size())) + n25, err := m.Revocable.MarshalTo(data[i:]) + if err != nil { + return 0, err } - this.NetTcpRttMicrosecsP99 = &v82 + i += n25 } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 26) + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - return this + return i, nil } -func NewPopulatedResourceUsage(r randyMesos, easy bool) *ResourceUsage { - this := &ResourceUsage{} - this.SlaveId = NewPopulatedSlaveID(r, easy) - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - if r.Intn(10) != 0 { - this.ExecutorId = NewPopulatedExecutorID(r, easy) - } - if r.Intn(10) != 0 { - v83 := randStringMesos(r) - this.ExecutorName = &v83 - } - if r.Intn(10) != 0 { - this.TaskId = NewPopulatedTaskID(r, easy) - } - if r.Intn(10) != 0 { - this.Statistics = NewPopulatedResourceStatistics(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 7) +func (m *Resource_ReservationInfo) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return this + return data[:n], nil } -func NewPopulatedPerfStatistics(r randyMesos, easy bool) *PerfStatistics { - this := &PerfStatistics{} - v84 := r.Float64() - if r.Intn(2) == 0 { - v84 *= -1 - } - this.Timestamp = &v84 - v85 := r.Float64() - if r.Intn(2) == 0 { - v85 *= -1 - } - this.Duration = &v85 - if r.Intn(10) != 0 { - v86 := uint64(r.Uint32()) - this.Cycles = &v86 - } - if r.Intn(10) != 0 { - v87 := uint64(r.Uint32()) - this.StalledCyclesFrontend = &v87 - } - if r.Intn(10) != 0 { - v88 := uint64(r.Uint32()) - this.StalledCyclesBackend = &v88 - } - if r.Intn(10) != 0 { - v89 := uint64(r.Uint32()) - this.Instructions = &v89 - } - if r.Intn(10) != 0 { - v90 := uint64(r.Uint32()) - this.CacheReferences = &v90 - } - if r.Intn(10) != 0 { - v91 := uint64(r.Uint32()) - this.CacheMisses = &v91 - } - if r.Intn(10) != 0 { - v92 := uint64(r.Uint32()) - this.Branches = &v92 - } - if r.Intn(10) != 0 { - v93 := uint64(r.Uint32()) - this.BranchMisses = &v93 +func (m *Resource_ReservationInfo) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Principal == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("principal") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Principal))) + i += copy(data[i:], *m.Principal) } - if r.Intn(10) != 0 { - v94 := uint64(r.Uint32()) - this.BusCycles = &v94 + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - if r.Intn(10) != 0 { - v95 := uint64(r.Uint32()) - this.RefCycles = &v95 + return i, nil +} + +func (m *Resource_DiskInfo) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - if r.Intn(10) != 0 { - v96 := r.Float64() - if r.Intn(2) == 0 { - v96 *= -1 + return data[:n], nil +} + +func (m *Resource_DiskInfo) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Persistence != nil { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(m.Persistence.Size())) + n26, err := m.Persistence.MarshalTo(data[i:]) + if err != nil { + return 0, err } - this.CpuClock = &v96 + i += n26 } - if r.Intn(10) != 0 { - v97 := r.Float64() - if r.Intn(2) == 0 { - v97 *= -1 + if m.Volume != nil { + data[i] = 0x12 + i++ + i = encodeVarintMesos(data, i, uint64(m.Volume.Size())) + n27, err := m.Volume.MarshalTo(data[i:]) + if err != nil { + return 0, err } - this.TaskClock = &v97 - } - if r.Intn(10) != 0 { - v98 := uint64(r.Uint32()) - this.PageFaults = &v98 - } - if r.Intn(10) != 0 { - v99 := uint64(r.Uint32()) - this.MinorFaults = &v99 - } - if r.Intn(10) != 0 { - v100 := uint64(r.Uint32()) - this.MajorFaults = &v100 - } - if r.Intn(10) != 0 { - v101 := uint64(r.Uint32()) - this.ContextSwitches = &v101 + i += n27 } - if r.Intn(10) != 0 { - v102 := uint64(r.Uint32()) - this.CpuMigrations = &v102 + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - if r.Intn(10) != 0 { - v103 := uint64(r.Uint32()) - this.AlignmentFaults = &v103 + return i, nil +} + +func (m *Resource_DiskInfo_Persistence) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - if r.Intn(10) != 0 { - v104 := uint64(r.Uint32()) - this.EmulationFaults = &v104 + return data[:n], nil +} + +func (m *Resource_DiskInfo_Persistence) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Id == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("id") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Id))) + i += copy(data[i:], *m.Id) } - if r.Intn(10) != 0 { - v105 := uint64(r.Uint32()) - this.L1DcacheLoads = &v105 + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - if r.Intn(10) != 0 { - v106 := uint64(r.Uint32()) - this.L1DcacheLoadMisses = &v106 + return i, nil +} + +func (m *Resource_RevocableInfo) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - if r.Intn(10) != 0 { - v107 := uint64(r.Uint32()) - this.L1DcacheStores = &v107 + return data[:n], nil +} + +func (m *Resource_RevocableInfo) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - if r.Intn(10) != 0 { - v108 := uint64(r.Uint32()) - this.L1DcacheStoreMisses = &v108 + return i, nil +} + +func (m *TrafficControlStatistics) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - if r.Intn(10) != 0 { - v109 := uint64(r.Uint32()) - this.L1DcachePrefetches = &v109 + return data[:n], nil +} + +func (m *TrafficControlStatistics) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Id == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("id") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Id))) + i += copy(data[i:], *m.Id) } - if r.Intn(10) != 0 { - v110 := uint64(r.Uint32()) - this.L1DcachePrefetchMisses = &v110 + if m.Backlog != nil { + data[i] = 0x10 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Backlog)) } - if r.Intn(10) != 0 { - v111 := uint64(r.Uint32()) - this.L1IcacheLoads = &v111 + if m.Bytes != nil { + data[i] = 0x18 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Bytes)) } - if r.Intn(10) != 0 { - v112 := uint64(r.Uint32()) - this.L1IcacheLoadMisses = &v112 + if m.Drops != nil { + data[i] = 0x20 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Drops)) } - if r.Intn(10) != 0 { - v113 := uint64(r.Uint32()) - this.L1IcachePrefetches = &v113 + if m.Overlimits != nil { + data[i] = 0x28 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Overlimits)) } - if r.Intn(10) != 0 { - v114 := uint64(r.Uint32()) - this.L1IcachePrefetchMisses = &v114 + if m.Packets != nil { + data[i] = 0x30 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Packets)) } - if r.Intn(10) != 0 { - v115 := uint64(r.Uint32()) - this.LlcLoads = &v115 + if m.Qlen != nil { + data[i] = 0x38 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Qlen)) } - if r.Intn(10) != 0 { - v116 := uint64(r.Uint32()) - this.LlcLoadMisses = &v116 + if m.Ratebps != nil { + data[i] = 0x40 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Ratebps)) } - if r.Intn(10) != 0 { - v117 := uint64(r.Uint32()) - this.LlcStores = &v117 + if m.Ratepps != nil { + data[i] = 0x48 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Ratepps)) } - if r.Intn(10) != 0 { - v118 := uint64(r.Uint32()) - this.LlcStoreMisses = &v118 + if m.Requeues != nil { + data[i] = 0x50 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Requeues)) } - if r.Intn(10) != 0 { - v119 := uint64(r.Uint32()) - this.LlcPrefetches = &v119 + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - if r.Intn(10) != 0 { - v120 := uint64(r.Uint32()) - this.LlcPrefetchMisses = &v120 + return i, nil +} + +func (m *ResourceStatistics) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - if r.Intn(10) != 0 { - v121 := uint64(r.Uint32()) - this.DtlbLoads = &v121 + return data[:n], nil +} + +func (m *ResourceStatistics) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Timestamp == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("timestamp") + } else { + data[i] = 0x9 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.Timestamp))) } - if r.Intn(10) != 0 { - v122 := uint64(r.Uint32()) - this.DtlbLoadMisses = &v122 + if m.CpusUserTimeSecs != nil { + data[i] = 0x11 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.CpusUserTimeSecs))) } - if r.Intn(10) != 0 { - v123 := uint64(r.Uint32()) - this.DtlbStores = &v123 + if m.CpusSystemTimeSecs != nil { + data[i] = 0x19 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.CpusSystemTimeSecs))) } - if r.Intn(10) != 0 { - v124 := uint64(r.Uint32()) - this.DtlbStoreMisses = &v124 + if m.CpusLimit != nil { + data[i] = 0x21 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.CpusLimit))) } - if r.Intn(10) != 0 { - v125 := uint64(r.Uint32()) - this.DtlbPrefetches = &v125 + if m.MemRssBytes != nil { + data[i] = 0x28 + i++ + i = encodeVarintMesos(data, i, uint64(*m.MemRssBytes)) } - if r.Intn(10) != 0 { - v126 := uint64(r.Uint32()) - this.DtlbPrefetchMisses = &v126 + if m.MemLimitBytes != nil { + data[i] = 0x30 + i++ + i = encodeVarintMesos(data, i, uint64(*m.MemLimitBytes)) } - if r.Intn(10) != 0 { - v127 := uint64(r.Uint32()) - this.ItlbLoads = &v127 + if m.CpusNrPeriods != nil { + data[i] = 0x38 + i++ + i = encodeVarintMesos(data, i, uint64(*m.CpusNrPeriods)) } - if r.Intn(10) != 0 { - v128 := uint64(r.Uint32()) - this.ItlbLoadMisses = &v128 + if m.CpusNrThrottled != nil { + data[i] = 0x40 + i++ + i = encodeVarintMesos(data, i, uint64(*m.CpusNrThrottled)) } - if r.Intn(10) != 0 { - v129 := uint64(r.Uint32()) - this.BranchLoads = &v129 + if m.CpusThrottledTimeSecs != nil { + data[i] = 0x49 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.CpusThrottledTimeSecs))) } - if r.Intn(10) != 0 { - v130 := uint64(r.Uint32()) - this.BranchLoadMisses = &v130 + if m.MemFileBytes != nil { + data[i] = 0x50 + i++ + i = encodeVarintMesos(data, i, uint64(*m.MemFileBytes)) } - if r.Intn(10) != 0 { - v131 := uint64(r.Uint32()) - this.NodeLoads = &v131 + if m.MemAnonBytes != nil { + data[i] = 0x58 + i++ + i = encodeVarintMesos(data, i, uint64(*m.MemAnonBytes)) } - if r.Intn(10) != 0 { - v132 := uint64(r.Uint32()) - this.NodeLoadMisses = &v132 + if m.MemMappedFileBytes != nil { + data[i] = 0x60 + i++ + i = encodeVarintMesos(data, i, uint64(*m.MemMappedFileBytes)) } - if r.Intn(10) != 0 { - v133 := uint64(r.Uint32()) - this.NodeStores = &v133 + if m.Perf != nil { + data[i] = 0x6a + i++ + i = encodeVarintMesos(data, i, uint64(m.Perf.Size())) + n28, err := m.Perf.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n28 } - if r.Intn(10) != 0 { - v134 := uint64(r.Uint32()) - this.NodeStoreMisses = &v134 + if m.NetRxPackets != nil { + data[i] = 0x70 + i++ + i = encodeVarintMesos(data, i, uint64(*m.NetRxPackets)) } - if r.Intn(10) != 0 { - v135 := uint64(r.Uint32()) - this.NodePrefetches = &v135 + if m.NetRxBytes != nil { + data[i] = 0x78 + i++ + i = encodeVarintMesos(data, i, uint64(*m.NetRxBytes)) } - if r.Intn(10) != 0 { - v136 := uint64(r.Uint32()) - this.NodePrefetchMisses = &v136 + if m.NetRxErrors != nil { + data[i] = 0x80 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.NetRxErrors)) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 54) + if m.NetRxDropped != nil { + data[i] = 0x88 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.NetRxDropped)) } - return this -} - -func NewPopulatedRequest(r randyMesos, easy bool) *Request { - this := &Request{} - if r.Intn(10) != 0 { - this.SlaveId = NewPopulatedSlaveID(r, easy) + if m.NetTxPackets != nil { + data[i] = 0x90 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.NetTxPackets)) } - if r.Intn(10) != 0 { - v137 := r.Intn(10) - this.Resources = make([]*Resource, v137) - for i := 0; i < v137; i++ { - this.Resources[i] = NewPopulatedResource(r, easy) - } + if m.NetTxBytes != nil { + data[i] = 0x98 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.NetTxBytes)) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) + if m.NetTxErrors != nil { + data[i] = 0xa0 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.NetTxErrors)) } - return this -} - -func NewPopulatedOffer(r randyMesos, easy bool) *Offer { - this := &Offer{} - this.Id = NewPopulatedOfferID(r, easy) - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - this.SlaveId = NewPopulatedSlaveID(r, easy) - v138 := randStringMesos(r) - this.Hostname = &v138 - if r.Intn(10) != 0 { - v139 := r.Intn(10) - this.Resources = make([]*Resource, v139) - for i := 0; i < v139; i++ { - this.Resources[i] = NewPopulatedResource(r, easy) - } + if m.NetTxDropped != nil { + data[i] = 0xa8 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.NetTxDropped)) } - if r.Intn(10) != 0 { - v140 := r.Intn(10) - this.Attributes = make([]*Attribute, v140) - for i := 0; i < v140; i++ { - this.Attributes[i] = NewPopulatedAttribute(r, easy) - } + if m.NetTcpRttMicrosecsP50 != nil { + data[i] = 0xb1 + i++ + data[i] = 0x1 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.NetTcpRttMicrosecsP50))) } - if r.Intn(10) != 0 { - v141 := r.Intn(10) - this.ExecutorIds = make([]*ExecutorID, v141) - for i := 0; i < v141; i++ { - this.ExecutorIds[i] = NewPopulatedExecutorID(r, easy) - } + if m.NetTcpRttMicrosecsP90 != nil { + data[i] = 0xb9 + i++ + data[i] = 0x1 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.NetTcpRttMicrosecsP90))) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 8) + if m.NetTcpRttMicrosecsP95 != nil { + data[i] = 0xc1 + i++ + data[i] = 0x1 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.NetTcpRttMicrosecsP95))) } - return this -} - -func NewPopulatedTaskInfo(r randyMesos, easy bool) *TaskInfo { - this := &TaskInfo{} - v142 := randStringMesos(r) - this.Name = &v142 - this.TaskId = NewPopulatedTaskID(r, easy) - this.SlaveId = NewPopulatedSlaveID(r, easy) - if r.Intn(10) != 0 { - v143 := r.Intn(10) - this.Resources = make([]*Resource, v143) - for i := 0; i < v143; i++ { - this.Resources[i] = NewPopulatedResource(r, easy) - } + if m.NetTcpRttMicrosecsP99 != nil { + data[i] = 0xc9 + i++ + data[i] = 0x1 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.NetTcpRttMicrosecsP99))) } - if r.Intn(10) != 0 { - this.Executor = NewPopulatedExecutorInfo(r, easy) + if m.DiskLimitBytes != nil { + data[i] = 0xd0 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.DiskLimitBytes)) } - if r.Intn(10) != 0 { - this.Command = NewPopulatedCommandInfo(r, easy) + if m.DiskUsedBytes != nil { + data[i] = 0xd8 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.DiskUsedBytes)) } - if r.Intn(10) != 0 { - this.Container = NewPopulatedContainerInfo(r, easy) + if m.NetTcpActiveConnections != nil { + data[i] = 0xe1 + i++ + data[i] = 0x1 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.NetTcpActiveConnections))) } - if r.Intn(10) != 0 { - v144 := r.Intn(100) - this.Data = make([]byte, v144) - for i := 0; i < v144; i++ { - this.Data[i] = byte(r.Intn(256)) - } + if m.NetTcpTimeWaitConnections != nil { + data[i] = 0xe9 + i++ + data[i] = 0x1 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.NetTcpTimeWaitConnections))) } - if r.Intn(10) != 0 { - this.HealthCheck = NewPopulatedHealthCheck(r, easy) + if m.Processes != nil { + data[i] = 0xf0 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Processes)) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 10) + if m.Threads != nil { + data[i] = 0xf8 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Threads)) } - return this -} - -func NewPopulatedTaskStatus(r randyMesos, easy bool) *TaskStatus { - this := &TaskStatus{} - this.TaskId = NewPopulatedTaskID(r, easy) - v145 := TaskState([]int32{6, 0, 1, 2, 3, 4, 5, 7}[r.Intn(8)]) - this.State = &v145 - if r.Intn(10) != 0 { - v146 := randStringMesos(r) - this.Message = &v146 + if m.MemLowPressureCounter != nil { + data[i] = 0x80 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.MemLowPressureCounter)) } - if r.Intn(10) != 0 { - v147 := TaskStatus_Source([]int32{0, 1, 2}[r.Intn(3)]) - this.Source = &v147 + if m.MemMediumPressureCounter != nil { + data[i] = 0x88 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.MemMediumPressureCounter)) } - if r.Intn(10) != 0 { - v148 := TaskStatus_Reason([]int32{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}[r.Intn(17)]) - this.Reason = &v148 + if m.MemCriticalPressureCounter != nil { + data[i] = 0x90 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.MemCriticalPressureCounter)) } - if r.Intn(10) != 0 { - v149 := r.Intn(100) - this.Data = make([]byte, v149) - for i := 0; i < v149; i++ { - this.Data[i] = byte(r.Intn(256)) + if len(m.NetTrafficControlStatistics) > 0 { + for _, msg := range m.NetTrafficControlStatistics { + data[i] = 0x9a + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n } } - if r.Intn(10) != 0 { - this.SlaveId = NewPopulatedSlaveID(r, easy) + if m.MemTotalBytes != nil { + data[i] = 0xa0 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.MemTotalBytes)) } - if r.Intn(10) != 0 { - this.ExecutorId = NewPopulatedExecutorID(r, easy) + if m.MemTotalMemswBytes != nil { + data[i] = 0xa8 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.MemTotalMemswBytes)) } - if r.Intn(10) != 0 { - v150 := r.Float64() - if r.Intn(2) == 0 { - v150 *= -1 - } - this.Timestamp = &v150 + if m.MemSoftLimitBytes != nil { + data[i] = 0xb0 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.MemSoftLimitBytes)) } - if r.Intn(10) != 0 { - v151 := bool(r.Intn(2) == 0) - this.Healthy = &v151 + if m.MemCacheBytes != nil { + data[i] = 0xb8 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.MemCacheBytes)) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 11) + if m.MemSwapBytes != nil { + data[i] = 0xc0 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.MemSwapBytes)) } - return this + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) + } + return i, nil } -func NewPopulatedFilters(r randyMesos, easy bool) *Filters { - this := &Filters{} - if r.Intn(10) != 0 { - v152 := r.Float64() - if r.Intn(2) == 0 { - v152 *= -1 - } - this.RefuseSeconds = &v152 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) +func (m *ResourceUsage) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return this + return data[:n], nil } -func NewPopulatedEnvironment(r randyMesos, easy bool) *Environment { - this := &Environment{} - if r.Intn(10) != 0 { - v153 := r.Intn(10) - this.Variables = make([]*Environment_Variable, v153) - for i := 0; i < v153; i++ { - this.Variables[i] = NewPopulatedEnvironment_Variable(r, easy) +func (m *ResourceUsage) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Executors) > 0 { + for _, msg := range m.Executors { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n } } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) - } - return this -} - -func NewPopulatedEnvironment_Variable(r randyMesos, easy bool) *Environment_Variable { - this := &Environment_Variable{} - v154 := randStringMesos(r) - this.Name = &v154 - v155 := randStringMesos(r) - this.Value = &v155 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - return this + return i, nil } -func NewPopulatedParameter(r randyMesos, easy bool) *Parameter { - this := &Parameter{} - v156 := randStringMesos(r) - this.Key = &v156 - v157 := randStringMesos(r) - this.Value = &v157 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) +func (m *ResourceUsage_Executor) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return this + return data[:n], nil } -func NewPopulatedParameters(r randyMesos, easy bool) *Parameters { - this := &Parameters{} - if r.Intn(10) != 0 { - v158 := r.Intn(10) - this.Parameter = make([]*Parameter, v158) - for i := 0; i < v158; i++ { - this.Parameter[i] = NewPopulatedParameter(r, easy) +func (m *ResourceUsage_Executor) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.ExecutorInfo == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("executor_info") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(m.ExecutorInfo.Size())) + n29, err := m.ExecutorInfo.MarshalTo(data[i:]) + if err != nil { + return 0, err } + i += n29 } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) - } - return this -} - -func NewPopulatedCredential(r randyMesos, easy bool) *Credential { - this := &Credential{} - v159 := randStringMesos(r) - this.Principal = &v159 - if r.Intn(10) != 0 { - v160 := r.Intn(100) - this.Secret = make([]byte, v160) - for i := 0; i < v160; i++ { - this.Secret[i] = byte(r.Intn(256)) + if len(m.Allocated) > 0 { + for _, msg := range m.Allocated { + data[i] = 0x12 + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n } } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) - } - return this -} - -func NewPopulatedCredentials(r randyMesos, easy bool) *Credentials { - this := &Credentials{} - if r.Intn(10) != 0 { - v161 := r.Intn(10) - this.Credentials = make([]*Credential, v161) - for i := 0; i < v161; i++ { - this.Credentials[i] = NewPopulatedCredential(r, easy) + if m.Statistics != nil { + data[i] = 0x1a + i++ + i = encodeVarintMesos(data, i, uint64(m.Statistics.Size())) + n30, err := m.Statistics.MarshalTo(data[i:]) + if err != nil { + return 0, err } + i += n30 } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - return this + return i, nil } -func NewPopulatedACL(r randyMesos, easy bool) *ACL { - this := &ACL{} - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 1) +func (m *PerfStatistics) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return this + return data[:n], nil } -func NewPopulatedACL_Entity(r randyMesos, easy bool) *ACL_Entity { - this := &ACL_Entity{} - if r.Intn(10) != 0 { - v162 := ACL_Entity_Type([]int32{0, 1, 2}[r.Intn(3)]) - this.Type = &v162 +func (m *PerfStatistics) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Timestamp == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("timestamp") + } else { + data[i] = 0x9 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.Timestamp))) } - if r.Intn(10) != 0 { - v163 := r.Intn(10) - this.Values = make([]string, v163) - for i := 0; i < v163; i++ { - this.Values[i] = randStringMesos(r) - } + if m.Duration == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("duration") + } else { + data[i] = 0x11 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.Duration))) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) + if m.Cycles != nil { + data[i] = 0x18 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Cycles)) } - return this -} - -func NewPopulatedACL_RegisterFramework(r randyMesos, easy bool) *ACL_RegisterFramework { - this := &ACL_RegisterFramework{} - this.Principals = NewPopulatedACL_Entity(r, easy) - this.Roles = NewPopulatedACL_Entity(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) + if m.StalledCyclesFrontend != nil { + data[i] = 0x20 + i++ + i = encodeVarintMesos(data, i, uint64(*m.StalledCyclesFrontend)) } - return this -} - -func NewPopulatedACL_RunTask(r randyMesos, easy bool) *ACL_RunTask { - this := &ACL_RunTask{} - this.Principals = NewPopulatedACL_Entity(r, easy) - this.Users = NewPopulatedACL_Entity(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) + if m.StalledCyclesBackend != nil { + data[i] = 0x28 + i++ + i = encodeVarintMesos(data, i, uint64(*m.StalledCyclesBackend)) } - return this -} - -func NewPopulatedACL_ShutdownFramework(r randyMesos, easy bool) *ACL_ShutdownFramework { - this := &ACL_ShutdownFramework{} - this.Principals = NewPopulatedACL_Entity(r, easy) - this.FrameworkPrincipals = NewPopulatedACL_Entity(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) + if m.Instructions != nil { + data[i] = 0x30 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Instructions)) } - return this -} - -func NewPopulatedACLs(r randyMesos, easy bool) *ACLs { - this := &ACLs{} - if r.Intn(10) != 0 { - v164 := bool(r.Intn(2) == 0) - this.Permissive = &v164 + if m.CacheReferences != nil { + data[i] = 0x38 + i++ + i = encodeVarintMesos(data, i, uint64(*m.CacheReferences)) } - if r.Intn(10) != 0 { - v165 := r.Intn(10) - this.RegisterFrameworks = make([]*ACL_RegisterFramework, v165) - for i := 0; i < v165; i++ { - this.RegisterFrameworks[i] = NewPopulatedACL_RegisterFramework(r, easy) - } + if m.CacheMisses != nil { + data[i] = 0x40 + i++ + i = encodeVarintMesos(data, i, uint64(*m.CacheMisses)) } - if r.Intn(10) != 0 { - v166 := r.Intn(10) - this.RunTasks = make([]*ACL_RunTask, v166) - for i := 0; i < v166; i++ { - this.RunTasks[i] = NewPopulatedACL_RunTask(r, easy) - } + if m.Branches != nil { + data[i] = 0x48 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Branches)) } - if r.Intn(10) != 0 { - v167 := r.Intn(10) - this.ShutdownFrameworks = make([]*ACL_ShutdownFramework, v167) - for i := 0; i < v167; i++ { - this.ShutdownFrameworks[i] = NewPopulatedACL_ShutdownFramework(r, easy) - } + if m.BranchMisses != nil { + data[i] = 0x50 + i++ + i = encodeVarintMesos(data, i, uint64(*m.BranchMisses)) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 5) + if m.BusCycles != nil { + data[i] = 0x58 + i++ + i = encodeVarintMesos(data, i, uint64(*m.BusCycles)) } - return this -} - -func NewPopulatedRateLimit(r randyMesos, easy bool) *RateLimit { - this := &RateLimit{} - if r.Intn(10) != 0 { - v168 := r.Float64() - if r.Intn(2) == 0 { - v168 *= -1 - } - this.Qps = &v168 + if m.RefCycles != nil { + data[i] = 0x60 + i++ + i = encodeVarintMesos(data, i, uint64(*m.RefCycles)) } - v169 := randStringMesos(r) - this.Principal = &v169 - if r.Intn(10) != 0 { - v170 := uint64(r.Uint32()) - this.Capacity = &v170 + if m.CpuClock != nil { + data[i] = 0x69 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.CpuClock))) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 4) + if m.TaskClock != nil { + data[i] = 0x71 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.TaskClock))) } - return this -} - -func NewPopulatedRateLimits(r randyMesos, easy bool) *RateLimits { - this := &RateLimits{} - if r.Intn(10) != 0 { - v171 := r.Intn(10) - this.Limits = make([]*RateLimit, v171) - for i := 0; i < v171; i++ { - this.Limits[i] = NewPopulatedRateLimit(r, easy) - } + if m.PageFaults != nil { + data[i] = 0x78 + i++ + i = encodeVarintMesos(data, i, uint64(*m.PageFaults)) } - if r.Intn(10) != 0 { - v172 := r.Float64() - if r.Intn(2) == 0 { - v172 *= -1 - } - this.AggregateDefaultQps = &v172 + if m.MinorFaults != nil { + data[i] = 0x80 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.MinorFaults)) } - if r.Intn(10) != 0 { - v173 := uint64(r.Uint32()) - this.AggregateDefaultCapacity = &v173 + if m.MajorFaults != nil { + data[i] = 0x88 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.MajorFaults)) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 4) + if m.ContextSwitches != nil { + data[i] = 0x90 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.ContextSwitches)) } - return this -} - -func NewPopulatedVolume(r randyMesos, easy bool) *Volume { - this := &Volume{} - v174 := randStringMesos(r) - this.ContainerPath = &v174 - if r.Intn(10) != 0 { - v175 := randStringMesos(r) - this.HostPath = &v175 + if m.CpuMigrations != nil { + data[i] = 0x98 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.CpuMigrations)) } - v176 := Volume_Mode([]int32{1, 2}[r.Intn(2)]) - this.Mode = &v176 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 4) + if m.AlignmentFaults != nil { + data[i] = 0xa0 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.AlignmentFaults)) } - return this -} - -func NewPopulatedContainerInfo(r randyMesos, easy bool) *ContainerInfo { - this := &ContainerInfo{} - v177 := ContainerInfo_Type([]int32{1, 2}[r.Intn(2)]) - this.Type = &v177 - if r.Intn(10) != 0 { - v178 := r.Intn(10) - this.Volumes = make([]*Volume, v178) - for i := 0; i < v178; i++ { - this.Volumes[i] = NewPopulatedVolume(r, easy) - } + if m.EmulationFaults != nil { + data[i] = 0xa8 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.EmulationFaults)) } - if r.Intn(10) != 0 { - v179 := randStringMesos(r) - this.Hostname = &v179 + if m.L1DcacheLoads != nil { + data[i] = 0xb0 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.L1DcacheLoads)) } - if r.Intn(10) != 0 { - this.Docker = NewPopulatedContainerInfo_DockerInfo(r, easy) + if m.L1DcacheLoadMisses != nil { + data[i] = 0xb8 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.L1DcacheLoadMisses)) + } + if m.L1DcacheStores != nil { + data[i] = 0xc0 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.L1DcacheStores)) + } + if m.L1DcacheStoreMisses != nil { + data[i] = 0xc8 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.L1DcacheStoreMisses)) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 5) + if m.L1DcachePrefetches != nil { + data[i] = 0xd0 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.L1DcachePrefetches)) } - return this -} - -func NewPopulatedContainerInfo_DockerInfo(r randyMesos, easy bool) *ContainerInfo_DockerInfo { - this := &ContainerInfo_DockerInfo{} - v180 := randStringMesos(r) - this.Image = &v180 - if r.Intn(10) != 0 { - v181 := ContainerInfo_DockerInfo_Network([]int32{1, 2, 3}[r.Intn(3)]) - this.Network = &v181 + if m.L1DcachePrefetchMisses != nil { + data[i] = 0xd8 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.L1DcachePrefetchMisses)) } - if r.Intn(10) != 0 { - v182 := r.Intn(10) - this.PortMappings = make([]*ContainerInfo_DockerInfo_PortMapping, v182) - for i := 0; i < v182; i++ { - this.PortMappings[i] = NewPopulatedContainerInfo_DockerInfo_PortMapping(r, easy) - } + if m.L1IcacheLoads != nil { + data[i] = 0xe0 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.L1IcacheLoads)) } - if r.Intn(10) != 0 { - v183 := bool(r.Intn(2) == 0) - this.Privileged = &v183 + if m.L1IcacheLoadMisses != nil { + data[i] = 0xe8 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.L1IcacheLoadMisses)) } - if r.Intn(10) != 0 { - v184 := r.Intn(10) - this.Parameters = make([]*Parameter, v184) - for i := 0; i < v184; i++ { - this.Parameters[i] = NewPopulatedParameter(r, easy) - } + if m.L1IcachePrefetches != nil { + data[i] = 0xf0 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.L1IcachePrefetches)) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 6) + if m.L1IcachePrefetchMisses != nil { + data[i] = 0xf8 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.L1IcachePrefetchMisses)) } - return this -} - -func NewPopulatedContainerInfo_DockerInfo_PortMapping(r randyMesos, easy bool) *ContainerInfo_DockerInfo_PortMapping { - this := &ContainerInfo_DockerInfo_PortMapping{} - v185 := r.Uint32() - this.HostPort = &v185 - v186 := r.Uint32() - this.ContainerPort = &v186 - if r.Intn(10) != 0 { - v187 := randStringMesos(r) - this.Protocol = &v187 + if m.LlcLoads != nil { + data[i] = 0x80 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.LlcLoads)) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 4) + if m.LlcLoadMisses != nil { + data[i] = 0x88 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.LlcLoadMisses)) } - return this -} - -type randyMesos interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneMesos(r randyMesos) rune { - res := rune(r.Uint32() % 1112064) - if 55296 <= res { - res += 2047 + if m.LlcStores != nil { + data[i] = 0x90 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.LlcStores)) } - return res -} -func randStringMesos(r randyMesos) string { - v188 := r.Intn(100) - tmps := make([]rune, v188) - for i := 0; i < v188; i++ { - tmps[i] = randUTF8RuneMesos(r) + if m.LlcStoreMisses != nil { + data[i] = 0x98 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.LlcStoreMisses)) } - return string(tmps) -} -func randUnrecognizedMesos(r randyMesos, maxFieldNumber int) (data []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - data = randFieldMesos(data, r, fieldNumber, wire) + if m.LlcPrefetches != nil { + data[i] = 0xa0 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.LlcPrefetches)) } - return data -} -func randFieldMesos(data []byte, r randyMesos, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - data = encodeVarintPopulateMesos(data, uint64(key)) - v189 := r.Int63() - if r.Intn(2) == 0 { - v189 *= -1 - } - data = encodeVarintPopulateMesos(data, uint64(v189)) - case 1: - data = encodeVarintPopulateMesos(data, uint64(key)) - data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - data = encodeVarintPopulateMesos(data, uint64(key)) - ll := r.Intn(100) - data = encodeVarintPopulateMesos(data, uint64(ll)) - for j := 0; j < ll; j++ { - data = append(data, byte(r.Intn(256))) - } - default: - data = encodeVarintPopulateMesos(data, uint64(key)) - data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) + if m.LlcPrefetchMisses != nil { + data[i] = 0xa8 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.LlcPrefetchMisses)) } - return data -} -func encodeVarintPopulateMesos(data []byte, v uint64) []byte { - for v >= 1<<7 { - data = append(data, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 + if m.DtlbLoads != nil { + data[i] = 0xb0 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.DtlbLoads)) } - data = append(data, uint8(v)) - return data -} -func (m *FrameworkID) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err + if m.DtlbLoadMisses != nil { + data[i] = 0xb8 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.DtlbLoadMisses)) } - return data[:n], nil -} - -func (m *FrameworkID) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Value != nil { - data[i] = 0xa + if m.DtlbStores != nil { + data[i] = 0xc0 i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.DtlbStores)) } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if m.DtlbStoreMisses != nil { + data[i] = 0xc8 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.DtlbStoreMisses)) } - return i, nil -} - -func (m *OfferID) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err + if m.DtlbPrefetches != nil { + data[i] = 0xd0 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.DtlbPrefetches)) } - return data[:n], nil -} - -func (m *OfferID) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Value != nil { - data[i] = 0xa + if m.DtlbPrefetchMisses != nil { + data[i] = 0xd8 i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.DtlbPrefetchMisses)) } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if m.ItlbLoads != nil { + data[i] = 0xe0 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.ItlbLoads)) } - return i, nil -} - -func (m *SlaveID) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err + if m.ItlbLoadMisses != nil { + data[i] = 0xe8 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.ItlbLoadMisses)) } - return data[:n], nil -} - -func (m *SlaveID) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Value != nil { - data[i] = 0xa + if m.BranchLoads != nil { + data[i] = 0xf0 i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.BranchLoads)) } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if m.BranchLoadMisses != nil { + data[i] = 0xf8 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.BranchLoadMisses)) } - return i, nil -} - -func (m *TaskID) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err + if m.NodeLoads != nil { + data[i] = 0x80 + i++ + data[i] = 0x3 + i++ + i = encodeVarintMesos(data, i, uint64(*m.NodeLoads)) } - return data[:n], nil -} - -func (m *TaskID) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Value != nil { - data[i] = 0xa + if m.NodeLoadMisses != nil { + data[i] = 0x88 i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) + data[i] = 0x3 + i++ + i = encodeVarintMesos(data, i, uint64(*m.NodeLoadMisses)) } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if m.NodeStores != nil { + data[i] = 0x90 + i++ + data[i] = 0x3 + i++ + i = encodeVarintMesos(data, i, uint64(*m.NodeStores)) } - return i, nil -} - -func (m *ExecutorID) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err + if m.NodeStoreMisses != nil { + data[i] = 0x98 + i++ + data[i] = 0x3 + i++ + i = encodeVarintMesos(data, i, uint64(*m.NodeStoreMisses)) } - return data[:n], nil -} - -func (m *ExecutorID) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Value != nil { - data[i] = 0xa + if m.NodePrefetches != nil { + data[i] = 0xa0 i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) + data[i] = 0x3 + i++ + i = encodeVarintMesos(data, i, uint64(*m.NodePrefetches)) + } + if m.NodePrefetchMisses != nil { + data[i] = 0xa8 + i++ + data[i] = 0x3 + i++ + i = encodeVarintMesos(data, i, uint64(*m.NodePrefetchMisses)) } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -13564,7 +15672,7 @@ func (m *ExecutorID) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *ContainerID) Marshal() (data []byte, err error) { +func (m *Request) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -13574,16 +15682,32 @@ func (m *ContainerID) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *ContainerID) MarshalTo(data []byte) (n int, err error) { +func (m *Request) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Value != nil { + if m.SlaveId != nil { data[i] = 0xa i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) + i = encodeVarintMesos(data, i, uint64(m.SlaveId.Size())) + n31, err := m.SlaveId.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n31 + } + if len(m.Resources) > 0 { + for _, msg := range m.Resources { + data[i] = 0x12 + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n + } } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -13591,7 +15715,7 @@ func (m *ContainerID) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *FrameworkInfo) Marshal() (data []byte, err error) { +func (m *Offer) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -13601,71 +15725,90 @@ func (m *FrameworkInfo) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *FrameworkInfo) MarshalTo(data []byte) (n int, err error) { +func (m *Offer) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.User != nil { + if m.Id == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("id") + } else { data[i] = 0xa i++ - i = encodeVarintMesos(data, i, uint64(len(*m.User))) - i += copy(data[i:], *m.User) - } - if m.Name != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) - } - if m.Id != nil { - data[i] = 0x1a - i++ i = encodeVarintMesos(data, i, uint64(m.Id.Size())) - n1, err := m.Id.MarshalTo(data[i:]) + n32, err := m.Id.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n1 - } - if m.FailoverTimeout != nil { - data[i] = 0x21 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.FailoverTimeout))) + i += n32 } - if m.Checkpoint != nil { - data[i] = 0x28 + if m.FrameworkId == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") + } else { + data[i] = 0x12 i++ - if *m.Checkpoint { - data[i] = 1 - } else { - data[i] = 0 + i = encodeVarintMesos(data, i, uint64(m.FrameworkId.Size())) + n33, err := m.FrameworkId.MarshalTo(data[i:]) + if err != nil { + return 0, err } - i++ + i += n33 } - if m.Role != nil { - data[i] = 0x32 + if m.SlaveId == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") + } else { + data[i] = 0x1a i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Role))) - i += copy(data[i:], *m.Role) + i = encodeVarintMesos(data, i, uint64(m.SlaveId.Size())) + n34, err := m.SlaveId.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n34 } - if m.Hostname != nil { - data[i] = 0x3a + if m.Hostname == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("hostname") + } else { + data[i] = 0x22 i++ i = encodeVarintMesos(data, i, uint64(len(*m.Hostname))) i += copy(data[i:], *m.Hostname) } - if m.Principal != nil { - data[i] = 0x42 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Principal))) - i += copy(data[i:], *m.Principal) + if len(m.Resources) > 0 { + for _, msg := range m.Resources { + data[i] = 0x2a + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n + } } - if m.WebuiUrl != nil { - data[i] = 0x4a - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.WebuiUrl))) - i += copy(data[i:], *m.WebuiUrl) + if len(m.ExecutorIds) > 0 { + for _, msg := range m.ExecutorIds { + data[i] = 0x32 + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n + } + } + if len(m.Attributes) > 0 { + for _, msg := range m.Attributes { + data[i] = 0x3a + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n + } } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -13673,7 +15816,7 @@ func (m *FrameworkInfo) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *HealthCheck) Marshal() (data []byte, err error) { +func (m *Offer_Operation) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -13683,55 +15826,67 @@ func (m *HealthCheck) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *HealthCheck) MarshalTo(data []byte) (n int, err error) { +func (m *Offer_Operation) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Http != nil { - data[i] = 0xa + if m.Type == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") + } else { + data[i] = 0x8 i++ - i = encodeVarintMesos(data, i, uint64(m.Http.Size())) - n2, err := m.Http.MarshalTo(data[i:]) + i = encodeVarintMesos(data, i, uint64(*m.Type)) + } + if m.Launch != nil { + data[i] = 0x12 + i++ + i = encodeVarintMesos(data, i, uint64(m.Launch.Size())) + n35, err := m.Launch.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n2 - } - if m.DelaySeconds != nil { - data[i] = 0x11 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.DelaySeconds))) - } - if m.IntervalSeconds != nil { - data[i] = 0x19 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.IntervalSeconds))) + i += n35 } - if m.TimeoutSeconds != nil { - data[i] = 0x21 + if m.Reserve != nil { + data[i] = 0x1a i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.TimeoutSeconds))) + i = encodeVarintMesos(data, i, uint64(m.Reserve.Size())) + n36, err := m.Reserve.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n36 } - if m.ConsecutiveFailures != nil { - data[i] = 0x28 + if m.Unreserve != nil { + data[i] = 0x22 i++ - i = encodeVarintMesos(data, i, uint64(*m.ConsecutiveFailures)) + i = encodeVarintMesos(data, i, uint64(m.Unreserve.Size())) + n37, err := m.Unreserve.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n37 } - if m.GracePeriodSeconds != nil { - data[i] = 0x31 + if m.Create != nil { + data[i] = 0x2a i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.GracePeriodSeconds))) + i = encodeVarintMesos(data, i, uint64(m.Create.Size())) + n38, err := m.Create.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n38 } - if m.Command != nil { - data[i] = 0x3a + if m.Destroy != nil { + data[i] = 0x32 i++ - i = encodeVarintMesos(data, i, uint64(m.Command.Size())) - n3, err := m.Command.MarshalTo(data[i:]) + i = encodeVarintMesos(data, i, uint64(m.Destroy.Size())) + n39, err := m.Destroy.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n3 + i += n39 } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -13739,7 +15894,7 @@ func (m *HealthCheck) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *HealthCheck_HTTP) Marshal() (data []byte, err error) { +func (m *Offer_Operation_Launch) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -13749,27 +15904,21 @@ func (m *HealthCheck_HTTP) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *HealthCheck_HTTP) MarshalTo(data []byte) (n int, err error) { +func (m *Offer_Operation_Launch) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Port != nil { - data[i] = 0x8 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Port)) - } - if m.Path != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Path))) - i += copy(data[i:], *m.Path) - } - if len(m.Statuses) > 0 { - for _, num := range m.Statuses { - data[i] = 0x20 + if len(m.TaskInfos) > 0 { + for _, msg := range m.TaskInfos { + data[i] = 0xa i++ - i = encodeVarintMesos(data, i, uint64(num)) + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n } } if m.XXX_unrecognized != nil { @@ -13778,7 +15927,7 @@ func (m *HealthCheck_HTTP) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *CommandInfo) Marshal() (data []byte, err error) { +func (m *Offer_Operation_Reserve) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -13788,23 +15937,13 @@ func (m *CommandInfo) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *CommandInfo) MarshalTo(data []byte) (n int, err error) { +func (m *Offer_Operation_Reserve) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Container != nil { - data[i] = 0x22 - i++ - i = encodeVarintMesos(data, i, uint64(m.Container.Size())) - n4, err := m.Container.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n4 - } - if len(m.Uris) > 0 { - for _, msg := range m.Uris { + if len(m.Resources) > 0 { + for _, msg := range m.Resources { data[i] = 0xa i++ i = encodeVarintMesos(data, i, uint64(msg.Size())) @@ -13815,60 +15954,46 @@ func (m *CommandInfo) MarshalTo(data []byte) (n int, err error) { i += n } } - if m.Environment != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(m.Environment.Size())) - n5, err := m.Environment.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n5 - } - if m.Shell != nil { - data[i] = 0x30 - i++ - if *m.Shell { - data[i] = 1 - } else { - data[i] = 0 - } - i++ + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - if m.Value != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) + return i, nil +} + +func (m *Offer_Operation_Unreserve) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - if len(m.Arguments) > 0 { - for _, s := range m.Arguments { - data[i] = 0x3a + return data[:n], nil +} + +func (m *Offer_Operation_Unreserve) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Resources) > 0 { + for _, msg := range m.Resources { + data[i] = 0xa i++ - l = len(s) - for l >= 1<<7 { - data[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err } - data[i] = uint8(l) - i++ - i += copy(data[i:], s) + i += n } } - if m.User != nil { - data[i] = 0x2a - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.User))) - i += copy(data[i:], *m.User) - } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) } return i, nil } -func (m *CommandInfo_URI) Marshal() (data []byte, err error) { +func (m *Offer_Operation_Create) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -13878,36 +16003,22 @@ func (m *CommandInfo_URI) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *CommandInfo_URI) MarshalTo(data []byte) (n int, err error) { +func (m *Offer_Operation_Create) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Value != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) - } - if m.Executable != nil { - data[i] = 0x10 - i++ - if *m.Executable { - data[i] = 1 - } else { - data[i] = 0 - } - i++ - } - if m.Extract != nil { - data[i] = 0x18 - i++ - if *m.Extract { - data[i] = 1 - } else { - data[i] = 0 + if len(m.Volumes) > 0 { + for _, msg := range m.Volumes { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n } - i++ } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -13915,7 +16026,7 @@ func (m *CommandInfo_URI) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *CommandInfo_ContainerInfo) Marshal() (data []byte, err error) { +func (m *Offer_Operation_Destroy) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -13925,30 +16036,21 @@ func (m *CommandInfo_ContainerInfo) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *CommandInfo_ContainerInfo) MarshalTo(data []byte) (n int, err error) { +func (m *Offer_Operation_Destroy) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Image != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Image))) - i += copy(data[i:], *m.Image) - } - if len(m.Options) > 0 { - for _, s := range m.Options { - data[i] = 0x12 + if len(m.Volumes) > 0 { + for _, msg := range m.Volumes { + data[i] = 0xa i++ - l = len(s) - for l >= 1<<7 { - data[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err } - data[i] = uint8(l) - i++ - i += copy(data[i:], s) + i += n } } if m.XXX_unrecognized != nil { @@ -13957,7 +16059,7 @@ func (m *CommandInfo_ContainerInfo) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *ExecutorInfo) Marshal() (data []byte, err error) { +func (m *TaskInfo) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -13967,54 +16069,46 @@ func (m *ExecutorInfo) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *ExecutorInfo) MarshalTo(data []byte) (n int, err error) { +func (m *TaskInfo) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.ExecutorId != nil { + if m.Name == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") + } else { data[i] = 0xa i++ - i = encodeVarintMesos(data, i, uint64(m.ExecutorId.Size())) - n6, err := m.ExecutorId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n6 - } - if m.FrameworkId != nil { - data[i] = 0x42 - i++ - i = encodeVarintMesos(data, i, uint64(m.FrameworkId.Size())) - n7, err := m.FrameworkId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n7 + i = encodeVarintMesos(data, i, uint64(len(*m.Name))) + i += copy(data[i:], *m.Name) } - if m.Command != nil { - data[i] = 0x3a + if m.TaskId == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("task_id") + } else { + data[i] = 0x12 i++ - i = encodeVarintMesos(data, i, uint64(m.Command.Size())) - n8, err := m.Command.MarshalTo(data[i:]) + i = encodeVarintMesos(data, i, uint64(m.TaskId.Size())) + n40, err := m.TaskId.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n8 + i += n40 } - if m.Container != nil { - data[i] = 0x5a + if m.SlaveId == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") + } else { + data[i] = 0x1a i++ - i = encodeVarintMesos(data, i, uint64(m.Container.Size())) - n9, err := m.Container.MarshalTo(data[i:]) + i = encodeVarintMesos(data, i, uint64(m.SlaveId.Size())) + n41, err := m.SlaveId.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n9 + i += n41 } if len(m.Resources) > 0 { for _, msg := range m.Resources { - data[i] = 0x2a + data[i] = 0x22 i++ i = encodeVarintMesos(data, i, uint64(msg.Size())) n, err := msg.MarshalTo(data[i:]) @@ -14024,23 +16118,71 @@ func (m *ExecutorInfo) MarshalTo(data []byte) (n int, err error) { i += n } } - if m.Name != nil { + if m.Executor != nil { + data[i] = 0x2a + i++ + i = encodeVarintMesos(data, i, uint64(m.Executor.Size())) + n42, err := m.Executor.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n42 + } + if m.Data != nil { + data[i] = 0x32 + i++ + i = encodeVarintMesos(data, i, uint64(len(m.Data))) + i += copy(data[i:], m.Data) + } + if m.Command != nil { + data[i] = 0x3a + i++ + i = encodeVarintMesos(data, i, uint64(m.Command.Size())) + n43, err := m.Command.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n43 + } + if m.HealthCheck != nil { + data[i] = 0x42 + i++ + i = encodeVarintMesos(data, i, uint64(m.HealthCheck.Size())) + n44, err := m.HealthCheck.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n44 + } + if m.Container != nil { data[i] = 0x4a i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) + i = encodeVarintMesos(data, i, uint64(m.Container.Size())) + n45, err := m.Container.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n45 } - if m.Source != nil { + if m.Labels != nil { data[i] = 0x52 i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Source))) - i += copy(data[i:], *m.Source) + i = encodeVarintMesos(data, i, uint64(m.Labels.Size())) + n46, err := m.Labels.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n46 } - if m.Data != nil { - data[i] = 0x22 + if m.Discovery != nil { + data[i] = 0x5a i++ - i = encodeVarintMesos(data, i, uint64(len(m.Data))) - i += copy(data[i:], m.Data) + i = encodeVarintMesos(data, i, uint64(m.Discovery.Size())) + n47, err := m.Discovery.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n47 } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -14048,7 +16190,7 @@ func (m *ExecutorInfo) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *MasterInfo) Marshal() (data []byte, err error) { +func (m *TaskStatus) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -14058,122 +16200,100 @@ func (m *MasterInfo) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *MasterInfo) MarshalTo(data []byte) (n int, err error) { +func (m *TaskStatus) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Id != nil { + if m.TaskId == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("task_id") + } else { data[i] = 0xa i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Id))) - i += copy(data[i:], *m.Id) + i = encodeVarintMesos(data, i, uint64(m.TaskId.Size())) + n48, err := m.TaskId.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n48 } - if m.Ip != nil { + if m.State == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("state") + } else { data[i] = 0x10 i++ - i = encodeVarintMesos(data, i, uint64(*m.Ip)) + i = encodeVarintMesos(data, i, uint64(*m.State)) } - if m.Port != nil { - data[i] = 0x18 + if m.Data != nil { + data[i] = 0x1a i++ - i = encodeVarintMesos(data, i, uint64(*m.Port)) + i = encodeVarintMesos(data, i, uint64(len(m.Data))) + i += copy(data[i:], m.Data) } - if m.Pid != nil { + if m.Message != nil { data[i] = 0x22 i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Pid))) - i += copy(data[i:], *m.Pid) + i = encodeVarintMesos(data, i, uint64(len(*m.Message))) + i += copy(data[i:], *m.Message) } - if m.Hostname != nil { + if m.SlaveId != nil { data[i] = 0x2a i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Hostname))) - i += copy(data[i:], *m.Hostname) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *SlaveInfo) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *SlaveInfo) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Hostname != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Hostname))) - i += copy(data[i:], *m.Hostname) - } - if m.Port != nil { - data[i] = 0x40 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Port)) - } - if len(m.Resources) > 0 { - for _, msg := range m.Resources { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n + i = encodeVarintMesos(data, i, uint64(m.SlaveId.Size())) + n49, err := m.SlaveId.MarshalTo(data[i:]) + if err != nil { + return 0, err } + i += n49 } - if len(m.Attributes) > 0 { - for _, msg := range m.Attributes { - data[i] = 0x2a - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } + if m.Timestamp != nil { + data[i] = 0x31 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.Timestamp))) } - if m.Id != nil { - data[i] = 0x32 + if m.ExecutorId != nil { + data[i] = 0x3a i++ - i = encodeVarintMesos(data, i, uint64(m.Id.Size())) - n10, err := m.Id.MarshalTo(data[i:]) + i = encodeVarintMesos(data, i, uint64(m.ExecutorId.Size())) + n50, err := m.ExecutorId.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n10 + i += n50 } - if m.Checkpoint != nil { - data[i] = 0x38 + if m.Healthy != nil { + data[i] = 0x40 i++ - if *m.Checkpoint { + if *m.Healthy { data[i] = 1 } else { data[i] = 0 } i++ } + if m.Source != nil { + data[i] = 0x48 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Source)) + } + if m.Reason != nil { + data[i] = 0x50 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Reason)) + } + if m.Uuid != nil { + data[i] = 0x5a + i++ + i = encodeVarintMesos(data, i, uint64(len(m.Uuid))) + i += copy(data[i:], m.Uuid) + } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) } return i, nil } -func (m *Value) Marshal() (data []byte, err error) { +func (m *Filters) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -14183,55 +16303,15 @@ func (m *Value) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Value) MarshalTo(data []byte) (n int, err error) { +func (m *Filters) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Type != nil { - data[i] = 0x8 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Type)) - } - if m.Scalar != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(m.Scalar.Size())) - n11, err := m.Scalar.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n11 - } - if m.Ranges != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(m.Ranges.Size())) - n12, err := m.Ranges.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n12 - } - if m.Set != nil { - data[i] = 0x22 - i++ - i = encodeVarintMesos(data, i, uint64(m.Set.Size())) - n13, err := m.Set.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n13 - } - if m.Text != nil { - data[i] = 0x2a + if m.RefuseSeconds != nil { + data[i] = 0x9 i++ - i = encodeVarintMesos(data, i, uint64(m.Text.Size())) - n14, err := m.Text.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n14 + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.RefuseSeconds))) } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -14239,7 +16319,7 @@ func (m *Value) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *Value_Scalar) Marshal() (data []byte, err error) { +func (m *Environment) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -14249,15 +16329,22 @@ func (m *Value_Scalar) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Value_Scalar) MarshalTo(data []byte) (n int, err error) { +func (m *Environment) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Value != nil { - data[i] = 0x9 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.Value))) + if len(m.Variables) > 0 { + for _, msg := range m.Variables { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n + } } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -14265,7 +16352,7 @@ func (m *Value_Scalar) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *Value_Range) Marshal() (data []byte, err error) { +func (m *Environment_Variable) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -14275,20 +16362,26 @@ func (m *Value_Range) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Value_Range) MarshalTo(data []byte) (n int, err error) { +func (m *Environment_Variable) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Begin != nil { - data[i] = 0x8 + if m.Name == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") + } else { + data[i] = 0xa i++ - i = encodeVarintMesos(data, i, uint64(*m.Begin)) + i = encodeVarintMesos(data, i, uint64(len(*m.Name))) + i += copy(data[i:], *m.Name) } - if m.End != nil { - data[i] = 0x10 + if m.Value == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") + } else { + data[i] = 0x12 i++ - i = encodeVarintMesos(data, i, uint64(*m.End)) + i = encodeVarintMesos(data, i, uint64(len(*m.Value))) + i += copy(data[i:], *m.Value) } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -14296,7 +16389,7 @@ func (m *Value_Range) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *Value_Ranges) Marshal() (data []byte, err error) { +func (m *Parameter) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -14306,22 +16399,26 @@ func (m *Value_Ranges) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Value_Ranges) MarshalTo(data []byte) (n int, err error) { +func (m *Parameter) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if len(m.Range) > 0 { - for _, msg := range m.Range { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } + if m.Key == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("key") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Key))) + i += copy(data[i:], *m.Key) + } + if m.Value == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") + } else { + data[i] = 0x12 + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Value))) + i += copy(data[i:], *m.Value) } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -14329,7 +16426,7 @@ func (m *Value_Ranges) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *Value_Set) Marshal() (data []byte, err error) { +func (m *Parameters) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -14339,24 +16436,21 @@ func (m *Value_Set) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Value_Set) MarshalTo(data []byte) (n int, err error) { +func (m *Parameters) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if len(m.Item) > 0 { - for _, s := range m.Item { + if len(m.Parameter) > 0 { + for _, msg := range m.Parameter { data[i] = 0xa i++ - l = len(s) - for l >= 1<<7 { - data[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err } - data[i] = uint8(l) - i++ - i += copy(data[i:], s) + i += n } } if m.XXX_unrecognized != nil { @@ -14365,7 +16459,7 @@ func (m *Value_Set) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *Value_Text) Marshal() (data []byte, err error) { +func (m *Credential) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -14375,16 +16469,24 @@ func (m *Value_Text) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Value_Text) MarshalTo(data []byte) (n int, err error) { +func (m *Credential) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Value != nil { + if m.Principal == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("principal") + } else { data[i] = 0xa i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) + i = encodeVarintMesos(data, i, uint64(len(*m.Principal))) + i += copy(data[i:], *m.Principal) + } + if m.Secret != nil { + data[i] = 0x12 + i++ + i = encodeVarintMesos(data, i, uint64(len(m.Secret))) + i += copy(data[i:], m.Secret) } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -14392,7 +16494,7 @@ func (m *Value_Text) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *Attribute) Marshal() (data []byte, err error) { +func (m *Credentials) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -14402,61 +16504,22 @@ func (m *Attribute) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Attribute) MarshalTo(data []byte) (n int, err error) { +func (m *Credentials) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Name != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) - } - if m.Type != nil { - data[i] = 0x10 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Type)) - } - if m.Scalar != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(m.Scalar.Size())) - n15, err := m.Scalar.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n15 - } - if m.Ranges != nil { - data[i] = 0x22 - i++ - i = encodeVarintMesos(data, i, uint64(m.Ranges.Size())) - n16, err := m.Ranges.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n16 - } - if m.Set != nil { - data[i] = 0x32 - i++ - i = encodeVarintMesos(data, i, uint64(m.Set.Size())) - n17, err := m.Set.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n17 - } - if m.Text != nil { - data[i] = 0x2a - i++ - i = encodeVarintMesos(data, i, uint64(m.Text.Size())) - n18, err := m.Text.MarshalTo(data[i:]) - if err != nil { - return 0, err + if len(m.Credentials) > 0 { + for _, msg := range m.Credentials { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n } - i += n18 } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -14464,7 +16527,7 @@ func (m *Attribute) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *Resource) Marshal() (data []byte, err error) { +func (m *ACL) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -14474,65 +16537,18 @@ func (m *Resource) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Resource) MarshalTo(data []byte) (n int, err error) { +func (m *ACL) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Name != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) - } - if m.Type != nil { - data[i] = 0x10 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Type)) - } - if m.Scalar != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(m.Scalar.Size())) - n19, err := m.Scalar.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n19 - } - if m.Ranges != nil { - data[i] = 0x22 - i++ - i = encodeVarintMesos(data, i, uint64(m.Ranges.Size())) - n20, err := m.Ranges.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n20 - } - if m.Set != nil { - data[i] = 0x2a - i++ - i = encodeVarintMesos(data, i, uint64(m.Set.Size())) - n21, err := m.Set.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n21 - } - if m.Role != nil { - data[i] = 0x32 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Role))) - i += copy(data[i:], *m.Role) - } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) } return i, nil } -func (m *ResourceStatistics) Marshal() (data []byte, err error) { +func (m *ACL_Entity) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -14542,160 +16558,30 @@ func (m *ResourceStatistics) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *ResourceStatistics) MarshalTo(data []byte) (n int, err error) { +func (m *ACL_Entity) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Timestamp != nil { - data[i] = 0x9 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.Timestamp))) - } - if m.CpusUserTimeSecs != nil { - data[i] = 0x11 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.CpusUserTimeSecs))) - } - if m.CpusSystemTimeSecs != nil { - data[i] = 0x19 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.CpusSystemTimeSecs))) - } - if m.CpusLimit != nil { - data[i] = 0x21 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.CpusLimit))) - } - if m.CpusNrPeriods != nil { - data[i] = 0x38 - i++ - i = encodeVarintMesos(data, i, uint64(*m.CpusNrPeriods)) - } - if m.CpusNrThrottled != nil { - data[i] = 0x40 - i++ - i = encodeVarintMesos(data, i, uint64(*m.CpusNrThrottled)) - } - if m.CpusThrottledTimeSecs != nil { - data[i] = 0x49 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.CpusThrottledTimeSecs))) - } - if m.MemRssBytes != nil { - data[i] = 0x28 - i++ - i = encodeVarintMesos(data, i, uint64(*m.MemRssBytes)) - } - if m.MemLimitBytes != nil { - data[i] = 0x30 - i++ - i = encodeVarintMesos(data, i, uint64(*m.MemLimitBytes)) - } - if m.MemFileBytes != nil { - data[i] = 0x50 - i++ - i = encodeVarintMesos(data, i, uint64(*m.MemFileBytes)) - } - if m.MemAnonBytes != nil { - data[i] = 0x58 - i++ - i = encodeVarintMesos(data, i, uint64(*m.MemAnonBytes)) - } - if m.MemMappedFileBytes != nil { - data[i] = 0x60 - i++ - i = encodeVarintMesos(data, i, uint64(*m.MemMappedFileBytes)) - } - if m.Perf != nil { - data[i] = 0x6a - i++ - i = encodeVarintMesos(data, i, uint64(m.Perf.Size())) - n22, err := m.Perf.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n22 - } - if m.NetRxPackets != nil { - data[i] = 0x70 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NetRxPackets)) - } - if m.NetRxBytes != nil { - data[i] = 0x78 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NetRxBytes)) - } - if m.NetRxErrors != nil { - data[i] = 0x80 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NetRxErrors)) - } - if m.NetRxDropped != nil { - data[i] = 0x88 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NetRxDropped)) - } - if m.NetTxPackets != nil { - data[i] = 0x90 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NetTxPackets)) - } - if m.NetTxBytes != nil { - data[i] = 0x98 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NetTxBytes)) - } - if m.NetTxErrors != nil { - data[i] = 0xa0 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NetTxErrors)) - } - if m.NetTxDropped != nil { - data[i] = 0xa8 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NetTxDropped)) - } - if m.NetTcpRttMicrosecsP50 != nil { - data[i] = 0xb1 - i++ - data[i] = 0x1 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.NetTcpRttMicrosecsP50))) - } - if m.NetTcpRttMicrosecsP90 != nil { - data[i] = 0xb9 - i++ - data[i] = 0x1 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.NetTcpRttMicrosecsP90))) - } - if m.NetTcpRttMicrosecsP95 != nil { - data[i] = 0xc1 - i++ - data[i] = 0x1 + if m.Type != nil { + data[i] = 0x8 i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.NetTcpRttMicrosecsP95))) + i = encodeVarintMesos(data, i, uint64(*m.Type)) } - if m.NetTcpRttMicrosecsP99 != nil { - data[i] = 0xc9 - i++ - data[i] = 0x1 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.NetTcpRttMicrosecsP99))) + if len(m.Values) > 0 { + for _, s := range m.Values { + data[i] = 0x12 + i++ + l = len(s) + for l >= 1<<7 { + data[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + data[i] = uint8(l) + i++ + i += copy(data[i:], s) + } } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -14703,7 +16589,7 @@ func (m *ResourceStatistics) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *ResourceUsage) Marshal() (data []byte, err error) { +func (m *ACL_RegisterFramework) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -14713,66 +16599,79 @@ func (m *ResourceUsage) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *ResourceUsage) MarshalTo(data []byte) (n int, err error) { +func (m *ACL_RegisterFramework) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.SlaveId != nil { + if m.Principals == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("principals") + } else { data[i] = 0xa i++ - i = encodeVarintMesos(data, i, uint64(m.SlaveId.Size())) - n23, err := m.SlaveId.MarshalTo(data[i:]) + i = encodeVarintMesos(data, i, uint64(m.Principals.Size())) + n51, err := m.Principals.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n23 + i += n51 } - if m.FrameworkId != nil { + if m.Roles == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("roles") + } else { data[i] = 0x12 i++ - i = encodeVarintMesos(data, i, uint64(m.FrameworkId.Size())) - n24, err := m.FrameworkId.MarshalTo(data[i:]) + i = encodeVarintMesos(data, i, uint64(m.Roles.Size())) + n52, err := m.Roles.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n24 + i += n52 } - if m.ExecutorId != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(m.ExecutorId.Size())) - n25, err := m.ExecutorId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n25 + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - if m.ExecutorName != nil { - data[i] = 0x22 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.ExecutorName))) - i += copy(data[i:], *m.ExecutorName) + return i, nil +} + +func (m *ACL_RunTask) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - if m.TaskId != nil { - data[i] = 0x2a + return data[:n], nil +} + +func (m *ACL_RunTask) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Principals == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("principals") + } else { + data[i] = 0xa i++ - i = encodeVarintMesos(data, i, uint64(m.TaskId.Size())) - n26, err := m.TaskId.MarshalTo(data[i:]) + i = encodeVarintMesos(data, i, uint64(m.Principals.Size())) + n53, err := m.Principals.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n26 + i += n53 } - if m.Statistics != nil { - data[i] = 0x32 + if m.Users == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("users") + } else { + data[i] = 0x12 i++ - i = encodeVarintMesos(data, i, uint64(m.Statistics.Size())) - n27, err := m.Statistics.MarshalTo(data[i:]) + i = encodeVarintMesos(data, i, uint64(m.Users.Size())) + n54, err := m.Users.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n27 + i += n54 } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -14780,7 +16679,7 @@ func (m *ResourceUsage) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *PerfStatistics) Marshal() (data []byte, err error) { +func (m *ACL_ShutdownFramework) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -14790,351 +16689,225 @@ func (m *PerfStatistics) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *PerfStatistics) MarshalTo(data []byte) (n int, err error) { +func (m *ACL_ShutdownFramework) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Timestamp != nil { - data[i] = 0x9 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.Timestamp))) - } - if m.Duration != nil { - data[i] = 0x11 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.Duration))) - } - if m.Cycles != nil { - data[i] = 0x18 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Cycles)) - } - if m.StalledCyclesFrontend != nil { - data[i] = 0x20 - i++ - i = encodeVarintMesos(data, i, uint64(*m.StalledCyclesFrontend)) - } - if m.StalledCyclesBackend != nil { - data[i] = 0x28 - i++ - i = encodeVarintMesos(data, i, uint64(*m.StalledCyclesBackend)) - } - if m.Instructions != nil { - data[i] = 0x30 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Instructions)) - } - if m.CacheReferences != nil { - data[i] = 0x38 - i++ - i = encodeVarintMesos(data, i, uint64(*m.CacheReferences)) - } - if m.CacheMisses != nil { - data[i] = 0x40 - i++ - i = encodeVarintMesos(data, i, uint64(*m.CacheMisses)) - } - if m.Branches != nil { - data[i] = 0x48 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Branches)) - } - if m.BranchMisses != nil { - data[i] = 0x50 - i++ - i = encodeVarintMesos(data, i, uint64(*m.BranchMisses)) - } - if m.BusCycles != nil { - data[i] = 0x58 - i++ - i = encodeVarintMesos(data, i, uint64(*m.BusCycles)) - } - if m.RefCycles != nil { - data[i] = 0x60 - i++ - i = encodeVarintMesos(data, i, uint64(*m.RefCycles)) - } - if m.CpuClock != nil { - data[i] = 0x69 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.CpuClock))) - } - if m.TaskClock != nil { - data[i] = 0x71 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.TaskClock))) - } - if m.PageFaults != nil { - data[i] = 0x78 - i++ - i = encodeVarintMesos(data, i, uint64(*m.PageFaults)) - } - if m.MinorFaults != nil { - data[i] = 0x80 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.MinorFaults)) - } - if m.MajorFaults != nil { - data[i] = 0x88 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.MajorFaults)) - } - if m.ContextSwitches != nil { - data[i] = 0x90 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.ContextSwitches)) - } - if m.CpuMigrations != nil { - data[i] = 0x98 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.CpuMigrations)) - } - if m.AlignmentFaults != nil { - data[i] = 0xa0 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.AlignmentFaults)) - } - if m.EmulationFaults != nil { - data[i] = 0xa8 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.EmulationFaults)) - } - if m.L1DcacheLoads != nil { - data[i] = 0xb0 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.L1DcacheLoads)) - } - if m.L1DcacheLoadMisses != nil { - data[i] = 0xb8 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.L1DcacheLoadMisses)) - } - if m.L1DcacheStores != nil { - data[i] = 0xc0 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.L1DcacheStores)) - } - if m.L1DcacheStoreMisses != nil { - data[i] = 0xc8 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.L1DcacheStoreMisses)) - } - if m.L1DcachePrefetches != nil { - data[i] = 0xd0 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.L1DcachePrefetches)) - } - if m.L1DcachePrefetchMisses != nil { - data[i] = 0xd8 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.L1DcachePrefetchMisses)) - } - if m.L1IcacheLoads != nil { - data[i] = 0xe0 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.L1IcacheLoads)) - } - if m.L1IcacheLoadMisses != nil { - data[i] = 0xe8 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.L1IcacheLoadMisses)) - } - if m.L1IcachePrefetches != nil { - data[i] = 0xf0 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.L1IcachePrefetches)) - } - if m.L1IcachePrefetchMisses != nil { - data[i] = 0xf8 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.L1IcachePrefetchMisses)) - } - if m.LlcLoads != nil { - data[i] = 0x80 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.LlcLoads)) - } - if m.LlcLoadMisses != nil { - data[i] = 0x88 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.LlcLoadMisses)) - } - if m.LlcStores != nil { - data[i] = 0x90 - i++ - data[i] = 0x2 + if m.Principals == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("principals") + } else { + data[i] = 0xa i++ - i = encodeVarintMesos(data, i, uint64(*m.LlcStores)) + i = encodeVarintMesos(data, i, uint64(m.Principals.Size())) + n55, err := m.Principals.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n55 } - if m.LlcStoreMisses != nil { - data[i] = 0x98 - i++ - data[i] = 0x2 + if m.FrameworkPrincipals == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_principals") + } else { + data[i] = 0x12 i++ - i = encodeVarintMesos(data, i, uint64(*m.LlcStoreMisses)) + i = encodeVarintMesos(data, i, uint64(m.FrameworkPrincipals.Size())) + n56, err := m.FrameworkPrincipals.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n56 } - if m.LlcPrefetches != nil { - data[i] = 0xa0 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.LlcPrefetches)) + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - if m.LlcPrefetchMisses != nil { - data[i] = 0xa8 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.LlcPrefetchMisses)) + return i, nil +} + +func (m *ACLs) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - if m.DtlbLoads != nil { - data[i] = 0xb0 + return data[:n], nil +} + +func (m *ACLs) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Permissive != nil { + data[i] = 0x8 i++ - data[i] = 0x2 + if *m.Permissive { + data[i] = 1 + } else { + data[i] = 0 + } i++ - i = encodeVarintMesos(data, i, uint64(*m.DtlbLoads)) } - if m.DtlbLoadMisses != nil { - data[i] = 0xb8 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.DtlbLoadMisses)) + if len(m.RegisterFrameworks) > 0 { + for _, msg := range m.RegisterFrameworks { + data[i] = 0x12 + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n + } } - if m.DtlbStores != nil { - data[i] = 0xc0 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.DtlbStores)) + if len(m.RunTasks) > 0 { + for _, msg := range m.RunTasks { + data[i] = 0x1a + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n + } } - if m.DtlbStoreMisses != nil { - data[i] = 0xc8 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.DtlbStoreMisses)) + if len(m.ShutdownFrameworks) > 0 { + for _, msg := range m.ShutdownFrameworks { + data[i] = 0x22 + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n + } } - if m.DtlbPrefetches != nil { - data[i] = 0xd0 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.DtlbPrefetches)) + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - if m.DtlbPrefetchMisses != nil { - data[i] = 0xd8 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.DtlbPrefetchMisses)) + return i, nil +} + +func (m *RateLimit) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - if m.ItlbLoads != nil { - data[i] = 0xe0 - i++ - data[i] = 0x2 + return data[:n], nil +} + +func (m *RateLimit) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Qps != nil { + data[i] = 0x9 i++ - i = encodeVarintMesos(data, i, uint64(*m.ItlbLoads)) + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.Qps))) } - if m.ItlbLoadMisses != nil { - data[i] = 0xe8 - i++ - data[i] = 0x2 + if m.Principal == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("principal") + } else { + data[i] = 0x12 i++ - i = encodeVarintMesos(data, i, uint64(*m.ItlbLoadMisses)) + i = encodeVarintMesos(data, i, uint64(len(*m.Principal))) + i += copy(data[i:], *m.Principal) } - if m.BranchLoads != nil { - data[i] = 0xf0 - i++ - data[i] = 0x2 + if m.Capacity != nil { + data[i] = 0x18 i++ - i = encodeVarintMesos(data, i, uint64(*m.BranchLoads)) + i = encodeVarintMesos(data, i, uint64(*m.Capacity)) } - if m.BranchLoadMisses != nil { - data[i] = 0xf8 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.BranchLoadMisses)) + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - if m.NodeLoads != nil { - data[i] = 0x80 - i++ - data[i] = 0x3 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NodeLoads)) + return i, nil +} + +func (m *RateLimits) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - if m.NodeLoadMisses != nil { - data[i] = 0x88 - i++ - data[i] = 0x3 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NodeLoadMisses)) + return data[:n], nil +} + +func (m *RateLimits) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Limits) > 0 { + for _, msg := range m.Limits { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n + } } - if m.NodeStores != nil { - data[i] = 0x90 - i++ - data[i] = 0x3 + if m.AggregateDefaultQps != nil { + data[i] = 0x11 i++ - i = encodeVarintMesos(data, i, uint64(*m.NodeStores)) + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.AggregateDefaultQps))) } - if m.NodeStoreMisses != nil { - data[i] = 0x98 - i++ - data[i] = 0x3 + if m.AggregateDefaultCapacity != nil { + data[i] = 0x18 i++ - i = encodeVarintMesos(data, i, uint64(*m.NodeStoreMisses)) + i = encodeVarintMesos(data, i, uint64(*m.AggregateDefaultCapacity)) } - if m.NodePrefetches != nil { - data[i] = 0xa0 - i++ - data[i] = 0x3 + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *Volume) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err + } + return data[:n], nil +} + +func (m *Volume) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.ContainerPath == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("container_path") + } else { + data[i] = 0xa i++ - i = encodeVarintMesos(data, i, uint64(*m.NodePrefetches)) + i = encodeVarintMesos(data, i, uint64(len(*m.ContainerPath))) + i += copy(data[i:], *m.ContainerPath) } - if m.NodePrefetchMisses != nil { - data[i] = 0xa8 + if m.HostPath != nil { + data[i] = 0x12 i++ - data[i] = 0x3 + i = encodeVarintMesos(data, i, uint64(len(*m.HostPath))) + i += copy(data[i:], *m.HostPath) + } + if m.Mode == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("mode") + } else { + data[i] = 0x18 i++ - i = encodeVarintMesos(data, i, uint64(*m.NodePrefetchMisses)) + i = encodeVarintMesos(data, i, uint64(*m.Mode)) } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -15142,7 +16915,7 @@ func (m *PerfStatistics) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *Request) Marshal() (data []byte, err error) { +func (m *ContainerInfo) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -15152,23 +16925,20 @@ func (m *Request) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Request) MarshalTo(data []byte) (n int, err error) { +func (m *ContainerInfo) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.SlaveId != nil { - data[i] = 0xa + if m.Type == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") + } else { + data[i] = 0x8 i++ - i = encodeVarintMesos(data, i, uint64(m.SlaveId.Size())) - n28, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n28 + i = encodeVarintMesos(data, i, uint64(*m.Type)) } - if len(m.Resources) > 0 { - for _, msg := range m.Resources { + if len(m.Volumes) > 0 { + for _, msg := range m.Volumes { data[i] = 0x12 i++ i = encodeVarintMesos(data, i, uint64(msg.Size())) @@ -15179,13 +16949,29 @@ func (m *Request) MarshalTo(data []byte) (n int, err error) { i += n } } + if m.Docker != nil { + data[i] = 0x1a + i++ + i = encodeVarintMesos(data, i, uint64(m.Docker.Size())) + n57, err := m.Docker.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n57 + } + if m.Hostname != nil { + data[i] = 0x22 + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Hostname))) + i += copy(data[i:], *m.Hostname) + } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) } return i, nil } -func (m *Offer) Marshal() (data []byte, err error) { +func (m *ContainerInfo_DockerInfo) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -15195,50 +16981,27 @@ func (m *Offer) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Offer) MarshalTo(data []byte) (n int, err error) { +func (m *ContainerInfo_DockerInfo) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Id != nil { + if m.Image == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("image") + } else { data[i] = 0xa i++ - i = encodeVarintMesos(data, i, uint64(m.Id.Size())) - n29, err := m.Id.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n29 - } - if m.FrameworkId != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(m.FrameworkId.Size())) - n30, err := m.FrameworkId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n30 - } - if m.SlaveId != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(m.SlaveId.Size())) - n31, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n31 + i = encodeVarintMesos(data, i, uint64(len(*m.Image))) + i += copy(data[i:], *m.Image) } - if m.Hostname != nil { - data[i] = 0x22 + if m.Network != nil { + data[i] = 0x10 i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Hostname))) - i += copy(data[i:], *m.Hostname) + i = encodeVarintMesos(data, i, uint64(*m.Network)) } - if len(m.Resources) > 0 { - for _, msg := range m.Resources { - data[i] = 0x2a + if len(m.PortMappings) > 0 { + for _, msg := range m.PortMappings { + data[i] = 0x1a i++ i = encodeVarintMesos(data, i, uint64(msg.Size())) n, err := msg.MarshalTo(data[i:]) @@ -15248,21 +17011,19 @@ func (m *Offer) MarshalTo(data []byte) (n int, err error) { i += n } } - if len(m.Attributes) > 0 { - for _, msg := range m.Attributes { - data[i] = 0x3a - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n + if m.Privileged != nil { + data[i] = 0x20 + i++ + if *m.Privileged { + data[i] = 1 + } else { + data[i] = 0 } + i++ } - if len(m.ExecutorIds) > 0 { - for _, msg := range m.ExecutorIds { - data[i] = 0x32 + if len(m.Parameters) > 0 { + for _, msg := range m.Parameters { + data[i] = 0x2a i++ i = encodeVarintMesos(data, i, uint64(msg.Size())) n, err := msg.MarshalTo(data[i:]) @@ -15272,13 +17033,23 @@ func (m *Offer) MarshalTo(data []byte) (n int, err error) { i += n } } + if m.ForcePullImage != nil { + data[i] = 0x30 + i++ + if *m.ForcePullImage { + data[i] = 1 + } else { + data[i] = 0 + } + i++ + } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) } return i, nil } -func (m *TaskInfo) Marshal() (data []byte, err error) { +func (m *ContainerInfo_DockerInfo_PortMapping) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -15288,40 +17059,55 @@ func (m *TaskInfo) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *TaskInfo) MarshalTo(data []byte) (n int, err error) { +func (m *ContainerInfo_DockerInfo_PortMapping) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Name != nil { - data[i] = 0xa + if m.HostPort == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("host_port") + } else { + data[i] = 0x8 i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) + i = encodeVarintMesos(data, i, uint64(*m.HostPort)) } - if m.TaskId != nil { - data[i] = 0x12 + if m.ContainerPort == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("container_port") + } else { + data[i] = 0x10 i++ - i = encodeVarintMesos(data, i, uint64(m.TaskId.Size())) - n32, err := m.TaskId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n32 + i = encodeVarintMesos(data, i, uint64(*m.ContainerPort)) } - if m.SlaveId != nil { + if m.Protocol != nil { data[i] = 0x1a i++ - i = encodeVarintMesos(data, i, uint64(m.SlaveId.Size())) - n33, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n33 + i = encodeVarintMesos(data, i, uint64(len(*m.Protocol))) + i += copy(data[i:], *m.Protocol) } - if len(m.Resources) > 0 { - for _, msg := range m.Resources { - data[i] = 0x22 + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *Labels) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err + } + return data[:n], nil +} + +func (m *Labels) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Labels) > 0 { + for _, msg := range m.Labels { + data[i] = 0xa i++ i = encodeVarintMesos(data, i, uint64(msg.Size())) n, err := msg.MarshalTo(data[i:]) @@ -15331,51 +17117,113 @@ func (m *TaskInfo) MarshalTo(data []byte) (n int, err error) { i += n } } - if m.Executor != nil { - data[i] = 0x2a + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *Label) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err + } + return data[:n], nil +} + +func (m *Label) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Key == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("key") + } else { + data[i] = 0xa i++ - i = encodeVarintMesos(data, i, uint64(m.Executor.Size())) - n34, err := m.Executor.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n34 + i = encodeVarintMesos(data, i, uint64(len(*m.Key))) + i += copy(data[i:], *m.Key) } - if m.Command != nil { - data[i] = 0x3a + if m.Value != nil { + data[i] = 0x12 i++ - i = encodeVarintMesos(data, i, uint64(m.Command.Size())) - n35, err := m.Command.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n35 + i = encodeVarintMesos(data, i, uint64(len(*m.Value))) + i += copy(data[i:], *m.Value) } - if m.Container != nil { - data[i] = 0x4a + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *Port) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err + } + return data[:n], nil +} + +func (m *Port) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Number == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("number") + } else { + data[i] = 0x8 i++ - i = encodeVarintMesos(data, i, uint64(m.Container.Size())) - n36, err := m.Container.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n36 + i = encodeVarintMesos(data, i, uint64(*m.Number)) } - if m.Data != nil { - data[i] = 0x32 + if m.Name != nil { + data[i] = 0x12 i++ - i = encodeVarintMesos(data, i, uint64(len(m.Data))) - i += copy(data[i:], m.Data) + i = encodeVarintMesos(data, i, uint64(len(*m.Name))) + i += copy(data[i:], *m.Name) } - if m.HealthCheck != nil { - data[i] = 0x42 + if m.Protocol != nil { + data[i] = 0x1a i++ - i = encodeVarintMesos(data, i, uint64(m.HealthCheck.Size())) - n37, err := m.HealthCheck.MarshalTo(data[i:]) - if err != nil { - return 0, err + i = encodeVarintMesos(data, i, uint64(len(*m.Protocol))) + i += copy(data[i:], *m.Protocol) + } + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *Ports) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err + } + return data[:n], nil +} + +func (m *Ports) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Ports) > 0 { + for _, msg := range m.Ports { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n } - i += n37 } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -15383,7 +17231,7 @@ func (m *TaskInfo) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *TaskStatus) Marshal() (data []byte, err error) { +func (m *DiscoveryInfo) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -15393,7515 +17241,14929 @@ func (m *TaskStatus) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *TaskStatus) MarshalTo(data []byte) (n int, err error) { +func (m *DiscoveryInfo) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.TaskId != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(m.TaskId.Size())) - n38, err := m.TaskId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n38 - } - if m.State != nil { - data[i] = 0x10 + if m.Visibility == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("visibility") + } else { + data[i] = 0x8 i++ - i = encodeVarintMesos(data, i, uint64(*m.State)) + i = encodeVarintMesos(data, i, uint64(*m.Visibility)) } - if m.Message != nil { - data[i] = 0x22 + if m.Name != nil { + data[i] = 0x12 i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Message))) - i += copy(data[i:], *m.Message) + i = encodeVarintMesos(data, i, uint64(len(*m.Name))) + i += copy(data[i:], *m.Name) } - if m.Source != nil { - data[i] = 0x48 + if m.Environment != nil { + data[i] = 0x1a i++ - i = encodeVarintMesos(data, i, uint64(*m.Source)) + i = encodeVarintMesos(data, i, uint64(len(*m.Environment))) + i += copy(data[i:], *m.Environment) } - if m.Reason != nil { - data[i] = 0x50 + if m.Location != nil { + data[i] = 0x22 i++ - i = encodeVarintMesos(data, i, uint64(*m.Reason)) + i = encodeVarintMesos(data, i, uint64(len(*m.Location))) + i += copy(data[i:], *m.Location) } - if m.Data != nil { - data[i] = 0x1a + if m.Version != nil { + data[i] = 0x2a i++ - i = encodeVarintMesos(data, i, uint64(len(m.Data))) - i += copy(data[i:], m.Data) + i = encodeVarintMesos(data, i, uint64(len(*m.Version))) + i += copy(data[i:], *m.Version) } - if m.SlaveId != nil { - data[i] = 0x2a + if m.Ports != nil { + data[i] = 0x32 i++ - i = encodeVarintMesos(data, i, uint64(m.SlaveId.Size())) - n39, err := m.SlaveId.MarshalTo(data[i:]) + i = encodeVarintMesos(data, i, uint64(m.Ports.Size())) + n58, err := m.Ports.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n39 + i += n58 } - if m.ExecutorId != nil { + if m.Labels != nil { data[i] = 0x3a i++ - i = encodeVarintMesos(data, i, uint64(m.ExecutorId.Size())) - n40, err := m.ExecutorId.MarshalTo(data[i:]) + i = encodeVarintMesos(data, i, uint64(m.Labels.Size())) + n59, err := m.Labels.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n40 + i += n59 + } + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) + } + return i, nil +} + +func encodeFixed64Mesos(data []byte, offset int, v uint64) int { + data[offset] = uint8(v) + data[offset+1] = uint8(v >> 8) + data[offset+2] = uint8(v >> 16) + data[offset+3] = uint8(v >> 24) + data[offset+4] = uint8(v >> 32) + data[offset+5] = uint8(v >> 40) + data[offset+6] = uint8(v >> 48) + data[offset+7] = uint8(v >> 56) + return offset + 8 +} +func encodeFixed32Mesos(data []byte, offset int, v uint32) int { + data[offset] = uint8(v) + data[offset+1] = uint8(v >> 8) + data[offset+2] = uint8(v >> 16) + data[offset+3] = uint8(v >> 24) + return offset + 4 +} +func encodeVarintMesos(data []byte, offset int, v uint64) int { + for v >= 1<<7 { + data[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + data[offset] = uint8(v) + return offset + 1 +} +func NewPopulatedFrameworkID(r randyMesos, easy bool) *FrameworkID { + this := &FrameworkID{} + v1 := randStringMesos(r) + this.Value = &v1 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + } + return this +} + +func NewPopulatedOfferID(r randyMesos, easy bool) *OfferID { + this := &OfferID{} + v2 := randStringMesos(r) + this.Value = &v2 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + } + return this +} + +func NewPopulatedSlaveID(r randyMesos, easy bool) *SlaveID { + this := &SlaveID{} + v3 := randStringMesos(r) + this.Value = &v3 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + } + return this +} + +func NewPopulatedTaskID(r randyMesos, easy bool) *TaskID { + this := &TaskID{} + v4 := randStringMesos(r) + this.Value = &v4 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + } + return this +} + +func NewPopulatedExecutorID(r randyMesos, easy bool) *ExecutorID { + this := &ExecutorID{} + v5 := randStringMesos(r) + this.Value = &v5 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + } + return this +} + +func NewPopulatedContainerID(r randyMesos, easy bool) *ContainerID { + this := &ContainerID{} + v6 := randStringMesos(r) + this.Value = &v6 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + } + return this +} + +func NewPopulatedFrameworkInfo(r randyMesos, easy bool) *FrameworkInfo { + this := &FrameworkInfo{} + v7 := randStringMesos(r) + this.User = &v7 + v8 := randStringMesos(r) + this.Name = &v8 + if r.Intn(10) != 0 { + this.Id = NewPopulatedFrameworkID(r, easy) + } + if r.Intn(10) != 0 { + v9 := float64(r.Float64()) + if r.Intn(2) == 0 { + v9 *= -1 + } + this.FailoverTimeout = &v9 + } + if r.Intn(10) != 0 { + v10 := bool(bool(r.Intn(2) == 0)) + this.Checkpoint = &v10 + } + if r.Intn(10) != 0 { + v11 := randStringMesos(r) + this.Role = &v11 + } + if r.Intn(10) != 0 { + v12 := randStringMesos(r) + this.Hostname = &v12 + } + if r.Intn(10) != 0 { + v13 := randStringMesos(r) + this.Principal = &v13 + } + if r.Intn(10) != 0 { + v14 := randStringMesos(r) + this.WebuiUrl = &v14 + } + if r.Intn(10) != 0 { + v15 := r.Intn(10) + this.Capabilities = make([]*FrameworkInfo_Capability, v15) + for i := 0; i < v15; i++ { + this.Capabilities[i] = NewPopulatedFrameworkInfo_Capability(r, easy) + } + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 11) + } + return this +} + +func NewPopulatedFrameworkInfo_Capability(r randyMesos, easy bool) *FrameworkInfo_Capability { + this := &FrameworkInfo_Capability{} + v16 := FrameworkInfo_Capability_Type([]int32{1}[r.Intn(1)]) + this.Type = &v16 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + } + return this +} + +func NewPopulatedHealthCheck(r randyMesos, easy bool) *HealthCheck { + this := &HealthCheck{} + if r.Intn(10) != 0 { + this.Http = NewPopulatedHealthCheck_HTTP(r, easy) + } + if r.Intn(10) != 0 { + v17 := float64(r.Float64()) + if r.Intn(2) == 0 { + v17 *= -1 + } + this.DelaySeconds = &v17 + } + if r.Intn(10) != 0 { + v18 := float64(r.Float64()) + if r.Intn(2) == 0 { + v18 *= -1 + } + this.IntervalSeconds = &v18 + } + if r.Intn(10) != 0 { + v19 := float64(r.Float64()) + if r.Intn(2) == 0 { + v19 *= -1 + } + this.TimeoutSeconds = &v19 + } + if r.Intn(10) != 0 { + v20 := uint32(r.Uint32()) + this.ConsecutiveFailures = &v20 + } + if r.Intn(10) != 0 { + v21 := float64(r.Float64()) + if r.Intn(2) == 0 { + v21 *= -1 + } + this.GracePeriodSeconds = &v21 + } + if r.Intn(10) != 0 { + this.Command = NewPopulatedCommandInfo(r, easy) + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 8) + } + return this +} + +func NewPopulatedHealthCheck_HTTP(r randyMesos, easy bool) *HealthCheck_HTTP { + this := &HealthCheck_HTTP{} + v22 := uint32(r.Uint32()) + this.Port = &v22 + if r.Intn(10) != 0 { + v23 := randStringMesos(r) + this.Path = &v23 + } + if r.Intn(10) != 0 { + v24 := r.Intn(100) + this.Statuses = make([]uint32, v24) + for i := 0; i < v24; i++ { + this.Statuses[i] = uint32(r.Uint32()) + } + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 5) + } + return this +} + +func NewPopulatedCommandInfo(r randyMesos, easy bool) *CommandInfo { + this := &CommandInfo{} + if r.Intn(10) != 0 { + v25 := r.Intn(10) + this.Uris = make([]*CommandInfo_URI, v25) + for i := 0; i < v25; i++ { + this.Uris[i] = NewPopulatedCommandInfo_URI(r, easy) + } + } + if r.Intn(10) != 0 { + this.Environment = NewPopulatedEnvironment(r, easy) } - if m.Timestamp != nil { - data[i] = 0x31 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.Timestamp))) + if r.Intn(10) != 0 { + v26 := randStringMesos(r) + this.Value = &v26 } - if m.Healthy != nil { - data[i] = 0x40 - i++ - if *m.Healthy { - data[i] = 1 - } else { - data[i] = 0 + if r.Intn(10) != 0 { + this.Container = NewPopulatedCommandInfo_ContainerInfo(r, easy) + } + if r.Intn(10) != 0 { + v27 := randStringMesos(r) + this.User = &v27 + } + if r.Intn(10) != 0 { + v28 := bool(bool(r.Intn(2) == 0)) + this.Shell = &v28 + } + if r.Intn(10) != 0 { + v29 := r.Intn(10) + this.Arguments = make([]string, v29) + for i := 0; i < v29; i++ { + this.Arguments[i] = randStringMesos(r) } - i++ } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 8) } - return i, nil + return this } -func (m *Filters) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err +func NewPopulatedCommandInfo_URI(r randyMesos, easy bool) *CommandInfo_URI { + this := &CommandInfo_URI{} + v30 := randStringMesos(r) + this.Value = &v30 + if r.Intn(10) != 0 { + v31 := bool(bool(r.Intn(2) == 0)) + this.Executable = &v31 } - return data[:n], nil -} - -func (m *Filters) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.RefuseSeconds != nil { - data[i] = 0x9 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.RefuseSeconds))) + if r.Intn(10) != 0 { + v32 := bool(bool(r.Intn(2) == 0)) + this.Extract = &v32 } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if r.Intn(10) != 0 { + v33 := bool(bool(r.Intn(2) == 0)) + this.Cache = &v33 } - return i, nil -} - -func (m *Environment) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 5) } - return data[:n], nil + return this } -func (m *Environment) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if len(m.Variables) > 0 { - for _, msg := range m.Variables { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n +func NewPopulatedCommandInfo_ContainerInfo(r randyMesos, easy bool) *CommandInfo_ContainerInfo { + this := &CommandInfo_ContainerInfo{} + v34 := randStringMesos(r) + this.Image = &v34 + if r.Intn(10) != 0 { + v35 := r.Intn(10) + this.Options = make([]string, v35) + for i := 0; i < v35; i++ { + this.Options[i] = randStringMesos(r) } } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 3) } - return i, nil + return this } -func (m *Environment_Variable) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err +func NewPopulatedExecutorInfo(r randyMesos, easy bool) *ExecutorInfo { + this := &ExecutorInfo{} + this.ExecutorId = NewPopulatedExecutorID(r, easy) + if r.Intn(10) != 0 { + v36 := r.Intn(100) + this.Data = make([]byte, v36) + for i := 0; i < v36; i++ { + this.Data[i] = byte(r.Intn(256)) + } } - return data[:n], nil -} - -func (m *Environment_Variable) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Name != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) + if r.Intn(10) != 0 { + v37 := r.Intn(10) + this.Resources = make([]*Resource, v37) + for i := 0; i < v37; i++ { + this.Resources[i] = NewPopulatedResource(r, easy) + } } - if m.Value != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) + this.Command = NewPopulatedCommandInfo(r, easy) + if r.Intn(10) != 0 { + this.FrameworkId = NewPopulatedFrameworkID(r, easy) } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if r.Intn(10) != 0 { + v38 := randStringMesos(r) + this.Name = &v38 } - return i, nil -} - -func (m *Parameter) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err + if r.Intn(10) != 0 { + v39 := randStringMesos(r) + this.Source = &v39 } - return data[:n], nil -} - -func (m *Parameter) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Key != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Key))) - i += copy(data[i:], *m.Key) + if r.Intn(10) != 0 { + this.Container = NewPopulatedContainerInfo(r, easy) } - if m.Value != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) + if r.Intn(10) != 0 { + this.Discovery = NewPopulatedDiscoveryInfo(r, easy) } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 13) } - return i, nil + return this } -func (m *Parameters) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err +func NewPopulatedMasterInfo(r randyMesos, easy bool) *MasterInfo { + this := &MasterInfo{} + v40 := randStringMesos(r) + this.Id = &v40 + v41 := uint32(r.Uint32()) + this.Ip = &v41 + v42 := uint32(r.Uint32()) + this.Port = &v42 + if r.Intn(10) != 0 { + v43 := randStringMesos(r) + this.Pid = &v43 } - return data[:n], nil + if r.Intn(10) != 0 { + v44 := randStringMesos(r) + this.Hostname = &v44 + } + if r.Intn(10) != 0 { + v45 := randStringMesos(r) + this.Version = &v45 + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 7) + } + return this } -func (m *Parameters) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if len(m.Parameter) > 0 { - for _, msg := range m.Parameter { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n +func NewPopulatedSlaveInfo(r randyMesos, easy bool) *SlaveInfo { + this := &SlaveInfo{} + v46 := randStringMesos(r) + this.Hostname = &v46 + if r.Intn(10) != 0 { + v47 := r.Intn(10) + this.Resources = make([]*Resource, v47) + for i := 0; i < v47; i++ { + this.Resources[i] = NewPopulatedResource(r, easy) } } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if r.Intn(10) != 0 { + v48 := r.Intn(10) + this.Attributes = make([]*Attribute, v48) + for i := 0; i < v48; i++ { + this.Attributes[i] = NewPopulatedAttribute(r, easy) + } } - return i, nil -} - -func (m *Credential) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err + if r.Intn(10) != 0 { + this.Id = NewPopulatedSlaveID(r, easy) } - return data[:n], nil + if r.Intn(10) != 0 { + v49 := bool(bool(r.Intn(2) == 0)) + this.Checkpoint = &v49 + } + if r.Intn(10) != 0 { + v50 := int32(r.Int31()) + if r.Intn(2) == 0 { + v50 *= -1 + } + this.Port = &v50 + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 9) + } + return this } -func (m *Credential) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Principal != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Principal))) - i += copy(data[i:], *m.Principal) +func NewPopulatedValue(r randyMesos, easy bool) *Value { + this := &Value{} + v51 := Value_Type([]int32{0, 1, 2, 3}[r.Intn(4)]) + this.Type = &v51 + if r.Intn(10) != 0 { + this.Scalar = NewPopulatedValue_Scalar(r, easy) } - if m.Secret != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(len(m.Secret))) - i += copy(data[i:], m.Secret) + if r.Intn(10) != 0 { + this.Ranges = NewPopulatedValue_Ranges(r, easy) + } + if r.Intn(10) != 0 { + this.Set = NewPopulatedValue_Set(r, easy) + } + if r.Intn(10) != 0 { + this.Text = NewPopulatedValue_Text(r, easy) + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 6) } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + return this +} + +func NewPopulatedValue_Scalar(r randyMesos, easy bool) *Value_Scalar { + this := &Value_Scalar{} + v52 := float64(r.Float64()) + if r.Intn(2) == 0 { + v52 *= -1 } - return i, nil + this.Value = &v52 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + } + return this } -func (m *Credentials) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err +func NewPopulatedValue_Range(r randyMesos, easy bool) *Value_Range { + this := &Value_Range{} + v53 := uint64(uint64(r.Uint32())) + this.Begin = &v53 + v54 := uint64(uint64(r.Uint32())) + this.End = &v54 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 3) } - return data[:n], nil + return this } -func (m *Credentials) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if len(m.Credentials) > 0 { - for _, msg := range m.Credentials { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n +func NewPopulatedValue_Ranges(r randyMesos, easy bool) *Value_Ranges { + this := &Value_Ranges{} + if r.Intn(10) != 0 { + v55 := r.Intn(10) + this.Range = make([]*Value_Range, v55) + for i := 0; i < v55; i++ { + this.Range[i] = NewPopulatedValue_Range(r, easy) } } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) } - return i, nil + return this } -func (m *ACL) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err +func NewPopulatedValue_Set(r randyMesos, easy bool) *Value_Set { + this := &Value_Set{} + if r.Intn(10) != 0 { + v56 := r.Intn(10) + this.Item = make([]string, v56) + for i := 0; i < v56; i++ { + this.Item[i] = randStringMesos(r) + } } - return data[:n], nil -} - -func (m *ACL) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) } - return i, nil + return this } -func (m *ACL_Entity) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err +func NewPopulatedValue_Text(r randyMesos, easy bool) *Value_Text { + this := &Value_Text{} + v57 := randStringMesos(r) + this.Value = &v57 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) } - return data[:n], nil + return this } -func (m *ACL_Entity) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Type != nil { - data[i] = 0x8 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Type)) +func NewPopulatedAttribute(r randyMesos, easy bool) *Attribute { + this := &Attribute{} + v58 := randStringMesos(r) + this.Name = &v58 + v59 := Value_Type([]int32{0, 1, 2, 3}[r.Intn(4)]) + this.Type = &v59 + if r.Intn(10) != 0 { + this.Scalar = NewPopulatedValue_Scalar(r, easy) } - if len(m.Values) > 0 { - for _, s := range m.Values { - data[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - data[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - data[i] = uint8(l) - i++ - i += copy(data[i:], s) - } + if r.Intn(10) != 0 { + this.Ranges = NewPopulatedValue_Ranges(r, easy) } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if r.Intn(10) != 0 { + this.Text = NewPopulatedValue_Text(r, easy) } - return i, nil -} - -func (m *ACL_RegisterFramework) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err + if r.Intn(10) != 0 { + this.Set = NewPopulatedValue_Set(r, easy) } - return data[:n], nil + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 7) + } + return this } -func (m *ACL_RegisterFramework) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Principals != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(m.Principals.Size())) - n41, err := m.Principals.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n41 +func NewPopulatedResource(r randyMesos, easy bool) *Resource { + this := &Resource{} + v60 := randStringMesos(r) + this.Name = &v60 + v61 := Value_Type([]int32{0, 1, 2, 3}[r.Intn(4)]) + this.Type = &v61 + if r.Intn(10) != 0 { + this.Scalar = NewPopulatedValue_Scalar(r, easy) } - if m.Roles != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(m.Roles.Size())) - n42, err := m.Roles.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n42 + if r.Intn(10) != 0 { + this.Ranges = NewPopulatedValue_Ranges(r, easy) } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if r.Intn(10) != 0 { + this.Set = NewPopulatedValue_Set(r, easy) } - return i, nil + if r.Intn(10) != 0 { + v62 := randStringMesos(r) + this.Role = &v62 + } + if r.Intn(10) != 0 { + this.Disk = NewPopulatedResource_DiskInfo(r, easy) + } + if r.Intn(10) != 0 { + this.Reservation = NewPopulatedResource_ReservationInfo(r, easy) + } + if r.Intn(10) != 0 { + this.Revocable = NewPopulatedResource_RevocableInfo(r, easy) + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 10) + } + return this } -func (m *ACL_RunTask) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err +func NewPopulatedResource_ReservationInfo(r randyMesos, easy bool) *Resource_ReservationInfo { + this := &Resource_ReservationInfo{} + v63 := randStringMesos(r) + this.Principal = &v63 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) } - return data[:n], nil + return this } -func (m *ACL_RunTask) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Principals != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(m.Principals.Size())) - n43, err := m.Principals.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n43 +func NewPopulatedResource_DiskInfo(r randyMesos, easy bool) *Resource_DiskInfo { + this := &Resource_DiskInfo{} + if r.Intn(10) != 0 { + this.Persistence = NewPopulatedResource_DiskInfo_Persistence(r, easy) } - if m.Users != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(m.Users.Size())) - n44, err := m.Users.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n44 + if r.Intn(10) != 0 { + this.Volume = NewPopulatedVolume(r, easy) } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 3) } - return i, nil + return this } -func (m *ACL_ShutdownFramework) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err +func NewPopulatedResource_DiskInfo_Persistence(r randyMesos, easy bool) *Resource_DiskInfo_Persistence { + this := &Resource_DiskInfo_Persistence{} + v64 := randStringMesos(r) + this.Id = &v64 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) } - return data[:n], nil + return this } -func (m *ACL_ShutdownFramework) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Principals != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(m.Principals.Size())) - n45, err := m.Principals.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n45 +func NewPopulatedResource_RevocableInfo(r randyMesos, easy bool) *Resource_RevocableInfo { + this := &Resource_RevocableInfo{} + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 1) + } + return this +} + +func NewPopulatedTrafficControlStatistics(r randyMesos, easy bool) *TrafficControlStatistics { + this := &TrafficControlStatistics{} + v65 := randStringMesos(r) + this.Id = &v65 + if r.Intn(10) != 0 { + v66 := uint64(uint64(r.Uint32())) + this.Backlog = &v66 + } + if r.Intn(10) != 0 { + v67 := uint64(uint64(r.Uint32())) + this.Bytes = &v67 + } + if r.Intn(10) != 0 { + v68 := uint64(uint64(r.Uint32())) + this.Drops = &v68 + } + if r.Intn(10) != 0 { + v69 := uint64(uint64(r.Uint32())) + this.Overlimits = &v69 + } + if r.Intn(10) != 0 { + v70 := uint64(uint64(r.Uint32())) + this.Packets = &v70 + } + if r.Intn(10) != 0 { + v71 := uint64(uint64(r.Uint32())) + this.Qlen = &v71 + } + if r.Intn(10) != 0 { + v72 := uint64(uint64(r.Uint32())) + this.Ratebps = &v72 } - if m.FrameworkPrincipals != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(m.FrameworkPrincipals.Size())) - n46, err := m.FrameworkPrincipals.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n46 + if r.Intn(10) != 0 { + v73 := uint64(uint64(r.Uint32())) + this.Ratepps = &v73 } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if r.Intn(10) != 0 { + v74 := uint64(uint64(r.Uint32())) + this.Requeues = &v74 } - return i, nil -} - -func (m *ACLs) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 11) } - return data[:n], nil + return this } -func (m *ACLs) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Permissive != nil { - data[i] = 0x8 - i++ - if *m.Permissive { - data[i] = 1 - } else { - data[i] = 0 +func NewPopulatedResourceStatistics(r randyMesos, easy bool) *ResourceStatistics { + this := &ResourceStatistics{} + v75 := float64(r.Float64()) + if r.Intn(2) == 0 { + v75 *= -1 + } + this.Timestamp = &v75 + if r.Intn(10) != 0 { + v76 := float64(r.Float64()) + if r.Intn(2) == 0 { + v76 *= -1 } - i++ + this.CpusUserTimeSecs = &v76 } - if len(m.RegisterFrameworks) > 0 { - for _, msg := range m.RegisterFrameworks { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n + if r.Intn(10) != 0 { + v77 := float64(r.Float64()) + if r.Intn(2) == 0 { + v77 *= -1 } + this.CpusSystemTimeSecs = &v77 } - if len(m.RunTasks) > 0 { - for _, msg := range m.RunTasks { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n + if r.Intn(10) != 0 { + v78 := float64(r.Float64()) + if r.Intn(2) == 0 { + v78 *= -1 } + this.CpusLimit = &v78 } - if len(m.ShutdownFrameworks) > 0 { - for _, msg := range m.ShutdownFrameworks { - data[i] = 0x22 - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n + if r.Intn(10) != 0 { + v79 := uint64(uint64(r.Uint32())) + this.MemRssBytes = &v79 + } + if r.Intn(10) != 0 { + v80 := uint64(uint64(r.Uint32())) + this.MemLimitBytes = &v80 + } + if r.Intn(10) != 0 { + v81 := uint32(r.Uint32()) + this.CpusNrPeriods = &v81 + } + if r.Intn(10) != 0 { + v82 := uint32(r.Uint32()) + this.CpusNrThrottled = &v82 + } + if r.Intn(10) != 0 { + v83 := float64(r.Float64()) + if r.Intn(2) == 0 { + v83 *= -1 } + this.CpusThrottledTimeSecs = &v83 } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if r.Intn(10) != 0 { + v84 := uint64(uint64(r.Uint32())) + this.MemFileBytes = &v84 } - return i, nil -} - -func (m *RateLimit) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err + if r.Intn(10) != 0 { + v85 := uint64(uint64(r.Uint32())) + this.MemAnonBytes = &v85 } - return data[:n], nil -} - -func (m *RateLimit) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Qps != nil { - data[i] = 0x9 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.Qps))) + if r.Intn(10) != 0 { + v86 := uint64(uint64(r.Uint32())) + this.MemMappedFileBytes = &v86 } - if m.Principal != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Principal))) - i += copy(data[i:], *m.Principal) + if r.Intn(10) != 0 { + this.Perf = NewPopulatedPerfStatistics(r, easy) } - if m.Capacity != nil { - data[i] = 0x18 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Capacity)) + if r.Intn(10) != 0 { + v87 := uint64(uint64(r.Uint32())) + this.NetRxPackets = &v87 } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if r.Intn(10) != 0 { + v88 := uint64(uint64(r.Uint32())) + this.NetRxBytes = &v88 } - return i, nil -} - -func (m *RateLimits) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err + if r.Intn(10) != 0 { + v89 := uint64(uint64(r.Uint32())) + this.NetRxErrors = &v89 } - return data[:n], nil -} - -func (m *RateLimits) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if len(m.Limits) > 0 { - for _, msg := range m.Limits { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } + if r.Intn(10) != 0 { + v90 := uint64(uint64(r.Uint32())) + this.NetRxDropped = &v90 } - if m.AggregateDefaultQps != nil { - data[i] = 0x11 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.AggregateDefaultQps))) + if r.Intn(10) != 0 { + v91 := uint64(uint64(r.Uint32())) + this.NetTxPackets = &v91 } - if m.AggregateDefaultCapacity != nil { - data[i] = 0x18 - i++ - i = encodeVarintMesos(data, i, uint64(*m.AggregateDefaultCapacity)) + if r.Intn(10) != 0 { + v92 := uint64(uint64(r.Uint32())) + this.NetTxBytes = &v92 } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if r.Intn(10) != 0 { + v93 := uint64(uint64(r.Uint32())) + this.NetTxErrors = &v93 } - return i, nil -} - -func (m *Volume) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err + if r.Intn(10) != 0 { + v94 := uint64(uint64(r.Uint32())) + this.NetTxDropped = &v94 } - return data[:n], nil -} - -func (m *Volume) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.ContainerPath != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.ContainerPath))) - i += copy(data[i:], *m.ContainerPath) + if r.Intn(10) != 0 { + v95 := float64(r.Float64()) + if r.Intn(2) == 0 { + v95 *= -1 + } + this.NetTcpRttMicrosecsP50 = &v95 } - if m.HostPath != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.HostPath))) - i += copy(data[i:], *m.HostPath) + if r.Intn(10) != 0 { + v96 := float64(r.Float64()) + if r.Intn(2) == 0 { + v96 *= -1 + } + this.NetTcpRttMicrosecsP90 = &v96 } - if m.Mode != nil { - data[i] = 0x18 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Mode)) + if r.Intn(10) != 0 { + v97 := float64(r.Float64()) + if r.Intn(2) == 0 { + v97 *= -1 + } + this.NetTcpRttMicrosecsP95 = &v97 } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if r.Intn(10) != 0 { + v98 := float64(r.Float64()) + if r.Intn(2) == 0 { + v98 *= -1 + } + this.NetTcpRttMicrosecsP99 = &v98 } - return i, nil -} - -func (m *ContainerInfo) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err + if r.Intn(10) != 0 { + v99 := uint64(uint64(r.Uint32())) + this.DiskLimitBytes = &v99 } - return data[:n], nil -} - -func (m *ContainerInfo) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Type != nil { - data[i] = 0x8 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Type)) + if r.Intn(10) != 0 { + v100 := uint64(uint64(r.Uint32())) + this.DiskUsedBytes = &v100 } - if len(m.Volumes) > 0 { - for _, msg := range m.Volumes { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n + if r.Intn(10) != 0 { + v101 := float64(r.Float64()) + if r.Intn(2) == 0 { + v101 *= -1 } + this.NetTcpActiveConnections = &v101 + } + if r.Intn(10) != 0 { + v102 := float64(r.Float64()) + if r.Intn(2) == 0 { + v102 *= -1 + } + this.NetTcpTimeWaitConnections = &v102 + } + if r.Intn(10) != 0 { + v103 := uint32(r.Uint32()) + this.Processes = &v103 + } + if r.Intn(10) != 0 { + v104 := uint32(r.Uint32()) + this.Threads = &v104 } - if m.Hostname != nil { - data[i] = 0x22 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Hostname))) - i += copy(data[i:], *m.Hostname) + if r.Intn(10) != 0 { + v105 := uint64(uint64(r.Uint32())) + this.MemLowPressureCounter = &v105 } - if m.Docker != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(m.Docker.Size())) - n47, err := m.Docker.MarshalTo(data[i:]) - if err != nil { - return 0, err + if r.Intn(10) != 0 { + v106 := uint64(uint64(r.Uint32())) + this.MemMediumPressureCounter = &v106 + } + if r.Intn(10) != 0 { + v107 := uint64(uint64(r.Uint32())) + this.MemCriticalPressureCounter = &v107 + } + if r.Intn(10) != 0 { + v108 := r.Intn(10) + this.NetTrafficControlStatistics = make([]*TrafficControlStatistics, v108) + for i := 0; i < v108; i++ { + this.NetTrafficControlStatistics[i] = NewPopulatedTrafficControlStatistics(r, easy) } - i += n47 } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if r.Intn(10) != 0 { + v109 := uint64(uint64(r.Uint32())) + this.MemTotalBytes = &v109 } - return i, nil -} - -func (m *ContainerInfo_DockerInfo) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err + if r.Intn(10) != 0 { + v110 := uint64(uint64(r.Uint32())) + this.MemTotalMemswBytes = &v110 } - return data[:n], nil -} - -func (m *ContainerInfo_DockerInfo) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Image != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Image))) - i += copy(data[i:], *m.Image) + if r.Intn(10) != 0 { + v111 := uint64(uint64(r.Uint32())) + this.MemSoftLimitBytes = &v111 } - if m.Network != nil { - data[i] = 0x10 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Network)) + if r.Intn(10) != 0 { + v112 := uint64(uint64(r.Uint32())) + this.MemCacheBytes = &v112 } - if len(m.PortMappings) > 0 { - for _, msg := range m.PortMappings { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } + if r.Intn(10) != 0 { + v113 := uint64(uint64(r.Uint32())) + this.MemSwapBytes = &v113 } - if m.Privileged != nil { - data[i] = 0x20 - i++ - if *m.Privileged { - data[i] = 1 - } else { - data[i] = 0 - } - i++ + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 41) } - if len(m.Parameters) > 0 { - for _, msg := range m.Parameters { - data[i] = 0x2a - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n + return this +} + +func NewPopulatedResourceUsage(r randyMesos, easy bool) *ResourceUsage { + this := &ResourceUsage{} + if r.Intn(10) != 0 { + v114 := r.Intn(10) + this.Executors = make([]*ResourceUsage_Executor, v114) + for i := 0; i < v114; i++ { + this.Executors[i] = NewPopulatedResourceUsage_Executor(r, easy) } } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) } - return i, nil + return this } -func (m *ContainerInfo_DockerInfo_PortMapping) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err +func NewPopulatedResourceUsage_Executor(r randyMesos, easy bool) *ResourceUsage_Executor { + this := &ResourceUsage_Executor{} + this.ExecutorInfo = NewPopulatedExecutorInfo(r, easy) + if r.Intn(10) != 0 { + v115 := r.Intn(10) + this.Allocated = make([]*Resource, v115) + for i := 0; i < v115; i++ { + this.Allocated[i] = NewPopulatedResource(r, easy) + } } - return data[:n], nil + if r.Intn(10) != 0 { + this.Statistics = NewPopulatedResourceStatistics(r, easy) + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 4) + } + return this } -func (m *ContainerInfo_DockerInfo_PortMapping) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.HostPort != nil { - data[i] = 0x8 - i++ - i = encodeVarintMesos(data, i, uint64(*m.HostPort)) +func NewPopulatedPerfStatistics(r randyMesos, easy bool) *PerfStatistics { + this := &PerfStatistics{} + v116 := float64(r.Float64()) + if r.Intn(2) == 0 { + v116 *= -1 } - if m.ContainerPort != nil { - data[i] = 0x10 - i++ - i = encodeVarintMesos(data, i, uint64(*m.ContainerPort)) + this.Timestamp = &v116 + v117 := float64(r.Float64()) + if r.Intn(2) == 0 { + v117 *= -1 } - if m.Protocol != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Protocol))) - i += copy(data[i:], *m.Protocol) + this.Duration = &v117 + if r.Intn(10) != 0 { + v118 := uint64(uint64(r.Uint32())) + this.Cycles = &v118 } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if r.Intn(10) != 0 { + v119 := uint64(uint64(r.Uint32())) + this.StalledCyclesFrontend = &v119 } - return i, nil -} - -func encodeFixed64Mesos(data []byte, offset int, v uint64) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - data[offset+4] = uint8(v >> 32) - data[offset+5] = uint8(v >> 40) - data[offset+6] = uint8(v >> 48) - data[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32Mesos(data []byte, offset int, v uint32) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - return offset + 4 -} -func encodeVarintMesos(data []byte, offset int, v uint64) int { - for v >= 1<<7 { - data[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ + if r.Intn(10) != 0 { + v120 := uint64(uint64(r.Uint32())) + this.StalledCyclesBackend = &v120 } - data[offset] = uint8(v) - return offset + 1 -} -func (this *FrameworkID) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v121 := uint64(uint64(r.Uint32())) + this.Instructions = &v121 } - s := strings1.Join([]string{`&mesosproto.FrameworkID{` + - `Value:` + valueToGoStringMesos(this.Value, "string"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *OfferID) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v122 := uint64(uint64(r.Uint32())) + this.CacheReferences = &v122 } - s := strings1.Join([]string{`&mesosproto.OfferID{` + - `Value:` + valueToGoStringMesos(this.Value, "string"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *SlaveID) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v123 := uint64(uint64(r.Uint32())) + this.CacheMisses = &v123 } - s := strings1.Join([]string{`&mesosproto.SlaveID{` + - `Value:` + valueToGoStringMesos(this.Value, "string"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *TaskID) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v124 := uint64(uint64(r.Uint32())) + this.Branches = &v124 } - s := strings1.Join([]string{`&mesosproto.TaskID{` + - `Value:` + valueToGoStringMesos(this.Value, "string"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *ExecutorID) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v125 := uint64(uint64(r.Uint32())) + this.BranchMisses = &v125 } - s := strings1.Join([]string{`&mesosproto.ExecutorID{` + - `Value:` + valueToGoStringMesos(this.Value, "string"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *ContainerID) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v126 := uint64(uint64(r.Uint32())) + this.BusCycles = &v126 } - s := strings1.Join([]string{`&mesosproto.ContainerID{` + - `Value:` + valueToGoStringMesos(this.Value, "string"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *FrameworkInfo) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v127 := uint64(uint64(r.Uint32())) + this.RefCycles = &v127 } - s := strings1.Join([]string{`&mesosproto.FrameworkInfo{` + - `User:` + valueToGoStringMesos(this.User, "string"), - `Name:` + valueToGoStringMesos(this.Name, "string"), - `Id:` + fmt2.Sprintf("%#v", this.Id), - `FailoverTimeout:` + valueToGoStringMesos(this.FailoverTimeout, "float64"), - `Checkpoint:` + valueToGoStringMesos(this.Checkpoint, "bool"), - `Role:` + valueToGoStringMesos(this.Role, "string"), - `Hostname:` + valueToGoStringMesos(this.Hostname, "string"), - `Principal:` + valueToGoStringMesos(this.Principal, "string"), - `WebuiUrl:` + valueToGoStringMesos(this.WebuiUrl, "string"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *HealthCheck) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v128 := float64(r.Float64()) + if r.Intn(2) == 0 { + v128 *= -1 + } + this.CpuClock = &v128 } - s := strings1.Join([]string{`&mesosproto.HealthCheck{` + - `Http:` + fmt2.Sprintf("%#v", this.Http), - `DelaySeconds:` + valueToGoStringMesos(this.DelaySeconds, "float64"), - `IntervalSeconds:` + valueToGoStringMesos(this.IntervalSeconds, "float64"), - `TimeoutSeconds:` + valueToGoStringMesos(this.TimeoutSeconds, "float64"), - `ConsecutiveFailures:` + valueToGoStringMesos(this.ConsecutiveFailures, "uint32"), - `GracePeriodSeconds:` + valueToGoStringMesos(this.GracePeriodSeconds, "float64"), - `Command:` + fmt2.Sprintf("%#v", this.Command), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *HealthCheck_HTTP) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v129 := float64(r.Float64()) + if r.Intn(2) == 0 { + v129 *= -1 + } + this.TaskClock = &v129 } - s := strings1.Join([]string{`&mesosproto.HealthCheck_HTTP{` + - `Port:` + valueToGoStringMesos(this.Port, "uint32"), - `Path:` + valueToGoStringMesos(this.Path, "string"), - `Statuses:` + fmt2.Sprintf("%#v", this.Statuses), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *CommandInfo) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v130 := uint64(uint64(r.Uint32())) + this.PageFaults = &v130 } - s := strings1.Join([]string{`&mesosproto.CommandInfo{` + - `Container:` + fmt2.Sprintf("%#v", this.Container), - `Uris:` + fmt2.Sprintf("%#v", this.Uris), - `Environment:` + fmt2.Sprintf("%#v", this.Environment), - `Shell:` + valueToGoStringMesos(this.Shell, "bool"), - `Value:` + valueToGoStringMesos(this.Value, "string"), - `Arguments:` + fmt2.Sprintf("%#v", this.Arguments), - `User:` + valueToGoStringMesos(this.User, "string"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *CommandInfo_URI) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v131 := uint64(uint64(r.Uint32())) + this.MinorFaults = &v131 } - s := strings1.Join([]string{`&mesosproto.CommandInfo_URI{` + - `Value:` + valueToGoStringMesos(this.Value, "string"), - `Executable:` + valueToGoStringMesos(this.Executable, "bool"), - `Extract:` + valueToGoStringMesos(this.Extract, "bool"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *CommandInfo_ContainerInfo) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v132 := uint64(uint64(r.Uint32())) + this.MajorFaults = &v132 + } + if r.Intn(10) != 0 { + v133 := uint64(uint64(r.Uint32())) + this.ContextSwitches = &v133 + } + if r.Intn(10) != 0 { + v134 := uint64(uint64(r.Uint32())) + this.CpuMigrations = &v134 + } + if r.Intn(10) != 0 { + v135 := uint64(uint64(r.Uint32())) + this.AlignmentFaults = &v135 + } + if r.Intn(10) != 0 { + v136 := uint64(uint64(r.Uint32())) + this.EmulationFaults = &v136 + } + if r.Intn(10) != 0 { + v137 := uint64(uint64(r.Uint32())) + this.L1DcacheLoads = &v137 + } + if r.Intn(10) != 0 { + v138 := uint64(uint64(r.Uint32())) + this.L1DcacheLoadMisses = &v138 + } + if r.Intn(10) != 0 { + v139 := uint64(uint64(r.Uint32())) + this.L1DcacheStores = &v139 + } + if r.Intn(10) != 0 { + v140 := uint64(uint64(r.Uint32())) + this.L1DcacheStoreMisses = &v140 + } + if r.Intn(10) != 0 { + v141 := uint64(uint64(r.Uint32())) + this.L1DcachePrefetches = &v141 } - s := strings1.Join([]string{`&mesosproto.CommandInfo_ContainerInfo{` + - `Image:` + valueToGoStringMesos(this.Image, "string"), - `Options:` + fmt2.Sprintf("%#v", this.Options), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *ExecutorInfo) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v142 := uint64(uint64(r.Uint32())) + this.L1DcachePrefetchMisses = &v142 } - s := strings1.Join([]string{`&mesosproto.ExecutorInfo{` + - `ExecutorId:` + fmt2.Sprintf("%#v", this.ExecutorId), - `FrameworkId:` + fmt2.Sprintf("%#v", this.FrameworkId), - `Command:` + fmt2.Sprintf("%#v", this.Command), - `Container:` + fmt2.Sprintf("%#v", this.Container), - `Resources:` + fmt2.Sprintf("%#v", this.Resources), - `Name:` + valueToGoStringMesos(this.Name, "string"), - `Source:` + valueToGoStringMesos(this.Source, "string"), - `Data:` + valueToGoStringMesos(this.Data, "byte"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *MasterInfo) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v143 := uint64(uint64(r.Uint32())) + this.L1IcacheLoads = &v143 } - s := strings1.Join([]string{`&mesosproto.MasterInfo{` + - `Id:` + valueToGoStringMesos(this.Id, "string"), - `Ip:` + valueToGoStringMesos(this.Ip, "uint32"), - `Port:` + valueToGoStringMesos(this.Port, "uint32"), - `Pid:` + valueToGoStringMesos(this.Pid, "string"), - `Hostname:` + valueToGoStringMesos(this.Hostname, "string"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *SlaveInfo) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v144 := uint64(uint64(r.Uint32())) + this.L1IcacheLoadMisses = &v144 } - s := strings1.Join([]string{`&mesosproto.SlaveInfo{` + - `Hostname:` + valueToGoStringMesos(this.Hostname, "string"), - `Port:` + valueToGoStringMesos(this.Port, "int32"), - `Resources:` + fmt2.Sprintf("%#v", this.Resources), - `Attributes:` + fmt2.Sprintf("%#v", this.Attributes), - `Id:` + fmt2.Sprintf("%#v", this.Id), - `Checkpoint:` + valueToGoStringMesos(this.Checkpoint, "bool"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Value) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v145 := uint64(uint64(r.Uint32())) + this.L1IcachePrefetches = &v145 } - s := strings1.Join([]string{`&mesosproto.Value{` + - `Type:` + valueToGoStringMesos(this.Type, "mesosproto.Value_Type"), - `Scalar:` + fmt2.Sprintf("%#v", this.Scalar), - `Ranges:` + fmt2.Sprintf("%#v", this.Ranges), - `Set:` + fmt2.Sprintf("%#v", this.Set), - `Text:` + fmt2.Sprintf("%#v", this.Text), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Value_Scalar) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v146 := uint64(uint64(r.Uint32())) + this.L1IcachePrefetchMisses = &v146 } - s := strings1.Join([]string{`&mesosproto.Value_Scalar{` + - `Value:` + valueToGoStringMesos(this.Value, "float64"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Value_Range) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v147 := uint64(uint64(r.Uint32())) + this.LlcLoads = &v147 } - s := strings1.Join([]string{`&mesosproto.Value_Range{` + - `Begin:` + valueToGoStringMesos(this.Begin, "uint64"), - `End:` + valueToGoStringMesos(this.End, "uint64"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Value_Ranges) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v148 := uint64(uint64(r.Uint32())) + this.LlcLoadMisses = &v148 } - s := strings1.Join([]string{`&mesosproto.Value_Ranges{` + - `Range:` + fmt2.Sprintf("%#v", this.Range), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Value_Set) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v149 := uint64(uint64(r.Uint32())) + this.LlcStores = &v149 } - s := strings1.Join([]string{`&mesosproto.Value_Set{` + - `Item:` + fmt2.Sprintf("%#v", this.Item), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Value_Text) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v150 := uint64(uint64(r.Uint32())) + this.LlcStoreMisses = &v150 } - s := strings1.Join([]string{`&mesosproto.Value_Text{` + - `Value:` + valueToGoStringMesos(this.Value, "string"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Attribute) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v151 := uint64(uint64(r.Uint32())) + this.LlcPrefetches = &v151 } - s := strings1.Join([]string{`&mesosproto.Attribute{` + - `Name:` + valueToGoStringMesos(this.Name, "string"), - `Type:` + valueToGoStringMesos(this.Type, "mesosproto.Value_Type"), - `Scalar:` + fmt2.Sprintf("%#v", this.Scalar), - `Ranges:` + fmt2.Sprintf("%#v", this.Ranges), - `Set:` + fmt2.Sprintf("%#v", this.Set), - `Text:` + fmt2.Sprintf("%#v", this.Text), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Resource) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v152 := uint64(uint64(r.Uint32())) + this.LlcPrefetchMisses = &v152 } - s := strings1.Join([]string{`&mesosproto.Resource{` + - `Name:` + valueToGoStringMesos(this.Name, "string"), - `Type:` + valueToGoStringMesos(this.Type, "mesosproto.Value_Type"), - `Scalar:` + fmt2.Sprintf("%#v", this.Scalar), - `Ranges:` + fmt2.Sprintf("%#v", this.Ranges), - `Set:` + fmt2.Sprintf("%#v", this.Set), - `Role:` + valueToGoStringMesos(this.Role, "string"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *ResourceStatistics) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v153 := uint64(uint64(r.Uint32())) + this.DtlbLoads = &v153 } - s := strings1.Join([]string{`&mesosproto.ResourceStatistics{` + - `Timestamp:` + valueToGoStringMesos(this.Timestamp, "float64"), - `CpusUserTimeSecs:` + valueToGoStringMesos(this.CpusUserTimeSecs, "float64"), - `CpusSystemTimeSecs:` + valueToGoStringMesos(this.CpusSystemTimeSecs, "float64"), - `CpusLimit:` + valueToGoStringMesos(this.CpusLimit, "float64"), - `CpusNrPeriods:` + valueToGoStringMesos(this.CpusNrPeriods, "uint32"), - `CpusNrThrottled:` + valueToGoStringMesos(this.CpusNrThrottled, "uint32"), - `CpusThrottledTimeSecs:` + valueToGoStringMesos(this.CpusThrottledTimeSecs, "float64"), - `MemRssBytes:` + valueToGoStringMesos(this.MemRssBytes, "uint64"), - `MemLimitBytes:` + valueToGoStringMesos(this.MemLimitBytes, "uint64"), - `MemFileBytes:` + valueToGoStringMesos(this.MemFileBytes, "uint64"), - `MemAnonBytes:` + valueToGoStringMesos(this.MemAnonBytes, "uint64"), - `MemMappedFileBytes:` + valueToGoStringMesos(this.MemMappedFileBytes, "uint64"), - `Perf:` + fmt2.Sprintf("%#v", this.Perf), - `NetRxPackets:` + valueToGoStringMesos(this.NetRxPackets, "uint64"), - `NetRxBytes:` + valueToGoStringMesos(this.NetRxBytes, "uint64"), - `NetRxErrors:` + valueToGoStringMesos(this.NetRxErrors, "uint64"), - `NetRxDropped:` + valueToGoStringMesos(this.NetRxDropped, "uint64"), - `NetTxPackets:` + valueToGoStringMesos(this.NetTxPackets, "uint64"), - `NetTxBytes:` + valueToGoStringMesos(this.NetTxBytes, "uint64"), - `NetTxErrors:` + valueToGoStringMesos(this.NetTxErrors, "uint64"), - `NetTxDropped:` + valueToGoStringMesos(this.NetTxDropped, "uint64"), - `NetTcpRttMicrosecsP50:` + valueToGoStringMesos(this.NetTcpRttMicrosecsP50, "float64"), - `NetTcpRttMicrosecsP90:` + valueToGoStringMesos(this.NetTcpRttMicrosecsP90, "float64"), - `NetTcpRttMicrosecsP95:` + valueToGoStringMesos(this.NetTcpRttMicrosecsP95, "float64"), - `NetTcpRttMicrosecsP99:` + valueToGoStringMesos(this.NetTcpRttMicrosecsP99, "float64"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *ResourceUsage) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v154 := uint64(uint64(r.Uint32())) + this.DtlbLoadMisses = &v154 } - s := strings1.Join([]string{`&mesosproto.ResourceUsage{` + - `SlaveId:` + fmt2.Sprintf("%#v", this.SlaveId), - `FrameworkId:` + fmt2.Sprintf("%#v", this.FrameworkId), - `ExecutorId:` + fmt2.Sprintf("%#v", this.ExecutorId), - `ExecutorName:` + valueToGoStringMesos(this.ExecutorName, "string"), - `TaskId:` + fmt2.Sprintf("%#v", this.TaskId), - `Statistics:` + fmt2.Sprintf("%#v", this.Statistics), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *PerfStatistics) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v155 := uint64(uint64(r.Uint32())) + this.DtlbStores = &v155 } - s := strings1.Join([]string{`&mesosproto.PerfStatistics{` + - `Timestamp:` + valueToGoStringMesos(this.Timestamp, "float64"), - `Duration:` + valueToGoStringMesos(this.Duration, "float64"), - `Cycles:` + valueToGoStringMesos(this.Cycles, "uint64"), - `StalledCyclesFrontend:` + valueToGoStringMesos(this.StalledCyclesFrontend, "uint64"), - `StalledCyclesBackend:` + valueToGoStringMesos(this.StalledCyclesBackend, "uint64"), - `Instructions:` + valueToGoStringMesos(this.Instructions, "uint64"), - `CacheReferences:` + valueToGoStringMesos(this.CacheReferences, "uint64"), - `CacheMisses:` + valueToGoStringMesos(this.CacheMisses, "uint64"), - `Branches:` + valueToGoStringMesos(this.Branches, "uint64"), - `BranchMisses:` + valueToGoStringMesos(this.BranchMisses, "uint64"), - `BusCycles:` + valueToGoStringMesos(this.BusCycles, "uint64"), - `RefCycles:` + valueToGoStringMesos(this.RefCycles, "uint64"), - `CpuClock:` + valueToGoStringMesos(this.CpuClock, "float64"), - `TaskClock:` + valueToGoStringMesos(this.TaskClock, "float64"), - `PageFaults:` + valueToGoStringMesos(this.PageFaults, "uint64"), - `MinorFaults:` + valueToGoStringMesos(this.MinorFaults, "uint64"), - `MajorFaults:` + valueToGoStringMesos(this.MajorFaults, "uint64"), - `ContextSwitches:` + valueToGoStringMesos(this.ContextSwitches, "uint64"), - `CpuMigrations:` + valueToGoStringMesos(this.CpuMigrations, "uint64"), - `AlignmentFaults:` + valueToGoStringMesos(this.AlignmentFaults, "uint64"), - `EmulationFaults:` + valueToGoStringMesos(this.EmulationFaults, "uint64"), - `L1DcacheLoads:` + valueToGoStringMesos(this.L1DcacheLoads, "uint64"), - `L1DcacheLoadMisses:` + valueToGoStringMesos(this.L1DcacheLoadMisses, "uint64"), - `L1DcacheStores:` + valueToGoStringMesos(this.L1DcacheStores, "uint64"), - `L1DcacheStoreMisses:` + valueToGoStringMesos(this.L1DcacheStoreMisses, "uint64"), - `L1DcachePrefetches:` + valueToGoStringMesos(this.L1DcachePrefetches, "uint64"), - `L1DcachePrefetchMisses:` + valueToGoStringMesos(this.L1DcachePrefetchMisses, "uint64"), - `L1IcacheLoads:` + valueToGoStringMesos(this.L1IcacheLoads, "uint64"), - `L1IcacheLoadMisses:` + valueToGoStringMesos(this.L1IcacheLoadMisses, "uint64"), - `L1IcachePrefetches:` + valueToGoStringMesos(this.L1IcachePrefetches, "uint64"), - `L1IcachePrefetchMisses:` + valueToGoStringMesos(this.L1IcachePrefetchMisses, "uint64"), - `LlcLoads:` + valueToGoStringMesos(this.LlcLoads, "uint64"), - `LlcLoadMisses:` + valueToGoStringMesos(this.LlcLoadMisses, "uint64"), - `LlcStores:` + valueToGoStringMesos(this.LlcStores, "uint64"), - `LlcStoreMisses:` + valueToGoStringMesos(this.LlcStoreMisses, "uint64"), - `LlcPrefetches:` + valueToGoStringMesos(this.LlcPrefetches, "uint64"), - `LlcPrefetchMisses:` + valueToGoStringMesos(this.LlcPrefetchMisses, "uint64"), - `DtlbLoads:` + valueToGoStringMesos(this.DtlbLoads, "uint64"), - `DtlbLoadMisses:` + valueToGoStringMesos(this.DtlbLoadMisses, "uint64"), - `DtlbStores:` + valueToGoStringMesos(this.DtlbStores, "uint64"), - `DtlbStoreMisses:` + valueToGoStringMesos(this.DtlbStoreMisses, "uint64"), - `DtlbPrefetches:` + valueToGoStringMesos(this.DtlbPrefetches, "uint64"), - `DtlbPrefetchMisses:` + valueToGoStringMesos(this.DtlbPrefetchMisses, "uint64"), - `ItlbLoads:` + valueToGoStringMesos(this.ItlbLoads, "uint64"), - `ItlbLoadMisses:` + valueToGoStringMesos(this.ItlbLoadMisses, "uint64"), - `BranchLoads:` + valueToGoStringMesos(this.BranchLoads, "uint64"), - `BranchLoadMisses:` + valueToGoStringMesos(this.BranchLoadMisses, "uint64"), - `NodeLoads:` + valueToGoStringMesos(this.NodeLoads, "uint64"), - `NodeLoadMisses:` + valueToGoStringMesos(this.NodeLoadMisses, "uint64"), - `NodeStores:` + valueToGoStringMesos(this.NodeStores, "uint64"), - `NodeStoreMisses:` + valueToGoStringMesos(this.NodeStoreMisses, "uint64"), - `NodePrefetches:` + valueToGoStringMesos(this.NodePrefetches, "uint64"), - `NodePrefetchMisses:` + valueToGoStringMesos(this.NodePrefetchMisses, "uint64"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Request) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v156 := uint64(uint64(r.Uint32())) + this.DtlbStoreMisses = &v156 } - s := strings1.Join([]string{`&mesosproto.Request{` + - `SlaveId:` + fmt2.Sprintf("%#v", this.SlaveId), - `Resources:` + fmt2.Sprintf("%#v", this.Resources), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Offer) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v157 := uint64(uint64(r.Uint32())) + this.DtlbPrefetches = &v157 } - s := strings1.Join([]string{`&mesosproto.Offer{` + - `Id:` + fmt2.Sprintf("%#v", this.Id), - `FrameworkId:` + fmt2.Sprintf("%#v", this.FrameworkId), - `SlaveId:` + fmt2.Sprintf("%#v", this.SlaveId), - `Hostname:` + valueToGoStringMesos(this.Hostname, "string"), - `Resources:` + fmt2.Sprintf("%#v", this.Resources), - `Attributes:` + fmt2.Sprintf("%#v", this.Attributes), - `ExecutorIds:` + fmt2.Sprintf("%#v", this.ExecutorIds), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *TaskInfo) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v158 := uint64(uint64(r.Uint32())) + this.DtlbPrefetchMisses = &v158 } - s := strings1.Join([]string{`&mesosproto.TaskInfo{` + - `Name:` + valueToGoStringMesos(this.Name, "string"), - `TaskId:` + fmt2.Sprintf("%#v", this.TaskId), - `SlaveId:` + fmt2.Sprintf("%#v", this.SlaveId), - `Resources:` + fmt2.Sprintf("%#v", this.Resources), - `Executor:` + fmt2.Sprintf("%#v", this.Executor), - `Command:` + fmt2.Sprintf("%#v", this.Command), - `Container:` + fmt2.Sprintf("%#v", this.Container), - `Data:` + valueToGoStringMesos(this.Data, "byte"), - `HealthCheck:` + fmt2.Sprintf("%#v", this.HealthCheck), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *TaskStatus) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v159 := uint64(uint64(r.Uint32())) + this.ItlbLoads = &v159 } - s := strings1.Join([]string{`&mesosproto.TaskStatus{` + - `TaskId:` + fmt2.Sprintf("%#v", this.TaskId), - `State:` + valueToGoStringMesos(this.State, "mesosproto.TaskState"), - `Message:` + valueToGoStringMesos(this.Message, "string"), - `Source:` + valueToGoStringMesos(this.Source, "mesosproto.TaskStatus_Source"), - `Reason:` + valueToGoStringMesos(this.Reason, "mesosproto.TaskStatus_Reason"), - `Data:` + valueToGoStringMesos(this.Data, "byte"), - `SlaveId:` + fmt2.Sprintf("%#v", this.SlaveId), - `ExecutorId:` + fmt2.Sprintf("%#v", this.ExecutorId), - `Timestamp:` + valueToGoStringMesos(this.Timestamp, "float64"), - `Healthy:` + valueToGoStringMesos(this.Healthy, "bool"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Filters) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v160 := uint64(uint64(r.Uint32())) + this.ItlbLoadMisses = &v160 } - s := strings1.Join([]string{`&mesosproto.Filters{` + - `RefuseSeconds:` + valueToGoStringMesos(this.RefuseSeconds, "float64"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Environment) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v161 := uint64(uint64(r.Uint32())) + this.BranchLoads = &v161 } - s := strings1.Join([]string{`&mesosproto.Environment{` + - `Variables:` + fmt2.Sprintf("%#v", this.Variables), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Environment_Variable) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v162 := uint64(uint64(r.Uint32())) + this.BranchLoadMisses = &v162 } - s := strings1.Join([]string{`&mesosproto.Environment_Variable{` + - `Name:` + valueToGoStringMesos(this.Name, "string"), - `Value:` + valueToGoStringMesos(this.Value, "string"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Parameter) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v163 := uint64(uint64(r.Uint32())) + this.NodeLoads = &v163 } - s := strings1.Join([]string{`&mesosproto.Parameter{` + - `Key:` + valueToGoStringMesos(this.Key, "string"), - `Value:` + valueToGoStringMesos(this.Value, "string"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Parameters) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v164 := uint64(uint64(r.Uint32())) + this.NodeLoadMisses = &v164 } - s := strings1.Join([]string{`&mesosproto.Parameters{` + - `Parameter:` + fmt2.Sprintf("%#v", this.Parameter), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Credential) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v165 := uint64(uint64(r.Uint32())) + this.NodeStores = &v165 } - s := strings1.Join([]string{`&mesosproto.Credential{` + - `Principal:` + valueToGoStringMesos(this.Principal, "string"), - `Secret:` + valueToGoStringMesos(this.Secret, "byte"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Credentials) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v166 := uint64(uint64(r.Uint32())) + this.NodeStoreMisses = &v166 } - s := strings1.Join([]string{`&mesosproto.Credentials{` + - `Credentials:` + fmt2.Sprintf("%#v", this.Credentials), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *ACL) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v167 := uint64(uint64(r.Uint32())) + this.NodePrefetches = &v167 } - s := strings1.Join([]string{`&mesosproto.ACL{` + - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *ACL_Entity) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v168 := uint64(uint64(r.Uint32())) + this.NodePrefetchMisses = &v168 } - s := strings1.Join([]string{`&mesosproto.ACL_Entity{` + - `Type:` + valueToGoStringMesos(this.Type, "mesosproto.ACL_Entity_Type"), - `Values:` + fmt2.Sprintf("%#v", this.Values), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *ACL_RegisterFramework) GoString() string { - if this == nil { - return "nil" + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 54) } - s := strings1.Join([]string{`&mesosproto.ACL_RegisterFramework{` + - `Principals:` + fmt2.Sprintf("%#v", this.Principals), - `Roles:` + fmt2.Sprintf("%#v", this.Roles), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + return this } -func (this *ACL_RunTask) GoString() string { - if this == nil { - return "nil" + +func NewPopulatedRequest(r randyMesos, easy bool) *Request { + this := &Request{} + if r.Intn(10) != 0 { + this.SlaveId = NewPopulatedSlaveID(r, easy) } - s := strings1.Join([]string{`&mesosproto.ACL_RunTask{` + - `Principals:` + fmt2.Sprintf("%#v", this.Principals), - `Users:` + fmt2.Sprintf("%#v", this.Users), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *ACL_ShutdownFramework) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v169 := r.Intn(10) + this.Resources = make([]*Resource, v169) + for i := 0; i < v169; i++ { + this.Resources[i] = NewPopulatedResource(r, easy) + } } - s := strings1.Join([]string{`&mesosproto.ACL_ShutdownFramework{` + - `Principals:` + fmt2.Sprintf("%#v", this.Principals), - `FrameworkPrincipals:` + fmt2.Sprintf("%#v", this.FrameworkPrincipals), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *ACLs) GoString() string { - if this == nil { - return "nil" + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 3) } - s := strings1.Join([]string{`&mesosproto.ACLs{` + - `Permissive:` + valueToGoStringMesos(this.Permissive, "bool"), - `RegisterFrameworks:` + fmt2.Sprintf("%#v", this.RegisterFrameworks), - `RunTasks:` + fmt2.Sprintf("%#v", this.RunTasks), - `ShutdownFrameworks:` + fmt2.Sprintf("%#v", this.ShutdownFrameworks), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + return this } -func (this *RateLimit) GoString() string { - if this == nil { - return "nil" + +func NewPopulatedOffer(r randyMesos, easy bool) *Offer { + this := &Offer{} + this.Id = NewPopulatedOfferID(r, easy) + this.FrameworkId = NewPopulatedFrameworkID(r, easy) + this.SlaveId = NewPopulatedSlaveID(r, easy) + v170 := randStringMesos(r) + this.Hostname = &v170 + if r.Intn(10) != 0 { + v171 := r.Intn(10) + this.Resources = make([]*Resource, v171) + for i := 0; i < v171; i++ { + this.Resources[i] = NewPopulatedResource(r, easy) + } } - s := strings1.Join([]string{`&mesosproto.RateLimit{` + - `Qps:` + valueToGoStringMesos(this.Qps, "float64"), - `Principal:` + valueToGoStringMesos(this.Principal, "string"), - `Capacity:` + valueToGoStringMesos(this.Capacity, "uint64"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *RateLimits) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v172 := r.Intn(10) + this.ExecutorIds = make([]*ExecutorID, v172) + for i := 0; i < v172; i++ { + this.ExecutorIds[i] = NewPopulatedExecutorID(r, easy) + } } - s := strings1.Join([]string{`&mesosproto.RateLimits{` + - `Limits:` + fmt2.Sprintf("%#v", this.Limits), - `AggregateDefaultQps:` + valueToGoStringMesos(this.AggregateDefaultQps, "float64"), - `AggregateDefaultCapacity:` + valueToGoStringMesos(this.AggregateDefaultCapacity, "uint64"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Volume) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v173 := r.Intn(10) + this.Attributes = make([]*Attribute, v173) + for i := 0; i < v173; i++ { + this.Attributes[i] = NewPopulatedAttribute(r, easy) + } } - s := strings1.Join([]string{`&mesosproto.Volume{` + - `ContainerPath:` + valueToGoStringMesos(this.ContainerPath, "string"), - `HostPath:` + valueToGoStringMesos(this.HostPath, "string"), - `Mode:` + valueToGoStringMesos(this.Mode, "mesosproto.Volume_Mode"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *ContainerInfo) GoString() string { - if this == nil { - return "nil" + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 8) } - s := strings1.Join([]string{`&mesosproto.ContainerInfo{` + - `Type:` + valueToGoStringMesos(this.Type, "mesosproto.ContainerInfo_Type"), - `Volumes:` + fmt2.Sprintf("%#v", this.Volumes), - `Hostname:` + valueToGoStringMesos(this.Hostname, "string"), - `Docker:` + fmt2.Sprintf("%#v", this.Docker), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + return this } -func (this *ContainerInfo_DockerInfo) GoString() string { - if this == nil { - return "nil" + +func NewPopulatedOffer_Operation(r randyMesos, easy bool) *Offer_Operation { + this := &Offer_Operation{} + v174 := Offer_Operation_Type([]int32{1, 2, 3, 4, 5}[r.Intn(5)]) + this.Type = &v174 + if r.Intn(10) != 0 { + this.Launch = NewPopulatedOffer_Operation_Launch(r, easy) } - s := strings1.Join([]string{`&mesosproto.ContainerInfo_DockerInfo{` + - `Image:` + valueToGoStringMesos(this.Image, "string"), - `Network:` + valueToGoStringMesos(this.Network, "mesosproto.ContainerInfo_DockerInfo_Network"), - `PortMappings:` + fmt2.Sprintf("%#v", this.PortMappings), - `Privileged:` + valueToGoStringMesos(this.Privileged, "bool"), - `Parameters:` + fmt2.Sprintf("%#v", this.Parameters), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *ContainerInfo_DockerInfo_PortMapping) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + this.Reserve = NewPopulatedOffer_Operation_Reserve(r, easy) } - s := strings1.Join([]string{`&mesosproto.ContainerInfo_DockerInfo_PortMapping{` + - `HostPort:` + valueToGoStringMesos(this.HostPort, "uint32"), - `ContainerPort:` + valueToGoStringMesos(this.ContainerPort, "uint32"), - `Protocol:` + valueToGoStringMesos(this.Protocol, "string"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func valueToGoStringMesos(v interface{}, typ string) string { - rv := reflect1.ValueOf(v) - if rv.IsNil() { - return "nil" + if r.Intn(10) != 0 { + this.Unreserve = NewPopulatedOffer_Operation_Unreserve(r, easy) } - pv := reflect1.Indirect(rv).Interface() - return fmt2.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func extensionToGoStringMesos(e map[int32]github_com_gogo_protobuf_proto1.Extension) string { - if e == nil { - return "nil" + if r.Intn(10) != 0 { + this.Create = NewPopulatedOffer_Operation_Create(r, easy) } - s := "map[int32]proto.Extension{" - keys := make([]int, 0, len(e)) - for k := range e { - keys = append(keys, int(k)) + if r.Intn(10) != 0 { + this.Destroy = NewPopulatedOffer_Operation_Destroy(r, easy) } - sort.Ints(keys) - ss := []string{} - for _, k := range keys { - ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString()) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 7) } - s += strings1.Join(ss, ",") + "}" - return s + return this } -func (this *FrameworkID) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") - } - that1, ok := that.(*FrameworkID) - if !ok { - return fmt3.Errorf("that is not of type *FrameworkID") - } - if that1 == nil { - if this == nil { - return nil +func NewPopulatedOffer_Operation_Launch(r randyMesos, easy bool) *Offer_Operation_Launch { + this := &Offer_Operation_Launch{} + if r.Intn(10) != 0 { + v175 := r.Intn(10) + this.TaskInfos = make([]*TaskInfo, v175) + for i := 0; i < v175; i++ { + this.TaskInfos[i] = NewPopulatedTaskInfo(r, easy) } - return fmt3.Errorf("that is type *FrameworkID but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *FrameworkIDbut is not nil && this == nil") } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + } + return this +} + +func NewPopulatedOffer_Operation_Reserve(r randyMesos, easy bool) *Offer_Operation_Reserve { + this := &Offer_Operation_Reserve{} + if r.Intn(10) != 0 { + v176 := r.Intn(10) + this.Resources = make([]*Resource, v176) + for i := 0; i < v176; i++ { + this.Resources[i] = NewPopulatedResource(r, easy) } - } else if this.Value != nil { - return fmt3.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) } - return nil + return this } -func (this *FrameworkID) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true + +func NewPopulatedOffer_Operation_Unreserve(r randyMesos, easy bool) *Offer_Operation_Unreserve { + this := &Offer_Operation_Unreserve{} + if r.Intn(10) != 0 { + v177 := r.Intn(10) + this.Resources = make([]*Resource, v177) + for i := 0; i < v177; i++ { + this.Resources[i] = NewPopulatedResource(r, easy) } - return false } - - that1, ok := that.(*FrameworkID) - if !ok { - return false + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) } - if that1 == nil { - if this == nil { - return true + return this +} + +func NewPopulatedOffer_Operation_Create(r randyMesos, easy bool) *Offer_Operation_Create { + this := &Offer_Operation_Create{} + if r.Intn(10) != 0 { + v178 := r.Intn(10) + this.Volumes = make([]*Resource, v178) + for i := 0; i < v178; i++ { + this.Volumes[i] = NewPopulatedResource(r, easy) } - return false - } else if this == nil { - return false } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + } + return this +} + +func NewPopulatedOffer_Operation_Destroy(r randyMesos, easy bool) *Offer_Operation_Destroy { + this := &Offer_Operation_Destroy{} + if r.Intn(10) != 0 { + v179 := r.Intn(10) + this.Volumes = make([]*Resource, v179) + for i := 0; i < v179; i++ { + this.Volumes[i] = NewPopulatedResource(r, easy) } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) } - return true + return this } -func (this *OfferID) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil + +func NewPopulatedTaskInfo(r randyMesos, easy bool) *TaskInfo { + this := &TaskInfo{} + v180 := randStringMesos(r) + this.Name = &v180 + this.TaskId = NewPopulatedTaskID(r, easy) + this.SlaveId = NewPopulatedSlaveID(r, easy) + if r.Intn(10) != 0 { + v181 := r.Intn(10) + this.Resources = make([]*Resource, v181) + for i := 0; i < v181; i++ { + this.Resources[i] = NewPopulatedResource(r, easy) } - return fmt3.Errorf("that == nil && this != nil") } - - that1, ok := that.(*OfferID) - if !ok { - return fmt3.Errorf("that is not of type *OfferID") + if r.Intn(10) != 0 { + this.Executor = NewPopulatedExecutorInfo(r, easy) } - if that1 == nil { - if this == nil { - return nil + if r.Intn(10) != 0 { + v182 := r.Intn(100) + this.Data = make([]byte, v182) + for i := 0; i < v182; i++ { + this.Data[i] = byte(r.Intn(256)) } - return fmt3.Errorf("that is type *OfferID but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *OfferIDbut is not nil && this == nil") } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) - } - } else if this.Value != nil { - return fmt3.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + if r.Intn(10) != 0 { + this.Command = NewPopulatedCommandInfo(r, easy) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if r.Intn(10) != 0 { + this.HealthCheck = NewPopulatedHealthCheck(r, easy) } - return nil + if r.Intn(10) != 0 { + this.Container = NewPopulatedContainerInfo(r, easy) + } + if r.Intn(10) != 0 { + this.Labels = NewPopulatedLabels(r, easy) + } + if r.Intn(10) != 0 { + this.Discovery = NewPopulatedDiscoveryInfo(r, easy) + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 12) + } + return this } -func (this *OfferID) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true + +func NewPopulatedTaskStatus(r randyMesos, easy bool) *TaskStatus { + this := &TaskStatus{} + this.TaskId = NewPopulatedTaskID(r, easy) + v183 := TaskState([]int32{6, 0, 1, 2, 3, 4, 5, 7}[r.Intn(8)]) + this.State = &v183 + if r.Intn(10) != 0 { + v184 := r.Intn(100) + this.Data = make([]byte, v184) + for i := 0; i < v184; i++ { + this.Data[i] = byte(r.Intn(256)) } - return false } - - that1, ok := that.(*OfferID) - if !ok { - return false + if r.Intn(10) != 0 { + v185 := randStringMesos(r) + this.Message = &v185 } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if r.Intn(10) != 0 { + this.SlaveId = NewPopulatedSlaveID(r, easy) } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false + if r.Intn(10) != 0 { + v186 := float64(r.Float64()) + if r.Intn(2) == 0 { + v186 *= -1 } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false + this.Timestamp = &v186 } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if r.Intn(10) != 0 { + this.ExecutorId = NewPopulatedExecutorID(r, easy) } - return true -} -func (this *SlaveID) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if r.Intn(10) != 0 { + v187 := bool(bool(r.Intn(2) == 0)) + this.Healthy = &v187 } - - that1, ok := that.(*SlaveID) - if !ok { - return fmt3.Errorf("that is not of type *SlaveID") + if r.Intn(10) != 0 { + v188 := TaskStatus_Source([]int32{0, 1, 2}[r.Intn(3)]) + this.Source = &v188 } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *SlaveID but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *SlaveIDbut is not nil && this == nil") + if r.Intn(10) != 0 { + v189 := TaskStatus_Reason([]int32{0, 17, 1, 2, 3, 4, 5, 6, 7, 8, 9, 18, 10, 11, 12, 13, 14, 15, 16}[r.Intn(19)]) + this.Reason = &v189 } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) + if r.Intn(10) != 0 { + v190 := r.Intn(100) + this.Uuid = make([]byte, v190) + for i := 0; i < v190; i++ { + this.Uuid[i] = byte(r.Intn(256)) } - } else if this.Value != nil { - return fmt3.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 12) } - return nil + return this } -func (this *SlaveID) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true + +func NewPopulatedFilters(r randyMesos, easy bool) *Filters { + this := &Filters{} + if r.Intn(10) != 0 { + v191 := float64(r.Float64()) + if r.Intn(2) == 0 { + v191 *= -1 } - return false + this.RefuseSeconds = &v191 } - - that1, ok := that.(*SlaveID) - if !ok { - return false + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) } - if that1 == nil { - if this == nil { - return true + return this +} + +func NewPopulatedEnvironment(r randyMesos, easy bool) *Environment { + this := &Environment{} + if r.Intn(10) != 0 { + v192 := r.Intn(10) + this.Variables = make([]*Environment_Variable, v192) + for i := 0; i < v192; i++ { + this.Variables[i] = NewPopulatedEnvironment_Variable(r, easy) } - return false - } else if this == nil { - return false } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false - } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + return this +} + +func NewPopulatedEnvironment_Variable(r randyMesos, easy bool) *Environment_Variable { + this := &Environment_Variable{} + v193 := randStringMesos(r) + this.Name = &v193 + v194 := randStringMesos(r) + this.Value = &v194 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 3) + } + return this +} + +func NewPopulatedParameter(r randyMesos, easy bool) *Parameter { + this := &Parameter{} + v195 := randStringMesos(r) + this.Key = &v195 + v196 := randStringMesos(r) + this.Value = &v196 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 3) } - return true + return this } -func (this *TaskID) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil + +func NewPopulatedParameters(r randyMesos, easy bool) *Parameters { + this := &Parameters{} + if r.Intn(10) != 0 { + v197 := r.Intn(10) + this.Parameter = make([]*Parameter, v197) + for i := 0; i < v197; i++ { + this.Parameter[i] = NewPopulatedParameter(r, easy) } - return fmt3.Errorf("that == nil && this != nil") } - - that1, ok := that.(*TaskID) - if !ok { - return fmt3.Errorf("that is not of type *TaskID") + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) } - if that1 == nil { - if this == nil { - return nil + return this +} + +func NewPopulatedCredential(r randyMesos, easy bool) *Credential { + this := &Credential{} + v198 := randStringMesos(r) + this.Principal = &v198 + if r.Intn(10) != 0 { + v199 := r.Intn(100) + this.Secret = make([]byte, v199) + for i := 0; i < v199; i++ { + this.Secret[i] = byte(r.Intn(256)) } - return fmt3.Errorf("that is type *TaskID but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *TaskIDbut is not nil && this == nil") } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 3) + } + return this +} + +func NewPopulatedCredentials(r randyMesos, easy bool) *Credentials { + this := &Credentials{} + if r.Intn(10) != 0 { + v200 := r.Intn(10) + this.Credentials = make([]*Credential, v200) + for i := 0; i < v200; i++ { + this.Credentials[i] = NewPopulatedCredential(r, easy) } - } else if this.Value != nil { - return fmt3.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) } - return nil + return this } -func (this *TaskID) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false + +func NewPopulatedACL(r randyMesos, easy bool) *ACL { + this := &ACL{} + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 1) } + return this +} - that1, ok := that.(*TaskID) - if !ok { - return false +func NewPopulatedACL_Entity(r randyMesos, easy bool) *ACL_Entity { + this := &ACL_Entity{} + if r.Intn(10) != 0 { + v201 := ACL_Entity_Type([]int32{0, 1, 2}[r.Intn(3)]) + this.Type = &v201 } - if that1 == nil { - if this == nil { - return true + if r.Intn(10) != 0 { + v202 := r.Intn(10) + this.Values = make([]string, v202) + for i := 0; i < v202; i++ { + this.Values[i] = randStringMesos(r) } - return false - } else if this == nil { - return false } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false - } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 3) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + return this +} + +func NewPopulatedACL_RegisterFramework(r randyMesos, easy bool) *ACL_RegisterFramework { + this := &ACL_RegisterFramework{} + this.Principals = NewPopulatedACL_Entity(r, easy) + this.Roles = NewPopulatedACL_Entity(r, easy) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 3) } - return true + return this } -func (this *ExecutorID) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + +func NewPopulatedACL_RunTask(r randyMesos, easy bool) *ACL_RunTask { + this := &ACL_RunTask{} + this.Principals = NewPopulatedACL_Entity(r, easy) + this.Users = NewPopulatedACL_Entity(r, easy) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 3) } + return this +} - that1, ok := that.(*ExecutorID) - if !ok { - return fmt3.Errorf("that is not of type *ExecutorID") +func NewPopulatedACL_ShutdownFramework(r randyMesos, easy bool) *ACL_ShutdownFramework { + this := &ACL_ShutdownFramework{} + this.Principals = NewPopulatedACL_Entity(r, easy) + this.FrameworkPrincipals = NewPopulatedACL_Entity(r, easy) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 3) } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *ExecutorID but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *ExecutorIDbut is not nil && this == nil") + return this +} + +func NewPopulatedACLs(r randyMesos, easy bool) *ACLs { + this := &ACLs{} + if r.Intn(10) != 0 { + v203 := bool(bool(r.Intn(2) == 0)) + this.Permissive = &v203 } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) + if r.Intn(10) != 0 { + v204 := r.Intn(10) + this.RegisterFrameworks = make([]*ACL_RegisterFramework, v204) + for i := 0; i < v204; i++ { + this.RegisterFrameworks[i] = NewPopulatedACL_RegisterFramework(r, easy) } - } else if this.Value != nil { - return fmt3.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if r.Intn(10) != 0 { + v205 := r.Intn(10) + this.RunTasks = make([]*ACL_RunTask, v205) + for i := 0; i < v205; i++ { + this.RunTasks[i] = NewPopulatedACL_RunTask(r, easy) + } } - return nil -} -func (this *ExecutorID) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true + if r.Intn(10) != 0 { + v206 := r.Intn(10) + this.ShutdownFrameworks = make([]*ACL_ShutdownFramework, v206) + for i := 0; i < v206; i++ { + this.ShutdownFrameworks[i] = NewPopulatedACL_ShutdownFramework(r, easy) } - return false } - - that1, ok := that.(*ExecutorID) - if !ok { - return false + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 5) } - if that1 == nil { - if this == nil { - return true + return this +} + +func NewPopulatedRateLimit(r randyMesos, easy bool) *RateLimit { + this := &RateLimit{} + if r.Intn(10) != 0 { + v207 := float64(r.Float64()) + if r.Intn(2) == 0 { + v207 *= -1 } - return false - } else if this == nil { - return false + this.Qps = &v207 } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false - } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false + v208 := randStringMesos(r) + this.Principal = &v208 + if r.Intn(10) != 0 { + v209 := uint64(uint64(r.Uint32())) + this.Capacity = &v209 } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 4) } - return true + return this } -func (this *ContainerID) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") - } - that1, ok := that.(*ContainerID) - if !ok { - return fmt3.Errorf("that is not of type *ContainerID") - } - if that1 == nil { - if this == nil { - return nil +func NewPopulatedRateLimits(r randyMesos, easy bool) *RateLimits { + this := &RateLimits{} + if r.Intn(10) != 0 { + v210 := r.Intn(10) + this.Limits = make([]*RateLimit, v210) + for i := 0; i < v210; i++ { + this.Limits[i] = NewPopulatedRateLimit(r, easy) } - return fmt3.Errorf("that is type *ContainerID but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *ContainerIDbut is not nil && this == nil") } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) + if r.Intn(10) != 0 { + v211 := float64(r.Float64()) + if r.Intn(2) == 0 { + v211 *= -1 } - } else if this.Value != nil { - return fmt3.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + this.AggregateDefaultQps = &v211 } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if r.Intn(10) != 0 { + v212 := uint64(uint64(r.Uint32())) + this.AggregateDefaultCapacity = &v212 } - return nil -} -func (this *ContainerID) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 4) } + return this +} - that1, ok := that.(*ContainerID) - if !ok { - return false +func NewPopulatedVolume(r randyMesos, easy bool) *Volume { + this := &Volume{} + v213 := randStringMesos(r) + this.ContainerPath = &v213 + if r.Intn(10) != 0 { + v214 := randStringMesos(r) + this.HostPath = &v214 } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + v215 := Volume_Mode([]int32{1, 2}[r.Intn(2)]) + this.Mode = &v215 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 4) } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false + return this +} + +func NewPopulatedContainerInfo(r randyMesos, easy bool) *ContainerInfo { + this := &ContainerInfo{} + v216 := ContainerInfo_Type([]int32{1, 2}[r.Intn(2)]) + this.Type = &v216 + if r.Intn(10) != 0 { + v217 := r.Intn(10) + this.Volumes = make([]*Volume, v217) + for i := 0; i < v217; i++ { + this.Volumes[i] = NewPopulatedVolume(r, easy) } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if r.Intn(10) != 0 { + this.Docker = NewPopulatedContainerInfo_DockerInfo(r, easy) + } + if r.Intn(10) != 0 { + v218 := randStringMesos(r) + this.Hostname = &v218 + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 5) } - return true + return this } -func (this *FrameworkInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") - } - that1, ok := that.(*FrameworkInfo) - if !ok { - return fmt3.Errorf("that is not of type *FrameworkInfo") +func NewPopulatedContainerInfo_DockerInfo(r randyMesos, easy bool) *ContainerInfo_DockerInfo { + this := &ContainerInfo_DockerInfo{} + v219 := randStringMesos(r) + this.Image = &v219 + if r.Intn(10) != 0 { + v220 := ContainerInfo_DockerInfo_Network([]int32{1, 2, 3}[r.Intn(3)]) + this.Network = &v220 } - if that1 == nil { - if this == nil { - return nil + if r.Intn(10) != 0 { + v221 := r.Intn(10) + this.PortMappings = make([]*ContainerInfo_DockerInfo_PortMapping, v221) + for i := 0; i < v221; i++ { + this.PortMappings[i] = NewPopulatedContainerInfo_DockerInfo_PortMapping(r, easy) } - return fmt3.Errorf("that is type *FrameworkInfo but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *FrameworkInfobut is not nil && this == nil") } - if this.User != nil && that1.User != nil { - if *this.User != *that1.User { - return fmt3.Errorf("User this(%v) Not Equal that(%v)", *this.User, *that1.User) - } - } else if this.User != nil { - return fmt3.Errorf("this.User == nil && that.User != nil") - } else if that1.User != nil { - return fmt3.Errorf("User this(%v) Not Equal that(%v)", this.User, that1.User) + if r.Intn(10) != 0 { + v222 := bool(bool(r.Intn(2) == 0)) + this.Privileged = &v222 } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt3.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) + if r.Intn(10) != 0 { + v223 := r.Intn(10) + this.Parameters = make([]*Parameter, v223) + for i := 0; i < v223; i++ { + this.Parameters[i] = NewPopulatedParameter(r, easy) } - } else if this.Name != nil { - return fmt3.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt3.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) } - if !this.Id.Equal(that1.Id) { - return fmt3.Errorf("Id this(%v) Not Equal that(%v)", this.Id, that1.Id) + if r.Intn(10) != 0 { + v224 := bool(bool(r.Intn(2) == 0)) + this.ForcePullImage = &v224 } - if this.FailoverTimeout != nil && that1.FailoverTimeout != nil { - if *this.FailoverTimeout != *that1.FailoverTimeout { - return fmt3.Errorf("FailoverTimeout this(%v) Not Equal that(%v)", *this.FailoverTimeout, *that1.FailoverTimeout) - } - } else if this.FailoverTimeout != nil { - return fmt3.Errorf("this.FailoverTimeout == nil && that.FailoverTimeout != nil") - } else if that1.FailoverTimeout != nil { - return fmt3.Errorf("FailoverTimeout this(%v) Not Equal that(%v)", this.FailoverTimeout, that1.FailoverTimeout) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 7) } - if this.Checkpoint != nil && that1.Checkpoint != nil { - if *this.Checkpoint != *that1.Checkpoint { - return fmt3.Errorf("Checkpoint this(%v) Not Equal that(%v)", *this.Checkpoint, *that1.Checkpoint) - } - } else if this.Checkpoint != nil { - return fmt3.Errorf("this.Checkpoint == nil && that.Checkpoint != nil") - } else if that1.Checkpoint != nil { - return fmt3.Errorf("Checkpoint this(%v) Not Equal that(%v)", this.Checkpoint, that1.Checkpoint) + return this +} + +func NewPopulatedContainerInfo_DockerInfo_PortMapping(r randyMesos, easy bool) *ContainerInfo_DockerInfo_PortMapping { + this := &ContainerInfo_DockerInfo_PortMapping{} + v225 := uint32(r.Uint32()) + this.HostPort = &v225 + v226 := uint32(r.Uint32()) + this.ContainerPort = &v226 + if r.Intn(10) != 0 { + v227 := randStringMesos(r) + this.Protocol = &v227 } - if this.Role != nil && that1.Role != nil { - if *this.Role != *that1.Role { - return fmt3.Errorf("Role this(%v) Not Equal that(%v)", *this.Role, *that1.Role) - } - } else if this.Role != nil { - return fmt3.Errorf("this.Role == nil && that.Role != nil") - } else if that1.Role != nil { - return fmt3.Errorf("Role this(%v) Not Equal that(%v)", this.Role, that1.Role) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 4) } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return fmt3.Errorf("Hostname this(%v) Not Equal that(%v)", *this.Hostname, *that1.Hostname) + return this +} + +func NewPopulatedLabels(r randyMesos, easy bool) *Labels { + this := &Labels{} + if r.Intn(10) != 0 { + v228 := r.Intn(10) + this.Labels = make([]*Label, v228) + for i := 0; i < v228; i++ { + this.Labels[i] = NewPopulatedLabel(r, easy) } - } else if this.Hostname != nil { - return fmt3.Errorf("this.Hostname == nil && that.Hostname != nil") - } else if that1.Hostname != nil { - return fmt3.Errorf("Hostname this(%v) Not Equal that(%v)", this.Hostname, that1.Hostname) } - if this.Principal != nil && that1.Principal != nil { - if *this.Principal != *that1.Principal { - return fmt3.Errorf("Principal this(%v) Not Equal that(%v)", *this.Principal, *that1.Principal) - } - } else if this.Principal != nil { - return fmt3.Errorf("this.Principal == nil && that.Principal != nil") - } else if that1.Principal != nil { - return fmt3.Errorf("Principal this(%v) Not Equal that(%v)", this.Principal, that1.Principal) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) } - if this.WebuiUrl != nil && that1.WebuiUrl != nil { - if *this.WebuiUrl != *that1.WebuiUrl { - return fmt3.Errorf("WebuiUrl this(%v) Not Equal that(%v)", *this.WebuiUrl, *that1.WebuiUrl) - } - } else if this.WebuiUrl != nil { - return fmt3.Errorf("this.WebuiUrl == nil && that.WebuiUrl != nil") - } else if that1.WebuiUrl != nil { - return fmt3.Errorf("WebuiUrl this(%v) Not Equal that(%v)", this.WebuiUrl, that1.WebuiUrl) + return this +} + +func NewPopulatedLabel(r randyMesos, easy bool) *Label { + this := &Label{} + v229 := randStringMesos(r) + this.Key = &v229 + if r.Intn(10) != 0 { + v230 := randStringMesos(r) + this.Value = &v230 } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 3) } - return nil + return this } -func (this *FrameworkInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true + +func NewPopulatedPort(r randyMesos, easy bool) *Port { + this := &Port{} + v231 := uint32(r.Uint32()) + this.Number = &v231 + if r.Intn(10) != 0 { + v232 := randStringMesos(r) + this.Name = &v232 + } + if r.Intn(10) != 0 { + v233 := randStringMesos(r) + this.Protocol = &v233 + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 4) + } + return this +} + +func NewPopulatedPorts(r randyMesos, easy bool) *Ports { + this := &Ports{} + if r.Intn(10) != 0 { + v234 := r.Intn(10) + this.Ports = make([]*Port, v234) + for i := 0; i < v234; i++ { + this.Ports[i] = NewPopulatedPort(r, easy) } - return false } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + } + return this +} - that1, ok := that.(*FrameworkInfo) - if !ok { - return false +func NewPopulatedDiscoveryInfo(r randyMesos, easy bool) *DiscoveryInfo { + this := &DiscoveryInfo{} + v235 := DiscoveryInfo_Visibility([]int32{0, 1, 2}[r.Intn(3)]) + this.Visibility = &v235 + if r.Intn(10) != 0 { + v236 := randStringMesos(r) + this.Name = &v236 } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if r.Intn(10) != 0 { + v237 := randStringMesos(r) + this.Environment = &v237 } - if this.User != nil && that1.User != nil { - if *this.User != *that1.User { - return false - } - } else if this.User != nil { - return false - } else if that1.User != nil { - return false + if r.Intn(10) != 0 { + v238 := randStringMesos(r) + this.Location = &v238 } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false - } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false + if r.Intn(10) != 0 { + v239 := randStringMesos(r) + this.Version = &v239 } - if !this.Id.Equal(that1.Id) { - return false + if r.Intn(10) != 0 { + this.Ports = NewPopulatedPorts(r, easy) } - if this.FailoverTimeout != nil && that1.FailoverTimeout != nil { - if *this.FailoverTimeout != *that1.FailoverTimeout { - return false - } - } else if this.FailoverTimeout != nil { - return false - } else if that1.FailoverTimeout != nil { - return false + if r.Intn(10) != 0 { + this.Labels = NewPopulatedLabels(r, easy) } - if this.Checkpoint != nil && that1.Checkpoint != nil { - if *this.Checkpoint != *that1.Checkpoint { - return false - } - } else if this.Checkpoint != nil { - return false - } else if that1.Checkpoint != nil { - return false + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 8) } - if this.Role != nil && that1.Role != nil { - if *this.Role != *that1.Role { - return false - } - } else if this.Role != nil { - return false - } else if that1.Role != nil { - return false + return this +} + +type randyMesos interface { + Float32() float32 + Float64() float64 + Int63() int64 + Int31() int32 + Uint32() uint32 + Intn(n int) int +} + +func randUTF8RuneMesos(r randyMesos) rune { + ru := r.Intn(62) + if ru < 10 { + return rune(ru + 48) + } else if ru < 36 { + return rune(ru + 55) } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return false - } - } else if this.Hostname != nil { - return false - } else if that1.Hostname != nil { - return false + return rune(ru + 61) +} +func randStringMesos(r randyMesos) string { + v240 := r.Intn(100) + tmps := make([]rune, v240) + for i := 0; i < v240; i++ { + tmps[i] = randUTF8RuneMesos(r) } - if this.Principal != nil && that1.Principal != nil { - if *this.Principal != *that1.Principal { - return false + return string(tmps) +} +func randUnrecognizedMesos(r randyMesos, maxFieldNumber int) (data []byte) { + l := r.Intn(5) + for i := 0; i < l; i++ { + wire := r.Intn(4) + if wire == 3 { + wire = 5 } - } else if this.Principal != nil { - return false - } else if that1.Principal != nil { - return false + fieldNumber := maxFieldNumber + r.Intn(100) + data = randFieldMesos(data, r, fieldNumber, wire) } - if this.WebuiUrl != nil && that1.WebuiUrl != nil { - if *this.WebuiUrl != *that1.WebuiUrl { - return false + return data +} +func randFieldMesos(data []byte, r randyMesos, fieldNumber int, wire int) []byte { + key := uint32(fieldNumber)<<3 | uint32(wire) + switch wire { + case 0: + data = encodeVarintPopulateMesos(data, uint64(key)) + v241 := r.Int63() + if r.Intn(2) == 0 { + v241 *= -1 } - } else if this.WebuiUrl != nil { - return false - } else if that1.WebuiUrl != nil { - return false + data = encodeVarintPopulateMesos(data, uint64(v241)) + case 1: + data = encodeVarintPopulateMesos(data, uint64(key)) + data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) + case 2: + data = encodeVarintPopulateMesos(data, uint64(key)) + ll := r.Intn(100) + data = encodeVarintPopulateMesos(data, uint64(ll)) + for j := 0; j < ll; j++ { + data = append(data, byte(r.Intn(256))) + } + default: + data = encodeVarintPopulateMesos(data, uint64(key)) + data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) + } + return data +} +func encodeVarintPopulateMesos(data []byte, v uint64) []byte { + for v >= 1<<7 { + data = append(data, uint8(uint64(v)&0x7f|0x80)) + v >>= 7 + } + data = append(data, uint8(v)) + return data +} +func (m *FrameworkID) Size() (n int) { + var l int + _ = l + if m.Value != nil { + l = len(*m.Value) + n += 1 + l + sovMesos(uint64(l)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return true + return n } -func (this *HealthCheck) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") - } - that1, ok := that.(*HealthCheck) - if !ok { - return fmt3.Errorf("that is not of type *HealthCheck") +func (m *OfferID) Size() (n int) { + var l int + _ = l + if m.Value != nil { + l = len(*m.Value) + n += 1 + l + sovMesos(uint64(l)) } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *HealthCheck but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *HealthCheckbut is not nil && this == nil") + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if !this.Http.Equal(that1.Http) { - return fmt3.Errorf("Http this(%v) Not Equal that(%v)", this.Http, that1.Http) + return n +} + +func (m *SlaveID) Size() (n int) { + var l int + _ = l + if m.Value != nil { + l = len(*m.Value) + n += 1 + l + sovMesos(uint64(l)) } - if this.DelaySeconds != nil && that1.DelaySeconds != nil { - if *this.DelaySeconds != *that1.DelaySeconds { - return fmt3.Errorf("DelaySeconds this(%v) Not Equal that(%v)", *this.DelaySeconds, *that1.DelaySeconds) - } - } else if this.DelaySeconds != nil { - return fmt3.Errorf("this.DelaySeconds == nil && that.DelaySeconds != nil") - } else if that1.DelaySeconds != nil { - return fmt3.Errorf("DelaySeconds this(%v) Not Equal that(%v)", this.DelaySeconds, that1.DelaySeconds) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.IntervalSeconds != nil && that1.IntervalSeconds != nil { - if *this.IntervalSeconds != *that1.IntervalSeconds { - return fmt3.Errorf("IntervalSeconds this(%v) Not Equal that(%v)", *this.IntervalSeconds, *that1.IntervalSeconds) - } - } else if this.IntervalSeconds != nil { - return fmt3.Errorf("this.IntervalSeconds == nil && that.IntervalSeconds != nil") - } else if that1.IntervalSeconds != nil { - return fmt3.Errorf("IntervalSeconds this(%v) Not Equal that(%v)", this.IntervalSeconds, that1.IntervalSeconds) + return n +} + +func (m *TaskID) Size() (n int) { + var l int + _ = l + if m.Value != nil { + l = len(*m.Value) + n += 1 + l + sovMesos(uint64(l)) } - if this.TimeoutSeconds != nil && that1.TimeoutSeconds != nil { - if *this.TimeoutSeconds != *that1.TimeoutSeconds { - return fmt3.Errorf("TimeoutSeconds this(%v) Not Equal that(%v)", *this.TimeoutSeconds, *that1.TimeoutSeconds) - } - } else if this.TimeoutSeconds != nil { - return fmt3.Errorf("this.TimeoutSeconds == nil && that.TimeoutSeconds != nil") - } else if that1.TimeoutSeconds != nil { - return fmt3.Errorf("TimeoutSeconds this(%v) Not Equal that(%v)", this.TimeoutSeconds, that1.TimeoutSeconds) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.ConsecutiveFailures != nil && that1.ConsecutiveFailures != nil { - if *this.ConsecutiveFailures != *that1.ConsecutiveFailures { - return fmt3.Errorf("ConsecutiveFailures this(%v) Not Equal that(%v)", *this.ConsecutiveFailures, *that1.ConsecutiveFailures) - } - } else if this.ConsecutiveFailures != nil { - return fmt3.Errorf("this.ConsecutiveFailures == nil && that.ConsecutiveFailures != nil") - } else if that1.ConsecutiveFailures != nil { - return fmt3.Errorf("ConsecutiveFailures this(%v) Not Equal that(%v)", this.ConsecutiveFailures, that1.ConsecutiveFailures) + return n +} + +func (m *ExecutorID) Size() (n int) { + var l int + _ = l + if m.Value != nil { + l = len(*m.Value) + n += 1 + l + sovMesos(uint64(l)) } - if this.GracePeriodSeconds != nil && that1.GracePeriodSeconds != nil { - if *this.GracePeriodSeconds != *that1.GracePeriodSeconds { - return fmt3.Errorf("GracePeriodSeconds this(%v) Not Equal that(%v)", *this.GracePeriodSeconds, *that1.GracePeriodSeconds) - } - } else if this.GracePeriodSeconds != nil { - return fmt3.Errorf("this.GracePeriodSeconds == nil && that.GracePeriodSeconds != nil") - } else if that1.GracePeriodSeconds != nil { - return fmt3.Errorf("GracePeriodSeconds this(%v) Not Equal that(%v)", this.GracePeriodSeconds, that1.GracePeriodSeconds) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if !this.Command.Equal(that1.Command) { - return fmt3.Errorf("Command this(%v) Not Equal that(%v)", this.Command, that1.Command) + return n +} + +func (m *ContainerID) Size() (n int) { + var l int + _ = l + if m.Value != nil { + l = len(*m.Value) + n += 1 + l + sovMesos(uint64(l)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return nil + return n } -func (this *HealthCheck) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - that1, ok := that.(*HealthCheck) - if !ok { - return false +func (m *FrameworkInfo) Size() (n int) { + var l int + _ = l + if m.User != nil { + l = len(*m.User) + n += 1 + l + sovMesos(uint64(l)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.Name != nil { + l = len(*m.Name) + n += 1 + l + sovMesos(uint64(l)) } - if !this.Http.Equal(that1.Http) { - return false + if m.Id != nil { + l = m.Id.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.DelaySeconds != nil && that1.DelaySeconds != nil { - if *this.DelaySeconds != *that1.DelaySeconds { - return false - } - } else if this.DelaySeconds != nil { - return false - } else if that1.DelaySeconds != nil { - return false + if m.FailoverTimeout != nil { + n += 9 } - if this.IntervalSeconds != nil && that1.IntervalSeconds != nil { - if *this.IntervalSeconds != *that1.IntervalSeconds { - return false - } - } else if this.IntervalSeconds != nil { - return false - } else if that1.IntervalSeconds != nil { - return false + if m.Checkpoint != nil { + n += 2 } - if this.TimeoutSeconds != nil && that1.TimeoutSeconds != nil { - if *this.TimeoutSeconds != *that1.TimeoutSeconds { - return false - } - } else if this.TimeoutSeconds != nil { - return false - } else if that1.TimeoutSeconds != nil { - return false + if m.Role != nil { + l = len(*m.Role) + n += 1 + l + sovMesos(uint64(l)) } - if this.ConsecutiveFailures != nil && that1.ConsecutiveFailures != nil { - if *this.ConsecutiveFailures != *that1.ConsecutiveFailures { - return false - } - } else if this.ConsecutiveFailures != nil { - return false - } else if that1.ConsecutiveFailures != nil { - return false + if m.Hostname != nil { + l = len(*m.Hostname) + n += 1 + l + sovMesos(uint64(l)) } - if this.GracePeriodSeconds != nil && that1.GracePeriodSeconds != nil { - if *this.GracePeriodSeconds != *that1.GracePeriodSeconds { - return false - } - } else if this.GracePeriodSeconds != nil { - return false - } else if that1.GracePeriodSeconds != nil { - return false + if m.Principal != nil { + l = len(*m.Principal) + n += 1 + l + sovMesos(uint64(l)) } - if !this.Command.Equal(that1.Command) { - return false + if m.WebuiUrl != nil { + l = len(*m.WebuiUrl) + n += 1 + l + sovMesos(uint64(l)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if len(m.Capabilities) > 0 { + for _, e := range m.Capabilities { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) + } } - return true + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n } -func (this *HealthCheck_HTTP) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + +func (m *FrameworkInfo_Capability) Size() (n int) { + var l int + _ = l + if m.Type != nil { + n += 1 + sovMesos(uint64(*m.Type)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } + return n +} - that1, ok := that.(*HealthCheck_HTTP) - if !ok { - return fmt3.Errorf("that is not of type *HealthCheck_HTTP") +func (m *HealthCheck) Size() (n int) { + var l int + _ = l + if m.Http != nil { + l = m.Http.Size() + n += 1 + l + sovMesos(uint64(l)) } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *HealthCheck_HTTP but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *HealthCheck_HTTPbut is not nil && this == nil") + if m.DelaySeconds != nil { + n += 9 } - if this.Port != nil && that1.Port != nil { - if *this.Port != *that1.Port { - return fmt3.Errorf("Port this(%v) Not Equal that(%v)", *this.Port, *that1.Port) - } - } else if this.Port != nil { - return fmt3.Errorf("this.Port == nil && that.Port != nil") - } else if that1.Port != nil { - return fmt3.Errorf("Port this(%v) Not Equal that(%v)", this.Port, that1.Port) + if m.IntervalSeconds != nil { + n += 9 + } + if m.TimeoutSeconds != nil { + n += 9 + } + if m.ConsecutiveFailures != nil { + n += 1 + sovMesos(uint64(*m.ConsecutiveFailures)) + } + if m.GracePeriodSeconds != nil { + n += 9 + } + if m.Command != nil { + l = m.Command.Size() + n += 1 + l + sovMesos(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.Path != nil && that1.Path != nil { - if *this.Path != *that1.Path { - return fmt3.Errorf("Path this(%v) Not Equal that(%v)", *this.Path, *that1.Path) - } - } else if this.Path != nil { - return fmt3.Errorf("this.Path == nil && that.Path != nil") - } else if that1.Path != nil { - return fmt3.Errorf("Path this(%v) Not Equal that(%v)", this.Path, that1.Path) + return n +} + +func (m *HealthCheck_HTTP) Size() (n int) { + var l int + _ = l + if m.Port != nil { + n += 1 + sovMesos(uint64(*m.Port)) } - if len(this.Statuses) != len(that1.Statuses) { - return fmt3.Errorf("Statuses this(%v) Not Equal that(%v)", len(this.Statuses), len(that1.Statuses)) + if m.Path != nil { + l = len(*m.Path) + n += 1 + l + sovMesos(uint64(l)) } - for i := range this.Statuses { - if this.Statuses[i] != that1.Statuses[i] { - return fmt3.Errorf("Statuses this[%v](%v) Not Equal that[%v](%v)", i, this.Statuses[i], i, that1.Statuses[i]) + if len(m.Statuses) > 0 { + for _, e := range m.Statuses { + n += 1 + sovMesos(uint64(e)) } } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return nil + return n } -func (this *HealthCheck_HTTP) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true + +func (m *CommandInfo) Size() (n int) { + var l int + _ = l + if len(m.Uris) > 0 { + for _, e := range m.Uris { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - return false } - - that1, ok := that.(*HealthCheck_HTTP) - if !ok { - return false + if m.Environment != nil { + l = m.Environment.Size() + n += 1 + l + sovMesos(uint64(l)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.Value != nil { + l = len(*m.Value) + n += 1 + l + sovMesos(uint64(l)) } - if this.Port != nil && that1.Port != nil { - if *this.Port != *that1.Port { - return false - } - } else if this.Port != nil { - return false - } else if that1.Port != nil { - return false + if m.Container != nil { + l = m.Container.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.Path != nil && that1.Path != nil { - if *this.Path != *that1.Path { - return false - } - } else if this.Path != nil { - return false - } else if that1.Path != nil { - return false + if m.User != nil { + l = len(*m.User) + n += 1 + l + sovMesos(uint64(l)) } - if len(this.Statuses) != len(that1.Statuses) { - return false + if m.Shell != nil { + n += 2 } - for i := range this.Statuses { - if this.Statuses[i] != that1.Statuses[i] { - return false + if len(m.Arguments) > 0 { + for _, s := range m.Arguments { + l = len(s) + n += 1 + l + sovMesos(uint64(l)) } } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return true + return n } -func (this *CommandInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") - } - that1, ok := that.(*CommandInfo) - if !ok { - return fmt3.Errorf("that is not of type *CommandInfo") +func (m *CommandInfo_URI) Size() (n int) { + var l int + _ = l + if m.Value != nil { + l = len(*m.Value) + n += 1 + l + sovMesos(uint64(l)) } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *CommandInfo but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *CommandInfobut is not nil && this == nil") + if m.Executable != nil { + n += 2 } - if !this.Container.Equal(that1.Container) { - return fmt3.Errorf("Container this(%v) Not Equal that(%v)", this.Container, that1.Container) + if m.Extract != nil { + n += 2 } - if len(this.Uris) != len(that1.Uris) { - return fmt3.Errorf("Uris this(%v) Not Equal that(%v)", len(this.Uris), len(that1.Uris)) + if m.Cache != nil { + n += 2 } - for i := range this.Uris { - if !this.Uris[i].Equal(that1.Uris[i]) { - return fmt3.Errorf("Uris this[%v](%v) Not Equal that[%v](%v)", i, this.Uris[i], i, that1.Uris[i]) - } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if !this.Environment.Equal(that1.Environment) { - return fmt3.Errorf("Environment this(%v) Not Equal that(%v)", this.Environment, that1.Environment) + return n +} + +func (m *CommandInfo_ContainerInfo) Size() (n int) { + var l int + _ = l + if m.Image != nil { + l = len(*m.Image) + n += 1 + l + sovMesos(uint64(l)) } - if this.Shell != nil && that1.Shell != nil { - if *this.Shell != *that1.Shell { - return fmt3.Errorf("Shell this(%v) Not Equal that(%v)", *this.Shell, *that1.Shell) + if len(m.Options) > 0 { + for _, s := range m.Options { + l = len(s) + n += 1 + l + sovMesos(uint64(l)) } - } else if this.Shell != nil { - return fmt3.Errorf("this.Shell == nil && that.Shell != nil") - } else if that1.Shell != nil { - return fmt3.Errorf("Shell this(%v) Not Equal that(%v)", this.Shell, that1.Shell) } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) - } - } else if this.Value != nil { - return fmt3.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if len(this.Arguments) != len(that1.Arguments) { - return fmt3.Errorf("Arguments this(%v) Not Equal that(%v)", len(this.Arguments), len(that1.Arguments)) + return n +} + +func (m *ExecutorInfo) Size() (n int) { + var l int + _ = l + if m.ExecutorId != nil { + l = m.ExecutorId.Size() + n += 1 + l + sovMesos(uint64(l)) } - for i := range this.Arguments { - if this.Arguments[i] != that1.Arguments[i] { - return fmt3.Errorf("Arguments this[%v](%v) Not Equal that[%v](%v)", i, this.Arguments[i], i, that1.Arguments[i]) - } + if m.Data != nil { + l = len(m.Data) + n += 1 + l + sovMesos(uint64(l)) } - if this.User != nil && that1.User != nil { - if *this.User != *that1.User { - return fmt3.Errorf("User this(%v) Not Equal that(%v)", *this.User, *that1.User) + if len(m.Resources) > 0 { + for _, e := range m.Resources { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.User != nil { - return fmt3.Errorf("this.User == nil && that.User != nil") - } else if that1.User != nil { - return fmt3.Errorf("User this(%v) Not Equal that(%v)", this.User, that1.User) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *CommandInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false + if m.Command != nil { + l = m.Command.Size() + n += 1 + l + sovMesos(uint64(l)) } - - that1, ok := that.(*CommandInfo) - if !ok { - return false + if m.FrameworkId != nil { + l = m.FrameworkId.Size() + n += 1 + l + sovMesos(uint64(l)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.Name != nil { + l = len(*m.Name) + n += 1 + l + sovMesos(uint64(l)) } - if !this.Container.Equal(that1.Container) { - return false + if m.Source != nil { + l = len(*m.Source) + n += 1 + l + sovMesos(uint64(l)) } - if len(this.Uris) != len(that1.Uris) { - return false + if m.Container != nil { + l = m.Container.Size() + n += 1 + l + sovMesos(uint64(l)) } - for i := range this.Uris { - if !this.Uris[i].Equal(that1.Uris[i]) { - return false - } + if m.Discovery != nil { + l = m.Discovery.Size() + n += 1 + l + sovMesos(uint64(l)) } - if !this.Environment.Equal(that1.Environment) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.Shell != nil && that1.Shell != nil { - if *this.Shell != *that1.Shell { - return false - } - } else if this.Shell != nil { - return false - } else if that1.Shell != nil { - return false + return n +} + +func (m *MasterInfo) Size() (n int) { + var l int + _ = l + if m.Id != nil { + l = len(*m.Id) + n += 1 + l + sovMesos(uint64(l)) } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false - } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false + if m.Ip != nil { + n += 1 + sovMesos(uint64(*m.Ip)) } - if len(this.Arguments) != len(that1.Arguments) { - return false + if m.Port != nil { + n += 1 + sovMesos(uint64(*m.Port)) } - for i := range this.Arguments { - if this.Arguments[i] != that1.Arguments[i] { - return false - } + if m.Pid != nil { + l = len(*m.Pid) + n += 1 + l + sovMesos(uint64(l)) } - if this.User != nil && that1.User != nil { - if *this.User != *that1.User { - return false - } - } else if this.User != nil { - return false - } else if that1.User != nil { - return false + if m.Hostname != nil { + l = len(*m.Hostname) + n += 1 + l + sovMesos(uint64(l)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.Version != nil { + l = len(*m.Version) + n += 1 + l + sovMesos(uint64(l)) } - return true -} -func (this *CommandInfo_URI) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } + return n +} - that1, ok := that.(*CommandInfo_URI) - if !ok { - return fmt3.Errorf("that is not of type *CommandInfo_URI") +func (m *SlaveInfo) Size() (n int) { + var l int + _ = l + if m.Hostname != nil { + l = len(*m.Hostname) + n += 1 + l + sovMesos(uint64(l)) } - if that1 == nil { - if this == nil { - return nil + if len(m.Resources) > 0 { + for _, e := range m.Resources { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - return fmt3.Errorf("that is type *CommandInfo_URI but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *CommandInfo_URIbut is not nil && this == nil") } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) + if len(m.Attributes) > 0 { + for _, e := range m.Attributes { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.Value != nil { - return fmt3.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) } - if this.Executable != nil && that1.Executable != nil { - if *this.Executable != *that1.Executable { - return fmt3.Errorf("Executable this(%v) Not Equal that(%v)", *this.Executable, *that1.Executable) - } - } else if this.Executable != nil { - return fmt3.Errorf("this.Executable == nil && that.Executable != nil") - } else if that1.Executable != nil { - return fmt3.Errorf("Executable this(%v) Not Equal that(%v)", this.Executable, that1.Executable) + if m.Id != nil { + l = m.Id.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.Extract != nil && that1.Extract != nil { - if *this.Extract != *that1.Extract { - return fmt3.Errorf("Extract this(%v) Not Equal that(%v)", *this.Extract, *that1.Extract) - } - } else if this.Extract != nil { - return fmt3.Errorf("this.Extract == nil && that.Extract != nil") - } else if that1.Extract != nil { - return fmt3.Errorf("Extract this(%v) Not Equal that(%v)", this.Extract, that1.Extract) + if m.Checkpoint != nil { + n += 2 } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if m.Port != nil { + n += 1 + sovMesos(uint64(*m.Port)) } - return nil -} -func (this *CommandInfo_URI) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } + return n +} - that1, ok := that.(*CommandInfo_URI) - if !ok { - return false +func (m *Value) Size() (n int) { + var l int + _ = l + if m.Type != nil { + n += 1 + sovMesos(uint64(*m.Type)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.Scalar != nil { + l = m.Scalar.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false - } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false + if m.Ranges != nil { + l = m.Ranges.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.Executable != nil && that1.Executable != nil { - if *this.Executable != *that1.Executable { - return false - } - } else if this.Executable != nil { - return false - } else if that1.Executable != nil { - return false + if m.Set != nil { + l = m.Set.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.Extract != nil && that1.Extract != nil { - if *this.Extract != *that1.Extract { - return false - } - } else if this.Extract != nil { - return false - } else if that1.Extract != nil { - return false + if m.Text != nil { + l = m.Text.Size() + n += 1 + l + sovMesos(uint64(l)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return true + return n } -func (this *CommandInfo_ContainerInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + +func (m *Value_Scalar) Size() (n int) { + var l int + _ = l + if m.Value != nil { + n += 9 + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } + return n +} - that1, ok := that.(*CommandInfo_ContainerInfo) - if !ok { - return fmt3.Errorf("that is not of type *CommandInfo_ContainerInfo") +func (m *Value_Range) Size() (n int) { + var l int + _ = l + if m.Begin != nil { + n += 1 + sovMesos(uint64(*m.Begin)) } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *CommandInfo_ContainerInfo but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *CommandInfo_ContainerInfobut is not nil && this == nil") + if m.End != nil { + n += 1 + sovMesos(uint64(*m.End)) } - if this.Image != nil && that1.Image != nil { - if *this.Image != *that1.Image { - return fmt3.Errorf("Image this(%v) Not Equal that(%v)", *this.Image, *that1.Image) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Value_Ranges) Size() (n int) { + var l int + _ = l + if len(m.Range) > 0 { + for _, e := range m.Range { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.Image != nil { - return fmt3.Errorf("this.Image == nil && that.Image != nil") - } else if that1.Image != nil { - return fmt3.Errorf("Image this(%v) Not Equal that(%v)", this.Image, that1.Image) } - if len(this.Options) != len(that1.Options) { - return fmt3.Errorf("Options this(%v) Not Equal that(%v)", len(this.Options), len(that1.Options)) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - for i := range this.Options { - if this.Options[i] != that1.Options[i] { - return fmt3.Errorf("Options this[%v](%v) Not Equal that[%v](%v)", i, this.Options[i], i, that1.Options[i]) + return n +} + +func (m *Value_Set) Size() (n int) { + var l int + _ = l + if len(m.Item) > 0 { + for _, s := range m.Item { + l = len(s) + n += 1 + l + sovMesos(uint64(l)) } } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return nil + return n } -func (this *CommandInfo_ContainerInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false + +func (m *Value_Text) Size() (n int) { + var l int + _ = l + if m.Value != nil { + l = len(*m.Value) + n += 1 + l + sovMesos(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } + return n +} - that1, ok := that.(*CommandInfo_ContainerInfo) - if !ok { - return false +func (m *Attribute) Size() (n int) { + var l int + _ = l + if m.Name != nil { + l = len(*m.Name) + n += 1 + l + sovMesos(uint64(l)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.Type != nil { + n += 1 + sovMesos(uint64(*m.Type)) } - if this.Image != nil && that1.Image != nil { - if *this.Image != *that1.Image { - return false - } - } else if this.Image != nil { - return false - } else if that1.Image != nil { - return false + if m.Scalar != nil { + l = m.Scalar.Size() + n += 1 + l + sovMesos(uint64(l)) } - if len(this.Options) != len(that1.Options) { - return false + if m.Ranges != nil { + l = m.Ranges.Size() + n += 1 + l + sovMesos(uint64(l)) } - for i := range this.Options { - if this.Options[i] != that1.Options[i] { - return false - } + if m.Text != nil { + l = m.Text.Size() + n += 1 + l + sovMesos(uint64(l)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.Set != nil { + l = m.Set.Size() + n += 1 + l + sovMesos(uint64(l)) } - return true -} -func (this *ExecutorInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } + return n +} - that1, ok := that.(*ExecutorInfo) - if !ok { - return fmt3.Errorf("that is not of type *ExecutorInfo") +func (m *Resource) Size() (n int) { + var l int + _ = l + if m.Name != nil { + l = len(*m.Name) + n += 1 + l + sovMesos(uint64(l)) } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *ExecutorInfo but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *ExecutorInfobut is not nil && this == nil") + if m.Type != nil { + n += 1 + sovMesos(uint64(*m.Type)) } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return fmt3.Errorf("ExecutorId this(%v) Not Equal that(%v)", this.ExecutorId, that1.ExecutorId) + if m.Scalar != nil { + l = m.Scalar.Size() + n += 1 + l + sovMesos(uint64(l)) } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt3.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) + if m.Ranges != nil { + l = m.Ranges.Size() + n += 1 + l + sovMesos(uint64(l)) } - if !this.Command.Equal(that1.Command) { - return fmt3.Errorf("Command this(%v) Not Equal that(%v)", this.Command, that1.Command) + if m.Set != nil { + l = m.Set.Size() + n += 1 + l + sovMesos(uint64(l)) } - if !this.Container.Equal(that1.Container) { - return fmt3.Errorf("Container this(%v) Not Equal that(%v)", this.Container, that1.Container) + if m.Role != nil { + l = len(*m.Role) + n += 1 + l + sovMesos(uint64(l)) } - if len(this.Resources) != len(that1.Resources) { - return fmt3.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) + if m.Disk != nil { + l = m.Disk.Size() + n += 1 + l + sovMesos(uint64(l)) } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return fmt3.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) - } + if m.Reservation != nil { + l = m.Reservation.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt3.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) - } - } else if this.Name != nil { - return fmt3.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt3.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) + if m.Revocable != nil { + l = m.Revocable.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.Source != nil && that1.Source != nil { - if *this.Source != *that1.Source { - return fmt3.Errorf("Source this(%v) Not Equal that(%v)", *this.Source, *that1.Source) - } - } else if this.Source != nil { - return fmt3.Errorf("this.Source == nil && that.Source != nil") - } else if that1.Source != nil { - return fmt3.Errorf("Source this(%v) Not Equal that(%v)", this.Source, that1.Source) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if !bytes.Equal(this.Data, that1.Data) { - return fmt3.Errorf("Data this(%v) Not Equal that(%v)", this.Data, that1.Data) + return n +} + +func (m *Resource_ReservationInfo) Size() (n int) { + var l int + _ = l + if m.Principal != nil { + l = len(*m.Principal) + n += 1 + l + sovMesos(uint64(l)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return nil + return n } -func (this *ExecutorInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false + +func (m *Resource_DiskInfo) Size() (n int) { + var l int + _ = l + if m.Persistence != nil { + l = m.Persistence.Size() + n += 1 + l + sovMesos(uint64(l)) + } + if m.Volume != nil { + l = m.Volume.Size() + n += 1 + l + sovMesos(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } + return n +} - that1, ok := that.(*ExecutorInfo) - if !ok { - return false +func (m *Resource_DiskInfo_Persistence) Size() (n int) { + var l int + _ = l + if m.Id != nil { + l = len(*m.Id) + n += 1 + l + sovMesos(uint64(l)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return false + return n +} + +func (m *Resource_RevocableInfo) Size() (n int) { + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false + return n +} + +func (m *TrafficControlStatistics) Size() (n int) { + var l int + _ = l + if m.Id != nil { + l = len(*m.Id) + n += 1 + l + sovMesos(uint64(l)) } - if !this.Command.Equal(that1.Command) { - return false + if m.Backlog != nil { + n += 1 + sovMesos(uint64(*m.Backlog)) } - if !this.Container.Equal(that1.Container) { - return false + if m.Bytes != nil { + n += 1 + sovMesos(uint64(*m.Bytes)) } - if len(this.Resources) != len(that1.Resources) { - return false + if m.Drops != nil { + n += 1 + sovMesos(uint64(*m.Drops)) } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return false - } + if m.Overlimits != nil { + n += 1 + sovMesos(uint64(*m.Overlimits)) } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false - } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false + if m.Packets != nil { + n += 1 + sovMesos(uint64(*m.Packets)) } - if this.Source != nil && that1.Source != nil { - if *this.Source != *that1.Source { - return false - } - } else if this.Source != nil { - return false - } else if that1.Source != nil { - return false + if m.Qlen != nil { + n += 1 + sovMesos(uint64(*m.Qlen)) } - if !bytes.Equal(this.Data, that1.Data) { - return false + if m.Ratebps != nil { + n += 1 + sovMesos(uint64(*m.Ratebps)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.Ratepps != nil { + n += 1 + sovMesos(uint64(*m.Ratepps)) } - return true -} -func (this *MasterInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if m.Requeues != nil { + n += 1 + sovMesos(uint64(*m.Requeues)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } + return n +} - that1, ok := that.(*MasterInfo) - if !ok { - return fmt3.Errorf("that is not of type *MasterInfo") +func (m *ResourceStatistics) Size() (n int) { + var l int + _ = l + if m.Timestamp != nil { + n += 9 } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *MasterInfo but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *MasterInfobut is not nil && this == nil") + if m.CpusUserTimeSecs != nil { + n += 9 } - if this.Id != nil && that1.Id != nil { - if *this.Id != *that1.Id { - return fmt3.Errorf("Id this(%v) Not Equal that(%v)", *this.Id, *that1.Id) - } - } else if this.Id != nil { - return fmt3.Errorf("this.Id == nil && that.Id != nil") - } else if that1.Id != nil { - return fmt3.Errorf("Id this(%v) Not Equal that(%v)", this.Id, that1.Id) + if m.CpusSystemTimeSecs != nil { + n += 9 } - if this.Ip != nil && that1.Ip != nil { - if *this.Ip != *that1.Ip { - return fmt3.Errorf("Ip this(%v) Not Equal that(%v)", *this.Ip, *that1.Ip) - } - } else if this.Ip != nil { - return fmt3.Errorf("this.Ip == nil && that.Ip != nil") - } else if that1.Ip != nil { - return fmt3.Errorf("Ip this(%v) Not Equal that(%v)", this.Ip, that1.Ip) + if m.CpusLimit != nil { + n += 9 } - if this.Port != nil && that1.Port != nil { - if *this.Port != *that1.Port { - return fmt3.Errorf("Port this(%v) Not Equal that(%v)", *this.Port, *that1.Port) - } - } else if this.Port != nil { - return fmt3.Errorf("this.Port == nil && that.Port != nil") - } else if that1.Port != nil { - return fmt3.Errorf("Port this(%v) Not Equal that(%v)", this.Port, that1.Port) + if m.MemRssBytes != nil { + n += 1 + sovMesos(uint64(*m.MemRssBytes)) } - if this.Pid != nil && that1.Pid != nil { - if *this.Pid != *that1.Pid { - return fmt3.Errorf("Pid this(%v) Not Equal that(%v)", *this.Pid, *that1.Pid) - } - } else if this.Pid != nil { - return fmt3.Errorf("this.Pid == nil && that.Pid != nil") - } else if that1.Pid != nil { - return fmt3.Errorf("Pid this(%v) Not Equal that(%v)", this.Pid, that1.Pid) + if m.MemLimitBytes != nil { + n += 1 + sovMesos(uint64(*m.MemLimitBytes)) } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return fmt3.Errorf("Hostname this(%v) Not Equal that(%v)", *this.Hostname, *that1.Hostname) - } - } else if this.Hostname != nil { - return fmt3.Errorf("this.Hostname == nil && that.Hostname != nil") - } else if that1.Hostname != nil { - return fmt3.Errorf("Hostname this(%v) Not Equal that(%v)", this.Hostname, that1.Hostname) + if m.CpusNrPeriods != nil { + n += 1 + sovMesos(uint64(*m.CpusNrPeriods)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if m.CpusNrThrottled != nil { + n += 1 + sovMesos(uint64(*m.CpusNrThrottled)) } - return nil -} -func (this *MasterInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false + if m.CpusThrottledTimeSecs != nil { + n += 9 + } + if m.MemFileBytes != nil { + n += 1 + sovMesos(uint64(*m.MemFileBytes)) + } + if m.MemAnonBytes != nil { + n += 1 + sovMesos(uint64(*m.MemAnonBytes)) } - - that1, ok := that.(*MasterInfo) - if !ok { - return false + if m.MemMappedFileBytes != nil { + n += 1 + sovMesos(uint64(*m.MemMappedFileBytes)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.Perf != nil { + l = m.Perf.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.Id != nil && that1.Id != nil { - if *this.Id != *that1.Id { - return false - } - } else if this.Id != nil { - return false - } else if that1.Id != nil { - return false + if m.NetRxPackets != nil { + n += 1 + sovMesos(uint64(*m.NetRxPackets)) } - if this.Ip != nil && that1.Ip != nil { - if *this.Ip != *that1.Ip { - return false - } - } else if this.Ip != nil { - return false - } else if that1.Ip != nil { - return false + if m.NetRxBytes != nil { + n += 1 + sovMesos(uint64(*m.NetRxBytes)) } - if this.Port != nil && that1.Port != nil { - if *this.Port != *that1.Port { - return false - } - } else if this.Port != nil { - return false - } else if that1.Port != nil { - return false + if m.NetRxErrors != nil { + n += 2 + sovMesos(uint64(*m.NetRxErrors)) } - if this.Pid != nil && that1.Pid != nil { - if *this.Pid != *that1.Pid { - return false - } - } else if this.Pid != nil { - return false - } else if that1.Pid != nil { - return false + if m.NetRxDropped != nil { + n += 2 + sovMesos(uint64(*m.NetRxDropped)) } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return false - } - } else if this.Hostname != nil { - return false - } else if that1.Hostname != nil { - return false + if m.NetTxPackets != nil { + n += 2 + sovMesos(uint64(*m.NetTxPackets)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.NetTxBytes != nil { + n += 2 + sovMesos(uint64(*m.NetTxBytes)) } - return true -} -func (this *SlaveInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if m.NetTxErrors != nil { + n += 2 + sovMesos(uint64(*m.NetTxErrors)) } - - that1, ok := that.(*SlaveInfo) - if !ok { - return fmt3.Errorf("that is not of type *SlaveInfo") + if m.NetTxDropped != nil { + n += 2 + sovMesos(uint64(*m.NetTxDropped)) } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *SlaveInfo but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *SlaveInfobut is not nil && this == nil") + if m.NetTcpRttMicrosecsP50 != nil { + n += 10 } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return fmt3.Errorf("Hostname this(%v) Not Equal that(%v)", *this.Hostname, *that1.Hostname) - } - } else if this.Hostname != nil { - return fmt3.Errorf("this.Hostname == nil && that.Hostname != nil") - } else if that1.Hostname != nil { - return fmt3.Errorf("Hostname this(%v) Not Equal that(%v)", this.Hostname, that1.Hostname) + if m.NetTcpRttMicrosecsP90 != nil { + n += 10 } - if this.Port != nil && that1.Port != nil { - if *this.Port != *that1.Port { - return fmt3.Errorf("Port this(%v) Not Equal that(%v)", *this.Port, *that1.Port) - } - } else if this.Port != nil { - return fmt3.Errorf("this.Port == nil && that.Port != nil") - } else if that1.Port != nil { - return fmt3.Errorf("Port this(%v) Not Equal that(%v)", this.Port, that1.Port) + if m.NetTcpRttMicrosecsP95 != nil { + n += 10 } - if len(this.Resources) != len(that1.Resources) { - return fmt3.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) + if m.NetTcpRttMicrosecsP99 != nil { + n += 10 } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return fmt3.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) - } + if m.DiskLimitBytes != nil { + n += 2 + sovMesos(uint64(*m.DiskLimitBytes)) } - if len(this.Attributes) != len(that1.Attributes) { - return fmt3.Errorf("Attributes this(%v) Not Equal that(%v)", len(this.Attributes), len(that1.Attributes)) + if m.DiskUsedBytes != nil { + n += 2 + sovMesos(uint64(*m.DiskUsedBytes)) } - for i := range this.Attributes { - if !this.Attributes[i].Equal(that1.Attributes[i]) { - return fmt3.Errorf("Attributes this[%v](%v) Not Equal that[%v](%v)", i, this.Attributes[i], i, that1.Attributes[i]) - } + if m.NetTcpActiveConnections != nil { + n += 10 } - if !this.Id.Equal(that1.Id) { - return fmt3.Errorf("Id this(%v) Not Equal that(%v)", this.Id, that1.Id) + if m.NetTcpTimeWaitConnections != nil { + n += 10 } - if this.Checkpoint != nil && that1.Checkpoint != nil { - if *this.Checkpoint != *that1.Checkpoint { - return fmt3.Errorf("Checkpoint this(%v) Not Equal that(%v)", *this.Checkpoint, *that1.Checkpoint) - } - } else if this.Checkpoint != nil { - return fmt3.Errorf("this.Checkpoint == nil && that.Checkpoint != nil") - } else if that1.Checkpoint != nil { - return fmt3.Errorf("Checkpoint this(%v) Not Equal that(%v)", this.Checkpoint, that1.Checkpoint) + if m.Processes != nil { + n += 2 + sovMesos(uint64(*m.Processes)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if m.Threads != nil { + n += 2 + sovMesos(uint64(*m.Threads)) } - return nil -} -func (this *SlaveInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false + if m.MemLowPressureCounter != nil { + n += 2 + sovMesos(uint64(*m.MemLowPressureCounter)) } - - that1, ok := that.(*SlaveInfo) - if !ok { - return false + if m.MemMediumPressureCounter != nil { + n += 2 + sovMesos(uint64(*m.MemMediumPressureCounter)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.MemCriticalPressureCounter != nil { + n += 2 + sovMesos(uint64(*m.MemCriticalPressureCounter)) } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return false + if len(m.NetTrafficControlStatistics) > 0 { + for _, e := range m.NetTrafficControlStatistics { + l = e.Size() + n += 2 + l + sovMesos(uint64(l)) } - } else if this.Hostname != nil { - return false - } else if that1.Hostname != nil { - return false } - if this.Port != nil && that1.Port != nil { - if *this.Port != *that1.Port { - return false - } - } else if this.Port != nil { - return false - } else if that1.Port != nil { - return false + if m.MemTotalBytes != nil { + n += 2 + sovMesos(uint64(*m.MemTotalBytes)) } - if len(this.Resources) != len(that1.Resources) { - return false + if m.MemTotalMemswBytes != nil { + n += 2 + sovMesos(uint64(*m.MemTotalMemswBytes)) } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return false - } + if m.MemSoftLimitBytes != nil { + n += 2 + sovMesos(uint64(*m.MemSoftLimitBytes)) } - if len(this.Attributes) != len(that1.Attributes) { - return false + if m.MemCacheBytes != nil { + n += 2 + sovMesos(uint64(*m.MemCacheBytes)) } - for i := range this.Attributes { - if !this.Attributes[i].Equal(that1.Attributes[i]) { - return false - } + if m.MemSwapBytes != nil { + n += 2 + sovMesos(uint64(*m.MemSwapBytes)) } - if !this.Id.Equal(that1.Id) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.Checkpoint != nil && that1.Checkpoint != nil { - if *this.Checkpoint != *that1.Checkpoint { - return false + return n +} + +func (m *ResourceUsage) Size() (n int) { + var l int + _ = l + if len(m.Executors) > 0 { + for _, e := range m.Executors { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.Checkpoint != nil { - return false - } else if that1.Checkpoint != nil { - return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return true + return n } -func (this *Value) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") - } - that1, ok := that.(*Value) - if !ok { - return fmt3.Errorf("that is not of type *Value") +func (m *ResourceUsage_Executor) Size() (n int) { + var l int + _ = l + if m.ExecutorInfo != nil { + l = m.ExecutorInfo.Size() + n += 1 + l + sovMesos(uint64(l)) } - if that1 == nil { - if this == nil { - return nil + if len(m.Allocated) > 0 { + for _, e := range m.Allocated { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - return fmt3.Errorf("that is type *Value but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Valuebut is not nil && this == nil") } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt3.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) - } - } else if this.Type != nil { - return fmt3.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt3.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) + if m.Statistics != nil { + l = m.Statistics.Size() + n += 1 + l + sovMesos(uint64(l)) } - if !this.Scalar.Equal(that1.Scalar) { - return fmt3.Errorf("Scalar this(%v) Not Equal that(%v)", this.Scalar, that1.Scalar) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if !this.Ranges.Equal(that1.Ranges) { - return fmt3.Errorf("Ranges this(%v) Not Equal that(%v)", this.Ranges, that1.Ranges) + return n +} + +func (m *PerfStatistics) Size() (n int) { + var l int + _ = l + if m.Timestamp != nil { + n += 9 } - if !this.Set.Equal(that1.Set) { - return fmt3.Errorf("Set this(%v) Not Equal that(%v)", this.Set, that1.Set) + if m.Duration != nil { + n += 9 } - if !this.Text.Equal(that1.Text) { - return fmt3.Errorf("Text this(%v) Not Equal that(%v)", this.Text, that1.Text) + if m.Cycles != nil { + n += 1 + sovMesos(uint64(*m.Cycles)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if m.StalledCyclesFrontend != nil { + n += 1 + sovMesos(uint64(*m.StalledCyclesFrontend)) } - return nil -} -func (this *Value) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false + if m.StalledCyclesBackend != nil { + n += 1 + sovMesos(uint64(*m.StalledCyclesBackend)) } - - that1, ok := that.(*Value) - if !ok { - return false + if m.Instructions != nil { + n += 1 + sovMesos(uint64(*m.Instructions)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.CacheReferences != nil { + n += 1 + sovMesos(uint64(*m.CacheReferences)) } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false - } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false + if m.CacheMisses != nil { + n += 1 + sovMesos(uint64(*m.CacheMisses)) } - if !this.Scalar.Equal(that1.Scalar) { - return false + if m.Branches != nil { + n += 1 + sovMesos(uint64(*m.Branches)) } - if !this.Ranges.Equal(that1.Ranges) { - return false + if m.BranchMisses != nil { + n += 1 + sovMesos(uint64(*m.BranchMisses)) } - if !this.Set.Equal(that1.Set) { - return false + if m.BusCycles != nil { + n += 1 + sovMesos(uint64(*m.BusCycles)) } - if !this.Text.Equal(that1.Text) { - return false + if m.RefCycles != nil { + n += 1 + sovMesos(uint64(*m.RefCycles)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.CpuClock != nil { + n += 9 } - return true -} -func (this *Value_Scalar) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if m.TaskClock != nil { + n += 9 } - - that1, ok := that.(*Value_Scalar) - if !ok { - return fmt3.Errorf("that is not of type *Value_Scalar") + if m.PageFaults != nil { + n += 1 + sovMesos(uint64(*m.PageFaults)) } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *Value_Scalar but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Value_Scalarbut is not nil && this == nil") + if m.MinorFaults != nil { + n += 2 + sovMesos(uint64(*m.MinorFaults)) } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) - } - } else if this.Value != nil { - return fmt3.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + if m.MajorFaults != nil { + n += 2 + sovMesos(uint64(*m.MajorFaults)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if m.ContextSwitches != nil { + n += 2 + sovMesos(uint64(*m.ContextSwitches)) } - return nil -} -func (this *Value_Scalar) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false + if m.CpuMigrations != nil { + n += 2 + sovMesos(uint64(*m.CpuMigrations)) } - - that1, ok := that.(*Value_Scalar) - if !ok { - return false + if m.AlignmentFaults != nil { + n += 2 + sovMesos(uint64(*m.AlignmentFaults)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.EmulationFaults != nil { + n += 2 + sovMesos(uint64(*m.EmulationFaults)) } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false - } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false + if m.L1DcacheLoads != nil { + n += 2 + sovMesos(uint64(*m.L1DcacheLoads)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.L1DcacheLoadMisses != nil { + n += 2 + sovMesos(uint64(*m.L1DcacheLoadMisses)) } - return true -} -func (this *Value_Range) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if m.L1DcacheStores != nil { + n += 2 + sovMesos(uint64(*m.L1DcacheStores)) } - - that1, ok := that.(*Value_Range) - if !ok { - return fmt3.Errorf("that is not of type *Value_Range") + if m.L1DcacheStoreMisses != nil { + n += 2 + sovMesos(uint64(*m.L1DcacheStoreMisses)) } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *Value_Range but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Value_Rangebut is not nil && this == nil") + if m.L1DcachePrefetches != nil { + n += 2 + sovMesos(uint64(*m.L1DcachePrefetches)) } - if this.Begin != nil && that1.Begin != nil { - if *this.Begin != *that1.Begin { - return fmt3.Errorf("Begin this(%v) Not Equal that(%v)", *this.Begin, *that1.Begin) - } - } else if this.Begin != nil { - return fmt3.Errorf("this.Begin == nil && that.Begin != nil") - } else if that1.Begin != nil { - return fmt3.Errorf("Begin this(%v) Not Equal that(%v)", this.Begin, that1.Begin) + if m.L1DcachePrefetchMisses != nil { + n += 2 + sovMesos(uint64(*m.L1DcachePrefetchMisses)) } - if this.End != nil && that1.End != nil { - if *this.End != *that1.End { - return fmt3.Errorf("End this(%v) Not Equal that(%v)", *this.End, *that1.End) - } - } else if this.End != nil { - return fmt3.Errorf("this.End == nil && that.End != nil") - } else if that1.End != nil { - return fmt3.Errorf("End this(%v) Not Equal that(%v)", this.End, that1.End) + if m.L1IcacheLoads != nil { + n += 2 + sovMesos(uint64(*m.L1IcacheLoads)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if m.L1IcacheLoadMisses != nil { + n += 2 + sovMesos(uint64(*m.L1IcacheLoadMisses)) } - return nil -} -func (this *Value_Range) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false + if m.L1IcachePrefetches != nil { + n += 2 + sovMesos(uint64(*m.L1IcachePrefetches)) } - - that1, ok := that.(*Value_Range) - if !ok { - return false + if m.L1IcachePrefetchMisses != nil { + n += 2 + sovMesos(uint64(*m.L1IcachePrefetchMisses)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.LlcLoads != nil { + n += 2 + sovMesos(uint64(*m.LlcLoads)) } - if this.Begin != nil && that1.Begin != nil { - if *this.Begin != *that1.Begin { - return false - } - } else if this.Begin != nil { - return false - } else if that1.Begin != nil { - return false + if m.LlcLoadMisses != nil { + n += 2 + sovMesos(uint64(*m.LlcLoadMisses)) } - if this.End != nil && that1.End != nil { - if *this.End != *that1.End { - return false - } - } else if this.End != nil { - return false - } else if that1.End != nil { - return false + if m.LlcStores != nil { + n += 2 + sovMesos(uint64(*m.LlcStores)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.LlcStoreMisses != nil { + n += 2 + sovMesos(uint64(*m.LlcStoreMisses)) } - return true -} -func (this *Value_Ranges) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if m.LlcPrefetches != nil { + n += 2 + sovMesos(uint64(*m.LlcPrefetches)) } - - that1, ok := that.(*Value_Ranges) - if !ok { - return fmt3.Errorf("that is not of type *Value_Ranges") + if m.LlcPrefetchMisses != nil { + n += 2 + sovMesos(uint64(*m.LlcPrefetchMisses)) } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *Value_Ranges but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Value_Rangesbut is not nil && this == nil") + if m.DtlbLoads != nil { + n += 2 + sovMesos(uint64(*m.DtlbLoads)) } - if len(this.Range) != len(that1.Range) { - return fmt3.Errorf("Range this(%v) Not Equal that(%v)", len(this.Range), len(that1.Range)) + if m.DtlbLoadMisses != nil { + n += 2 + sovMesos(uint64(*m.DtlbLoadMisses)) } - for i := range this.Range { - if !this.Range[i].Equal(that1.Range[i]) { - return fmt3.Errorf("Range this[%v](%v) Not Equal that[%v](%v)", i, this.Range[i], i, that1.Range[i]) - } + if m.DtlbStores != nil { + n += 2 + sovMesos(uint64(*m.DtlbStores)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if m.DtlbStoreMisses != nil { + n += 2 + sovMesos(uint64(*m.DtlbStoreMisses)) } - return nil -} -func (this *Value_Ranges) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false + if m.DtlbPrefetches != nil { + n += 2 + sovMesos(uint64(*m.DtlbPrefetches)) } - - that1, ok := that.(*Value_Ranges) - if !ok { - return false + if m.DtlbPrefetchMisses != nil { + n += 2 + sovMesos(uint64(*m.DtlbPrefetchMisses)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.ItlbLoads != nil { + n += 2 + sovMesos(uint64(*m.ItlbLoads)) + } + if m.ItlbLoadMisses != nil { + n += 2 + sovMesos(uint64(*m.ItlbLoadMisses)) } - if len(this.Range) != len(that1.Range) { - return false + if m.BranchLoads != nil { + n += 2 + sovMesos(uint64(*m.BranchLoads)) } - for i := range this.Range { - if !this.Range[i].Equal(that1.Range[i]) { - return false - } + if m.BranchLoadMisses != nil { + n += 2 + sovMesos(uint64(*m.BranchLoadMisses)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.NodeLoads != nil { + n += 2 + sovMesos(uint64(*m.NodeLoads)) } - return true -} -func (this *Value_Set) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if m.NodeLoadMisses != nil { + n += 2 + sovMesos(uint64(*m.NodeLoadMisses)) } - - that1, ok := that.(*Value_Set) - if !ok { - return fmt3.Errorf("that is not of type *Value_Set") + if m.NodeStores != nil { + n += 2 + sovMesos(uint64(*m.NodeStores)) } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *Value_Set but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Value_Setbut is not nil && this == nil") + if m.NodeStoreMisses != nil { + n += 2 + sovMesos(uint64(*m.NodeStoreMisses)) } - if len(this.Item) != len(that1.Item) { - return fmt3.Errorf("Item this(%v) Not Equal that(%v)", len(this.Item), len(that1.Item)) + if m.NodePrefetches != nil { + n += 2 + sovMesos(uint64(*m.NodePrefetches)) } - for i := range this.Item { - if this.Item[i] != that1.Item[i] { - return fmt3.Errorf("Item this[%v](%v) Not Equal that[%v](%v)", i, this.Item[i], i, that1.Item[i]) - } + if m.NodePrefetchMisses != nil { + n += 2 + sovMesos(uint64(*m.NodePrefetchMisses)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return nil + return n } -func (this *Value_Set) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - that1, ok := that.(*Value_Set) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.Item) != len(that1.Item) { - return false +func (m *Request) Size() (n int) { + var l int + _ = l + if m.SlaveId != nil { + l = m.SlaveId.Size() + n += 1 + l + sovMesos(uint64(l)) } - for i := range this.Item { - if this.Item[i] != that1.Item[i] { - return false + if len(m.Resources) > 0 { + for _, e := range m.Resources { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return true + return n } -func (this *Value_Text) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") - } - that1, ok := that.(*Value_Text) - if !ok { - return fmt3.Errorf("that is not of type *Value_Text") +func (m *Offer) Size() (n int) { + var l int + _ = l + if m.Id != nil { + l = m.Id.Size() + n += 1 + l + sovMesos(uint64(l)) } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *Value_Text but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Value_Textbut is not nil && this == nil") + if m.FrameworkId != nil { + l = m.FrameworkId.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) - } - } else if this.Value != nil { - return fmt3.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + if m.SlaveId != nil { + l = m.SlaveId.Size() + n += 1 + l + sovMesos(uint64(l)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if m.Hostname != nil { + l = len(*m.Hostname) + n += 1 + l + sovMesos(uint64(l)) } - return nil -} -func (this *Value_Text) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true + if len(m.Resources) > 0 { + for _, e := range m.Resources { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - return false - } - - that1, ok := that.(*Value_Text) - if !ok { - return false } - if that1 == nil { - if this == nil { - return true + if len(m.ExecutorIds) > 0 { + for _, e := range m.ExecutorIds { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - return false - } else if this == nil { - return false } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false + if len(m.Attributes) > 0 { + for _, e := range m.Attributes { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return true + return n } -func (this *Attribute) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") - } - that1, ok := that.(*Attribute) - if !ok { - return fmt3.Errorf("that is not of type *Attribute") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *Attribute but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Attributebut is not nil && this == nil") - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt3.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) - } - } else if this.Name != nil { - return fmt3.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt3.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) +func (m *Offer_Operation) Size() (n int) { + var l int + _ = l + if m.Type != nil { + n += 1 + sovMesos(uint64(*m.Type)) } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt3.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) - } - } else if this.Type != nil { - return fmt3.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt3.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) + if m.Launch != nil { + l = m.Launch.Size() + n += 1 + l + sovMesos(uint64(l)) } - if !this.Scalar.Equal(that1.Scalar) { - return fmt3.Errorf("Scalar this(%v) Not Equal that(%v)", this.Scalar, that1.Scalar) + if m.Reserve != nil { + l = m.Reserve.Size() + n += 1 + l + sovMesos(uint64(l)) } - if !this.Ranges.Equal(that1.Ranges) { - return fmt3.Errorf("Ranges this(%v) Not Equal that(%v)", this.Ranges, that1.Ranges) + if m.Unreserve != nil { + l = m.Unreserve.Size() + n += 1 + l + sovMesos(uint64(l)) } - if !this.Set.Equal(that1.Set) { - return fmt3.Errorf("Set this(%v) Not Equal that(%v)", this.Set, that1.Set) + if m.Create != nil { + l = m.Create.Size() + n += 1 + l + sovMesos(uint64(l)) } - if !this.Text.Equal(that1.Text) { - return fmt3.Errorf("Text this(%v) Not Equal that(%v)", this.Text, that1.Text) + if m.Destroy != nil { + l = m.Destroy.Size() + n += 1 + l + sovMesos(uint64(l)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return nil + return n } -func (this *Attribute) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - that1, ok := that.(*Attribute) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true +func (m *Offer_Operation_Launch) Size() (n int) { + var l int + _ = l + if len(m.TaskInfos) > 0 { + for _, e := range m.TaskInfos { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - return false - } else if this == nil { - return false } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false - } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false - } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false + return n +} + +func (m *Offer_Operation_Reserve) Size() (n int) { + var l int + _ = l + if len(m.Resources) > 0 { + for _, e := range m.Resources { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) + } } - if !this.Scalar.Equal(that1.Scalar) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if !this.Ranges.Equal(that1.Ranges) { - return false + return n +} + +func (m *Offer_Operation_Unreserve) Size() (n int) { + var l int + _ = l + if len(m.Resources) > 0 { + for _, e := range m.Resources { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) + } } - if !this.Set.Equal(that1.Set) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if !this.Text.Equal(that1.Text) { - return false + return n +} + +func (m *Offer_Operation_Create) Size() (n int) { + var l int + _ = l + if len(m.Volumes) > 0 { + for _, e := range m.Volumes { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) + } } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return true + return n } -func (this *Resource) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil + +func (m *Offer_Operation_Destroy) Size() (n int) { + var l int + _ = l + if len(m.Volumes) > 0 { + for _, e := range m.Volumes { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - return fmt3.Errorf("that == nil && this != nil") } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} - that1, ok := that.(*Resource) - if !ok { - return fmt3.Errorf("that is not of type *Resource") +func (m *TaskInfo) Size() (n int) { + var l int + _ = l + if m.Name != nil { + l = len(*m.Name) + n += 1 + l + sovMesos(uint64(l)) } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *Resource but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Resourcebut is not nil && this == nil") + if m.TaskId != nil { + l = m.TaskId.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt3.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) - } - } else if this.Name != nil { - return fmt3.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt3.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) + if m.SlaveId != nil { + l = m.SlaveId.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt3.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) + if len(m.Resources) > 0 { + for _, e := range m.Resources { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.Type != nil { - return fmt3.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt3.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) } - if !this.Scalar.Equal(that1.Scalar) { - return fmt3.Errorf("Scalar this(%v) Not Equal that(%v)", this.Scalar, that1.Scalar) + if m.Executor != nil { + l = m.Executor.Size() + n += 1 + l + sovMesos(uint64(l)) } - if !this.Ranges.Equal(that1.Ranges) { - return fmt3.Errorf("Ranges this(%v) Not Equal that(%v)", this.Ranges, that1.Ranges) + if m.Data != nil { + l = len(m.Data) + n += 1 + l + sovMesos(uint64(l)) } - if !this.Set.Equal(that1.Set) { - return fmt3.Errorf("Set this(%v) Not Equal that(%v)", this.Set, that1.Set) + if m.Command != nil { + l = m.Command.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.Role != nil && that1.Role != nil { - if *this.Role != *that1.Role { - return fmt3.Errorf("Role this(%v) Not Equal that(%v)", *this.Role, *that1.Role) - } - } else if this.Role != nil { - return fmt3.Errorf("this.Role == nil && that.Role != nil") - } else if that1.Role != nil { - return fmt3.Errorf("Role this(%v) Not Equal that(%v)", this.Role, that1.Role) + if m.HealthCheck != nil { + l = m.HealthCheck.Size() + n += 1 + l + sovMesos(uint64(l)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if m.Container != nil { + l = m.Container.Size() + n += 1 + l + sovMesos(uint64(l)) } - return nil -} -func (this *Resource) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false + if m.Labels != nil { + l = m.Labels.Size() + n += 1 + l + sovMesos(uint64(l)) + } + if m.Discovery != nil { + l = m.Discovery.Size() + n += 1 + l + sovMesos(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} - that1, ok := that.(*Resource) - if !ok { - return false +func (m *TaskStatus) Size() (n int) { + var l int + _ = l + if m.TaskId != nil { + l = m.TaskId.Size() + n += 1 + l + sovMesos(uint64(l)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.State != nil { + n += 1 + sovMesos(uint64(*m.State)) } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false - } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false + if m.Data != nil { + l = len(m.Data) + n += 1 + l + sovMesos(uint64(l)) } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false - } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false + if m.Message != nil { + l = len(*m.Message) + n += 1 + l + sovMesos(uint64(l)) } - if !this.Scalar.Equal(that1.Scalar) { - return false + if m.SlaveId != nil { + l = m.SlaveId.Size() + n += 1 + l + sovMesos(uint64(l)) } - if !this.Ranges.Equal(that1.Ranges) { - return false + if m.Timestamp != nil { + n += 9 } - if !this.Set.Equal(that1.Set) { - return false + if m.ExecutorId != nil { + l = m.ExecutorId.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.Role != nil && that1.Role != nil { - if *this.Role != *that1.Role { - return false - } - } else if this.Role != nil { - return false - } else if that1.Role != nil { - return false + if m.Healthy != nil { + n += 2 } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.Source != nil { + n += 1 + sovMesos(uint64(*m.Source)) } - return true -} -func (this *ResourceStatistics) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if m.Reason != nil { + n += 1 + sovMesos(uint64(*m.Reason)) + } + if m.Uuid != nil { + l = len(m.Uuid) + n += 1 + l + sovMesos(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} - that1, ok := that.(*ResourceStatistics) - if !ok { - return fmt3.Errorf("that is not of type *ResourceStatistics") +func (m *Filters) Size() (n int) { + var l int + _ = l + if m.RefuseSeconds != nil { + n += 9 } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *ResourceStatistics but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *ResourceStatisticsbut is not nil && this == nil") + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.Timestamp != nil && that1.Timestamp != nil { - if *this.Timestamp != *that1.Timestamp { - return fmt3.Errorf("Timestamp this(%v) Not Equal that(%v)", *this.Timestamp, *that1.Timestamp) + return n +} + +func (m *Environment) Size() (n int) { + var l int + _ = l + if len(m.Variables) > 0 { + for _, e := range m.Variables { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.Timestamp != nil { - return fmt3.Errorf("this.Timestamp == nil && that.Timestamp != nil") - } else if that1.Timestamp != nil { - return fmt3.Errorf("Timestamp this(%v) Not Equal that(%v)", this.Timestamp, that1.Timestamp) } - if this.CpusUserTimeSecs != nil && that1.CpusUserTimeSecs != nil { - if *this.CpusUserTimeSecs != *that1.CpusUserTimeSecs { - return fmt3.Errorf("CpusUserTimeSecs this(%v) Not Equal that(%v)", *this.CpusUserTimeSecs, *that1.CpusUserTimeSecs) - } - } else if this.CpusUserTimeSecs != nil { - return fmt3.Errorf("this.CpusUserTimeSecs == nil && that.CpusUserTimeSecs != nil") - } else if that1.CpusUserTimeSecs != nil { - return fmt3.Errorf("CpusUserTimeSecs this(%v) Not Equal that(%v)", this.CpusUserTimeSecs, that1.CpusUserTimeSecs) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Environment_Variable) Size() (n int) { + var l int + _ = l + if m.Name != nil { + l = len(*m.Name) + n += 1 + l + sovMesos(uint64(l)) } - if this.CpusSystemTimeSecs != nil && that1.CpusSystemTimeSecs != nil { - if *this.CpusSystemTimeSecs != *that1.CpusSystemTimeSecs { - return fmt3.Errorf("CpusSystemTimeSecs this(%v) Not Equal that(%v)", *this.CpusSystemTimeSecs, *that1.CpusSystemTimeSecs) - } - } else if this.CpusSystemTimeSecs != nil { - return fmt3.Errorf("this.CpusSystemTimeSecs == nil && that.CpusSystemTimeSecs != nil") - } else if that1.CpusSystemTimeSecs != nil { - return fmt3.Errorf("CpusSystemTimeSecs this(%v) Not Equal that(%v)", this.CpusSystemTimeSecs, that1.CpusSystemTimeSecs) + if m.Value != nil { + l = len(*m.Value) + n += 1 + l + sovMesos(uint64(l)) } - if this.CpusLimit != nil && that1.CpusLimit != nil { - if *this.CpusLimit != *that1.CpusLimit { - return fmt3.Errorf("CpusLimit this(%v) Not Equal that(%v)", *this.CpusLimit, *that1.CpusLimit) - } - } else if this.CpusLimit != nil { - return fmt3.Errorf("this.CpusLimit == nil && that.CpusLimit != nil") - } else if that1.CpusLimit != nil { - return fmt3.Errorf("CpusLimit this(%v) Not Equal that(%v)", this.CpusLimit, that1.CpusLimit) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.CpusNrPeriods != nil && that1.CpusNrPeriods != nil { - if *this.CpusNrPeriods != *that1.CpusNrPeriods { - return fmt3.Errorf("CpusNrPeriods this(%v) Not Equal that(%v)", *this.CpusNrPeriods, *that1.CpusNrPeriods) - } - } else if this.CpusNrPeriods != nil { - return fmt3.Errorf("this.CpusNrPeriods == nil && that.CpusNrPeriods != nil") - } else if that1.CpusNrPeriods != nil { - return fmt3.Errorf("CpusNrPeriods this(%v) Not Equal that(%v)", this.CpusNrPeriods, that1.CpusNrPeriods) + return n +} + +func (m *Parameter) Size() (n int) { + var l int + _ = l + if m.Key != nil { + l = len(*m.Key) + n += 1 + l + sovMesos(uint64(l)) } - if this.CpusNrThrottled != nil && that1.CpusNrThrottled != nil { - if *this.CpusNrThrottled != *that1.CpusNrThrottled { - return fmt3.Errorf("CpusNrThrottled this(%v) Not Equal that(%v)", *this.CpusNrThrottled, *that1.CpusNrThrottled) - } - } else if this.CpusNrThrottled != nil { - return fmt3.Errorf("this.CpusNrThrottled == nil && that.CpusNrThrottled != nil") - } else if that1.CpusNrThrottled != nil { - return fmt3.Errorf("CpusNrThrottled this(%v) Not Equal that(%v)", this.CpusNrThrottled, that1.CpusNrThrottled) + if m.Value != nil { + l = len(*m.Value) + n += 1 + l + sovMesos(uint64(l)) } - if this.CpusThrottledTimeSecs != nil && that1.CpusThrottledTimeSecs != nil { - if *this.CpusThrottledTimeSecs != *that1.CpusThrottledTimeSecs { - return fmt3.Errorf("CpusThrottledTimeSecs this(%v) Not Equal that(%v)", *this.CpusThrottledTimeSecs, *that1.CpusThrottledTimeSecs) - } - } else if this.CpusThrottledTimeSecs != nil { - return fmt3.Errorf("this.CpusThrottledTimeSecs == nil && that.CpusThrottledTimeSecs != nil") - } else if that1.CpusThrottledTimeSecs != nil { - return fmt3.Errorf("CpusThrottledTimeSecs this(%v) Not Equal that(%v)", this.CpusThrottledTimeSecs, that1.CpusThrottledTimeSecs) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.MemRssBytes != nil && that1.MemRssBytes != nil { - if *this.MemRssBytes != *that1.MemRssBytes { - return fmt3.Errorf("MemRssBytes this(%v) Not Equal that(%v)", *this.MemRssBytes, *that1.MemRssBytes) + return n +} + +func (m *Parameters) Size() (n int) { + var l int + _ = l + if len(m.Parameter) > 0 { + for _, e := range m.Parameter { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.MemRssBytes != nil { - return fmt3.Errorf("this.MemRssBytes == nil && that.MemRssBytes != nil") - } else if that1.MemRssBytes != nil { - return fmt3.Errorf("MemRssBytes this(%v) Not Equal that(%v)", this.MemRssBytes, that1.MemRssBytes) } - if this.MemLimitBytes != nil && that1.MemLimitBytes != nil { - if *this.MemLimitBytes != *that1.MemLimitBytes { - return fmt3.Errorf("MemLimitBytes this(%v) Not Equal that(%v)", *this.MemLimitBytes, *that1.MemLimitBytes) - } - } else if this.MemLimitBytes != nil { - return fmt3.Errorf("this.MemLimitBytes == nil && that.MemLimitBytes != nil") - } else if that1.MemLimitBytes != nil { - return fmt3.Errorf("MemLimitBytes this(%v) Not Equal that(%v)", this.MemLimitBytes, that1.MemLimitBytes) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.MemFileBytes != nil && that1.MemFileBytes != nil { - if *this.MemFileBytes != *that1.MemFileBytes { - return fmt3.Errorf("MemFileBytes this(%v) Not Equal that(%v)", *this.MemFileBytes, *that1.MemFileBytes) - } - } else if this.MemFileBytes != nil { - return fmt3.Errorf("this.MemFileBytes == nil && that.MemFileBytes != nil") - } else if that1.MemFileBytes != nil { - return fmt3.Errorf("MemFileBytes this(%v) Not Equal that(%v)", this.MemFileBytes, that1.MemFileBytes) + return n +} + +func (m *Credential) Size() (n int) { + var l int + _ = l + if m.Principal != nil { + l = len(*m.Principal) + n += 1 + l + sovMesos(uint64(l)) } - if this.MemAnonBytes != nil && that1.MemAnonBytes != nil { - if *this.MemAnonBytes != *that1.MemAnonBytes { - return fmt3.Errorf("MemAnonBytes this(%v) Not Equal that(%v)", *this.MemAnonBytes, *that1.MemAnonBytes) - } - } else if this.MemAnonBytes != nil { - return fmt3.Errorf("this.MemAnonBytes == nil && that.MemAnonBytes != nil") - } else if that1.MemAnonBytes != nil { - return fmt3.Errorf("MemAnonBytes this(%v) Not Equal that(%v)", this.MemAnonBytes, that1.MemAnonBytes) + if m.Secret != nil { + l = len(m.Secret) + n += 1 + l + sovMesos(uint64(l)) } - if this.MemMappedFileBytes != nil && that1.MemMappedFileBytes != nil { - if *this.MemMappedFileBytes != *that1.MemMappedFileBytes { - return fmt3.Errorf("MemMappedFileBytes this(%v) Not Equal that(%v)", *this.MemMappedFileBytes, *that1.MemMappedFileBytes) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Credentials) Size() (n int) { + var l int + _ = l + if len(m.Credentials) > 0 { + for _, e := range m.Credentials { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.MemMappedFileBytes != nil { - return fmt3.Errorf("this.MemMappedFileBytes == nil && that.MemMappedFileBytes != nil") - } else if that1.MemMappedFileBytes != nil { - return fmt3.Errorf("MemMappedFileBytes this(%v) Not Equal that(%v)", this.MemMappedFileBytes, that1.MemMappedFileBytes) } - if !this.Perf.Equal(that1.Perf) { - return fmt3.Errorf("Perf this(%v) Not Equal that(%v)", this.Perf, that1.Perf) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.NetRxPackets != nil && that1.NetRxPackets != nil { - if *this.NetRxPackets != *that1.NetRxPackets { - return fmt3.Errorf("NetRxPackets this(%v) Not Equal that(%v)", *this.NetRxPackets, *that1.NetRxPackets) - } - } else if this.NetRxPackets != nil { - return fmt3.Errorf("this.NetRxPackets == nil && that.NetRxPackets != nil") - } else if that1.NetRxPackets != nil { - return fmt3.Errorf("NetRxPackets this(%v) Not Equal that(%v)", this.NetRxPackets, that1.NetRxPackets) + return n +} + +func (m *ACL) Size() (n int) { + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.NetRxBytes != nil && that1.NetRxBytes != nil { - if *this.NetRxBytes != *that1.NetRxBytes { - return fmt3.Errorf("NetRxBytes this(%v) Not Equal that(%v)", *this.NetRxBytes, *that1.NetRxBytes) - } - } else if this.NetRxBytes != nil { - return fmt3.Errorf("this.NetRxBytes == nil && that.NetRxBytes != nil") - } else if that1.NetRxBytes != nil { - return fmt3.Errorf("NetRxBytes this(%v) Not Equal that(%v)", this.NetRxBytes, that1.NetRxBytes) + return n +} + +func (m *ACL_Entity) Size() (n int) { + var l int + _ = l + if m.Type != nil { + n += 1 + sovMesos(uint64(*m.Type)) } - if this.NetRxErrors != nil && that1.NetRxErrors != nil { - if *this.NetRxErrors != *that1.NetRxErrors { - return fmt3.Errorf("NetRxErrors this(%v) Not Equal that(%v)", *this.NetRxErrors, *that1.NetRxErrors) + if len(m.Values) > 0 { + for _, s := range m.Values { + l = len(s) + n += 1 + l + sovMesos(uint64(l)) } - } else if this.NetRxErrors != nil { - return fmt3.Errorf("this.NetRxErrors == nil && that.NetRxErrors != nil") - } else if that1.NetRxErrors != nil { - return fmt3.Errorf("NetRxErrors this(%v) Not Equal that(%v)", this.NetRxErrors, that1.NetRxErrors) } - if this.NetRxDropped != nil && that1.NetRxDropped != nil { - if *this.NetRxDropped != *that1.NetRxDropped { - return fmt3.Errorf("NetRxDropped this(%v) Not Equal that(%v)", *this.NetRxDropped, *that1.NetRxDropped) - } - } else if this.NetRxDropped != nil { - return fmt3.Errorf("this.NetRxDropped == nil && that.NetRxDropped != nil") - } else if that1.NetRxDropped != nil { - return fmt3.Errorf("NetRxDropped this(%v) Not Equal that(%v)", this.NetRxDropped, that1.NetRxDropped) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.NetTxPackets != nil && that1.NetTxPackets != nil { - if *this.NetTxPackets != *that1.NetTxPackets { - return fmt3.Errorf("NetTxPackets this(%v) Not Equal that(%v)", *this.NetTxPackets, *that1.NetTxPackets) - } - } else if this.NetTxPackets != nil { - return fmt3.Errorf("this.NetTxPackets == nil && that.NetTxPackets != nil") - } else if that1.NetTxPackets != nil { - return fmt3.Errorf("NetTxPackets this(%v) Not Equal that(%v)", this.NetTxPackets, that1.NetTxPackets) + return n +} + +func (m *ACL_RegisterFramework) Size() (n int) { + var l int + _ = l + if m.Principals != nil { + l = m.Principals.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.NetTxBytes != nil && that1.NetTxBytes != nil { - if *this.NetTxBytes != *that1.NetTxBytes { - return fmt3.Errorf("NetTxBytes this(%v) Not Equal that(%v)", *this.NetTxBytes, *that1.NetTxBytes) - } - } else if this.NetTxBytes != nil { - return fmt3.Errorf("this.NetTxBytes == nil && that.NetTxBytes != nil") - } else if that1.NetTxBytes != nil { - return fmt3.Errorf("NetTxBytes this(%v) Not Equal that(%v)", this.NetTxBytes, that1.NetTxBytes) + if m.Roles != nil { + l = m.Roles.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.NetTxErrors != nil && that1.NetTxErrors != nil { - if *this.NetTxErrors != *that1.NetTxErrors { - return fmt3.Errorf("NetTxErrors this(%v) Not Equal that(%v)", *this.NetTxErrors, *that1.NetTxErrors) - } - } else if this.NetTxErrors != nil { - return fmt3.Errorf("this.NetTxErrors == nil && that.NetTxErrors != nil") - } else if that1.NetTxErrors != nil { - return fmt3.Errorf("NetTxErrors this(%v) Not Equal that(%v)", this.NetTxErrors, that1.NetTxErrors) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.NetTxDropped != nil && that1.NetTxDropped != nil { - if *this.NetTxDropped != *that1.NetTxDropped { - return fmt3.Errorf("NetTxDropped this(%v) Not Equal that(%v)", *this.NetTxDropped, *that1.NetTxDropped) - } - } else if this.NetTxDropped != nil { - return fmt3.Errorf("this.NetTxDropped == nil && that.NetTxDropped != nil") - } else if that1.NetTxDropped != nil { - return fmt3.Errorf("NetTxDropped this(%v) Not Equal that(%v)", this.NetTxDropped, that1.NetTxDropped) + return n +} + +func (m *ACL_RunTask) Size() (n int) { + var l int + _ = l + if m.Principals != nil { + l = m.Principals.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.NetTcpRttMicrosecsP50 != nil && that1.NetTcpRttMicrosecsP50 != nil { - if *this.NetTcpRttMicrosecsP50 != *that1.NetTcpRttMicrosecsP50 { - return fmt3.Errorf("NetTcpRttMicrosecsP50 this(%v) Not Equal that(%v)", *this.NetTcpRttMicrosecsP50, *that1.NetTcpRttMicrosecsP50) - } - } else if this.NetTcpRttMicrosecsP50 != nil { - return fmt3.Errorf("this.NetTcpRttMicrosecsP50 == nil && that.NetTcpRttMicrosecsP50 != nil") - } else if that1.NetTcpRttMicrosecsP50 != nil { - return fmt3.Errorf("NetTcpRttMicrosecsP50 this(%v) Not Equal that(%v)", this.NetTcpRttMicrosecsP50, that1.NetTcpRttMicrosecsP50) + if m.Users != nil { + l = m.Users.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.NetTcpRttMicrosecsP90 != nil && that1.NetTcpRttMicrosecsP90 != nil { - if *this.NetTcpRttMicrosecsP90 != *that1.NetTcpRttMicrosecsP90 { - return fmt3.Errorf("NetTcpRttMicrosecsP90 this(%v) Not Equal that(%v)", *this.NetTcpRttMicrosecsP90, *that1.NetTcpRttMicrosecsP90) - } - } else if this.NetTcpRttMicrosecsP90 != nil { - return fmt3.Errorf("this.NetTcpRttMicrosecsP90 == nil && that.NetTcpRttMicrosecsP90 != nil") - } else if that1.NetTcpRttMicrosecsP90 != nil { - return fmt3.Errorf("NetTcpRttMicrosecsP90 this(%v) Not Equal that(%v)", this.NetTcpRttMicrosecsP90, that1.NetTcpRttMicrosecsP90) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.NetTcpRttMicrosecsP95 != nil && that1.NetTcpRttMicrosecsP95 != nil { - if *this.NetTcpRttMicrosecsP95 != *that1.NetTcpRttMicrosecsP95 { - return fmt3.Errorf("NetTcpRttMicrosecsP95 this(%v) Not Equal that(%v)", *this.NetTcpRttMicrosecsP95, *that1.NetTcpRttMicrosecsP95) - } - } else if this.NetTcpRttMicrosecsP95 != nil { - return fmt3.Errorf("this.NetTcpRttMicrosecsP95 == nil && that.NetTcpRttMicrosecsP95 != nil") - } else if that1.NetTcpRttMicrosecsP95 != nil { - return fmt3.Errorf("NetTcpRttMicrosecsP95 this(%v) Not Equal that(%v)", this.NetTcpRttMicrosecsP95, that1.NetTcpRttMicrosecsP95) + return n +} + +func (m *ACL_ShutdownFramework) Size() (n int) { + var l int + _ = l + if m.Principals != nil { + l = m.Principals.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.NetTcpRttMicrosecsP99 != nil && that1.NetTcpRttMicrosecsP99 != nil { - if *this.NetTcpRttMicrosecsP99 != *that1.NetTcpRttMicrosecsP99 { - return fmt3.Errorf("NetTcpRttMicrosecsP99 this(%v) Not Equal that(%v)", *this.NetTcpRttMicrosecsP99, *that1.NetTcpRttMicrosecsP99) - } - } else if this.NetTcpRttMicrosecsP99 != nil { - return fmt3.Errorf("this.NetTcpRttMicrosecsP99 == nil && that.NetTcpRttMicrosecsP99 != nil") - } else if that1.NetTcpRttMicrosecsP99 != nil { - return fmt3.Errorf("NetTcpRttMicrosecsP99 this(%v) Not Equal that(%v)", this.NetTcpRttMicrosecsP99, that1.NetTcpRttMicrosecsP99) + if m.FrameworkPrincipals != nil { + l = m.FrameworkPrincipals.Size() + n += 1 + l + sovMesos(uint64(l)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return nil + return n } -func (this *ResourceStatistics) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - that1, ok := that.(*ResourceStatistics) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false +func (m *ACLs) Size() (n int) { + var l int + _ = l + if m.Permissive != nil { + n += 2 } - if this.Timestamp != nil && that1.Timestamp != nil { - if *this.Timestamp != *that1.Timestamp { - return false + if len(m.RegisterFrameworks) > 0 { + for _, e := range m.RegisterFrameworks { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.Timestamp != nil { - return false - } else if that1.Timestamp != nil { - return false } - if this.CpusUserTimeSecs != nil && that1.CpusUserTimeSecs != nil { - if *this.CpusUserTimeSecs != *that1.CpusUserTimeSecs { - return false + if len(m.RunTasks) > 0 { + for _, e := range m.RunTasks { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.CpusUserTimeSecs != nil { - return false - } else if that1.CpusUserTimeSecs != nil { - return false } - if this.CpusSystemTimeSecs != nil && that1.CpusSystemTimeSecs != nil { - if *this.CpusSystemTimeSecs != *that1.CpusSystemTimeSecs { - return false + if len(m.ShutdownFrameworks) > 0 { + for _, e := range m.ShutdownFrameworks { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.CpusSystemTimeSecs != nil { - return false - } else if that1.CpusSystemTimeSecs != nil { - return false } - if this.CpusLimit != nil && that1.CpusLimit != nil { - if *this.CpusLimit != *that1.CpusLimit { - return false - } - } else if this.CpusLimit != nil { - return false - } else if that1.CpusLimit != nil { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.CpusNrPeriods != nil && that1.CpusNrPeriods != nil { - if *this.CpusNrPeriods != *that1.CpusNrPeriods { - return false - } - } else if this.CpusNrPeriods != nil { - return false - } else if that1.CpusNrPeriods != nil { - return false + return n +} + +func (m *RateLimit) Size() (n int) { + var l int + _ = l + if m.Qps != nil { + n += 9 } - if this.CpusNrThrottled != nil && that1.CpusNrThrottled != nil { - if *this.CpusNrThrottled != *that1.CpusNrThrottled { - return false - } - } else if this.CpusNrThrottled != nil { - return false - } else if that1.CpusNrThrottled != nil { - return false + if m.Principal != nil { + l = len(*m.Principal) + n += 1 + l + sovMesos(uint64(l)) } - if this.CpusThrottledTimeSecs != nil && that1.CpusThrottledTimeSecs != nil { - if *this.CpusThrottledTimeSecs != *that1.CpusThrottledTimeSecs { - return false - } - } else if this.CpusThrottledTimeSecs != nil { - return false - } else if that1.CpusThrottledTimeSecs != nil { - return false + if m.Capacity != nil { + n += 1 + sovMesos(uint64(*m.Capacity)) } - if this.MemRssBytes != nil && that1.MemRssBytes != nil { - if *this.MemRssBytes != *that1.MemRssBytes { - return false - } - } else if this.MemRssBytes != nil { - return false - } else if that1.MemRssBytes != nil { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.MemLimitBytes != nil && that1.MemLimitBytes != nil { - if *this.MemLimitBytes != *that1.MemLimitBytes { - return false + return n +} + +func (m *RateLimits) Size() (n int) { + var l int + _ = l + if len(m.Limits) > 0 { + for _, e := range m.Limits { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.MemLimitBytes != nil { - return false - } else if that1.MemLimitBytes != nil { - return false } - if this.MemFileBytes != nil && that1.MemFileBytes != nil { - if *this.MemFileBytes != *that1.MemFileBytes { - return false - } - } else if this.MemFileBytes != nil { - return false - } else if that1.MemFileBytes != nil { - return false + if m.AggregateDefaultQps != nil { + n += 9 } - if this.MemAnonBytes != nil && that1.MemAnonBytes != nil { - if *this.MemAnonBytes != *that1.MemAnonBytes { - return false - } - } else if this.MemAnonBytes != nil { - return false - } else if that1.MemAnonBytes != nil { - return false + if m.AggregateDefaultCapacity != nil { + n += 1 + sovMesos(uint64(*m.AggregateDefaultCapacity)) } - if this.MemMappedFileBytes != nil && that1.MemMappedFileBytes != nil { - if *this.MemMappedFileBytes != *that1.MemMappedFileBytes { - return false - } - } else if this.MemMappedFileBytes != nil { - return false - } else if that1.MemMappedFileBytes != nil { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if !this.Perf.Equal(that1.Perf) { - return false + return n +} + +func (m *Volume) Size() (n int) { + var l int + _ = l + if m.ContainerPath != nil { + l = len(*m.ContainerPath) + n += 1 + l + sovMesos(uint64(l)) } - if this.NetRxPackets != nil && that1.NetRxPackets != nil { - if *this.NetRxPackets != *that1.NetRxPackets { - return false - } - } else if this.NetRxPackets != nil { - return false - } else if that1.NetRxPackets != nil { - return false + if m.HostPath != nil { + l = len(*m.HostPath) + n += 1 + l + sovMesos(uint64(l)) } - if this.NetRxBytes != nil && that1.NetRxBytes != nil { - if *this.NetRxBytes != *that1.NetRxBytes { - return false - } - } else if this.NetRxBytes != nil { - return false - } else if that1.NetRxBytes != nil { - return false + if m.Mode != nil { + n += 1 + sovMesos(uint64(*m.Mode)) } - if this.NetRxErrors != nil && that1.NetRxErrors != nil { - if *this.NetRxErrors != *that1.NetRxErrors { - return false - } - } else if this.NetRxErrors != nil { - return false - } else if that1.NetRxErrors != nil { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.NetRxDropped != nil && that1.NetRxDropped != nil { - if *this.NetRxDropped != *that1.NetRxDropped { - return false - } - } else if this.NetRxDropped != nil { - return false - } else if that1.NetRxDropped != nil { - return false + return n +} + +func (m *ContainerInfo) Size() (n int) { + var l int + _ = l + if m.Type != nil { + n += 1 + sovMesos(uint64(*m.Type)) } - if this.NetTxPackets != nil && that1.NetTxPackets != nil { - if *this.NetTxPackets != *that1.NetTxPackets { - return false + if len(m.Volumes) > 0 { + for _, e := range m.Volumes { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.NetTxPackets != nil { - return false - } else if that1.NetTxPackets != nil { - return false } - if this.NetTxBytes != nil && that1.NetTxBytes != nil { - if *this.NetTxBytes != *that1.NetTxBytes { - return false - } - } else if this.NetTxBytes != nil { - return false - } else if that1.NetTxBytes != nil { - return false + if m.Docker != nil { + l = m.Docker.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.NetTxErrors != nil && that1.NetTxErrors != nil { - if *this.NetTxErrors != *that1.NetTxErrors { - return false - } - } else if this.NetTxErrors != nil { - return false - } else if that1.NetTxErrors != nil { - return false + if m.Hostname != nil { + l = len(*m.Hostname) + n += 1 + l + sovMesos(uint64(l)) } - if this.NetTxDropped != nil && that1.NetTxDropped != nil { - if *this.NetTxDropped != *that1.NetTxDropped { - return false - } - } else if this.NetTxDropped != nil { - return false - } else if that1.NetTxDropped != nil { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.NetTcpRttMicrosecsP50 != nil && that1.NetTcpRttMicrosecsP50 != nil { - if *this.NetTcpRttMicrosecsP50 != *that1.NetTcpRttMicrosecsP50 { - return false - } - } else if this.NetTcpRttMicrosecsP50 != nil { - return false - } else if that1.NetTcpRttMicrosecsP50 != nil { - return false + return n +} + +func (m *ContainerInfo_DockerInfo) Size() (n int) { + var l int + _ = l + if m.Image != nil { + l = len(*m.Image) + n += 1 + l + sovMesos(uint64(l)) } - if this.NetTcpRttMicrosecsP90 != nil && that1.NetTcpRttMicrosecsP90 != nil { - if *this.NetTcpRttMicrosecsP90 != *that1.NetTcpRttMicrosecsP90 { - return false - } - } else if this.NetTcpRttMicrosecsP90 != nil { - return false - } else if that1.NetTcpRttMicrosecsP90 != nil { - return false + if m.Network != nil { + n += 1 + sovMesos(uint64(*m.Network)) } - if this.NetTcpRttMicrosecsP95 != nil && that1.NetTcpRttMicrosecsP95 != nil { - if *this.NetTcpRttMicrosecsP95 != *that1.NetTcpRttMicrosecsP95 { - return false + if len(m.PortMappings) > 0 { + for _, e := range m.PortMappings { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.NetTcpRttMicrosecsP95 != nil { - return false - } else if that1.NetTcpRttMicrosecsP95 != nil { - return false } - if this.NetTcpRttMicrosecsP99 != nil && that1.NetTcpRttMicrosecsP99 != nil { - if *this.NetTcpRttMicrosecsP99 != *that1.NetTcpRttMicrosecsP99 { - return false + if m.Privileged != nil { + n += 2 + } + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.NetTcpRttMicrosecsP99 != nil { - return false - } else if that1.NetTcpRttMicrosecsP99 != nil { - return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.ForcePullImage != nil { + n += 2 } - return true -} -func (this *ResourceUsage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } + return n +} - that1, ok := that.(*ResourceUsage) - if !ok { - return fmt3.Errorf("that is not of type *ResourceUsage") +func (m *ContainerInfo_DockerInfo_PortMapping) Size() (n int) { + var l int + _ = l + if m.HostPort != nil { + n += 1 + sovMesos(uint64(*m.HostPort)) } - if that1 == nil { - if this == nil { - return nil + if m.ContainerPort != nil { + n += 1 + sovMesos(uint64(*m.ContainerPort)) + } + if m.Protocol != nil { + l = len(*m.Protocol) + n += 1 + l + sovMesos(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Labels) Size() (n int) { + var l int + _ = l + if len(m.Labels) > 0 { + for _, e := range m.Labels { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - return fmt3.Errorf("that is type *ResourceUsage but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *ResourceUsagebut is not nil && this == nil") } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt3.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt3.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) + return n +} + +func (m *Label) Size() (n int) { + var l int + _ = l + if m.Key != nil { + l = len(*m.Key) + n += 1 + l + sovMesos(uint64(l)) } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return fmt3.Errorf("ExecutorId this(%v) Not Equal that(%v)", this.ExecutorId, that1.ExecutorId) + if m.Value != nil { + l = len(*m.Value) + n += 1 + l + sovMesos(uint64(l)) } - if this.ExecutorName != nil && that1.ExecutorName != nil { - if *this.ExecutorName != *that1.ExecutorName { - return fmt3.Errorf("ExecutorName this(%v) Not Equal that(%v)", *this.ExecutorName, *that1.ExecutorName) - } - } else if this.ExecutorName != nil { - return fmt3.Errorf("this.ExecutorName == nil && that.ExecutorName != nil") - } else if that1.ExecutorName != nil { - return fmt3.Errorf("ExecutorName this(%v) Not Equal that(%v)", this.ExecutorName, that1.ExecutorName) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if !this.TaskId.Equal(that1.TaskId) { - return fmt3.Errorf("TaskId this(%v) Not Equal that(%v)", this.TaskId, that1.TaskId) + return n +} + +func (m *Port) Size() (n int) { + var l int + _ = l + if m.Number != nil { + n += 1 + sovMesos(uint64(*m.Number)) } - if !this.Statistics.Equal(that1.Statistics) { - return fmt3.Errorf("Statistics this(%v) Not Equal that(%v)", this.Statistics, that1.Statistics) + if m.Name != nil { + l = len(*m.Name) + n += 1 + l + sovMesos(uint64(l)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if m.Protocol != nil { + l = len(*m.Protocol) + n += 1 + l + sovMesos(uint64(l)) } - return nil + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n } -func (this *ResourceUsage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true + +func (m *Ports) Size() (n int) { + var l int + _ = l + if len(m.Ports) > 0 { + for _, e := range m.Ports { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - return false } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} - that1, ok := that.(*ResourceUsage) - if !ok { - return false +func (m *DiscoveryInfo) Size() (n int) { + var l int + _ = l + if m.Visibility != nil { + n += 1 + sovMesos(uint64(*m.Visibility)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.Name != nil { + l = len(*m.Name) + n += 1 + l + sovMesos(uint64(l)) } - if !this.SlaveId.Equal(that1.SlaveId) { - return false + if m.Environment != nil { + l = len(*m.Environment) + n += 1 + l + sovMesos(uint64(l)) } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false + if m.Location != nil { + l = len(*m.Location) + n += 1 + l + sovMesos(uint64(l)) } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return false + if m.Version != nil { + l = len(*m.Version) + n += 1 + l + sovMesos(uint64(l)) } - if this.ExecutorName != nil && that1.ExecutorName != nil { - if *this.ExecutorName != *that1.ExecutorName { - return false + if m.Ports != nil { + l = m.Ports.Size() + n += 1 + l + sovMesos(uint64(l)) + } + if m.Labels != nil { + l = m.Labels.Size() + n += 1 + l + sovMesos(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovMesos(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break } - } else if this.ExecutorName != nil { - return false - } else if that1.ExecutorName != nil { - return false } - if !this.TaskId.Equal(that1.TaskId) { - return false + return n +} +func sozMesos(x uint64) (n int) { + return sovMesos(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *FrameworkID) String() string { + if this == nil { + return "nil" } - if !this.Statistics.Equal(that1.Statistics) { - return false + s := strings.Join([]string{`&FrameworkID{`, + `Value:` + valueToStringMesos(this.Value) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *OfferID) String() string { + if this == nil { + return "nil" } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + s := strings.Join([]string{`&OfferID{`, + `Value:` + valueToStringMesos(this.Value) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *SlaveID) String() string { + if this == nil { + return "nil" } - return true + s := strings.Join([]string{`&SlaveID{`, + `Value:` + valueToStringMesos(this.Value) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s } -func (this *PerfStatistics) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") +func (this *TaskID) String() string { + if this == nil { + return "nil" } - - that1, ok := that.(*PerfStatistics) - if !ok { - return fmt3.Errorf("that is not of type *PerfStatistics") + s := strings.Join([]string{`&TaskID{`, + `Value:` + valueToStringMesos(this.Value) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ExecutorID) String() string { + if this == nil { + return "nil" } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *PerfStatistics but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *PerfStatisticsbut is not nil && this == nil") + s := strings.Join([]string{`&ExecutorID{`, + `Value:` + valueToStringMesos(this.Value) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ContainerID) String() string { + if this == nil { + return "nil" } - if this.Timestamp != nil && that1.Timestamp != nil { - if *this.Timestamp != *that1.Timestamp { - return fmt3.Errorf("Timestamp this(%v) Not Equal that(%v)", *this.Timestamp, *that1.Timestamp) - } - } else if this.Timestamp != nil { - return fmt3.Errorf("this.Timestamp == nil && that.Timestamp != nil") - } else if that1.Timestamp != nil { - return fmt3.Errorf("Timestamp this(%v) Not Equal that(%v)", this.Timestamp, that1.Timestamp) + s := strings.Join([]string{`&ContainerID{`, + `Value:` + valueToStringMesos(this.Value) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *FrameworkInfo) String() string { + if this == nil { + return "nil" } - if this.Duration != nil && that1.Duration != nil { - if *this.Duration != *that1.Duration { - return fmt3.Errorf("Duration this(%v) Not Equal that(%v)", *this.Duration, *that1.Duration) - } - } else if this.Duration != nil { - return fmt3.Errorf("this.Duration == nil && that.Duration != nil") - } else if that1.Duration != nil { - return fmt3.Errorf("Duration this(%v) Not Equal that(%v)", this.Duration, that1.Duration) + s := strings.Join([]string{`&FrameworkInfo{`, + `User:` + valueToStringMesos(this.User) + `,`, + `Name:` + valueToStringMesos(this.Name) + `,`, + `Id:` + strings.Replace(fmt.Sprintf("%v", this.Id), "FrameworkID", "FrameworkID", 1) + `,`, + `FailoverTimeout:` + valueToStringMesos(this.FailoverTimeout) + `,`, + `Checkpoint:` + valueToStringMesos(this.Checkpoint) + `,`, + `Role:` + valueToStringMesos(this.Role) + `,`, + `Hostname:` + valueToStringMesos(this.Hostname) + `,`, + `Principal:` + valueToStringMesos(this.Principal) + `,`, + `WebuiUrl:` + valueToStringMesos(this.WebuiUrl) + `,`, + `Capabilities:` + strings.Replace(fmt.Sprintf("%v", this.Capabilities), "FrameworkInfo_Capability", "FrameworkInfo_Capability", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *FrameworkInfo_Capability) String() string { + if this == nil { + return "nil" } - if this.Cycles != nil && that1.Cycles != nil { - if *this.Cycles != *that1.Cycles { - return fmt3.Errorf("Cycles this(%v) Not Equal that(%v)", *this.Cycles, *that1.Cycles) - } - } else if this.Cycles != nil { - return fmt3.Errorf("this.Cycles == nil && that.Cycles != nil") - } else if that1.Cycles != nil { - return fmt3.Errorf("Cycles this(%v) Not Equal that(%v)", this.Cycles, that1.Cycles) + s := strings.Join([]string{`&FrameworkInfo_Capability{`, + `Type:` + valueToStringMesos(this.Type) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *HealthCheck) String() string { + if this == nil { + return "nil" } - if this.StalledCyclesFrontend != nil && that1.StalledCyclesFrontend != nil { - if *this.StalledCyclesFrontend != *that1.StalledCyclesFrontend { - return fmt3.Errorf("StalledCyclesFrontend this(%v) Not Equal that(%v)", *this.StalledCyclesFrontend, *that1.StalledCyclesFrontend) - } - } else if this.StalledCyclesFrontend != nil { - return fmt3.Errorf("this.StalledCyclesFrontend == nil && that.StalledCyclesFrontend != nil") - } else if that1.StalledCyclesFrontend != nil { - return fmt3.Errorf("StalledCyclesFrontend this(%v) Not Equal that(%v)", this.StalledCyclesFrontend, that1.StalledCyclesFrontend) + s := strings.Join([]string{`&HealthCheck{`, + `Http:` + strings.Replace(fmt.Sprintf("%v", this.Http), "HealthCheck_HTTP", "HealthCheck_HTTP", 1) + `,`, + `DelaySeconds:` + valueToStringMesos(this.DelaySeconds) + `,`, + `IntervalSeconds:` + valueToStringMesos(this.IntervalSeconds) + `,`, + `TimeoutSeconds:` + valueToStringMesos(this.TimeoutSeconds) + `,`, + `ConsecutiveFailures:` + valueToStringMesos(this.ConsecutiveFailures) + `,`, + `GracePeriodSeconds:` + valueToStringMesos(this.GracePeriodSeconds) + `,`, + `Command:` + strings.Replace(fmt.Sprintf("%v", this.Command), "CommandInfo", "CommandInfo", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *HealthCheck_HTTP) String() string { + if this == nil { + return "nil" } - if this.StalledCyclesBackend != nil && that1.StalledCyclesBackend != nil { - if *this.StalledCyclesBackend != *that1.StalledCyclesBackend { - return fmt3.Errorf("StalledCyclesBackend this(%v) Not Equal that(%v)", *this.StalledCyclesBackend, *that1.StalledCyclesBackend) - } - } else if this.StalledCyclesBackend != nil { - return fmt3.Errorf("this.StalledCyclesBackend == nil && that.StalledCyclesBackend != nil") - } else if that1.StalledCyclesBackend != nil { - return fmt3.Errorf("StalledCyclesBackend this(%v) Not Equal that(%v)", this.StalledCyclesBackend, that1.StalledCyclesBackend) + s := strings.Join([]string{`&HealthCheck_HTTP{`, + `Port:` + valueToStringMesos(this.Port) + `,`, + `Path:` + valueToStringMesos(this.Path) + `,`, + `Statuses:` + fmt.Sprintf("%v", this.Statuses) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *CommandInfo) String() string { + if this == nil { + return "nil" } - if this.Instructions != nil && that1.Instructions != nil { - if *this.Instructions != *that1.Instructions { - return fmt3.Errorf("Instructions this(%v) Not Equal that(%v)", *this.Instructions, *that1.Instructions) - } - } else if this.Instructions != nil { - return fmt3.Errorf("this.Instructions == nil && that.Instructions != nil") - } else if that1.Instructions != nil { - return fmt3.Errorf("Instructions this(%v) Not Equal that(%v)", this.Instructions, that1.Instructions) + s := strings.Join([]string{`&CommandInfo{`, + `Uris:` + strings.Replace(fmt.Sprintf("%v", this.Uris), "CommandInfo_URI", "CommandInfo_URI", 1) + `,`, + `Environment:` + strings.Replace(fmt.Sprintf("%v", this.Environment), "Environment", "Environment", 1) + `,`, + `Value:` + valueToStringMesos(this.Value) + `,`, + `Container:` + strings.Replace(fmt.Sprintf("%v", this.Container), "CommandInfo_ContainerInfo", "CommandInfo_ContainerInfo", 1) + `,`, + `User:` + valueToStringMesos(this.User) + `,`, + `Shell:` + valueToStringMesos(this.Shell) + `,`, + `Arguments:` + fmt.Sprintf("%v", this.Arguments) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *CommandInfo_URI) String() string { + if this == nil { + return "nil" } - if this.CacheReferences != nil && that1.CacheReferences != nil { - if *this.CacheReferences != *that1.CacheReferences { - return fmt3.Errorf("CacheReferences this(%v) Not Equal that(%v)", *this.CacheReferences, *that1.CacheReferences) - } - } else if this.CacheReferences != nil { - return fmt3.Errorf("this.CacheReferences == nil && that.CacheReferences != nil") - } else if that1.CacheReferences != nil { - return fmt3.Errorf("CacheReferences this(%v) Not Equal that(%v)", this.CacheReferences, that1.CacheReferences) + s := strings.Join([]string{`&CommandInfo_URI{`, + `Value:` + valueToStringMesos(this.Value) + `,`, + `Executable:` + valueToStringMesos(this.Executable) + `,`, + `Extract:` + valueToStringMesos(this.Extract) + `,`, + `Cache:` + valueToStringMesos(this.Cache) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *CommandInfo_ContainerInfo) String() string { + if this == nil { + return "nil" } - if this.CacheMisses != nil && that1.CacheMisses != nil { - if *this.CacheMisses != *that1.CacheMisses { - return fmt3.Errorf("CacheMisses this(%v) Not Equal that(%v)", *this.CacheMisses, *that1.CacheMisses) - } - } else if this.CacheMisses != nil { - return fmt3.Errorf("this.CacheMisses == nil && that.CacheMisses != nil") - } else if that1.CacheMisses != nil { - return fmt3.Errorf("CacheMisses this(%v) Not Equal that(%v)", this.CacheMisses, that1.CacheMisses) + s := strings.Join([]string{`&CommandInfo_ContainerInfo{`, + `Image:` + valueToStringMesos(this.Image) + `,`, + `Options:` + fmt.Sprintf("%v", this.Options) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ExecutorInfo) String() string { + if this == nil { + return "nil" } - if this.Branches != nil && that1.Branches != nil { - if *this.Branches != *that1.Branches { - return fmt3.Errorf("Branches this(%v) Not Equal that(%v)", *this.Branches, *that1.Branches) - } - } else if this.Branches != nil { - return fmt3.Errorf("this.Branches == nil && that.Branches != nil") - } else if that1.Branches != nil { - return fmt3.Errorf("Branches this(%v) Not Equal that(%v)", this.Branches, that1.Branches) + s := strings.Join([]string{`&ExecutorInfo{`, + `ExecutorId:` + strings.Replace(fmt.Sprintf("%v", this.ExecutorId), "ExecutorID", "ExecutorID", 1) + `,`, + `Data:` + valueToStringMesos(this.Data) + `,`, + `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, + `Command:` + strings.Replace(fmt.Sprintf("%v", this.Command), "CommandInfo", "CommandInfo", 1) + `,`, + `FrameworkId:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, + `Name:` + valueToStringMesos(this.Name) + `,`, + `Source:` + valueToStringMesos(this.Source) + `,`, + `Container:` + strings.Replace(fmt.Sprintf("%v", this.Container), "ContainerInfo", "ContainerInfo", 1) + `,`, + `Discovery:` + strings.Replace(fmt.Sprintf("%v", this.Discovery), "DiscoveryInfo", "DiscoveryInfo", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *MasterInfo) String() string { + if this == nil { + return "nil" } - if this.BranchMisses != nil && that1.BranchMisses != nil { - if *this.BranchMisses != *that1.BranchMisses { - return fmt3.Errorf("BranchMisses this(%v) Not Equal that(%v)", *this.BranchMisses, *that1.BranchMisses) - } - } else if this.BranchMisses != nil { - return fmt3.Errorf("this.BranchMisses == nil && that.BranchMisses != nil") - } else if that1.BranchMisses != nil { - return fmt3.Errorf("BranchMisses this(%v) Not Equal that(%v)", this.BranchMisses, that1.BranchMisses) + s := strings.Join([]string{`&MasterInfo{`, + `Id:` + valueToStringMesos(this.Id) + `,`, + `Ip:` + valueToStringMesos(this.Ip) + `,`, + `Port:` + valueToStringMesos(this.Port) + `,`, + `Pid:` + valueToStringMesos(this.Pid) + `,`, + `Hostname:` + valueToStringMesos(this.Hostname) + `,`, + `Version:` + valueToStringMesos(this.Version) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *SlaveInfo) String() string { + if this == nil { + return "nil" } - if this.BusCycles != nil && that1.BusCycles != nil { - if *this.BusCycles != *that1.BusCycles { - return fmt3.Errorf("BusCycles this(%v) Not Equal that(%v)", *this.BusCycles, *that1.BusCycles) - } - } else if this.BusCycles != nil { - return fmt3.Errorf("this.BusCycles == nil && that.BusCycles != nil") - } else if that1.BusCycles != nil { - return fmt3.Errorf("BusCycles this(%v) Not Equal that(%v)", this.BusCycles, that1.BusCycles) + s := strings.Join([]string{`&SlaveInfo{`, + `Hostname:` + valueToStringMesos(this.Hostname) + `,`, + `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, + `Attributes:` + strings.Replace(fmt.Sprintf("%v", this.Attributes), "Attribute", "Attribute", 1) + `,`, + `Id:` + strings.Replace(fmt.Sprintf("%v", this.Id), "SlaveID", "SlaveID", 1) + `,`, + `Checkpoint:` + valueToStringMesos(this.Checkpoint) + `,`, + `Port:` + valueToStringMesos(this.Port) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Value) String() string { + if this == nil { + return "nil" } - if this.RefCycles != nil && that1.RefCycles != nil { - if *this.RefCycles != *that1.RefCycles { - return fmt3.Errorf("RefCycles this(%v) Not Equal that(%v)", *this.RefCycles, *that1.RefCycles) - } - } else if this.RefCycles != nil { - return fmt3.Errorf("this.RefCycles == nil && that.RefCycles != nil") - } else if that1.RefCycles != nil { - return fmt3.Errorf("RefCycles this(%v) Not Equal that(%v)", this.RefCycles, that1.RefCycles) + s := strings.Join([]string{`&Value{`, + `Type:` + valueToStringMesos(this.Type) + `,`, + `Scalar:` + strings.Replace(fmt.Sprintf("%v", this.Scalar), "Value_Scalar", "Value_Scalar", 1) + `,`, + `Ranges:` + strings.Replace(fmt.Sprintf("%v", this.Ranges), "Value_Ranges", "Value_Ranges", 1) + `,`, + `Set:` + strings.Replace(fmt.Sprintf("%v", this.Set), "Value_Set", "Value_Set", 1) + `,`, + `Text:` + strings.Replace(fmt.Sprintf("%v", this.Text), "Value_Text", "Value_Text", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Value_Scalar) String() string { + if this == nil { + return "nil" } - if this.CpuClock != nil && that1.CpuClock != nil { - if *this.CpuClock != *that1.CpuClock { - return fmt3.Errorf("CpuClock this(%v) Not Equal that(%v)", *this.CpuClock, *that1.CpuClock) - } - } else if this.CpuClock != nil { - return fmt3.Errorf("this.CpuClock == nil && that.CpuClock != nil") - } else if that1.CpuClock != nil { - return fmt3.Errorf("CpuClock this(%v) Not Equal that(%v)", this.CpuClock, that1.CpuClock) + s := strings.Join([]string{`&Value_Scalar{`, + `Value:` + valueToStringMesos(this.Value) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Value_Range) String() string { + if this == nil { + return "nil" } - if this.TaskClock != nil && that1.TaskClock != nil { - if *this.TaskClock != *that1.TaskClock { - return fmt3.Errorf("TaskClock this(%v) Not Equal that(%v)", *this.TaskClock, *that1.TaskClock) - } - } else if this.TaskClock != nil { - return fmt3.Errorf("this.TaskClock == nil && that.TaskClock != nil") - } else if that1.TaskClock != nil { - return fmt3.Errorf("TaskClock this(%v) Not Equal that(%v)", this.TaskClock, that1.TaskClock) + s := strings.Join([]string{`&Value_Range{`, + `Begin:` + valueToStringMesos(this.Begin) + `,`, + `End:` + valueToStringMesos(this.End) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Value_Ranges) String() string { + if this == nil { + return "nil" } - if this.PageFaults != nil && that1.PageFaults != nil { - if *this.PageFaults != *that1.PageFaults { - return fmt3.Errorf("PageFaults this(%v) Not Equal that(%v)", *this.PageFaults, *that1.PageFaults) - } - } else if this.PageFaults != nil { - return fmt3.Errorf("this.PageFaults == nil && that.PageFaults != nil") - } else if that1.PageFaults != nil { - return fmt3.Errorf("PageFaults this(%v) Not Equal that(%v)", this.PageFaults, that1.PageFaults) + s := strings.Join([]string{`&Value_Ranges{`, + `Range:` + strings.Replace(fmt.Sprintf("%v", this.Range), "Value_Range", "Value_Range", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Value_Set) String() string { + if this == nil { + return "nil" } - if this.MinorFaults != nil && that1.MinorFaults != nil { - if *this.MinorFaults != *that1.MinorFaults { - return fmt3.Errorf("MinorFaults this(%v) Not Equal that(%v)", *this.MinorFaults, *that1.MinorFaults) - } - } else if this.MinorFaults != nil { - return fmt3.Errorf("this.MinorFaults == nil && that.MinorFaults != nil") - } else if that1.MinorFaults != nil { - return fmt3.Errorf("MinorFaults this(%v) Not Equal that(%v)", this.MinorFaults, that1.MinorFaults) + s := strings.Join([]string{`&Value_Set{`, + `Item:` + fmt.Sprintf("%v", this.Item) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Value_Text) String() string { + if this == nil { + return "nil" } - if this.MajorFaults != nil && that1.MajorFaults != nil { - if *this.MajorFaults != *that1.MajorFaults { - return fmt3.Errorf("MajorFaults this(%v) Not Equal that(%v)", *this.MajorFaults, *that1.MajorFaults) - } - } else if this.MajorFaults != nil { - return fmt3.Errorf("this.MajorFaults == nil && that.MajorFaults != nil") - } else if that1.MajorFaults != nil { - return fmt3.Errorf("MajorFaults this(%v) Not Equal that(%v)", this.MajorFaults, that1.MajorFaults) + s := strings.Join([]string{`&Value_Text{`, + `Value:` + valueToStringMesos(this.Value) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Attribute) String() string { + if this == nil { + return "nil" } - if this.ContextSwitches != nil && that1.ContextSwitches != nil { - if *this.ContextSwitches != *that1.ContextSwitches { - return fmt3.Errorf("ContextSwitches this(%v) Not Equal that(%v)", *this.ContextSwitches, *that1.ContextSwitches) - } - } else if this.ContextSwitches != nil { - return fmt3.Errorf("this.ContextSwitches == nil && that.ContextSwitches != nil") - } else if that1.ContextSwitches != nil { - return fmt3.Errorf("ContextSwitches this(%v) Not Equal that(%v)", this.ContextSwitches, that1.ContextSwitches) + s := strings.Join([]string{`&Attribute{`, + `Name:` + valueToStringMesos(this.Name) + `,`, + `Type:` + valueToStringMesos(this.Type) + `,`, + `Scalar:` + strings.Replace(fmt.Sprintf("%v", this.Scalar), "Value_Scalar", "Value_Scalar", 1) + `,`, + `Ranges:` + strings.Replace(fmt.Sprintf("%v", this.Ranges), "Value_Ranges", "Value_Ranges", 1) + `,`, + `Text:` + strings.Replace(fmt.Sprintf("%v", this.Text), "Value_Text", "Value_Text", 1) + `,`, + `Set:` + strings.Replace(fmt.Sprintf("%v", this.Set), "Value_Set", "Value_Set", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Resource) String() string { + if this == nil { + return "nil" } - if this.CpuMigrations != nil && that1.CpuMigrations != nil { - if *this.CpuMigrations != *that1.CpuMigrations { - return fmt3.Errorf("CpuMigrations this(%v) Not Equal that(%v)", *this.CpuMigrations, *that1.CpuMigrations) - } - } else if this.CpuMigrations != nil { - return fmt3.Errorf("this.CpuMigrations == nil && that.CpuMigrations != nil") - } else if that1.CpuMigrations != nil { - return fmt3.Errorf("CpuMigrations this(%v) Not Equal that(%v)", this.CpuMigrations, that1.CpuMigrations) + s := strings.Join([]string{`&Resource{`, + `Name:` + valueToStringMesos(this.Name) + `,`, + `Type:` + valueToStringMesos(this.Type) + `,`, + `Scalar:` + strings.Replace(fmt.Sprintf("%v", this.Scalar), "Value_Scalar", "Value_Scalar", 1) + `,`, + `Ranges:` + strings.Replace(fmt.Sprintf("%v", this.Ranges), "Value_Ranges", "Value_Ranges", 1) + `,`, + `Set:` + strings.Replace(fmt.Sprintf("%v", this.Set), "Value_Set", "Value_Set", 1) + `,`, + `Role:` + valueToStringMesos(this.Role) + `,`, + `Disk:` + strings.Replace(fmt.Sprintf("%v", this.Disk), "Resource_DiskInfo", "Resource_DiskInfo", 1) + `,`, + `Reservation:` + strings.Replace(fmt.Sprintf("%v", this.Reservation), "Resource_ReservationInfo", "Resource_ReservationInfo", 1) + `,`, + `Revocable:` + strings.Replace(fmt.Sprintf("%v", this.Revocable), "Resource_RevocableInfo", "Resource_RevocableInfo", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Resource_ReservationInfo) String() string { + if this == nil { + return "nil" } - if this.AlignmentFaults != nil && that1.AlignmentFaults != nil { - if *this.AlignmentFaults != *that1.AlignmentFaults { - return fmt3.Errorf("AlignmentFaults this(%v) Not Equal that(%v)", *this.AlignmentFaults, *that1.AlignmentFaults) - } - } else if this.AlignmentFaults != nil { - return fmt3.Errorf("this.AlignmentFaults == nil && that.AlignmentFaults != nil") - } else if that1.AlignmentFaults != nil { - return fmt3.Errorf("AlignmentFaults this(%v) Not Equal that(%v)", this.AlignmentFaults, that1.AlignmentFaults) + s := strings.Join([]string{`&Resource_ReservationInfo{`, + `Principal:` + valueToStringMesos(this.Principal) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Resource_DiskInfo) String() string { + if this == nil { + return "nil" } - if this.EmulationFaults != nil && that1.EmulationFaults != nil { - if *this.EmulationFaults != *that1.EmulationFaults { - return fmt3.Errorf("EmulationFaults this(%v) Not Equal that(%v)", *this.EmulationFaults, *that1.EmulationFaults) - } - } else if this.EmulationFaults != nil { - return fmt3.Errorf("this.EmulationFaults == nil && that.EmulationFaults != nil") - } else if that1.EmulationFaults != nil { - return fmt3.Errorf("EmulationFaults this(%v) Not Equal that(%v)", this.EmulationFaults, that1.EmulationFaults) + s := strings.Join([]string{`&Resource_DiskInfo{`, + `Persistence:` + strings.Replace(fmt.Sprintf("%v", this.Persistence), "Resource_DiskInfo_Persistence", "Resource_DiskInfo_Persistence", 1) + `,`, + `Volume:` + strings.Replace(fmt.Sprintf("%v", this.Volume), "Volume", "Volume", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Resource_DiskInfo_Persistence) String() string { + if this == nil { + return "nil" } - if this.L1DcacheLoads != nil && that1.L1DcacheLoads != nil { - if *this.L1DcacheLoads != *that1.L1DcacheLoads { - return fmt3.Errorf("L1DcacheLoads this(%v) Not Equal that(%v)", *this.L1DcacheLoads, *that1.L1DcacheLoads) - } - } else if this.L1DcacheLoads != nil { - return fmt3.Errorf("this.L1DcacheLoads == nil && that.L1DcacheLoads != nil") - } else if that1.L1DcacheLoads != nil { - return fmt3.Errorf("L1DcacheLoads this(%v) Not Equal that(%v)", this.L1DcacheLoads, that1.L1DcacheLoads) + s := strings.Join([]string{`&Resource_DiskInfo_Persistence{`, + `Id:` + valueToStringMesos(this.Id) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Resource_RevocableInfo) String() string { + if this == nil { + return "nil" } - if this.L1DcacheLoadMisses != nil && that1.L1DcacheLoadMisses != nil { - if *this.L1DcacheLoadMisses != *that1.L1DcacheLoadMisses { - return fmt3.Errorf("L1DcacheLoadMisses this(%v) Not Equal that(%v)", *this.L1DcacheLoadMisses, *that1.L1DcacheLoadMisses) - } - } else if this.L1DcacheLoadMisses != nil { - return fmt3.Errorf("this.L1DcacheLoadMisses == nil && that.L1DcacheLoadMisses != nil") - } else if that1.L1DcacheLoadMisses != nil { - return fmt3.Errorf("L1DcacheLoadMisses this(%v) Not Equal that(%v)", this.L1DcacheLoadMisses, that1.L1DcacheLoadMisses) + s := strings.Join([]string{`&Resource_RevocableInfo{`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *TrafficControlStatistics) String() string { + if this == nil { + return "nil" } - if this.L1DcacheStores != nil && that1.L1DcacheStores != nil { - if *this.L1DcacheStores != *that1.L1DcacheStores { - return fmt3.Errorf("L1DcacheStores this(%v) Not Equal that(%v)", *this.L1DcacheStores, *that1.L1DcacheStores) - } - } else if this.L1DcacheStores != nil { - return fmt3.Errorf("this.L1DcacheStores == nil && that.L1DcacheStores != nil") - } else if that1.L1DcacheStores != nil { - return fmt3.Errorf("L1DcacheStores this(%v) Not Equal that(%v)", this.L1DcacheStores, that1.L1DcacheStores) + s := strings.Join([]string{`&TrafficControlStatistics{`, + `Id:` + valueToStringMesos(this.Id) + `,`, + `Backlog:` + valueToStringMesos(this.Backlog) + `,`, + `Bytes:` + valueToStringMesos(this.Bytes) + `,`, + `Drops:` + valueToStringMesos(this.Drops) + `,`, + `Overlimits:` + valueToStringMesos(this.Overlimits) + `,`, + `Packets:` + valueToStringMesos(this.Packets) + `,`, + `Qlen:` + valueToStringMesos(this.Qlen) + `,`, + `Ratebps:` + valueToStringMesos(this.Ratebps) + `,`, + `Ratepps:` + valueToStringMesos(this.Ratepps) + `,`, + `Requeues:` + valueToStringMesos(this.Requeues) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ResourceStatistics) String() string { + if this == nil { + return "nil" } - if this.L1DcacheStoreMisses != nil && that1.L1DcacheStoreMisses != nil { - if *this.L1DcacheStoreMisses != *that1.L1DcacheStoreMisses { - return fmt3.Errorf("L1DcacheStoreMisses this(%v) Not Equal that(%v)", *this.L1DcacheStoreMisses, *that1.L1DcacheStoreMisses) - } - } else if this.L1DcacheStoreMisses != nil { - return fmt3.Errorf("this.L1DcacheStoreMisses == nil && that.L1DcacheStoreMisses != nil") - } else if that1.L1DcacheStoreMisses != nil { - return fmt3.Errorf("L1DcacheStoreMisses this(%v) Not Equal that(%v)", this.L1DcacheStoreMisses, that1.L1DcacheStoreMisses) + s := strings.Join([]string{`&ResourceStatistics{`, + `Timestamp:` + valueToStringMesos(this.Timestamp) + `,`, + `CpusUserTimeSecs:` + valueToStringMesos(this.CpusUserTimeSecs) + `,`, + `CpusSystemTimeSecs:` + valueToStringMesos(this.CpusSystemTimeSecs) + `,`, + `CpusLimit:` + valueToStringMesos(this.CpusLimit) + `,`, + `MemRssBytes:` + valueToStringMesos(this.MemRssBytes) + `,`, + `MemLimitBytes:` + valueToStringMesos(this.MemLimitBytes) + `,`, + `CpusNrPeriods:` + valueToStringMesos(this.CpusNrPeriods) + `,`, + `CpusNrThrottled:` + valueToStringMesos(this.CpusNrThrottled) + `,`, + `CpusThrottledTimeSecs:` + valueToStringMesos(this.CpusThrottledTimeSecs) + `,`, + `MemFileBytes:` + valueToStringMesos(this.MemFileBytes) + `,`, + `MemAnonBytes:` + valueToStringMesos(this.MemAnonBytes) + `,`, + `MemMappedFileBytes:` + valueToStringMesos(this.MemMappedFileBytes) + `,`, + `Perf:` + strings.Replace(fmt.Sprintf("%v", this.Perf), "PerfStatistics", "PerfStatistics", 1) + `,`, + `NetRxPackets:` + valueToStringMesos(this.NetRxPackets) + `,`, + `NetRxBytes:` + valueToStringMesos(this.NetRxBytes) + `,`, + `NetRxErrors:` + valueToStringMesos(this.NetRxErrors) + `,`, + `NetRxDropped:` + valueToStringMesos(this.NetRxDropped) + `,`, + `NetTxPackets:` + valueToStringMesos(this.NetTxPackets) + `,`, + `NetTxBytes:` + valueToStringMesos(this.NetTxBytes) + `,`, + `NetTxErrors:` + valueToStringMesos(this.NetTxErrors) + `,`, + `NetTxDropped:` + valueToStringMesos(this.NetTxDropped) + `,`, + `NetTcpRttMicrosecsP50:` + valueToStringMesos(this.NetTcpRttMicrosecsP50) + `,`, + `NetTcpRttMicrosecsP90:` + valueToStringMesos(this.NetTcpRttMicrosecsP90) + `,`, + `NetTcpRttMicrosecsP95:` + valueToStringMesos(this.NetTcpRttMicrosecsP95) + `,`, + `NetTcpRttMicrosecsP99:` + valueToStringMesos(this.NetTcpRttMicrosecsP99) + `,`, + `DiskLimitBytes:` + valueToStringMesos(this.DiskLimitBytes) + `,`, + `DiskUsedBytes:` + valueToStringMesos(this.DiskUsedBytes) + `,`, + `NetTcpActiveConnections:` + valueToStringMesos(this.NetTcpActiveConnections) + `,`, + `NetTcpTimeWaitConnections:` + valueToStringMesos(this.NetTcpTimeWaitConnections) + `,`, + `Processes:` + valueToStringMesos(this.Processes) + `,`, + `Threads:` + valueToStringMesos(this.Threads) + `,`, + `MemLowPressureCounter:` + valueToStringMesos(this.MemLowPressureCounter) + `,`, + `MemMediumPressureCounter:` + valueToStringMesos(this.MemMediumPressureCounter) + `,`, + `MemCriticalPressureCounter:` + valueToStringMesos(this.MemCriticalPressureCounter) + `,`, + `NetTrafficControlStatistics:` + strings.Replace(fmt.Sprintf("%v", this.NetTrafficControlStatistics), "TrafficControlStatistics", "TrafficControlStatistics", 1) + `,`, + `MemTotalBytes:` + valueToStringMesos(this.MemTotalBytes) + `,`, + `MemTotalMemswBytes:` + valueToStringMesos(this.MemTotalMemswBytes) + `,`, + `MemSoftLimitBytes:` + valueToStringMesos(this.MemSoftLimitBytes) + `,`, + `MemCacheBytes:` + valueToStringMesos(this.MemCacheBytes) + `,`, + `MemSwapBytes:` + valueToStringMesos(this.MemSwapBytes) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ResourceUsage) String() string { + if this == nil { + return "nil" } - if this.L1DcachePrefetches != nil && that1.L1DcachePrefetches != nil { - if *this.L1DcachePrefetches != *that1.L1DcachePrefetches { - return fmt3.Errorf("L1DcachePrefetches this(%v) Not Equal that(%v)", *this.L1DcachePrefetches, *that1.L1DcachePrefetches) - } - } else if this.L1DcachePrefetches != nil { - return fmt3.Errorf("this.L1DcachePrefetches == nil && that.L1DcachePrefetches != nil") - } else if that1.L1DcachePrefetches != nil { - return fmt3.Errorf("L1DcachePrefetches this(%v) Not Equal that(%v)", this.L1DcachePrefetches, that1.L1DcachePrefetches) + s := strings.Join([]string{`&ResourceUsage{`, + `Executors:` + strings.Replace(fmt.Sprintf("%v", this.Executors), "ResourceUsage_Executor", "ResourceUsage_Executor", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ResourceUsage_Executor) String() string { + if this == nil { + return "nil" } - if this.L1DcachePrefetchMisses != nil && that1.L1DcachePrefetchMisses != nil { - if *this.L1DcachePrefetchMisses != *that1.L1DcachePrefetchMisses { - return fmt3.Errorf("L1DcachePrefetchMisses this(%v) Not Equal that(%v)", *this.L1DcachePrefetchMisses, *that1.L1DcachePrefetchMisses) - } - } else if this.L1DcachePrefetchMisses != nil { - return fmt3.Errorf("this.L1DcachePrefetchMisses == nil && that.L1DcachePrefetchMisses != nil") - } else if that1.L1DcachePrefetchMisses != nil { - return fmt3.Errorf("L1DcachePrefetchMisses this(%v) Not Equal that(%v)", this.L1DcachePrefetchMisses, that1.L1DcachePrefetchMisses) + s := strings.Join([]string{`&ResourceUsage_Executor{`, + `ExecutorInfo:` + strings.Replace(fmt.Sprintf("%v", this.ExecutorInfo), "ExecutorInfo", "ExecutorInfo", 1) + `,`, + `Allocated:` + strings.Replace(fmt.Sprintf("%v", this.Allocated), "Resource", "Resource", 1) + `,`, + `Statistics:` + strings.Replace(fmt.Sprintf("%v", this.Statistics), "ResourceStatistics", "ResourceStatistics", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *PerfStatistics) String() string { + if this == nil { + return "nil" } - if this.L1IcacheLoads != nil && that1.L1IcacheLoads != nil { - if *this.L1IcacheLoads != *that1.L1IcacheLoads { - return fmt3.Errorf("L1IcacheLoads this(%v) Not Equal that(%v)", *this.L1IcacheLoads, *that1.L1IcacheLoads) - } - } else if this.L1IcacheLoads != nil { - return fmt3.Errorf("this.L1IcacheLoads == nil && that.L1IcacheLoads != nil") - } else if that1.L1IcacheLoads != nil { - return fmt3.Errorf("L1IcacheLoads this(%v) Not Equal that(%v)", this.L1IcacheLoads, that1.L1IcacheLoads) + s := strings.Join([]string{`&PerfStatistics{`, + `Timestamp:` + valueToStringMesos(this.Timestamp) + `,`, + `Duration:` + valueToStringMesos(this.Duration) + `,`, + `Cycles:` + valueToStringMesos(this.Cycles) + `,`, + `StalledCyclesFrontend:` + valueToStringMesos(this.StalledCyclesFrontend) + `,`, + `StalledCyclesBackend:` + valueToStringMesos(this.StalledCyclesBackend) + `,`, + `Instructions:` + valueToStringMesos(this.Instructions) + `,`, + `CacheReferences:` + valueToStringMesos(this.CacheReferences) + `,`, + `CacheMisses:` + valueToStringMesos(this.CacheMisses) + `,`, + `Branches:` + valueToStringMesos(this.Branches) + `,`, + `BranchMisses:` + valueToStringMesos(this.BranchMisses) + `,`, + `BusCycles:` + valueToStringMesos(this.BusCycles) + `,`, + `RefCycles:` + valueToStringMesos(this.RefCycles) + `,`, + `CpuClock:` + valueToStringMesos(this.CpuClock) + `,`, + `TaskClock:` + valueToStringMesos(this.TaskClock) + `,`, + `PageFaults:` + valueToStringMesos(this.PageFaults) + `,`, + `MinorFaults:` + valueToStringMesos(this.MinorFaults) + `,`, + `MajorFaults:` + valueToStringMesos(this.MajorFaults) + `,`, + `ContextSwitches:` + valueToStringMesos(this.ContextSwitches) + `,`, + `CpuMigrations:` + valueToStringMesos(this.CpuMigrations) + `,`, + `AlignmentFaults:` + valueToStringMesos(this.AlignmentFaults) + `,`, + `EmulationFaults:` + valueToStringMesos(this.EmulationFaults) + `,`, + `L1DcacheLoads:` + valueToStringMesos(this.L1DcacheLoads) + `,`, + `L1DcacheLoadMisses:` + valueToStringMesos(this.L1DcacheLoadMisses) + `,`, + `L1DcacheStores:` + valueToStringMesos(this.L1DcacheStores) + `,`, + `L1DcacheStoreMisses:` + valueToStringMesos(this.L1DcacheStoreMisses) + `,`, + `L1DcachePrefetches:` + valueToStringMesos(this.L1DcachePrefetches) + `,`, + `L1DcachePrefetchMisses:` + valueToStringMesos(this.L1DcachePrefetchMisses) + `,`, + `L1IcacheLoads:` + valueToStringMesos(this.L1IcacheLoads) + `,`, + `L1IcacheLoadMisses:` + valueToStringMesos(this.L1IcacheLoadMisses) + `,`, + `L1IcachePrefetches:` + valueToStringMesos(this.L1IcachePrefetches) + `,`, + `L1IcachePrefetchMisses:` + valueToStringMesos(this.L1IcachePrefetchMisses) + `,`, + `LlcLoads:` + valueToStringMesos(this.LlcLoads) + `,`, + `LlcLoadMisses:` + valueToStringMesos(this.LlcLoadMisses) + `,`, + `LlcStores:` + valueToStringMesos(this.LlcStores) + `,`, + `LlcStoreMisses:` + valueToStringMesos(this.LlcStoreMisses) + `,`, + `LlcPrefetches:` + valueToStringMesos(this.LlcPrefetches) + `,`, + `LlcPrefetchMisses:` + valueToStringMesos(this.LlcPrefetchMisses) + `,`, + `DtlbLoads:` + valueToStringMesos(this.DtlbLoads) + `,`, + `DtlbLoadMisses:` + valueToStringMesos(this.DtlbLoadMisses) + `,`, + `DtlbStores:` + valueToStringMesos(this.DtlbStores) + `,`, + `DtlbStoreMisses:` + valueToStringMesos(this.DtlbStoreMisses) + `,`, + `DtlbPrefetches:` + valueToStringMesos(this.DtlbPrefetches) + `,`, + `DtlbPrefetchMisses:` + valueToStringMesos(this.DtlbPrefetchMisses) + `,`, + `ItlbLoads:` + valueToStringMesos(this.ItlbLoads) + `,`, + `ItlbLoadMisses:` + valueToStringMesos(this.ItlbLoadMisses) + `,`, + `BranchLoads:` + valueToStringMesos(this.BranchLoads) + `,`, + `BranchLoadMisses:` + valueToStringMesos(this.BranchLoadMisses) + `,`, + `NodeLoads:` + valueToStringMesos(this.NodeLoads) + `,`, + `NodeLoadMisses:` + valueToStringMesos(this.NodeLoadMisses) + `,`, + `NodeStores:` + valueToStringMesos(this.NodeStores) + `,`, + `NodeStoreMisses:` + valueToStringMesos(this.NodeStoreMisses) + `,`, + `NodePrefetches:` + valueToStringMesos(this.NodePrefetches) + `,`, + `NodePrefetchMisses:` + valueToStringMesos(this.NodePrefetchMisses) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Request) String() string { + if this == nil { + return "nil" } - if this.L1IcacheLoadMisses != nil && that1.L1IcacheLoadMisses != nil { - if *this.L1IcacheLoadMisses != *that1.L1IcacheLoadMisses { - return fmt3.Errorf("L1IcacheLoadMisses this(%v) Not Equal that(%v)", *this.L1IcacheLoadMisses, *that1.L1IcacheLoadMisses) - } - } else if this.L1IcacheLoadMisses != nil { - return fmt3.Errorf("this.L1IcacheLoadMisses == nil && that.L1IcacheLoadMisses != nil") - } else if that1.L1IcacheLoadMisses != nil { - return fmt3.Errorf("L1IcacheLoadMisses this(%v) Not Equal that(%v)", this.L1IcacheLoadMisses, that1.L1IcacheLoadMisses) + s := strings.Join([]string{`&Request{`, + `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, + `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Offer) String() string { + if this == nil { + return "nil" } - if this.L1IcachePrefetches != nil && that1.L1IcachePrefetches != nil { - if *this.L1IcachePrefetches != *that1.L1IcachePrefetches { - return fmt3.Errorf("L1IcachePrefetches this(%v) Not Equal that(%v)", *this.L1IcachePrefetches, *that1.L1IcachePrefetches) - } - } else if this.L1IcachePrefetches != nil { - return fmt3.Errorf("this.L1IcachePrefetches == nil && that.L1IcachePrefetches != nil") - } else if that1.L1IcachePrefetches != nil { - return fmt3.Errorf("L1IcachePrefetches this(%v) Not Equal that(%v)", this.L1IcachePrefetches, that1.L1IcachePrefetches) + s := strings.Join([]string{`&Offer{`, + `Id:` + strings.Replace(fmt.Sprintf("%v", this.Id), "OfferID", "OfferID", 1) + `,`, + `FrameworkId:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, + `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, + `Hostname:` + valueToStringMesos(this.Hostname) + `,`, + `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, + `ExecutorIds:` + strings.Replace(fmt.Sprintf("%v", this.ExecutorIds), "ExecutorID", "ExecutorID", 1) + `,`, + `Attributes:` + strings.Replace(fmt.Sprintf("%v", this.Attributes), "Attribute", "Attribute", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Offer_Operation) String() string { + if this == nil { + return "nil" } - if this.L1IcachePrefetchMisses != nil && that1.L1IcachePrefetchMisses != nil { - if *this.L1IcachePrefetchMisses != *that1.L1IcachePrefetchMisses { - return fmt3.Errorf("L1IcachePrefetchMisses this(%v) Not Equal that(%v)", *this.L1IcachePrefetchMisses, *that1.L1IcachePrefetchMisses) - } - } else if this.L1IcachePrefetchMisses != nil { - return fmt3.Errorf("this.L1IcachePrefetchMisses == nil && that.L1IcachePrefetchMisses != nil") - } else if that1.L1IcachePrefetchMisses != nil { - return fmt3.Errorf("L1IcachePrefetchMisses this(%v) Not Equal that(%v)", this.L1IcachePrefetchMisses, that1.L1IcachePrefetchMisses) + s := strings.Join([]string{`&Offer_Operation{`, + `Type:` + valueToStringMesos(this.Type) + `,`, + `Launch:` + strings.Replace(fmt.Sprintf("%v", this.Launch), "Offer_Operation_Launch", "Offer_Operation_Launch", 1) + `,`, + `Reserve:` + strings.Replace(fmt.Sprintf("%v", this.Reserve), "Offer_Operation_Reserve", "Offer_Operation_Reserve", 1) + `,`, + `Unreserve:` + strings.Replace(fmt.Sprintf("%v", this.Unreserve), "Offer_Operation_Unreserve", "Offer_Operation_Unreserve", 1) + `,`, + `Create:` + strings.Replace(fmt.Sprintf("%v", this.Create), "Offer_Operation_Create", "Offer_Operation_Create", 1) + `,`, + `Destroy:` + strings.Replace(fmt.Sprintf("%v", this.Destroy), "Offer_Operation_Destroy", "Offer_Operation_Destroy", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Offer_Operation_Launch) String() string { + if this == nil { + return "nil" } - if this.LlcLoads != nil && that1.LlcLoads != nil { - if *this.LlcLoads != *that1.LlcLoads { - return fmt3.Errorf("LlcLoads this(%v) Not Equal that(%v)", *this.LlcLoads, *that1.LlcLoads) - } - } else if this.LlcLoads != nil { - return fmt3.Errorf("this.LlcLoads == nil && that.LlcLoads != nil") - } else if that1.LlcLoads != nil { - return fmt3.Errorf("LlcLoads this(%v) Not Equal that(%v)", this.LlcLoads, that1.LlcLoads) + s := strings.Join([]string{`&Offer_Operation_Launch{`, + `TaskInfos:` + strings.Replace(fmt.Sprintf("%v", this.TaskInfos), "TaskInfo", "TaskInfo", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Offer_Operation_Reserve) String() string { + if this == nil { + return "nil" } - if this.LlcLoadMisses != nil && that1.LlcLoadMisses != nil { - if *this.LlcLoadMisses != *that1.LlcLoadMisses { - return fmt3.Errorf("LlcLoadMisses this(%v) Not Equal that(%v)", *this.LlcLoadMisses, *that1.LlcLoadMisses) - } - } else if this.LlcLoadMisses != nil { - return fmt3.Errorf("this.LlcLoadMisses == nil && that.LlcLoadMisses != nil") - } else if that1.LlcLoadMisses != nil { - return fmt3.Errorf("LlcLoadMisses this(%v) Not Equal that(%v)", this.LlcLoadMisses, that1.LlcLoadMisses) + s := strings.Join([]string{`&Offer_Operation_Reserve{`, + `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Offer_Operation_Unreserve) String() string { + if this == nil { + return "nil" } - if this.LlcStores != nil && that1.LlcStores != nil { - if *this.LlcStores != *that1.LlcStores { - return fmt3.Errorf("LlcStores this(%v) Not Equal that(%v)", *this.LlcStores, *that1.LlcStores) - } - } else if this.LlcStores != nil { - return fmt3.Errorf("this.LlcStores == nil && that.LlcStores != nil") - } else if that1.LlcStores != nil { - return fmt3.Errorf("LlcStores this(%v) Not Equal that(%v)", this.LlcStores, that1.LlcStores) + s := strings.Join([]string{`&Offer_Operation_Unreserve{`, + `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Offer_Operation_Create) String() string { + if this == nil { + return "nil" } - if this.LlcStoreMisses != nil && that1.LlcStoreMisses != nil { - if *this.LlcStoreMisses != *that1.LlcStoreMisses { - return fmt3.Errorf("LlcStoreMisses this(%v) Not Equal that(%v)", *this.LlcStoreMisses, *that1.LlcStoreMisses) - } - } else if this.LlcStoreMisses != nil { - return fmt3.Errorf("this.LlcStoreMisses == nil && that.LlcStoreMisses != nil") - } else if that1.LlcStoreMisses != nil { - return fmt3.Errorf("LlcStoreMisses this(%v) Not Equal that(%v)", this.LlcStoreMisses, that1.LlcStoreMisses) + s := strings.Join([]string{`&Offer_Operation_Create{`, + `Volumes:` + strings.Replace(fmt.Sprintf("%v", this.Volumes), "Resource", "Resource", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Offer_Operation_Destroy) String() string { + if this == nil { + return "nil" } - if this.LlcPrefetches != nil && that1.LlcPrefetches != nil { - if *this.LlcPrefetches != *that1.LlcPrefetches { - return fmt3.Errorf("LlcPrefetches this(%v) Not Equal that(%v)", *this.LlcPrefetches, *that1.LlcPrefetches) - } - } else if this.LlcPrefetches != nil { - return fmt3.Errorf("this.LlcPrefetches == nil && that.LlcPrefetches != nil") - } else if that1.LlcPrefetches != nil { - return fmt3.Errorf("LlcPrefetches this(%v) Not Equal that(%v)", this.LlcPrefetches, that1.LlcPrefetches) + s := strings.Join([]string{`&Offer_Operation_Destroy{`, + `Volumes:` + strings.Replace(fmt.Sprintf("%v", this.Volumes), "Resource", "Resource", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *TaskInfo) String() string { + if this == nil { + return "nil" } - if this.LlcPrefetchMisses != nil && that1.LlcPrefetchMisses != nil { - if *this.LlcPrefetchMisses != *that1.LlcPrefetchMisses { - return fmt3.Errorf("LlcPrefetchMisses this(%v) Not Equal that(%v)", *this.LlcPrefetchMisses, *that1.LlcPrefetchMisses) - } - } else if this.LlcPrefetchMisses != nil { - return fmt3.Errorf("this.LlcPrefetchMisses == nil && that.LlcPrefetchMisses != nil") - } else if that1.LlcPrefetchMisses != nil { - return fmt3.Errorf("LlcPrefetchMisses this(%v) Not Equal that(%v)", this.LlcPrefetchMisses, that1.LlcPrefetchMisses) + s := strings.Join([]string{`&TaskInfo{`, + `Name:` + valueToStringMesos(this.Name) + `,`, + `TaskId:` + strings.Replace(fmt.Sprintf("%v", this.TaskId), "TaskID", "TaskID", 1) + `,`, + `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, + `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, + `Executor:` + strings.Replace(fmt.Sprintf("%v", this.Executor), "ExecutorInfo", "ExecutorInfo", 1) + `,`, + `Data:` + valueToStringMesos(this.Data) + `,`, + `Command:` + strings.Replace(fmt.Sprintf("%v", this.Command), "CommandInfo", "CommandInfo", 1) + `,`, + `HealthCheck:` + strings.Replace(fmt.Sprintf("%v", this.HealthCheck), "HealthCheck", "HealthCheck", 1) + `,`, + `Container:` + strings.Replace(fmt.Sprintf("%v", this.Container), "ContainerInfo", "ContainerInfo", 1) + `,`, + `Labels:` + strings.Replace(fmt.Sprintf("%v", this.Labels), "Labels", "Labels", 1) + `,`, + `Discovery:` + strings.Replace(fmt.Sprintf("%v", this.Discovery), "DiscoveryInfo", "DiscoveryInfo", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *TaskStatus) String() string { + if this == nil { + return "nil" } - if this.DtlbLoads != nil && that1.DtlbLoads != nil { - if *this.DtlbLoads != *that1.DtlbLoads { - return fmt3.Errorf("DtlbLoads this(%v) Not Equal that(%v)", *this.DtlbLoads, *that1.DtlbLoads) - } - } else if this.DtlbLoads != nil { - return fmt3.Errorf("this.DtlbLoads == nil && that.DtlbLoads != nil") - } else if that1.DtlbLoads != nil { - return fmt3.Errorf("DtlbLoads this(%v) Not Equal that(%v)", this.DtlbLoads, that1.DtlbLoads) + s := strings.Join([]string{`&TaskStatus{`, + `TaskId:` + strings.Replace(fmt.Sprintf("%v", this.TaskId), "TaskID", "TaskID", 1) + `,`, + `State:` + valueToStringMesos(this.State) + `,`, + `Data:` + valueToStringMesos(this.Data) + `,`, + `Message:` + valueToStringMesos(this.Message) + `,`, + `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, + `Timestamp:` + valueToStringMesos(this.Timestamp) + `,`, + `ExecutorId:` + strings.Replace(fmt.Sprintf("%v", this.ExecutorId), "ExecutorID", "ExecutorID", 1) + `,`, + `Healthy:` + valueToStringMesos(this.Healthy) + `,`, + `Source:` + valueToStringMesos(this.Source) + `,`, + `Reason:` + valueToStringMesos(this.Reason) + `,`, + `Uuid:` + valueToStringMesos(this.Uuid) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Filters) String() string { + if this == nil { + return "nil" } - if this.DtlbLoadMisses != nil && that1.DtlbLoadMisses != nil { - if *this.DtlbLoadMisses != *that1.DtlbLoadMisses { - return fmt3.Errorf("DtlbLoadMisses this(%v) Not Equal that(%v)", *this.DtlbLoadMisses, *that1.DtlbLoadMisses) - } - } else if this.DtlbLoadMisses != nil { - return fmt3.Errorf("this.DtlbLoadMisses == nil && that.DtlbLoadMisses != nil") - } else if that1.DtlbLoadMisses != nil { - return fmt3.Errorf("DtlbLoadMisses this(%v) Not Equal that(%v)", this.DtlbLoadMisses, that1.DtlbLoadMisses) + s := strings.Join([]string{`&Filters{`, + `RefuseSeconds:` + valueToStringMesos(this.RefuseSeconds) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Environment) String() string { + if this == nil { + return "nil" } - if this.DtlbStores != nil && that1.DtlbStores != nil { - if *this.DtlbStores != *that1.DtlbStores { - return fmt3.Errorf("DtlbStores this(%v) Not Equal that(%v)", *this.DtlbStores, *that1.DtlbStores) - } - } else if this.DtlbStores != nil { - return fmt3.Errorf("this.DtlbStores == nil && that.DtlbStores != nil") - } else if that1.DtlbStores != nil { - return fmt3.Errorf("DtlbStores this(%v) Not Equal that(%v)", this.DtlbStores, that1.DtlbStores) + s := strings.Join([]string{`&Environment{`, + `Variables:` + strings.Replace(fmt.Sprintf("%v", this.Variables), "Environment_Variable", "Environment_Variable", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Environment_Variable) String() string { + if this == nil { + return "nil" } - if this.DtlbStoreMisses != nil && that1.DtlbStoreMisses != nil { - if *this.DtlbStoreMisses != *that1.DtlbStoreMisses { - return fmt3.Errorf("DtlbStoreMisses this(%v) Not Equal that(%v)", *this.DtlbStoreMisses, *that1.DtlbStoreMisses) - } - } else if this.DtlbStoreMisses != nil { - return fmt3.Errorf("this.DtlbStoreMisses == nil && that.DtlbStoreMisses != nil") - } else if that1.DtlbStoreMisses != nil { - return fmt3.Errorf("DtlbStoreMisses this(%v) Not Equal that(%v)", this.DtlbStoreMisses, that1.DtlbStoreMisses) + s := strings.Join([]string{`&Environment_Variable{`, + `Name:` + valueToStringMesos(this.Name) + `,`, + `Value:` + valueToStringMesos(this.Value) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Parameter) String() string { + if this == nil { + return "nil" } - if this.DtlbPrefetches != nil && that1.DtlbPrefetches != nil { - if *this.DtlbPrefetches != *that1.DtlbPrefetches { - return fmt3.Errorf("DtlbPrefetches this(%v) Not Equal that(%v)", *this.DtlbPrefetches, *that1.DtlbPrefetches) - } - } else if this.DtlbPrefetches != nil { - return fmt3.Errorf("this.DtlbPrefetches == nil && that.DtlbPrefetches != nil") - } else if that1.DtlbPrefetches != nil { - return fmt3.Errorf("DtlbPrefetches this(%v) Not Equal that(%v)", this.DtlbPrefetches, that1.DtlbPrefetches) + s := strings.Join([]string{`&Parameter{`, + `Key:` + valueToStringMesos(this.Key) + `,`, + `Value:` + valueToStringMesos(this.Value) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Parameters) String() string { + if this == nil { + return "nil" } - if this.DtlbPrefetchMisses != nil && that1.DtlbPrefetchMisses != nil { - if *this.DtlbPrefetchMisses != *that1.DtlbPrefetchMisses { - return fmt3.Errorf("DtlbPrefetchMisses this(%v) Not Equal that(%v)", *this.DtlbPrefetchMisses, *that1.DtlbPrefetchMisses) - } - } else if this.DtlbPrefetchMisses != nil { - return fmt3.Errorf("this.DtlbPrefetchMisses == nil && that.DtlbPrefetchMisses != nil") - } else if that1.DtlbPrefetchMisses != nil { - return fmt3.Errorf("DtlbPrefetchMisses this(%v) Not Equal that(%v)", this.DtlbPrefetchMisses, that1.DtlbPrefetchMisses) + s := strings.Join([]string{`&Parameters{`, + `Parameter:` + strings.Replace(fmt.Sprintf("%v", this.Parameter), "Parameter", "Parameter", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Credential) String() string { + if this == nil { + return "nil" } - if this.ItlbLoads != nil && that1.ItlbLoads != nil { - if *this.ItlbLoads != *that1.ItlbLoads { - return fmt3.Errorf("ItlbLoads this(%v) Not Equal that(%v)", *this.ItlbLoads, *that1.ItlbLoads) - } - } else if this.ItlbLoads != nil { - return fmt3.Errorf("this.ItlbLoads == nil && that.ItlbLoads != nil") - } else if that1.ItlbLoads != nil { - return fmt3.Errorf("ItlbLoads this(%v) Not Equal that(%v)", this.ItlbLoads, that1.ItlbLoads) + s := strings.Join([]string{`&Credential{`, + `Principal:` + valueToStringMesos(this.Principal) + `,`, + `Secret:` + valueToStringMesos(this.Secret) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Credentials) String() string { + if this == nil { + return "nil" } - if this.ItlbLoadMisses != nil && that1.ItlbLoadMisses != nil { - if *this.ItlbLoadMisses != *that1.ItlbLoadMisses { - return fmt3.Errorf("ItlbLoadMisses this(%v) Not Equal that(%v)", *this.ItlbLoadMisses, *that1.ItlbLoadMisses) - } - } else if this.ItlbLoadMisses != nil { - return fmt3.Errorf("this.ItlbLoadMisses == nil && that.ItlbLoadMisses != nil") - } else if that1.ItlbLoadMisses != nil { - return fmt3.Errorf("ItlbLoadMisses this(%v) Not Equal that(%v)", this.ItlbLoadMisses, that1.ItlbLoadMisses) + s := strings.Join([]string{`&Credentials{`, + `Credentials:` + strings.Replace(fmt.Sprintf("%v", this.Credentials), "Credential", "Credential", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ACL) String() string { + if this == nil { + return "nil" } - if this.BranchLoads != nil && that1.BranchLoads != nil { - if *this.BranchLoads != *that1.BranchLoads { - return fmt3.Errorf("BranchLoads this(%v) Not Equal that(%v)", *this.BranchLoads, *that1.BranchLoads) - } - } else if this.BranchLoads != nil { - return fmt3.Errorf("this.BranchLoads == nil && that.BranchLoads != nil") - } else if that1.BranchLoads != nil { - return fmt3.Errorf("BranchLoads this(%v) Not Equal that(%v)", this.BranchLoads, that1.BranchLoads) + s := strings.Join([]string{`&ACL{`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ACL_Entity) String() string { + if this == nil { + return "nil" } - if this.BranchLoadMisses != nil && that1.BranchLoadMisses != nil { - if *this.BranchLoadMisses != *that1.BranchLoadMisses { - return fmt3.Errorf("BranchLoadMisses this(%v) Not Equal that(%v)", *this.BranchLoadMisses, *that1.BranchLoadMisses) - } - } else if this.BranchLoadMisses != nil { - return fmt3.Errorf("this.BranchLoadMisses == nil && that.BranchLoadMisses != nil") - } else if that1.BranchLoadMisses != nil { - return fmt3.Errorf("BranchLoadMisses this(%v) Not Equal that(%v)", this.BranchLoadMisses, that1.BranchLoadMisses) + s := strings.Join([]string{`&ACL_Entity{`, + `Type:` + valueToStringMesos(this.Type) + `,`, + `Values:` + fmt.Sprintf("%v", this.Values) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ACL_RegisterFramework) String() string { + if this == nil { + return "nil" } - if this.NodeLoads != nil && that1.NodeLoads != nil { - if *this.NodeLoads != *that1.NodeLoads { - return fmt3.Errorf("NodeLoads this(%v) Not Equal that(%v)", *this.NodeLoads, *that1.NodeLoads) - } - } else if this.NodeLoads != nil { - return fmt3.Errorf("this.NodeLoads == nil && that.NodeLoads != nil") - } else if that1.NodeLoads != nil { - return fmt3.Errorf("NodeLoads this(%v) Not Equal that(%v)", this.NodeLoads, that1.NodeLoads) + s := strings.Join([]string{`&ACL_RegisterFramework{`, + `Principals:` + strings.Replace(fmt.Sprintf("%v", this.Principals), "ACL_Entity", "ACL_Entity", 1) + `,`, + `Roles:` + strings.Replace(fmt.Sprintf("%v", this.Roles), "ACL_Entity", "ACL_Entity", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ACL_RunTask) String() string { + if this == nil { + return "nil" } - if this.NodeLoadMisses != nil && that1.NodeLoadMisses != nil { - if *this.NodeLoadMisses != *that1.NodeLoadMisses { - return fmt3.Errorf("NodeLoadMisses this(%v) Not Equal that(%v)", *this.NodeLoadMisses, *that1.NodeLoadMisses) - } - } else if this.NodeLoadMisses != nil { - return fmt3.Errorf("this.NodeLoadMisses == nil && that.NodeLoadMisses != nil") - } else if that1.NodeLoadMisses != nil { - return fmt3.Errorf("NodeLoadMisses this(%v) Not Equal that(%v)", this.NodeLoadMisses, that1.NodeLoadMisses) + s := strings.Join([]string{`&ACL_RunTask{`, + `Principals:` + strings.Replace(fmt.Sprintf("%v", this.Principals), "ACL_Entity", "ACL_Entity", 1) + `,`, + `Users:` + strings.Replace(fmt.Sprintf("%v", this.Users), "ACL_Entity", "ACL_Entity", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ACL_ShutdownFramework) String() string { + if this == nil { + return "nil" } - if this.NodeStores != nil && that1.NodeStores != nil { - if *this.NodeStores != *that1.NodeStores { - return fmt3.Errorf("NodeStores this(%v) Not Equal that(%v)", *this.NodeStores, *that1.NodeStores) - } - } else if this.NodeStores != nil { - return fmt3.Errorf("this.NodeStores == nil && that.NodeStores != nil") - } else if that1.NodeStores != nil { - return fmt3.Errorf("NodeStores this(%v) Not Equal that(%v)", this.NodeStores, that1.NodeStores) + s := strings.Join([]string{`&ACL_ShutdownFramework{`, + `Principals:` + strings.Replace(fmt.Sprintf("%v", this.Principals), "ACL_Entity", "ACL_Entity", 1) + `,`, + `FrameworkPrincipals:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkPrincipals), "ACL_Entity", "ACL_Entity", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ACLs) String() string { + if this == nil { + return "nil" } - if this.NodeStoreMisses != nil && that1.NodeStoreMisses != nil { - if *this.NodeStoreMisses != *that1.NodeStoreMisses { - return fmt3.Errorf("NodeStoreMisses this(%v) Not Equal that(%v)", *this.NodeStoreMisses, *that1.NodeStoreMisses) - } - } else if this.NodeStoreMisses != nil { - return fmt3.Errorf("this.NodeStoreMisses == nil && that.NodeStoreMisses != nil") - } else if that1.NodeStoreMisses != nil { - return fmt3.Errorf("NodeStoreMisses this(%v) Not Equal that(%v)", this.NodeStoreMisses, that1.NodeStoreMisses) + s := strings.Join([]string{`&ACLs{`, + `Permissive:` + valueToStringMesos(this.Permissive) + `,`, + `RegisterFrameworks:` + strings.Replace(fmt.Sprintf("%v", this.RegisterFrameworks), "ACL_RegisterFramework", "ACL_RegisterFramework", 1) + `,`, + `RunTasks:` + strings.Replace(fmt.Sprintf("%v", this.RunTasks), "ACL_RunTask", "ACL_RunTask", 1) + `,`, + `ShutdownFrameworks:` + strings.Replace(fmt.Sprintf("%v", this.ShutdownFrameworks), "ACL_ShutdownFramework", "ACL_ShutdownFramework", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *RateLimit) String() string { + if this == nil { + return "nil" } - if this.NodePrefetches != nil && that1.NodePrefetches != nil { - if *this.NodePrefetches != *that1.NodePrefetches { - return fmt3.Errorf("NodePrefetches this(%v) Not Equal that(%v)", *this.NodePrefetches, *that1.NodePrefetches) - } - } else if this.NodePrefetches != nil { - return fmt3.Errorf("this.NodePrefetches == nil && that.NodePrefetches != nil") - } else if that1.NodePrefetches != nil { - return fmt3.Errorf("NodePrefetches this(%v) Not Equal that(%v)", this.NodePrefetches, that1.NodePrefetches) + s := strings.Join([]string{`&RateLimit{`, + `Qps:` + valueToStringMesos(this.Qps) + `,`, + `Principal:` + valueToStringMesos(this.Principal) + `,`, + `Capacity:` + valueToStringMesos(this.Capacity) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *RateLimits) String() string { + if this == nil { + return "nil" } - if this.NodePrefetchMisses != nil && that1.NodePrefetchMisses != nil { - if *this.NodePrefetchMisses != *that1.NodePrefetchMisses { - return fmt3.Errorf("NodePrefetchMisses this(%v) Not Equal that(%v)", *this.NodePrefetchMisses, *that1.NodePrefetchMisses) - } - } else if this.NodePrefetchMisses != nil { - return fmt3.Errorf("this.NodePrefetchMisses == nil && that.NodePrefetchMisses != nil") - } else if that1.NodePrefetchMisses != nil { - return fmt3.Errorf("NodePrefetchMisses this(%v) Not Equal that(%v)", this.NodePrefetchMisses, that1.NodePrefetchMisses) + s := strings.Join([]string{`&RateLimits{`, + `Limits:` + strings.Replace(fmt.Sprintf("%v", this.Limits), "RateLimit", "RateLimit", 1) + `,`, + `AggregateDefaultQps:` + valueToStringMesos(this.AggregateDefaultQps) + `,`, + `AggregateDefaultCapacity:` + valueToStringMesos(this.AggregateDefaultCapacity) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Volume) String() string { + if this == nil { + return "nil" } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + s := strings.Join([]string{`&Volume{`, + `ContainerPath:` + valueToStringMesos(this.ContainerPath) + `,`, + `HostPath:` + valueToStringMesos(this.HostPath) + `,`, + `Mode:` + valueToStringMesos(this.Mode) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ContainerInfo) String() string { + if this == nil { + return "nil" } - return nil + s := strings.Join([]string{`&ContainerInfo{`, + `Type:` + valueToStringMesos(this.Type) + `,`, + `Volumes:` + strings.Replace(fmt.Sprintf("%v", this.Volumes), "Volume", "Volume", 1) + `,`, + `Docker:` + strings.Replace(fmt.Sprintf("%v", this.Docker), "ContainerInfo_DockerInfo", "ContainerInfo_DockerInfo", 1) + `,`, + `Hostname:` + valueToStringMesos(this.Hostname) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s } -func (this *PerfStatistics) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false +func (this *ContainerInfo_DockerInfo) String() string { + if this == nil { + return "nil" } - - that1, ok := that.(*PerfStatistics) - if !ok { - return false + s := strings.Join([]string{`&ContainerInfo_DockerInfo{`, + `Image:` + valueToStringMesos(this.Image) + `,`, + `Network:` + valueToStringMesos(this.Network) + `,`, + `PortMappings:` + strings.Replace(fmt.Sprintf("%v", this.PortMappings), "ContainerInfo_DockerInfo_PortMapping", "ContainerInfo_DockerInfo_PortMapping", 1) + `,`, + `Privileged:` + valueToStringMesos(this.Privileged) + `,`, + `Parameters:` + strings.Replace(fmt.Sprintf("%v", this.Parameters), "Parameter", "Parameter", 1) + `,`, + `ForcePullImage:` + valueToStringMesos(this.ForcePullImage) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ContainerInfo_DockerInfo_PortMapping) String() string { + if this == nil { + return "nil" } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + s := strings.Join([]string{`&ContainerInfo_DockerInfo_PortMapping{`, + `HostPort:` + valueToStringMesos(this.HostPort) + `,`, + `ContainerPort:` + valueToStringMesos(this.ContainerPort) + `,`, + `Protocol:` + valueToStringMesos(this.Protocol) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Labels) String() string { + if this == nil { + return "nil" } - if this.Timestamp != nil && that1.Timestamp != nil { - if *this.Timestamp != *that1.Timestamp { - return false - } - } else if this.Timestamp != nil { - return false - } else if that1.Timestamp != nil { - return false + s := strings.Join([]string{`&Labels{`, + `Labels:` + strings.Replace(fmt.Sprintf("%v", this.Labels), "Label", "Label", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Label) String() string { + if this == nil { + return "nil" } - if this.Duration != nil && that1.Duration != nil { - if *this.Duration != *that1.Duration { - return false - } - } else if this.Duration != nil { - return false - } else if that1.Duration != nil { - return false + s := strings.Join([]string{`&Label{`, + `Key:` + valueToStringMesos(this.Key) + `,`, + `Value:` + valueToStringMesos(this.Value) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Port) String() string { + if this == nil { + return "nil" } - if this.Cycles != nil && that1.Cycles != nil { - if *this.Cycles != *that1.Cycles { - return false - } - } else if this.Cycles != nil { - return false - } else if that1.Cycles != nil { - return false + s := strings.Join([]string{`&Port{`, + `Number:` + valueToStringMesos(this.Number) + `,`, + `Name:` + valueToStringMesos(this.Name) + `,`, + `Protocol:` + valueToStringMesos(this.Protocol) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Ports) String() string { + if this == nil { + return "nil" } - if this.StalledCyclesFrontend != nil && that1.StalledCyclesFrontend != nil { - if *this.StalledCyclesFrontend != *that1.StalledCyclesFrontend { - return false - } - } else if this.StalledCyclesFrontend != nil { - return false - } else if that1.StalledCyclesFrontend != nil { - return false + s := strings.Join([]string{`&Ports{`, + `Ports:` + strings.Replace(fmt.Sprintf("%v", this.Ports), "Port", "Port", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *DiscoveryInfo) String() string { + if this == nil { + return "nil" } - if this.StalledCyclesBackend != nil && that1.StalledCyclesBackend != nil { - if *this.StalledCyclesBackend != *that1.StalledCyclesBackend { - return false - } - } else if this.StalledCyclesBackend != nil { - return false - } else if that1.StalledCyclesBackend != nil { - return false + s := strings.Join([]string{`&DiscoveryInfo{`, + `Visibility:` + valueToStringMesos(this.Visibility) + `,`, + `Name:` + valueToStringMesos(this.Name) + `,`, + `Environment:` + valueToStringMesos(this.Environment) + `,`, + `Location:` + valueToStringMesos(this.Location) + `,`, + `Version:` + valueToStringMesos(this.Version) + `,`, + `Ports:` + strings.Replace(fmt.Sprintf("%v", this.Ports), "Ports", "Ports", 1) + `,`, + `Labels:` + strings.Replace(fmt.Sprintf("%v", this.Labels), "Labels", "Labels", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func valueToStringMesos(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" } - if this.Instructions != nil && that1.Instructions != nil { - if *this.Instructions != *that1.Instructions { - return false + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *FrameworkID) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.Instructions != nil { - return false - } else if that1.Instructions != nil { - return false - } - if this.CacheReferences != nil && that1.CacheReferences != nil { - if *this.CacheReferences != *that1.CacheReferences { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Value = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.CacheReferences != nil { - return false - } else if that1.CacheReferences != nil { - return false } - if this.CacheMisses != nil && that1.CacheMisses != nil { - if *this.CacheMisses != *that1.CacheMisses { - return false - } - } else if this.CacheMisses != nil { - return false - } else if that1.CacheMisses != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") } - if this.Branches != nil && that1.Branches != nil { - if *this.Branches != *that1.Branches { - return false + + return nil +} +func (m *OfferID) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.Branches != nil { - return false - } else if that1.Branches != nil { - return false - } - if this.BranchMisses != nil && that1.BranchMisses != nil { - if *this.BranchMisses != *that1.BranchMisses { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Value = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.BranchMisses != nil { - return false - } else if that1.BranchMisses != nil { - return false } - if this.BusCycles != nil && that1.BusCycles != nil { - if *this.BusCycles != *that1.BusCycles { - return false - } - } else if this.BusCycles != nil { - return false - } else if that1.BusCycles != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") } - if this.RefCycles != nil && that1.RefCycles != nil { - if *this.RefCycles != *that1.RefCycles { - return false + + return nil +} +func (m *SlaveID) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.RefCycles != nil { - return false - } else if that1.RefCycles != nil { - return false - } - if this.CpuClock != nil && that1.CpuClock != nil { - if *this.CpuClock != *that1.CpuClock { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Value = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.CpuClock != nil { - return false - } else if that1.CpuClock != nil { - return false } - if this.TaskClock != nil && that1.TaskClock != nil { - if *this.TaskClock != *that1.TaskClock { - return false - } - } else if this.TaskClock != nil { - return false - } else if that1.TaskClock != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") } - if this.PageFaults != nil && that1.PageFaults != nil { - if *this.PageFaults != *that1.PageFaults { - return false + + return nil +} +func (m *TaskID) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.PageFaults != nil { - return false - } else if that1.PageFaults != nil { - return false - } - if this.MinorFaults != nil && that1.MinorFaults != nil { - if *this.MinorFaults != *that1.MinorFaults { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Value = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.MinorFaults != nil { - return false - } else if that1.MinorFaults != nil { - return false } - if this.MajorFaults != nil && that1.MajorFaults != nil { - if *this.MajorFaults != *that1.MajorFaults { - return false - } - } else if this.MajorFaults != nil { - return false - } else if that1.MajorFaults != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") } - if this.ContextSwitches != nil && that1.ContextSwitches != nil { - if *this.ContextSwitches != *that1.ContextSwitches { - return false + + return nil +} +func (m *ExecutorID) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.ContextSwitches != nil { - return false - } else if that1.ContextSwitches != nil { - return false - } - if this.CpuMigrations != nil && that1.CpuMigrations != nil { - if *this.CpuMigrations != *that1.CpuMigrations { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Value = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.CpuMigrations != nil { - return false - } else if that1.CpuMigrations != nil { - return false } - if this.AlignmentFaults != nil && that1.AlignmentFaults != nil { - if *this.AlignmentFaults != *that1.AlignmentFaults { - return false - } - } else if this.AlignmentFaults != nil { - return false - } else if that1.AlignmentFaults != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") } - if this.EmulationFaults != nil && that1.EmulationFaults != nil { - if *this.EmulationFaults != *that1.EmulationFaults { - return false + + return nil +} +func (m *ContainerID) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.EmulationFaults != nil { - return false - } else if that1.EmulationFaults != nil { - return false - } - if this.L1DcacheLoads != nil && that1.L1DcacheLoads != nil { - if *this.L1DcacheLoads != *that1.L1DcacheLoads { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Value = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.L1DcacheLoads != nil { - return false - } else if that1.L1DcacheLoads != nil { - return false } - if this.L1DcacheLoadMisses != nil && that1.L1DcacheLoadMisses != nil { - if *this.L1DcacheLoadMisses != *that1.L1DcacheLoadMisses { - return false - } - } else if this.L1DcacheLoadMisses != nil { - return false - } else if that1.L1DcacheLoadMisses != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") } - if this.L1DcacheStores != nil && that1.L1DcacheStores != nil { - if *this.L1DcacheStores != *that1.L1DcacheStores { - return false + + return nil +} +func (m *FrameworkInfo) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.L1DcacheStores != nil { - return false - } else if that1.L1DcacheStores != nil { - return false - } - if this.L1DcacheStoreMisses != nil && that1.L1DcacheStoreMisses != nil { - if *this.L1DcacheStoreMisses != *that1.L1DcacheStoreMisses { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.User = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Name = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Id == nil { + m.Id = &FrameworkID{} + } + if err := m.Id.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field FailoverTimeout", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.FailoverTimeout = &v2 + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Checkpoint", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Checkpoint = &b + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Role = &s + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Hostname = &s + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Principal", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Principal = &s + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WebuiUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.WebuiUrl = &s + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Capabilities", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Capabilities = append(m.Capabilities, &FrameworkInfo_Capability{}) + if err := m.Capabilities[len(m.Capabilities)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.L1DcacheStoreMisses != nil { - return false - } else if that1.L1DcacheStoreMisses != nil { - return false } - if this.L1DcachePrefetches != nil && that1.L1DcachePrefetches != nil { - if *this.L1DcachePrefetches != *that1.L1DcachePrefetches { - return false - } - } else if this.L1DcachePrefetches != nil { - return false - } else if that1.L1DcachePrefetches != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("user") } - if this.L1DcachePrefetchMisses != nil && that1.L1DcachePrefetchMisses != nil { - if *this.L1DcachePrefetchMisses != *that1.L1DcachePrefetchMisses { - return false - } - } else if this.L1DcachePrefetchMisses != nil { - return false - } else if that1.L1DcachePrefetchMisses != nil { - return false + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") } - if this.L1IcacheLoads != nil && that1.L1IcacheLoads != nil { - if *this.L1IcacheLoads != *that1.L1IcacheLoads { - return false + + return nil +} +func (m *FrameworkInfo_Capability) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.L1IcacheLoads != nil { - return false - } else if that1.L1IcacheLoads != nil { - return false - } - if this.L1IcacheLoadMisses != nil && that1.L1IcacheLoadMisses != nil { - if *this.L1IcacheLoadMisses != *that1.L1IcacheLoadMisses { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var v FrameworkInfo_Capability_Type + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (FrameworkInfo_Capability_Type(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Type = &v + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.L1IcacheLoadMisses != nil { - return false - } else if that1.L1IcacheLoadMisses != nil { - return false } - if this.L1IcachePrefetches != nil && that1.L1IcachePrefetches != nil { - if *this.L1IcachePrefetches != *that1.L1IcachePrefetches { - return false - } - } else if this.L1IcachePrefetches != nil { - return false - } else if that1.L1IcachePrefetches != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") } - if this.L1IcachePrefetchMisses != nil && that1.L1IcachePrefetchMisses != nil { - if *this.L1IcachePrefetchMisses != *that1.L1IcachePrefetchMisses { - return false + + return nil +} +func (m *HealthCheck) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.L1IcachePrefetchMisses != nil { - return false - } else if that1.L1IcachePrefetchMisses != nil { - return false - } - if this.LlcLoads != nil && that1.LlcLoads != nil { - if *this.LlcLoads != *that1.LlcLoads { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Http", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Http == nil { + m.Http = &HealthCheck_HTTP{} + } + if err := m.Http.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field DelaySeconds", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.DelaySeconds = &v2 + case 3: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field IntervalSeconds", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.IntervalSeconds = &v2 + case 4: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutSeconds", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.TimeoutSeconds = &v2 + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsecutiveFailures", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.ConsecutiveFailures = &v + case 6: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field GracePeriodSeconds", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.GracePeriodSeconds = &v2 + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Command", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Command == nil { + m.Command = &CommandInfo{} + } + if err := m.Command.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.LlcLoads != nil { - return false - } else if that1.LlcLoads != nil { - return false } - if this.LlcLoadMisses != nil && that1.LlcLoadMisses != nil { - if *this.LlcLoadMisses != *that1.LlcLoadMisses { - return false + + return nil +} +func (m *HealthCheck_HTTP) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.LlcLoadMisses != nil { - return false - } else if that1.LlcLoadMisses != nil { - return false - } - if this.LlcStores != nil && that1.LlcStores != nil { - if *this.LlcStores != *that1.LlcStores { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Port = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Path = &s + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Statuses", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Statuses = append(m.Statuses, v) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.LlcStores != nil { - return false - } else if that1.LlcStores != nil { - return false } - if this.LlcStoreMisses != nil && that1.LlcStoreMisses != nil { - if *this.LlcStoreMisses != *that1.LlcStoreMisses { - return false - } - } else if this.LlcStoreMisses != nil { - return false - } else if that1.LlcStoreMisses != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("port") } - if this.LlcPrefetches != nil && that1.LlcPrefetches != nil { - if *this.LlcPrefetches != *that1.LlcPrefetches { - return false + + return nil +} +func (m *CommandInfo) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.LlcPrefetches != nil { - return false - } else if that1.LlcPrefetches != nil { - return false - } - if this.LlcPrefetchMisses != nil && that1.LlcPrefetchMisses != nil { - if *this.LlcPrefetchMisses != *that1.LlcPrefetchMisses { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Uris", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Uris = append(m.Uris, &CommandInfo_URI{}) + if err := m.Uris[len(m.Uris)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Environment", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Environment == nil { + m.Environment = &Environment{} + } + if err := m.Environment.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Value = &s + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Container == nil { + m.Container = &CommandInfo_ContainerInfo{} + } + if err := m.Container.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.User = &s + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Shell", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Shell = &b + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Arguments", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Arguments = append(m.Arguments, string(data[iNdEx:postIndex])) + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.LlcPrefetchMisses != nil { - return false - } else if that1.LlcPrefetchMisses != nil { - return false } - if this.DtlbLoads != nil && that1.DtlbLoads != nil { - if *this.DtlbLoads != *that1.DtlbLoads { - return false + + return nil +} +func (m *CommandInfo_URI) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.DtlbLoads != nil { - return false - } else if that1.DtlbLoads != nil { - return false - } - if this.DtlbLoadMisses != nil && that1.DtlbLoadMisses != nil { - if *this.DtlbLoadMisses != *that1.DtlbLoadMisses { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Value = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Executable", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Executable = &b + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Extract", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Extract = &b + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Cache", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Cache = &b + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.DtlbLoadMisses != nil { - return false - } else if that1.DtlbLoadMisses != nil { - return false } - if this.DtlbStores != nil && that1.DtlbStores != nil { - if *this.DtlbStores != *that1.DtlbStores { - return false - } - } else if this.DtlbStores != nil { - return false - } else if that1.DtlbStores != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") } - if this.DtlbStoreMisses != nil && that1.DtlbStoreMisses != nil { - if *this.DtlbStoreMisses != *that1.DtlbStoreMisses { - return false + + return nil +} +func (m *CommandInfo_ContainerInfo) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.DtlbStoreMisses != nil { - return false - } else if that1.DtlbStoreMisses != nil { - return false - } - if this.DtlbPrefetches != nil && that1.DtlbPrefetches != nil { - if *this.DtlbPrefetches != *that1.DtlbPrefetches { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Image = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Options = append(m.Options, string(data[iNdEx:postIndex])) + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.DtlbPrefetches != nil { - return false - } else if that1.DtlbPrefetches != nil { - return false } - if this.DtlbPrefetchMisses != nil && that1.DtlbPrefetchMisses != nil { - if *this.DtlbPrefetchMisses != *that1.DtlbPrefetchMisses { - return false - } - } else if this.DtlbPrefetchMisses != nil { - return false - } else if that1.DtlbPrefetchMisses != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("image") } - if this.ItlbLoads != nil && that1.ItlbLoads != nil { - if *this.ItlbLoads != *that1.ItlbLoads { - return false + + return nil +} +func (m *ExecutorInfo) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.ItlbLoads != nil { - return false - } else if that1.ItlbLoads != nil { - return false - } - if this.ItlbLoadMisses != nil && that1.ItlbLoadMisses != nil { - if *this.ItlbLoadMisses != *that1.ItlbLoadMisses { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutorId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ExecutorId == nil { + m.ExecutorId = &ExecutorID{} + } + if err := m.ExecutorId.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append([]byte{}, data[iNdEx:postIndex]...) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Resources = append(m.Resources, &Resource{}) + if err := m.Resources[len(m.Resources)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Command", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Command == nil { + m.Command = &CommandInfo{} + } + if err := m.Command.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000002) + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.FrameworkId == nil { + m.FrameworkId = &FrameworkID{} + } + if err := m.FrameworkId.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Name = &s + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Source = &s + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Container == nil { + m.Container = &ContainerInfo{} + } + if err := m.Container.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Discovery", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Discovery == nil { + m.Discovery = &DiscoveryInfo{} + } + if err := m.Discovery.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.ItlbLoadMisses != nil { - return false - } else if that1.ItlbLoadMisses != nil { - return false } - if this.BranchLoads != nil && that1.BranchLoads != nil { - if *this.BranchLoads != *that1.BranchLoads { - return false - } - } else if this.BranchLoads != nil { - return false - } else if that1.BranchLoads != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("executor_id") } - if this.BranchLoadMisses != nil && that1.BranchLoadMisses != nil { - if *this.BranchLoadMisses != *that1.BranchLoadMisses { - return false - } - } else if this.BranchLoadMisses != nil { - return false - } else if that1.BranchLoadMisses != nil { - return false + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("command") } - if this.NodeLoads != nil && that1.NodeLoads != nil { - if *this.NodeLoads != *that1.NodeLoads { - return false + + return nil +} +func (m *MasterInfo) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Id = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Ip", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Ip = &v + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Port = &v + hasFields[0] |= uint64(0x00000004) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Pid = &s + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Hostname = &s + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Version = &s + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.NodeLoads != nil { - return false - } else if that1.NodeLoads != nil { - return false } - if this.NodeLoadMisses != nil && that1.NodeLoadMisses != nil { - if *this.NodeLoadMisses != *that1.NodeLoadMisses { - return false - } - } else if this.NodeLoadMisses != nil { - return false - } else if that1.NodeLoadMisses != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("id") } - if this.NodeStores != nil && that1.NodeStores != nil { - if *this.NodeStores != *that1.NodeStores { - return false - } - } else if this.NodeStores != nil { - return false - } else if that1.NodeStores != nil { - return false + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("ip") } - if this.NodeStoreMisses != nil && that1.NodeStoreMisses != nil { - if *this.NodeStoreMisses != *that1.NodeStoreMisses { - return false - } - } else if this.NodeStoreMisses != nil { - return false - } else if that1.NodeStoreMisses != nil { - return false + if hasFields[0]&uint64(0x00000004) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("port") } - if this.NodePrefetches != nil && that1.NodePrefetches != nil { - if *this.NodePrefetches != *that1.NodePrefetches { - return false + + return nil +} +func (m *SlaveInfo) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.NodePrefetches != nil { - return false - } else if that1.NodePrefetches != nil { - return false - } - if this.NodePrefetchMisses != nil && that1.NodePrefetchMisses != nil { - if *this.NodePrefetchMisses != *that1.NodePrefetchMisses { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Hostname = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Resources = append(m.Resources, &Resource{}) + if err := m.Resources[len(m.Resources)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Attributes = append(m.Attributes, &Attribute{}) + if err := m.Attributes[len(m.Attributes)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Id == nil { + m.Id = &SlaveID{} + } + if err := m.Id.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Checkpoint", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Checkpoint = &b + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Port = &v + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.NodePrefetchMisses != nil { - return false - } else if that1.NodePrefetchMisses != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false } - return true -} -func (this *Request) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("hostname") } - that1, ok := that.(*Request) - if !ok { - return fmt3.Errorf("that is not of type *Request") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *Request but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Requestbut is not nil && this == nil") - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt3.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if len(this.Resources) != len(that1.Resources) { - return fmt3.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return fmt3.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } return nil } -func (this *Request) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Request) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if len(this.Resources) != len(that1.Resources) { - return false - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Offer) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Offer) - if !ok { - return fmt3.Errorf("that is not of type *Offer") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *Offer but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Offerbut is not nil && this == nil") - } - if !this.Id.Equal(that1.Id) { - return fmt3.Errorf("Id this(%v) Not Equal that(%v)", this.Id, that1.Id) - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt3.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt3.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return fmt3.Errorf("Hostname this(%v) Not Equal that(%v)", *this.Hostname, *that1.Hostname) +func (m *Value) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.Hostname != nil { - return fmt3.Errorf("this.Hostname == nil && that.Hostname != nil") - } else if that1.Hostname != nil { - return fmt3.Errorf("Hostname this(%v) Not Equal that(%v)", this.Hostname, that1.Hostname) - } - if len(this.Resources) != len(that1.Resources) { - return fmt3.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return fmt3.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var v Value_Type + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (Value_Type(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Type = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Scalar", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Scalar == nil { + m.Scalar = &Value_Scalar{} + } + if err := m.Scalar.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ranges", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Ranges == nil { + m.Ranges = &Value_Ranges{} + } + if err := m.Ranges.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Set", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Set == nil { + m.Set = &Value_Set{} + } + if err := m.Set.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Text", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Text == nil { + m.Text = &Value_Text{} + } + if err := m.Text.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } } - if len(this.Attributes) != len(that1.Attributes) { - return fmt3.Errorf("Attributes this(%v) Not Equal that(%v)", len(this.Attributes), len(that1.Attributes)) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") } - for i := range this.Attributes { - if !this.Attributes[i].Equal(that1.Attributes[i]) { - return fmt3.Errorf("Attributes this[%v](%v) Not Equal that[%v](%v)", i, this.Attributes[i], i, that1.Attributes[i]) + + return nil +} +func (m *Value_Scalar) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } - if len(this.ExecutorIds) != len(that1.ExecutorIds) { - return fmt3.Errorf("ExecutorIds this(%v) Not Equal that(%v)", len(this.ExecutorIds), len(that1.ExecutorIds)) - } - for i := range this.ExecutorIds { - if !this.ExecutorIds[i].Equal(that1.ExecutorIds[i]) { - return fmt3.Errorf("ExecutorIds this[%v](%v) Not Equal that[%v](%v)", i, this.ExecutorIds[i], i, that1.ExecutorIds[i]) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.Value = &v2 + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") } + return nil } -func (this *Offer) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Offer) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true +func (m *Value_Range) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - return false - } else if this == nil { - return false - } - if !this.Id.Equal(that1.Id) { - return false - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Begin", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Begin = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field End", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.End = &v + hasFields[0] |= uint64(0x00000002) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Hostname != nil { - return false - } else if that1.Hostname != nil { - return false } - if len(this.Resources) != len(that1.Resources) { - return false - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return false - } + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("begin") } - if len(this.Attributes) != len(that1.Attributes) { - return false + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("end") } - for i := range this.Attributes { - if !this.Attributes[i].Equal(that1.Attributes[i]) { - return false + + return nil +} +func (m *Value_Ranges) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } - if len(this.ExecutorIds) != len(that1.ExecutorIds) { - return false - } - for i := range this.ExecutorIds { - if !this.ExecutorIds[i].Equal(that1.ExecutorIds[i]) { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Range", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Range = append(m.Range, &Value_Range{}) + if err := m.Range[len(m.Range)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true + + return nil } -func (this *TaskInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil +func (m *Value_Set) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Item", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Item = append(m.Item, string(data[iNdEx:postIndex])) + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt3.Errorf("that == nil && this != nil") } - that1, ok := that.(*TaskInfo) - if !ok { - return fmt3.Errorf("that is not of type *TaskInfo") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *TaskInfo but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *TaskInfobut is not nil && this == nil") - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt3.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) + return nil +} +func (m *Value_Text) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.Name != nil { - return fmt3.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt3.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) - } - if !this.TaskId.Equal(that1.TaskId) { - return fmt3.Errorf("TaskId this(%v) Not Equal that(%v)", this.TaskId, that1.TaskId) - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt3.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if len(this.Resources) != len(that1.Resources) { - return fmt3.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return fmt3.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Value = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } } - if !this.Executor.Equal(that1.Executor) { - return fmt3.Errorf("Executor this(%v) Not Equal that(%v)", this.Executor, that1.Executor) - } - if !this.Command.Equal(that1.Command) { - return fmt3.Errorf("Command this(%v) Not Equal that(%v)", this.Command, that1.Command) - } - if !this.Container.Equal(that1.Container) { - return fmt3.Errorf("Container this(%v) Not Equal that(%v)", this.Container, that1.Container) - } - if !bytes.Equal(this.Data, that1.Data) { - return fmt3.Errorf("Data this(%v) Not Equal that(%v)", this.Data, that1.Data) - } - if !this.HealthCheck.Equal(that1.HealthCheck) { - return fmt3.Errorf("HealthCheck this(%v) Not Equal that(%v)", this.HealthCheck, that1.HealthCheck) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") } + return nil } -func (this *TaskInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*TaskInfo) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false +func (m *Attribute) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false - } - if !this.TaskId.Equal(that1.TaskId) { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if len(this.Resources) != len(that1.Resources) { - return false - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Name = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var v Value_Type + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (Value_Type(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Type = &v + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Scalar", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Scalar == nil { + m.Scalar = &Value_Scalar{} + } + if err := m.Scalar.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ranges", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Ranges == nil { + m.Ranges = &Value_Ranges{} + } + if err := m.Ranges.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Text", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Text == nil { + m.Text = &Value_Text{} + } + if err := m.Text.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Set", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Set == nil { + m.Set = &Value_Set{} + } + if err := m.Set.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } } - if !this.Executor.Equal(that1.Executor) { - return false - } - if !this.Command.Equal(that1.Command) { - return false - } - if !this.Container.Equal(that1.Container) { - return false - } - if !bytes.Equal(this.Data, that1.Data) { - return false - } - if !this.HealthCheck.Equal(that1.HealthCheck) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") } - return true -} -func (this *TaskStatus) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") } - that1, ok := that.(*TaskStatus) - if !ok { - return fmt3.Errorf("that is not of type *TaskStatus") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *TaskStatus but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *TaskStatusbut is not nil && this == nil") - } - if !this.TaskId.Equal(that1.TaskId) { - return fmt3.Errorf("TaskId this(%v) Not Equal that(%v)", this.TaskId, that1.TaskId) - } - if this.State != nil && that1.State != nil { - if *this.State != *that1.State { - return fmt3.Errorf("State this(%v) Not Equal that(%v)", *this.State, *that1.State) - } - } else if this.State != nil { - return fmt3.Errorf("this.State == nil && that.State != nil") - } else if that1.State != nil { - return fmt3.Errorf("State this(%v) Not Equal that(%v)", this.State, that1.State) - } - if this.Message != nil && that1.Message != nil { - if *this.Message != *that1.Message { - return fmt3.Errorf("Message this(%v) Not Equal that(%v)", *this.Message, *that1.Message) - } - } else if this.Message != nil { - return fmt3.Errorf("this.Message == nil && that.Message != nil") - } else if that1.Message != nil { - return fmt3.Errorf("Message this(%v) Not Equal that(%v)", this.Message, that1.Message) - } - if this.Source != nil && that1.Source != nil { - if *this.Source != *that1.Source { - return fmt3.Errorf("Source this(%v) Not Equal that(%v)", *this.Source, *that1.Source) - } - } else if this.Source != nil { - return fmt3.Errorf("this.Source == nil && that.Source != nil") - } else if that1.Source != nil { - return fmt3.Errorf("Source this(%v) Not Equal that(%v)", this.Source, that1.Source) - } - if this.Reason != nil && that1.Reason != nil { - if *this.Reason != *that1.Reason { - return fmt3.Errorf("Reason this(%v) Not Equal that(%v)", *this.Reason, *that1.Reason) + return nil +} +func (m *Resource) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.Reason != nil { - return fmt3.Errorf("this.Reason == nil && that.Reason != nil") - } else if that1.Reason != nil { - return fmt3.Errorf("Reason this(%v) Not Equal that(%v)", this.Reason, that1.Reason) - } - if !bytes.Equal(this.Data, that1.Data) { - return fmt3.Errorf("Data this(%v) Not Equal that(%v)", this.Data, that1.Data) - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt3.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return fmt3.Errorf("ExecutorId this(%v) Not Equal that(%v)", this.ExecutorId, that1.ExecutorId) - } - if this.Timestamp != nil && that1.Timestamp != nil { - if *this.Timestamp != *that1.Timestamp { - return fmt3.Errorf("Timestamp this(%v) Not Equal that(%v)", *this.Timestamp, *that1.Timestamp) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Name = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var v Value_Type + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (Value_Type(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Type = &v + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Scalar", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Scalar == nil { + m.Scalar = &Value_Scalar{} + } + if err := m.Scalar.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ranges", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Ranges == nil { + m.Ranges = &Value_Ranges{} + } + if err := m.Ranges.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Set", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Set == nil { + m.Set = &Value_Set{} + } + if err := m.Set.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Role = &s + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Disk", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Disk == nil { + m.Disk = &Resource_DiskInfo{} + } + if err := m.Disk.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reservation", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Reservation == nil { + m.Reservation = &Resource_ReservationInfo{} + } + if err := m.Reservation.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Revocable", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Revocable == nil { + m.Revocable = &Resource_RevocableInfo{} + } + if err := m.Revocable.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Timestamp != nil { - return fmt3.Errorf("this.Timestamp == nil && that.Timestamp != nil") - } else if that1.Timestamp != nil { - return fmt3.Errorf("Timestamp this(%v) Not Equal that(%v)", this.Timestamp, that1.Timestamp) } - if this.Healthy != nil && that1.Healthy != nil { - if *this.Healthy != *that1.Healthy { - return fmt3.Errorf("Healthy this(%v) Not Equal that(%v)", *this.Healthy, *that1.Healthy) - } - } else if this.Healthy != nil { - return fmt3.Errorf("this.Healthy == nil && that.Healthy != nil") - } else if that1.Healthy != nil { - return fmt3.Errorf("Healthy this(%v) Not Equal that(%v)", this.Healthy, that1.Healthy) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") } + return nil } -func (this *TaskStatus) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*TaskStatus) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.TaskId.Equal(that1.TaskId) { - return false - } - if this.State != nil && that1.State != nil { - if *this.State != *that1.State { - return false - } - } else if this.State != nil { - return false - } else if that1.State != nil { - return false - } - if this.Message != nil && that1.Message != nil { - if *this.Message != *that1.Message { - return false - } - } else if this.Message != nil { - return false - } else if that1.Message != nil { - return false - } - if this.Source != nil && that1.Source != nil { - if *this.Source != *that1.Source { - return false - } - } else if this.Source != nil { - return false - } else if that1.Source != nil { - return false - } - if this.Reason != nil && that1.Reason != nil { - if *this.Reason != *that1.Reason { - return false - } - } else if this.Reason != nil { - return false - } else if that1.Reason != nil { - return false - } - if !bytes.Equal(this.Data, that1.Data) { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return false - } - if this.Timestamp != nil && that1.Timestamp != nil { - if *this.Timestamp != *that1.Timestamp { - return false +func (m *Resource_ReservationInfo) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.Timestamp != nil { - return false - } else if that1.Timestamp != nil { - return false - } - if this.Healthy != nil && that1.Healthy != nil { - if *this.Healthy != *that1.Healthy { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Principal", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Principal = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Healthy != nil { - return false - } else if that1.Healthy != nil { - return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("principal") } - return true + + return nil } -func (this *Filters) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil +func (m *Resource_DiskInfo) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - return fmt3.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Filters) - if !ok { - return fmt3.Errorf("that is not of type *Filters") - } - if that1 == nil { - if this == nil { - return nil + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Persistence", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Persistence == nil { + m.Persistence = &Resource_DiskInfo_Persistence{} + } + if err := m.Persistence.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Volume", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Volume == nil { + m.Volume = &Volume{} + } + if err := m.Volume.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt3.Errorf("that is type *Filters but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Filtersbut is not nil && this == nil") } - if this.RefuseSeconds != nil && that1.RefuseSeconds != nil { - if *this.RefuseSeconds != *that1.RefuseSeconds { - return fmt3.Errorf("RefuseSeconds this(%v) Not Equal that(%v)", *this.RefuseSeconds, *that1.RefuseSeconds) + + return nil +} +func (m *Resource_DiskInfo_Persistence) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Id = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.RefuseSeconds != nil { - return fmt3.Errorf("this.RefuseSeconds == nil && that.RefuseSeconds != nil") - } else if that1.RefuseSeconds != nil { - return fmt3.Errorf("RefuseSeconds this(%v) Not Equal that(%v)", this.RefuseSeconds, that1.RefuseSeconds) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("id") } + return nil } -func (this *Filters) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true +func (m *Resource_RevocableInfo) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + switch fieldNum { + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false } - that1, ok := that.(*Filters) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true + return nil +} +func (m *TrafficControlStatistics) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - return false - } else if this == nil { - return false - } - if this.RefuseSeconds != nil && that1.RefuseSeconds != nil { - if *this.RefuseSeconds != *that1.RefuseSeconds { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Id = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Backlog", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Backlog = &v + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Bytes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Bytes = &v + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Drops", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Drops = &v + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Overlimits", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Overlimits = &v + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Packets", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Packets = &v + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Qlen", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Qlen = &v + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Ratebps", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Ratebps = &v + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Ratepps", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Ratepps = &v + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Requeues", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Requeues = &v + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.RefuseSeconds != nil { - return false - } else if that1.RefuseSeconds != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false } - return true -} -func (this *Environment) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("id") } - that1, ok := that.(*Environment) - if !ok { - return fmt3.Errorf("that is not of type *Environment") - } - if that1 == nil { - if this == nil { - return nil + return nil +} +func (m *ResourceStatistics) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - return fmt3.Errorf("that is type *Environment but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Environmentbut is not nil && this == nil") - } - if len(this.Variables) != len(that1.Variables) { - return fmt3.Errorf("Variables this(%v) Not Equal that(%v)", len(this.Variables), len(that1.Variables)) - } - for i := range this.Variables { - if !this.Variables[i].Equal(that1.Variables[i]) { - return fmt3.Errorf("Variables this[%v](%v) Not Equal that[%v](%v)", i, this.Variables[i], i, that1.Variables[i]) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.Timestamp = &v2 + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field CpusUserTimeSecs", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.CpusUserTimeSecs = &v2 + case 3: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field CpusSystemTimeSecs", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.CpusSystemTimeSecs = &v2 + case 4: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field CpusLimit", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.CpusLimit = &v2 + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemRssBytes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MemRssBytes = &v + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemLimitBytes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MemLimitBytes = &v + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CpusNrPeriods", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.CpusNrPeriods = &v + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CpusNrThrottled", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.CpusNrThrottled = &v + case 9: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field CpusThrottledTimeSecs", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.CpusThrottledTimeSecs = &v2 + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemFileBytes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MemFileBytes = &v + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemAnonBytes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MemAnonBytes = &v + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemMappedFileBytes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MemMappedFileBytes = &v + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Perf", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Perf == nil { + m.Perf = &PerfStatistics{} + } + if err := m.Perf.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NetRxPackets", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NetRxPackets = &v + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NetRxBytes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NetRxBytes = &v + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NetRxErrors", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NetRxErrors = &v + case 17: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NetRxDropped", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NetRxDropped = &v + case 18: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NetTxPackets", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NetTxPackets = &v + case 19: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NetTxBytes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NetTxBytes = &v + case 20: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NetTxErrors", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NetTxErrors = &v + case 21: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NetTxDropped", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NetTxDropped = &v + case 22: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field NetTcpRttMicrosecsP50", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.NetTcpRttMicrosecsP50 = &v2 + case 23: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field NetTcpRttMicrosecsP90", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.NetTcpRttMicrosecsP90 = &v2 + case 24: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field NetTcpRttMicrosecsP95", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.NetTcpRttMicrosecsP95 = &v2 + case 25: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field NetTcpRttMicrosecsP99", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.NetTcpRttMicrosecsP99 = &v2 + case 26: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DiskLimitBytes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.DiskLimitBytes = &v + case 27: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DiskUsedBytes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.DiskUsedBytes = &v + case 28: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field NetTcpActiveConnections", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.NetTcpActiveConnections = &v2 + case 29: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field NetTcpTimeWaitConnections", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.NetTcpTimeWaitConnections = &v2 + case 30: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Processes", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Processes = &v + case 31: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Threads", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Threads = &v + case 32: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemLowPressureCounter", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MemLowPressureCounter = &v + case 33: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemMediumPressureCounter", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MemMediumPressureCounter = &v + case 34: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemCriticalPressureCounter", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MemCriticalPressureCounter = &v + case 35: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NetTrafficControlStatistics", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NetTrafficControlStatistics = append(m.NetTrafficControlStatistics, &TrafficControlStatistics{}) + if err := m.NetTrafficControlStatistics[len(m.NetTrafficControlStatistics)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 36: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemTotalBytes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MemTotalBytes = &v + case 37: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemTotalMemswBytes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MemTotalMemswBytes = &v + case 38: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemSoftLimitBytes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MemSoftLimitBytes = &v + case 39: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemCacheBytes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MemCacheBytes = &v + case 40: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemSwapBytes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MemSwapBytes = &v + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("timestamp") } + return nil } -func (this *Environment) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Environment) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.Variables) != len(that1.Variables) { - return false - } - for i := range this.Variables { - if !this.Variables[i].Equal(that1.Variables[i]) { - return false +func (m *ResourceUsage) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Environment_Variable) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Executors", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Executors = append(m.Executors, &ResourceUsage_Executor{}) + if err := m.Executors[len(m.Executors)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt3.Errorf("that == nil && this != nil") } - that1, ok := that.(*Environment_Variable) - if !ok { - return fmt3.Errorf("that is not of type *Environment_Variable") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *Environment_Variable but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Environment_Variablebut is not nil && this == nil") - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt3.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) - } - } else if this.Name != nil { - return fmt3.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt3.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) - } - } else if this.Value != nil { - return fmt3.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } return nil } -func (this *Environment_Variable) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Environment_Variable) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false - } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false +func (m *ResourceUsage_Executor) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Parameter) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutorInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ExecutorInfo == nil { + m.ExecutorInfo = &ExecutorInfo{} + } + if err := m.ExecutorInfo.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Allocated", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Allocated = append(m.Allocated, &Resource{}) + if err := m.Allocated[len(m.Allocated)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Statistics", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Statistics == nil { + m.Statistics = &ResourceStatistics{} + } + if err := m.Statistics.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt3.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Parameter) - if !ok { - return fmt3.Errorf("that is not of type *Parameter") } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *Parameter but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Parameterbut is not nil && this == nil") + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("executor_info") } - if this.Key != nil && that1.Key != nil { - if *this.Key != *that1.Key { - return fmt3.Errorf("Key this(%v) Not Equal that(%v)", *this.Key, *that1.Key) + + return nil +} +func (m *PerfStatistics) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.Key != nil { - return fmt3.Errorf("this.Key == nil && that.Key != nil") - } else if that1.Key != nil { - return fmt3.Errorf("Key this(%v) Not Equal that(%v)", this.Key, that1.Key) - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.Timestamp = &v2 + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.Duration = &v2 + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Cycles", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Cycles = &v + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StalledCyclesFrontend", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.StalledCyclesFrontend = &v + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StalledCyclesBackend", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.StalledCyclesBackend = &v + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Instructions", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Instructions = &v + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CacheReferences", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.CacheReferences = &v + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CacheMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.CacheMisses = &v + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Branches", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Branches = &v + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BranchMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.BranchMisses = &v + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BusCycles", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.BusCycles = &v + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RefCycles", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.RefCycles = &v + case 13: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field CpuClock", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.CpuClock = &v2 + case 14: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field TaskClock", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.TaskClock = &v2 + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PageFaults", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.PageFaults = &v + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinorFaults", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MinorFaults = &v + case 17: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MajorFaults", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MajorFaults = &v + case 18: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ContextSwitches", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.ContextSwitches = &v + case 19: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CpuMigrations", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.CpuMigrations = &v + case 20: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AlignmentFaults", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.AlignmentFaults = &v + case 21: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EmulationFaults", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.EmulationFaults = &v + case 22: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field L1DcacheLoads", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.L1DcacheLoads = &v + case 23: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field L1DcacheLoadMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.L1DcacheLoadMisses = &v + case 24: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field L1DcacheStores", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.L1DcacheStores = &v + case 25: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field L1DcacheStoreMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.L1DcacheStoreMisses = &v + case 26: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field L1DcachePrefetches", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.L1DcachePrefetches = &v + case 27: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field L1DcachePrefetchMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.L1DcachePrefetchMisses = &v + case 28: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field L1IcacheLoads", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.L1IcacheLoads = &v + case 29: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field L1IcacheLoadMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.L1IcacheLoadMisses = &v + case 30: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field L1IcachePrefetches", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.L1IcachePrefetches = &v + case 31: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field L1IcachePrefetchMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.L1IcachePrefetchMisses = &v + case 32: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LlcLoads", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.LlcLoads = &v + case 33: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LlcLoadMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.LlcLoadMisses = &v + case 34: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LlcStores", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.LlcStores = &v + case 35: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LlcStoreMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.LlcStoreMisses = &v + case 36: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LlcPrefetches", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.LlcPrefetches = &v + case 37: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LlcPrefetchMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.LlcPrefetchMisses = &v + case 38: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DtlbLoads", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.DtlbLoads = &v + case 39: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DtlbLoadMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.DtlbLoadMisses = &v + case 40: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DtlbStores", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.DtlbStores = &v + case 41: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DtlbStoreMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.DtlbStoreMisses = &v + case 42: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DtlbPrefetches", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.DtlbPrefetches = &v + case 43: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DtlbPrefetchMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.DtlbPrefetchMisses = &v + case 44: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ItlbLoads", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.ItlbLoads = &v + case 45: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ItlbLoadMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.ItlbLoadMisses = &v + case 46: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BranchLoads", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.BranchLoads = &v + case 47: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BranchLoadMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.BranchLoadMisses = &v + case 48: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeLoads", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NodeLoads = &v + case 49: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeLoadMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NodeLoadMisses = &v + case 50: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeStores", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NodeStores = &v + case 51: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeStoreMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NodeStoreMisses = &v + case 52: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NodePrefetches", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NodePrefetches = &v + case 53: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NodePrefetchMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NodePrefetchMisses = &v + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Value != nil { - return fmt3.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("timestamp") } + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("duration") + } + return nil } -func (this *Parameter) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true +func (m *Request) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SlaveId == nil { + m.SlaveId = &SlaveID{} + } + if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Resources = append(m.Resources, &Resource{}) + if err := m.Resources[len(m.Resources)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false } - that1, ok := that.(*Parameter) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true + return nil +} +func (m *Offer) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Id == nil { + m.Id = &OfferID{} + } + if err := m.Id.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.FrameworkId == nil { + m.FrameworkId = &FrameworkID{} + } + if err := m.FrameworkId.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SlaveId == nil { + m.SlaveId = &SlaveID{} + } + if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000004) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Hostname = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000008) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Resources = append(m.Resources, &Resource{}) + if err := m.Resources[len(m.Resources)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutorIds", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExecutorIds = append(m.ExecutorIds, &ExecutorID{}) + if err := m.ExecutorIds[len(m.ExecutorIds)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Attributes = append(m.Attributes, &Attribute{}) + if err := m.Attributes[len(m.Attributes)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false - } else if this == nil { - return false } - if this.Key != nil && that1.Key != nil { - if *this.Key != *that1.Key { - return false - } - } else if this.Key != nil { - return false - } else if that1.Key != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("id") } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false - } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if hasFields[0]&uint64(0x00000004) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") } - return true -} -func (this *Parameters) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if hasFields[0]&uint64(0x00000008) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("hostname") } - that1, ok := that.(*Parameters) - if !ok { - return fmt3.Errorf("that is not of type *Parameters") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *Parameters but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Parametersbut is not nil && this == nil") - } - if len(this.Parameter) != len(that1.Parameter) { - return fmt3.Errorf("Parameter this(%v) Not Equal that(%v)", len(this.Parameter), len(that1.Parameter)) - } - for i := range this.Parameter { - if !this.Parameter[i].Equal(that1.Parameter[i]) { - return fmt3.Errorf("Parameter this[%v](%v) Not Equal that[%v](%v)", i, this.Parameter[i], i, that1.Parameter[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } return nil } -func (this *Parameters) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Parameters) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true +func (m *Offer_Operation) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - return false - } else if this == nil { - return false - } - if len(this.Parameter) != len(that1.Parameter) { - return false - } - for i := range this.Parameter { - if !this.Parameter[i].Equal(that1.Parameter[i]) { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var v Offer_Operation_Type + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (Offer_Operation_Type(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Type = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Launch", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Launch == nil { + m.Launch = &Offer_Operation_Launch{} + } + if err := m.Launch.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reserve", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Reserve == nil { + m.Reserve = &Offer_Operation_Reserve{} + } + if err := m.Reserve.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Unreserve", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Unreserve == nil { + m.Unreserve = &Offer_Operation_Unreserve{} + } + if err := m.Unreserve.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Create", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Create == nil { + m.Create = &Offer_Operation_Create{} + } + if err := m.Create.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Destroy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Destroy == nil { + m.Destroy = &Offer_Operation_Destroy{} + } + if err := m.Destroy.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") } - return true + + return nil } -func (this *Credential) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil +func (m *Offer_Operation_Launch) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TaskInfos", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TaskInfos = append(m.TaskInfos, &TaskInfo{}) + if err := m.TaskInfos[len(m.TaskInfos)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt3.Errorf("that == nil && this != nil") } - that1, ok := that.(*Credential) - if !ok { - return fmt3.Errorf("that is not of type *Credential") - } - if that1 == nil { - if this == nil { - return nil + return nil +} +func (m *Offer_Operation_Reserve) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - return fmt3.Errorf("that is type *Credential but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Credentialbut is not nil && this == nil") - } - if this.Principal != nil && that1.Principal != nil { - if *this.Principal != *that1.Principal { - return fmt3.Errorf("Principal this(%v) Not Equal that(%v)", *this.Principal, *that1.Principal) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Resources = append(m.Resources, &Resource{}) + if err := m.Resources[len(m.Resources)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Principal != nil { - return fmt3.Errorf("this.Principal == nil && that.Principal != nil") - } else if that1.Principal != nil { - return fmt3.Errorf("Principal this(%v) Not Equal that(%v)", this.Principal, that1.Principal) - } - if !bytes.Equal(this.Secret, that1.Secret) { - return fmt3.Errorf("Secret this(%v) Not Equal that(%v)", this.Secret, that1.Secret) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } + return nil } -func (this *Credential) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true +func (m *Offer_Operation_Unreserve) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Resources = append(m.Resources, &Resource{}) + if err := m.Resources[len(m.Resources)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false } - that1, ok := that.(*Credential) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true + return nil +} +func (m *Offer_Operation_Create) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - return false - } else if this == nil { - return false - } - if this.Principal != nil && that1.Principal != nil { - if *this.Principal != *that1.Principal { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Volumes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Volumes = append(m.Volumes, &Resource{}) + if err := m.Volumes[len(m.Volumes)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Principal != nil { - return false - } else if that1.Principal != nil { - return false - } - if !bytes.Equal(this.Secret, that1.Secret) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false } - return true + + return nil } -func (this *Credentials) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil +func (m *Offer_Operation_Destroy) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Volumes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Volumes = append(m.Volumes, &Resource{}) + if err := m.Volumes[len(m.Volumes)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt3.Errorf("that == nil && this != nil") } - that1, ok := that.(*Credentials) - if !ok { - return fmt3.Errorf("that is not of type *Credentials") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *Credentials but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Credentialsbut is not nil && this == nil") - } - if len(this.Credentials) != len(that1.Credentials) { - return fmt3.Errorf("Credentials this(%v) Not Equal that(%v)", len(this.Credentials), len(that1.Credentials)) - } - for i := range this.Credentials { - if !this.Credentials[i].Equal(that1.Credentials[i]) { - return fmt3.Errorf("Credentials this[%v](%v) Not Equal that[%v](%v)", i, this.Credentials[i], i, that1.Credentials[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } return nil } -func (this *Credentials) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true +func (m *TaskInfo) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - return false - } - - that1, ok := that.(*Credentials) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Name = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TaskId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TaskId == nil { + m.TaskId = &TaskID{} + } + if err := m.TaskId.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SlaveId == nil { + m.SlaveId = &SlaveID{} + } + if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000004) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Resources = append(m.Resources, &Resource{}) + if err := m.Resources[len(m.Resources)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Executor", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Executor == nil { + m.Executor = &ExecutorInfo{} + } + if err := m.Executor.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append([]byte{}, data[iNdEx:postIndex]...) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Command", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Command == nil { + m.Command = &CommandInfo{} + } + if err := m.Command.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HealthCheck", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.HealthCheck == nil { + m.HealthCheck = &HealthCheck{} + } + if err := m.HealthCheck.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Container == nil { + m.Container = &ContainerInfo{} + } + if err := m.Container.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Labels == nil { + m.Labels = &Labels{} + } + if err := m.Labels.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Discovery", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Discovery == nil { + m.Discovery = &DiscoveryInfo{} + } + if err := m.Discovery.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false - } else if this == nil { - return false - } - if len(this.Credentials) != len(that1.Credentials) { - return false } - for i := range this.Credentials { - if !this.Credentials[i].Equal(that1.Credentials[i]) { - return false - } + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("task_id") } - return true -} -func (this *ACL) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if hasFields[0]&uint64(0x00000004) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") } - that1, ok := that.(*ACL) - if !ok { - return fmt3.Errorf("that is not of type *ACL") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *ACL but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *ACLbut is not nil && this == nil") - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } return nil } -func (this *ACL) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true +func (m *TaskStatus) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - return false - } - - that1, ok := that.(*ACL) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TaskId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TaskId == nil { + m.TaskId = &TaskID{} + } + if err := m.TaskId.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + } + var v TaskState + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (TaskState(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.State = &v + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append([]byte{}, data[iNdEx:postIndex]...) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Message = &s + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SlaveId == nil { + m.SlaveId = &SlaveID{} + } + if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.Timestamp = &v2 + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutorId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ExecutorId == nil { + m.ExecutorId = &ExecutorID{} + } + if err := m.ExecutorId.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Healthy", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Healthy = &b + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) + } + var v TaskStatus_Source + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (TaskStatus_Source(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Source = &v + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) + } + var v TaskStatus_Reason + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (TaskStatus_Reason(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Reason = &v + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Uuid", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Uuid = append([]byte{}, data[iNdEx:postIndex]...) + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false - } else if this == nil { - return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("task_id") } - return true -} -func (this *ACL_Entity) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("state") } - that1, ok := that.(*ACL_Entity) - if !ok { - return fmt3.Errorf("that is not of type *ACL_Entity") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *ACL_Entity but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *ACL_Entitybut is not nil && this == nil") - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt3.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) - } - } else if this.Type != nil { - return fmt3.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt3.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) - } - if len(this.Values) != len(that1.Values) { - return fmt3.Errorf("Values this(%v) Not Equal that(%v)", len(this.Values), len(that1.Values)) - } - for i := range this.Values { - if this.Values[i] != that1.Values[i] { - return fmt3.Errorf("Values this[%v](%v) Not Equal that[%v](%v)", i, this.Values[i], i, that1.Values[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } return nil } -func (this *ACL_Entity) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ACL_Entity) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false - } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false - } - if len(this.Values) != len(that1.Values) { - return false - } - for i := range this.Values { - if this.Values[i] != that1.Values[i] { - return false +func (m *Filters) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ACL_RegisterFramework) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field RefuseSeconds", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.RefuseSeconds = &v2 + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt3.Errorf("that == nil && this != nil") } - that1, ok := that.(*ACL_RegisterFramework) - if !ok { - return fmt3.Errorf("that is not of type *ACL_RegisterFramework") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *ACL_RegisterFramework but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *ACL_RegisterFrameworkbut is not nil && this == nil") - } - if !this.Principals.Equal(that1.Principals) { - return fmt3.Errorf("Principals this(%v) Not Equal that(%v)", this.Principals, that1.Principals) - } - if !this.Roles.Equal(that1.Roles) { - return fmt3.Errorf("Roles this(%v) Not Equal that(%v)", this.Roles, that1.Roles) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } return nil } -func (this *ACL_RegisterFramework) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ACL_RegisterFramework) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.Principals.Equal(that1.Principals) { - return false - } - if !this.Roles.Equal(that1.Roles) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ACL_RunTask) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ACL_RunTask) - if !ok { - return fmt3.Errorf("that is not of type *ACL_RunTask") - } - if that1 == nil { - if this == nil { - return nil +func (m *Environment) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - return fmt3.Errorf("that is type *ACL_RunTask but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *ACL_RunTaskbut is not nil && this == nil") - } - if !this.Principals.Equal(that1.Principals) { - return fmt3.Errorf("Principals this(%v) Not Equal that(%v)", this.Principals, that1.Principals) - } - if !this.Users.Equal(that1.Users) { - return fmt3.Errorf("Users this(%v) Not Equal that(%v)", this.Users, that1.Users) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ACL_RunTask) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Variables", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Variables = append(m.Variables, &Environment_Variable{}) + if err := m.Variables[len(m.Variables)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false } - that1, ok := that.(*ACL_RunTask) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.Principals.Equal(that1.Principals) { - return false - } - if !this.Users.Equal(that1.Users) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true + return nil } -func (this *ACL_ShutdownFramework) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil +func (m *Environment_Variable) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - return fmt3.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ACL_ShutdownFramework) - if !ok { - return fmt3.Errorf("that is not of type *ACL_ShutdownFramework") - } - if that1 == nil { - if this == nil { - return nil + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Name = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Value = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000002) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt3.Errorf("that is type *ACL_ShutdownFramework but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *ACL_ShutdownFrameworkbut is not nil && this == nil") - } - if !this.Principals.Equal(that1.Principals) { - return fmt3.Errorf("Principals this(%v) Not Equal that(%v)", this.Principals, that1.Principals) } - if !this.FrameworkPrincipals.Equal(that1.FrameworkPrincipals) { - return fmt3.Errorf("FrameworkPrincipals this(%v) Not Equal that(%v)", this.FrameworkPrincipals, that1.FrameworkPrincipals) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") } + return nil } -func (this *ACL_ShutdownFramework) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true +func (m *Parameter) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - return false - } - - that1, ok := that.(*ACL_ShutdownFramework) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Key = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Value = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000002) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false - } else if this == nil { - return false } - if !this.Principals.Equal(that1.Principals) { - return false - } - if !this.FrameworkPrincipals.Equal(that1.FrameworkPrincipals) { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("key") } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") } - return true + + return nil } -func (this *ACLs) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil +func (m *Parameters) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameter = append(m.Parameter, &Parameter{}) + if err := m.Parameter[len(m.Parameter)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt3.Errorf("that == nil && this != nil") } - that1, ok := that.(*ACLs) - if !ok { - return fmt3.Errorf("that is not of type *ACLs") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *ACLs but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *ACLsbut is not nil && this == nil") - } - if this.Permissive != nil && that1.Permissive != nil { - if *this.Permissive != *that1.Permissive { - return fmt3.Errorf("Permissive this(%v) Not Equal that(%v)", *this.Permissive, *that1.Permissive) + return nil +} +func (m *Credential) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.Permissive != nil { - return fmt3.Errorf("this.Permissive == nil && that.Permissive != nil") - } else if that1.Permissive != nil { - return fmt3.Errorf("Permissive this(%v) Not Equal that(%v)", this.Permissive, that1.Permissive) - } - if len(this.RegisterFrameworks) != len(that1.RegisterFrameworks) { - return fmt3.Errorf("RegisterFrameworks this(%v) Not Equal that(%v)", len(this.RegisterFrameworks), len(that1.RegisterFrameworks)) - } - for i := range this.RegisterFrameworks { - if !this.RegisterFrameworks[i].Equal(that1.RegisterFrameworks[i]) { - return fmt3.Errorf("RegisterFrameworks this[%v](%v) Not Equal that[%v](%v)", i, this.RegisterFrameworks[i], i, that1.RegisterFrameworks[i]) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Principal", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Principal = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Secret", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Secret = append([]byte{}, data[iNdEx:postIndex]...) + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } } - if len(this.RunTasks) != len(that1.RunTasks) { - return fmt3.Errorf("RunTasks this(%v) Not Equal that(%v)", len(this.RunTasks), len(that1.RunTasks)) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("principal") } - for i := range this.RunTasks { - if !this.RunTasks[i].Equal(that1.RunTasks[i]) { - return fmt3.Errorf("RunTasks this[%v](%v) Not Equal that[%v](%v)", i, this.RunTasks[i], i, that1.RunTasks[i]) + + return nil +} +func (m *Credentials) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } - if len(this.ShutdownFrameworks) != len(that1.ShutdownFrameworks) { - return fmt3.Errorf("ShutdownFrameworks this(%v) Not Equal that(%v)", len(this.ShutdownFrameworks), len(that1.ShutdownFrameworks)) - } - for i := range this.ShutdownFrameworks { - if !this.ShutdownFrameworks[i].Equal(that1.ShutdownFrameworks[i]) { - return fmt3.Errorf("ShutdownFrameworks this[%v](%v) Not Equal that[%v](%v)", i, this.ShutdownFrameworks[i], i, that1.ShutdownFrameworks[i]) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Credentials", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Credentials = append(m.Credentials, &Credential{}) + if err := m.Credentials[len(m.Credentials)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } + return nil } -func (this *ACLs) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true +func (m *ACL) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + switch fieldNum { + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false } - that1, ok := that.(*ACLs) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true + return nil +} +func (m *ACL_Entity) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - return false - } else if this == nil { - return false - } - if this.Permissive != nil && that1.Permissive != nil { - if *this.Permissive != *that1.Permissive { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var v ACL_Entity_Type + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (ACL_Entity_Type(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Type = &v + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Values = append(m.Values, string(data[iNdEx:postIndex])) + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Permissive != nil { - return false - } else if that1.Permissive != nil { - return false } - if len(this.RegisterFrameworks) != len(that1.RegisterFrameworks) { - return false - } - for i := range this.RegisterFrameworks { - if !this.RegisterFrameworks[i].Equal(that1.RegisterFrameworks[i]) { - return false + + return nil +} +func (m *ACL_RegisterFramework) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } - if len(this.RunTasks) != len(that1.RunTasks) { - return false - } - for i := range this.RunTasks { - if !this.RunTasks[i].Equal(that1.RunTasks[i]) { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Principals", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Principals == nil { + m.Principals = &ACL_Entity{} + } + if err := m.Principals.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Roles == nil { + m.Roles = &ACL_Entity{} + } + if err := m.Roles.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000002) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } } - if len(this.ShutdownFrameworks) != len(that1.ShutdownFrameworks) { - return false - } - for i := range this.ShutdownFrameworks { - if !this.ShutdownFrameworks[i].Equal(that1.ShutdownFrameworks[i]) { - return false - } + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("principals") } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("roles") } - return true + + return nil } -func (this *RateLimit) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil +func (m *ACL_RunTask) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Principals", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Principals == nil { + m.Principals = &ACL_Entity{} + } + if err := m.Principals.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Users", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Users == nil { + m.Users = &ACL_Entity{} + } + if err := m.Users.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000002) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt3.Errorf("that == nil && this != nil") } - - that1, ok := that.(*RateLimit) - if !ok { - return fmt3.Errorf("that is not of type *RateLimit") + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("principals") } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *RateLimit but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *RateLimitbut is not nil && this == nil") + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("users") } - if this.Qps != nil && that1.Qps != nil { - if *this.Qps != *that1.Qps { - return fmt3.Errorf("Qps this(%v) Not Equal that(%v)", *this.Qps, *that1.Qps) + + return nil +} +func (m *ACL_ShutdownFramework) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.Qps != nil { - return fmt3.Errorf("this.Qps == nil && that.Qps != nil") - } else if that1.Qps != nil { - return fmt3.Errorf("Qps this(%v) Not Equal that(%v)", this.Qps, that1.Qps) - } - if this.Principal != nil && that1.Principal != nil { - if *this.Principal != *that1.Principal { - return fmt3.Errorf("Principal this(%v) Not Equal that(%v)", *this.Principal, *that1.Principal) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Principals", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Principals == nil { + m.Principals = &ACL_Entity{} + } + if err := m.Principals.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FrameworkPrincipals", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.FrameworkPrincipals == nil { + m.FrameworkPrincipals = &ACL_Entity{} + } + if err := m.FrameworkPrincipals.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000002) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Principal != nil { - return fmt3.Errorf("this.Principal == nil && that.Principal != nil") - } else if that1.Principal != nil { - return fmt3.Errorf("Principal this(%v) Not Equal that(%v)", this.Principal, that1.Principal) } - if this.Capacity != nil && that1.Capacity != nil { - if *this.Capacity != *that1.Capacity { - return fmt3.Errorf("Capacity this(%v) Not Equal that(%v)", *this.Capacity, *that1.Capacity) - } - } else if this.Capacity != nil { - return fmt3.Errorf("this.Capacity == nil && that.Capacity != nil") - } else if that1.Capacity != nil { - return fmt3.Errorf("Capacity this(%v) Not Equal that(%v)", this.Capacity, that1.Capacity) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("principals") } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_principals") } + return nil } -func (this *RateLimit) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*RateLimit) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Qps != nil && that1.Qps != nil { - if *this.Qps != *that1.Qps { - return false - } - } else if this.Qps != nil { - return false - } else if that1.Qps != nil { - return false - } - if this.Principal != nil && that1.Principal != nil { - if *this.Principal != *that1.Principal { - return false +func (m *ACLs) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.Principal != nil { - return false - } else if that1.Principal != nil { - return false - } - if this.Capacity != nil && that1.Capacity != nil { - if *this.Capacity != *that1.Capacity { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Permissive", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Permissive = &b + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegisterFrameworks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RegisterFrameworks = append(m.RegisterFrameworks, &ACL_RegisterFramework{}) + if err := m.RegisterFrameworks[len(m.RegisterFrameworks)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RunTasks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RunTasks = append(m.RunTasks, &ACL_RunTask{}) + if err := m.RunTasks[len(m.RunTasks)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ShutdownFrameworks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ShutdownFrameworks = append(m.ShutdownFrameworks, &ACL_ShutdownFramework{}) + if err := m.ShutdownFrameworks[len(m.ShutdownFrameworks)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Capacity != nil { - return false - } else if that1.Capacity != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false } - return true + + return nil } -func (this *RateLimits) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil +func (m *RateLimit) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - return fmt3.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*RateLimits) - if !ok { - return fmt3.Errorf("that is not of type *RateLimits") - } - if that1 == nil { - if this == nil { - return nil + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Qps", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.Qps = &v2 + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Principal", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Principal = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Capacity", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Capacity = &v + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt3.Errorf("that is type *RateLimits but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *RateLimitsbut is not nil && this == nil") - } - if len(this.Limits) != len(that1.Limits) { - return fmt3.Errorf("Limits this(%v) Not Equal that(%v)", len(this.Limits), len(that1.Limits)) } - for i := range this.Limits { - if !this.Limits[i].Equal(that1.Limits[i]) { - return fmt3.Errorf("Limits this[%v](%v) Not Equal that[%v](%v)", i, this.Limits[i], i, that1.Limits[i]) - } + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("principal") } - if this.AggregateDefaultQps != nil && that1.AggregateDefaultQps != nil { - if *this.AggregateDefaultQps != *that1.AggregateDefaultQps { - return fmt3.Errorf("AggregateDefaultQps this(%v) Not Equal that(%v)", *this.AggregateDefaultQps, *that1.AggregateDefaultQps) + + return nil +} +func (m *RateLimits) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.AggregateDefaultQps != nil { - return fmt3.Errorf("this.AggregateDefaultQps == nil && that.AggregateDefaultQps != nil") - } else if that1.AggregateDefaultQps != nil { - return fmt3.Errorf("AggregateDefaultQps this(%v) Not Equal that(%v)", this.AggregateDefaultQps, that1.AggregateDefaultQps) - } - if this.AggregateDefaultCapacity != nil && that1.AggregateDefaultCapacity != nil { - if *this.AggregateDefaultCapacity != *that1.AggregateDefaultCapacity { - return fmt3.Errorf("AggregateDefaultCapacity this(%v) Not Equal that(%v)", *this.AggregateDefaultCapacity, *that1.AggregateDefaultCapacity) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Limits", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Limits = append(m.Limits, &RateLimit{}) + if err := m.Limits[len(m.Limits)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field AggregateDefaultQps", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.AggregateDefaultQps = &v2 + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AggregateDefaultCapacity", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.AggregateDefaultCapacity = &v + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.AggregateDefaultCapacity != nil { - return fmt3.Errorf("this.AggregateDefaultCapacity == nil && that.AggregateDefaultCapacity != nil") - } else if that1.AggregateDefaultCapacity != nil { - return fmt3.Errorf("AggregateDefaultCapacity this(%v) Not Equal that(%v)", this.AggregateDefaultCapacity, that1.AggregateDefaultCapacity) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } + return nil } -func (this *RateLimits) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true +func (m *Volume) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - return false - } - - that1, ok := that.(*RateLimits) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerPath", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.ContainerPath = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HostPath", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.HostPath = &s + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Mode", wireType) + } + var v Volume_Mode + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (Volume_Mode(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Mode = &v + hasFields[0] |= uint64(0x00000002) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false - } else if this == nil { - return false } - if len(this.Limits) != len(that1.Limits) { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("container_path") } - for i := range this.Limits { - if !this.Limits[i].Equal(that1.Limits[i]) { - return false - } + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("mode") } - if this.AggregateDefaultQps != nil && that1.AggregateDefaultQps != nil { - if *this.AggregateDefaultQps != *that1.AggregateDefaultQps { - return false + + return nil +} +func (m *ContainerInfo) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.AggregateDefaultQps != nil { - return false - } else if that1.AggregateDefaultQps != nil { - return false - } - if this.AggregateDefaultCapacity != nil && that1.AggregateDefaultCapacity != nil { - if *this.AggregateDefaultCapacity != *that1.AggregateDefaultCapacity { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var v ContainerInfo_Type + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (ContainerInfo_Type(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Type = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Volumes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Volumes = append(m.Volumes, &Volume{}) + if err := m.Volumes[len(m.Volumes)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Docker", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Docker == nil { + m.Docker = &ContainerInfo_DockerInfo{} + } + if err := m.Docker.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Hostname = &s + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.AggregateDefaultCapacity != nil { - return false - } else if that1.AggregateDefaultCapacity != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false } - return true -} -func (this *Volume) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") } - that1, ok := that.(*Volume) - if !ok { - return fmt3.Errorf("that is not of type *Volume") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *Volume but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Volumebut is not nil && this == nil") - } - if this.ContainerPath != nil && that1.ContainerPath != nil { - if *this.ContainerPath != *that1.ContainerPath { - return fmt3.Errorf("ContainerPath this(%v) Not Equal that(%v)", *this.ContainerPath, *that1.ContainerPath) - } - } else if this.ContainerPath != nil { - return fmt3.Errorf("this.ContainerPath == nil && that.ContainerPath != nil") - } else if that1.ContainerPath != nil { - return fmt3.Errorf("ContainerPath this(%v) Not Equal that(%v)", this.ContainerPath, that1.ContainerPath) - } - if this.HostPath != nil && that1.HostPath != nil { - if *this.HostPath != *that1.HostPath { - return fmt3.Errorf("HostPath this(%v) Not Equal that(%v)", *this.HostPath, *that1.HostPath) - } - } else if this.HostPath != nil { - return fmt3.Errorf("this.HostPath == nil && that.HostPath != nil") - } else if that1.HostPath != nil { - return fmt3.Errorf("HostPath this(%v) Not Equal that(%v)", this.HostPath, that1.HostPath) - } - if this.Mode != nil && that1.Mode != nil { - if *this.Mode != *that1.Mode { - return fmt3.Errorf("Mode this(%v) Not Equal that(%v)", *this.Mode, *that1.Mode) - } - } else if this.Mode != nil { - return fmt3.Errorf("this.Mode == nil && that.Mode != nil") - } else if that1.Mode != nil { - return fmt3.Errorf("Mode this(%v) Not Equal that(%v)", this.Mode, that1.Mode) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } return nil } -func (this *Volume) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Volume) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.ContainerPath != nil && that1.ContainerPath != nil { - if *this.ContainerPath != *that1.ContainerPath { - return false - } - } else if this.ContainerPath != nil { - return false - } else if that1.ContainerPath != nil { - return false - } - if this.HostPath != nil && that1.HostPath != nil { - if *this.HostPath != *that1.HostPath { - return false +func (m *ContainerInfo_DockerInfo) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.HostPath != nil { - return false - } else if that1.HostPath != nil { - return false - } - if this.Mode != nil && that1.Mode != nil { - if *this.Mode != *that1.Mode { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Image = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType) + } + var v ContainerInfo_DockerInfo_Network + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (ContainerInfo_DockerInfo_Network(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Network = &v + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortMappings", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PortMappings = append(m.PortMappings, &ContainerInfo_DockerInfo_PortMapping{}) + if err := m.PortMappings[len(m.PortMappings)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Privileged", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Privileged = &b + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, &Parameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ForcePullImage", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.ForcePullImage = &b + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Mode != nil { - return false - } else if that1.Mode != nil { - return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ContainerInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("image") } - that1, ok := that.(*ContainerInfo) - if !ok { - return fmt3.Errorf("that is not of type *ContainerInfo") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *ContainerInfo but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *ContainerInfobut is not nil && this == nil") - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt3.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) - } - } else if this.Type != nil { - return fmt3.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt3.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) - } - if len(this.Volumes) != len(that1.Volumes) { - return fmt3.Errorf("Volumes this(%v) Not Equal that(%v)", len(this.Volumes), len(that1.Volumes)) - } - for i := range this.Volumes { - if !this.Volumes[i].Equal(that1.Volumes[i]) { - return fmt3.Errorf("Volumes this[%v](%v) Not Equal that[%v](%v)", i, this.Volumes[i], i, that1.Volumes[i]) - } - } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return fmt3.Errorf("Hostname this(%v) Not Equal that(%v)", *this.Hostname, *that1.Hostname) - } - } else if this.Hostname != nil { - return fmt3.Errorf("this.Hostname == nil && that.Hostname != nil") - } else if that1.Hostname != nil { - return fmt3.Errorf("Hostname this(%v) Not Equal that(%v)", this.Hostname, that1.Hostname) - } - if !this.Docker.Equal(that1.Docker) { - return fmt3.Errorf("Docker this(%v) Not Equal that(%v)", this.Docker, that1.Docker) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } return nil } -func (this *ContainerInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ContainerInfo) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false - } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false - } - if len(this.Volumes) != len(that1.Volumes) { - return false - } - for i := range this.Volumes { - if !this.Volumes[i].Equal(that1.Volumes[i]) { - return false +func (m *ContainerInfo_DockerInfo_PortMapping) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HostPort", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.HostPort = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerPort", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.ContainerPort = &v + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Protocol = &s + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Hostname != nil { - return false - } else if that1.Hostname != nil { - return false - } - if !this.Docker.Equal(that1.Docker) { - return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("host_port") } - return true -} -func (this *ContainerInfo_DockerInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("container_port") } - that1, ok := that.(*ContainerInfo_DockerInfo) - if !ok { - return fmt3.Errorf("that is not of type *ContainerInfo_DockerInfo") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *ContainerInfo_DockerInfo but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *ContainerInfo_DockerInfobut is not nil && this == nil") - } - if this.Image != nil && that1.Image != nil { - if *this.Image != *that1.Image { - return fmt3.Errorf("Image this(%v) Not Equal that(%v)", *this.Image, *that1.Image) - } - } else if this.Image != nil { - return fmt3.Errorf("this.Image == nil && that.Image != nil") - } else if that1.Image != nil { - return fmt3.Errorf("Image this(%v) Not Equal that(%v)", this.Image, that1.Image) - } - if this.Network != nil && that1.Network != nil { - if *this.Network != *that1.Network { - return fmt3.Errorf("Network this(%v) Not Equal that(%v)", *this.Network, *that1.Network) - } - } else if this.Network != nil { - return fmt3.Errorf("this.Network == nil && that.Network != nil") - } else if that1.Network != nil { - return fmt3.Errorf("Network this(%v) Not Equal that(%v)", this.Network, that1.Network) - } - if len(this.PortMappings) != len(that1.PortMappings) { - return fmt3.Errorf("PortMappings this(%v) Not Equal that(%v)", len(this.PortMappings), len(that1.PortMappings)) - } - for i := range this.PortMappings { - if !this.PortMappings[i].Equal(that1.PortMappings[i]) { - return fmt3.Errorf("PortMappings this[%v](%v) Not Equal that[%v](%v)", i, this.PortMappings[i], i, that1.PortMappings[i]) - } - } - if this.Privileged != nil && that1.Privileged != nil { - if *this.Privileged != *that1.Privileged { - return fmt3.Errorf("Privileged this(%v) Not Equal that(%v)", *this.Privileged, *that1.Privileged) + return nil +} +func (m *Labels) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.Privileged != nil { - return fmt3.Errorf("this.Privileged == nil && that.Privileged != nil") - } else if that1.Privileged != nil { - return fmt3.Errorf("Privileged this(%v) Not Equal that(%v)", this.Privileged, that1.Privileged) - } - if len(this.Parameters) != len(that1.Parameters) { - return fmt3.Errorf("Parameters this(%v) Not Equal that(%v)", len(this.Parameters), len(that1.Parameters)) - } - for i := range this.Parameters { - if !this.Parameters[i].Equal(that1.Parameters[i]) { - return fmt3.Errorf("Parameters this[%v](%v) Not Equal that[%v](%v)", i, this.Parameters[i], i, that1.Parameters[i]) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Labels = append(m.Labels, &Label{}) + if err := m.Labels[len(m.Labels)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } + return nil } -func (this *ContainerInfo_DockerInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ContainerInfo_DockerInfo) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Image != nil && that1.Image != nil { - if *this.Image != *that1.Image { - return false +func (m *Label) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.Image != nil { - return false - } else if that1.Image != nil { - return false - } - if this.Network != nil && that1.Network != nil { - if *this.Network != *that1.Network { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Key = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Value = &s + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Network != nil { - return false - } else if that1.Network != nil { - return false - } - if len(this.PortMappings) != len(that1.PortMappings) { - return false } - for i := range this.PortMappings { - if !this.PortMappings[i].Equal(that1.PortMappings[i]) { - return false - } + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("key") } - if this.Privileged != nil && that1.Privileged != nil { - if *this.Privileged != *that1.Privileged { - return false + + return nil +} +func (m *Port) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.Privileged != nil { - return false - } else if that1.Privileged != nil { - return false - } - if len(this.Parameters) != len(that1.Parameters) { - return false - } - for i := range this.Parameters { - if !this.Parameters[i].Equal(that1.Parameters[i]) { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Number", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Number = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Name = &s + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Protocol = &s + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("number") } - return true + + return nil } -func (this *ContainerInfo_DockerInfo_PortMapping) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil +func (m *Ports) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ports", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ports = append(m.Ports, &Port{}) + if err := m.Ports[len(m.Ports)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt3.Errorf("that == nil && this != nil") } - that1, ok := that.(*ContainerInfo_DockerInfo_PortMapping) - if !ok { - return fmt3.Errorf("that is not of type *ContainerInfo_DockerInfo_PortMapping") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *ContainerInfo_DockerInfo_PortMapping but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *ContainerInfo_DockerInfo_PortMappingbut is not nil && this == nil") - } - if this.HostPort != nil && that1.HostPort != nil { - if *this.HostPort != *that1.HostPort { - return fmt3.Errorf("HostPort this(%v) Not Equal that(%v)", *this.HostPort, *that1.HostPort) - } - } else if this.HostPort != nil { - return fmt3.Errorf("this.HostPort == nil && that.HostPort != nil") - } else if that1.HostPort != nil { - return fmt3.Errorf("HostPort this(%v) Not Equal that(%v)", this.HostPort, that1.HostPort) - } - if this.ContainerPort != nil && that1.ContainerPort != nil { - if *this.ContainerPort != *that1.ContainerPort { - return fmt3.Errorf("ContainerPort this(%v) Not Equal that(%v)", *this.ContainerPort, *that1.ContainerPort) - } - } else if this.ContainerPort != nil { - return fmt3.Errorf("this.ContainerPort == nil && that.ContainerPort != nil") - } else if that1.ContainerPort != nil { - return fmt3.Errorf("ContainerPort this(%v) Not Equal that(%v)", this.ContainerPort, that1.ContainerPort) - } - if this.Protocol != nil && that1.Protocol != nil { - if *this.Protocol != *that1.Protocol { - return fmt3.Errorf("Protocol this(%v) Not Equal that(%v)", *this.Protocol, *that1.Protocol) - } - } else if this.Protocol != nil { - return fmt3.Errorf("this.Protocol == nil && that.Protocol != nil") - } else if that1.Protocol != nil { - return fmt3.Errorf("Protocol this(%v) Not Equal that(%v)", this.Protocol, that1.Protocol) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } return nil } -func (this *ContainerInfo_DockerInfo_PortMapping) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true +func (m *DiscoveryInfo) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - return false - } - - that1, ok := that.(*ContainerInfo_DockerInfo_PortMapping) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Visibility", wireType) + } + var v DiscoveryInfo_Visibility + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (DiscoveryInfo_Visibility(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Visibility = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Name = &s + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Environment", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Environment = &s + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Location", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Location = &s + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Version = &s + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ports", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Ports == nil { + m.Ports = &Ports{} + } + if err := m.Ports.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Labels == nil { + m.Labels = &Labels{} + } + if err := m.Labels.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false - } else if this == nil { - return false } - if this.HostPort != nil && that1.HostPort != nil { - if *this.HostPort != *that1.HostPort { - return false - } - } else if this.HostPort != nil { - return false - } else if that1.HostPort != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("visibility") } - if this.ContainerPort != nil && that1.ContainerPort != nil { - if *this.ContainerPort != *that1.ContainerPort { - return false + + return nil +} +func skipMesos(data []byte) (n int, err error) { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.ContainerPort != nil { - return false - } else if that1.ContainerPort != nil { - return false - } - if this.Protocol != nil && that1.Protocol != nil { - if *this.Protocol != *that1.Protocol { - return false + wireType := int(wire & 0x7) + switch wireType { + case 0: + for { + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if data[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + iNdEx += length + if length < 0 { + return 0, ErrInvalidLengthMesos + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipMesos(data[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } - } else if this.Protocol != nil { - return false - } else if that1.Protocol != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false } - return true + panic("unreachable") } + +var ( + ErrInvalidLengthMesos = fmt.Errorf("proto: negative length found during unmarshaling") +) diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/mesos.proto b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/mesos.proto index 545879ede8794..2d00b43fdec2c 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/mesos.proto +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/mesos.proto @@ -105,52 +105,83 @@ message ContainerID { /** - * Describes a framework. The user field is used to determine the - * Unix user that an executor/task should be launched as. If the user - * field is set to an empty string Mesos will automagically set it - * to the current user. Note that the ID is only available after a - * framework has registered, however, it is included here in order to - * facilitate scheduler failover (i.e., if it is set then the - * MesosSchedulerDriver expects the scheduler is performing failover). - * The amount of time that the master will wait for the scheduler to - * failover before removing the framework is specified by - * failover_timeout. If checkpoint is set, framework pid, executor - * pids and status updates are checkpointed to disk by the slaves. - * Checkpointing allows a restarted slave to reconnect with old - * executors and recover status updates, at the cost of disk I/O. - * The role field is used to group frameworks for allocation - * decisions, depending on the allocation policy being used. - * If the hostname field is set to an empty string Mesos will - * automagically set it to the current hostname. - * The principal field should match the credential the framework uses - * in authentication. This field is used for framework API rate - * exporting and limiting and should be set even if authentication is - * not enabled if these features are desired. - * The webui_url field allows a framework to advertise its web UI, so - * that the Mesos web UI can link to it. It is expected to be a full - * URL, for example http://my-scheduler.example.com:8080/. + * Describes a framework. */ message FrameworkInfo { + // Used to determine the Unix user that an executor or task should + // be launched as. If the user field is set to an empty string Mesos + // will automagically set it to the current user. required string user = 1; + + // Name of the framework that shows up in the Mesos Web UI. required string name = 2; + + // Note that 'id' is only available after a framework has + // registered, however, it is included here in order to facilitate + // scheduler failover (i.e., if it is set then the + // MesosSchedulerDriver expects the scheduler is performing + // failover). optional FrameworkID id = 3; + + // The amount of time that the master will wait for the scheduler to + // failover before it tears down the framework by killing all its + // tasks/executors. This should be non-zero if a framework expects + // to reconnect after a failover and not lose its tasks/executors. optional double failover_timeout = 4 [default = 0.0]; + + // If set, framework pid, executor pids and status updates are + // checkpointed to disk by the slaves. Checkpointing allows a + // restarted slave to reconnect with old executors and recover + // status updates, at the cost of disk I/O. optional bool checkpoint = 5 [default = false]; + + // Used to group frameworks for allocation decisions, depending on + // the allocation policy being used. optional string role = 6 [default = "*"]; + + // Used to indicate the current host from which the scheduler is + // registered in the Mesos Web UI. If set to an empty string Mesos + // will automagically set it to the current hostname. optional string hostname = 7; + + // This field should match the credential's principal the framework + // uses for authentication. This field is used for framework API + // rate limiting and dynamic reservations. It should be set even + // if authentication is not enabled if these features are desired. optional string principal = 8; + + // This field allows a framework to advertise its web UI, so that + // the Mesos web UI can link to it. It is expected to be a full URL, + // for example http://my-scheduler.example.com:8080/. optional string webui_url = 9; + + message Capability { + enum Type { + // Receive offers with revocable resources. See 'Resource' + // message for details. + // TODO(vinod): This is currently a no-op. + REVOCABLE_RESOURCES = 1; + } + + required Type type = 1; + } + + // This field allows a framework to advertise its set of + // capabilities (e.g., ability to receive offers for revocable + // resources). + repeated Capability capabilities = 10; } /** * Describes a health check for a task or executor (or any arbitrary * process/command). A "strategy" is picked by specifying one of the - * optional fields, currently only 'http' and 'command' are - * supported. Specifying more than one strategy is an error. + * optional fields; currently only 'command' is supported. + * Specifying more than one strategy is an error. */ message HealthCheck { - // Describes an HTTP health check. + // Describes an HTTP health check. This is not fully implemented and not + // recommended for use - see MESOS-2533. message HTTP { // Port to send the HTTP request. required uint32 port = 1; @@ -170,6 +201,7 @@ message HealthCheck { // for specific data in the response. } + // HTTP health check - not yet recommended for use, see MESOS-2533. optional HTTP http = 1; // TODO(benh): Consider adding a URL health check strategy which @@ -177,12 +209,7 @@ message HealthCheck { // encapsulates all the details in a single string field. // TODO(benh): Other possible health check strategies could include - // one for TCP/UDP or a "command". A "command" could be running a - // (shell) command to check the healthiness. We'd need to determine - // what arguments (or environment variables) we'd want to set so - // that the command could do it's job (i.e., do we want to expose - // the stdout/stderr and/or the pid to make checking for healthiness - // easier). + // one for TCP/UDP. // Amount of time to wait until starting the health checks. optional double delay_seconds = 2 [default = 15.0]; @@ -218,7 +245,24 @@ message CommandInfo { message URI { required string value = 1; optional bool executable = 2; + + // In case the fetched file is recognized as an archive, extract + // its contents into the sandbox. Note that a cached archive is + // not copied from the cache to the sandbox in case extraction + // originates from an archive in the cache. optional bool extract = 3 [default = true]; + + // If this field is "true", the fetcher cache will be used. If not, + // fetching bypasses the cache and downloads directly into the + // sandbox directory, no matter whether a suitable cache file is + // available or not. The former directs the fetcher to download to + // the file cache, then copy from there to the sandbox. Subsequent + // fetch attempts with the same URI will omit downloading and copy + // from the cache as long as the file is resident there. Cache files + // may get evicted at any time, which then leads to renewed + // downloading. See also "docs/fetcher.md" and + // "docs/fetcher-cache-internals.md". + optional bool cache = 4; } // Describes a container. @@ -293,6 +337,12 @@ message ExecutorInfo { // usage information into a time series database for monitoring. optional string source = 10; optional bytes data = 4; + + // Service discovery information for the executor. It is not + // interpreted or acted upon by Mesos. It is up to a service + // discovery system to use this information as needed and to handle + // executors without service discovery information. + optional DiscoveryInfo discovery = 12; } @@ -307,6 +357,7 @@ message MasterInfo { required uint32 port = 3 [default = 5050]; optional string pid = 4; optional string hostname = 5; + optional string version = 6; } @@ -323,6 +374,8 @@ message SlaveInfo { repeated Resource resources = 3; repeated Attribute attributes = 5; optional SlaveID id = 6; + // TODO(joerg84): Remove checkpoint field as with 0.22.0 + // slave checkpointing is enabled for all slaves (MESOS-2317). optional bool checkpoint = 7 [default = false]; } @@ -399,15 +452,122 @@ message Resource { optional Value.Ranges ranges = 4; optional Value.Set set = 5; optional string role = 6 [default = "*"]; + + message ReservationInfo { + // Describes a dynamic reservation. A dynamic reservation is + // acquired by an operator via the '/reserve' HTTP endpoint or by + // a framework via the offer cycle by sending back an + // 'Offer::Operation::Reserve' message. + // NOTE: We currently do not allow frameworks with role "*" to + // make dynamic reservations. + + // This field indicates the principal of the operator or framework + // that reserved this resource. It is used in conjunction with the + // "unreserve" ACL to determine whether the entity attempting to + // unreserve this resource is permitted to do so. + // NOTE: This field should match the FrameworkInfo.principal of + // the framework that reserved this resource. + required string principal = 1; + } + + // If this is set, this resource was dynamically reserved by an + // operator or a framework. Otherwise, this resource is either unreserved + // or statically reserved by an operator via the --resources flag. + optional ReservationInfo reservation = 8; + + message DiskInfo { + // Describes a persistent disk volume. + // A persistent disk volume will not be automatically garbage + // collected if the task/executor/slave terminates, but is + // re-offered to the framework(s) belonging to the 'role'. + // A framework can set the ID (if it is not set yet) to express + // the intention to create a new persistent disk volume from a + // regular disk resource. To reuse a previously created volume, a + // framework can launch a task/executor when it receives an offer + // with a persistent volume, i.e., ID is set. + // NOTE: Currently, we do not allow a persistent disk volume + // without a reservation (i.e., 'role' should not be '*'). + message Persistence { + // A unique ID for the persistent disk volume. + // NOTE: The ID needs to be unique per role on each slave. + required string id = 1; + } + + optional Persistence persistence = 1; + + // Describes how this disk resource will be mounted in the + // container. If not set, the disk resource will be used as the + // sandbox. Otherwise, it will be mounted according to the + // 'container_path' inside 'volume'. The 'host_path' inside + // 'volume' is ignored. + // NOTE: If 'volume' is set but 'persistence' is not set, the + // volume will be automatically garbage collected after + // task/executor terminates. Currently, if 'persistence' is set, + // 'volume' must be set. + optional Volume volume = 2; + } + + optional DiskInfo disk = 7; + + message RevocableInfo {} + + // If this is set, the resources are revocable, i.e., any tasks or + // executors launched using these resources could get preempted or + // throttled at any time. This could be used by frameworks to run + // best effort tasks that do not need strict uptime or performance + // guarantees. Note that if this is set, 'disk' or 'reservation' + // cannot be set. + optional RevocableInfo revocable = 9; +} + +/** + * When the network bandwidth caps are enabled and the container + * is over its limit, outbound packets may be either delayed or + * dropped completely either because it exceeds the maximum bandwidth + * allocation for a single container (the cap) or because the combined + * network traffic of multiple containers on the host exceeds the + * transmit capacity of the host (the share). We can report the + * following statistics for each of these conditions exported directly + * from the Linux Traffic Control Queueing Discipline. + * + * id : name of the limiter, e.g. 'tx_bw_cap' + * backlog : number of packets currently delayed + * bytes : total bytes seen + * drops : number of packets dropped in total + * overlimits : number of packets which exceeded allocation + * packets : total packets seen + * qlen : number of packets currently queued + * rate_bps : throughput in bytes/sec + * rate_pps : throughput in packets/sec + * requeues : number of times a packet has been delayed due to + * locking or device contention issues + * + * More information on the operation of Linux Traffic Control can be + * found at http://www.lartc.org/lartc.html. + */ +message TrafficControlStatistics { + required string id = 1; + optional uint64 backlog = 2; + optional uint64 bytes = 3; + optional uint64 drops = 4; + optional uint64 overlimits = 5; + optional uint64 packets = 6; + optional uint64 qlen = 7; + optional uint64 ratebps = 8; + optional uint64 ratepps = 9; + optional uint64 requeues = 10; } -/* +/** * A snapshot of resource usage statistics. */ message ResourceStatistics { required double timestamp = 1; // Snapshot time, in seconds since the Epoch. + optional uint32 processes = 30; + optional uint32 threads = 31; + // CPU Usage Information: // Total CPU time spent in user mode, and kernel mode. optional double cpus_user_time_secs = 2; @@ -422,17 +582,55 @@ message ResourceStatistics { optional double cpus_throttled_time_secs = 9; // Memory Usage Information: - optional uint64 mem_rss_bytes = 5; // Resident Set Size. - // Amount of memory resources allocated. + // mem_total_bytes was added in 0.23.0 to represent the total memory + // of a process in RAM (as opposed to in Swap). This was previously + // reported as mem_rss_bytes, which was also changed in 0.23.0 to + // represent only the anonymous memory usage, to keep in sync with + // Linux kernel's (arguably erroneous) use of terminology. + optional uint64 mem_total_bytes = 36; + + // Total memory + swap usage. This is set if swap is enabled. + optional uint64 mem_total_memsw_bytes = 37; + + // Hard memory limit for a container. optional uint64 mem_limit_bytes = 6; - // Broken out memory usage information (files, anonymous, and mmaped files) + // Soft memory limit for a container. + optional uint64 mem_soft_limit_bytes = 38; + + // Broken out memory usage information: pagecache, rss (anonymous), + // mmaped files and swap. + + // TODO(chzhcn) mem_file_bytes and mem_anon_bytes are deprecated in + // 0.23.0 and will be removed in 0.24.0. optional uint64 mem_file_bytes = 10; optional uint64 mem_anon_bytes = 11; - optional uint64 mem_mapped_file_bytes = 12; - // TODO(bmahler): Add disk usage. + // mem_cache_bytes is added in 0.23.0 to represent page cache usage. + optional uint64 mem_cache_bytes = 39; + + // Since 0.23.0, mem_rss_bytes is changed to represent only + // anonymous memory usage. Note that neither its requiredness, type, + // name nor numeric tag has been changed. + optional uint64 mem_rss_bytes = 5; + + optional uint64 mem_mapped_file_bytes = 12; + // This is only set if swap is enabled. + optional uint64 mem_swap_bytes = 40; + + // Number of occurrences of different levels of memory pressure + // events reported by memory cgroup. Pressure listening (re)starts + // with these values set to 0 when slave (re)starts. See + // https://www.kernel.org/doc/Documentation/cgroups/memory.txt for + // more details. + optional uint64 mem_low_pressure_counter = 32; + optional uint64 mem_medium_pressure_counter = 33; + optional uint64 mem_critical_pressure_counter = 34; + + // Disk Usage Information for executor working directory. + optional uint64 disk_limit_bytes = 26; + optional uint64 disk_used_bytes = 27; // Perf statistics. optional PerfStatistics perf = 13; @@ -453,34 +651,36 @@ message ResourceStatistics { optional double net_tcp_rtt_microsecs_p90 = 23; optional double net_tcp_rtt_microsecs_p95 = 24; optional double net_tcp_rtt_microsecs_p99 = 25; + + optional double net_tcp_active_connections = 28; + optional double net_tcp_time_wait_connections = 29; + + // Network traffic flowing into or out of a container can be delayed + // or dropped due to congestion or policy inside and outside the + // container. + repeated TrafficControlStatistics net_traffic_control_statistics = 35; } /** - * Describes a snapshot of the resource usage for an executor. - * - * TODO(bmahler): Note that we want to be sending this information - * to the master, and subsequently to the relevant scheduler. So - * this proto is designed to be easy for the scheduler to use, this - * is why we provide the slave id, executor info / task info. + * Describes a snapshot of the resource usage for executors. */ message ResourceUsage { - required SlaveID slave_id = 1; - required FrameworkID framework_id = 2; + message Executor { + required ExecutorInfo executor_info = 1; - // Resource usage is for an executor. For tasks launched with - // an explicit executor, the executor id is provided. For tasks - // launched without an executor, our internal executor will be - // used. In this case, we provide the task id here instead, in - // order to make this message easier for schedulers to work with. + // This includes resources used by the executor itself + // as well as its active tasks. + repeated Resource allocated = 2; - optional ExecutorID executor_id = 3; // If present, this executor was - optional string executor_name = 4; // explicitly specified. + // Current resource usage. If absent, the containerizer + // cannot provide resource usage. + optional ResourceStatistics statistics = 3; + } - optional TaskID task_id = 5; // If present, the task did not have an executor. + repeated Executor executors = 1; - // If missing, the isolation module cannot provide resource usage. - optional ResourceStatistics statistics = 6; + // TODO(jieyu): Include slave's total resources here. } @@ -564,6 +764,8 @@ message PerfStatistics { * to proactively influence the allocator. If 'slave_id' is provided * then this request is assumed to only apply to resources on that * slave. + * + * TODO(vinod): Remove this once the old driver is removed. */ message Request { optional SlaveID slave_id = 1; @@ -583,6 +785,44 @@ message Offer { repeated Resource resources = 5; repeated Attribute attributes = 7; repeated ExecutorID executor_ids = 6; + + // Defines an operation that can be performed against offers. + message Operation { + enum Type { + LAUNCH = 1; + RESERVE = 2; + UNRESERVE = 3; + CREATE = 4; + DESTROY = 5; + } + + message Launch { + repeated TaskInfo task_infos = 1; + } + + message Reserve { + repeated Resource resources = 1; + } + + message Unreserve { + repeated Resource resources = 1; + } + + message Create { + repeated Resource volumes = 1; + } + + message Destroy { + repeated Resource volumes = 1; + } + + required Type type = 1; + optional Launch launch = 2; + optional Reserve reserve = 3; + optional Unreserve unreserve = 4; + optional Create create = 5; + optional Destroy destroy = 6; + } } @@ -607,6 +847,19 @@ message TaskInfo { // A health check for the task (currently in *alpha* and initial // support will only be for TaskInfo's that have a CommandInfo). optional HealthCheck health_check = 8; + + // Labels are free-form key value pairs which are exposed through + // master and slave endpoints. Labels will not be interpreted or + // acted upon by Mesos itself. As opposed to the data field, labels + // will be kept in memory on master and slave processes. Therefore, + // labels should be used to tag tasks with light-weight meta-data. + optional Labels labels = 10; + + // Service discovery information for the task. It is not interpreted + // or acted upon by Mesos. It is up to a service discovery system + // to use this information as needed and to handle tasks without + // service discovery information. + optional DiscoveryInfo discovery = 11; } @@ -625,8 +878,6 @@ enum TaskState { TASK_FAILED = 3; // TERMINAL. The task failed to finish successfully. TASK_KILLED = 4; // TERMINAL. The task was killed by the executor. TASK_LOST = 5; // TERMINAL. The task failed but can be rescheduled. - // TASK_ERROR is currently unused but will be introduced in 0.22.0. - // TODO(dhamon): Start using TASK_ERROR. TASK_ERROR = 7; // TERMINAL. The task description contains an error. } @@ -635,16 +886,20 @@ enum TaskState { * Describes the current status of a task. */ message TaskStatus { - /** Describes the source of the task status update. */ + // Describes the source of the task status update. enum Source { SOURCE_MASTER = 0; SOURCE_SLAVE = 1; SOURCE_EXECUTOR = 2; } - /** Detailed reason for the task status update. */ + // Detailed reason for the task status update. + // + // TODO(bmahler): Differentiate between slave removal reasons + // (e.g. unhealthy vs. unregistered for maintenance). enum Reason { REASON_COMMAND_EXECUTOR_FAILED = 0; + REASON_EXECUTOR_PREEMPTED = 17; REASON_EXECUTOR_TERMINATED = 1; REASON_EXECUTOR_UNREGISTERED = 2; REASON_FRAMEWORK_REMOVED = 3; @@ -654,6 +909,7 @@ message TaskStatus { REASON_MASTER_DISCONNECTED = 7; REASON_MEMORY_LIMIT = 8; REASON_RECONCILIATION = 9; + REASON_RESOURCES_UNKNOWN = 18; REASON_SLAVE_DISCONNECTED = 10; REASON_SLAVE_REMOVED = 11; REASON_SLAVE_RESTARTED = 12; @@ -673,6 +929,17 @@ message TaskStatus { optional ExecutorID executor_id = 7; // TODO(benh): Use in master/slave. optional double timestamp = 6; + // Statuses that are delivered reliably to the scheduler will + // include a 'uuid'. The status is considered delivered once + // it is acknowledged by the scheduler. Schedulers can choose + // to either explicitly acknowledge statuses or let the scheduler + // driver implicitly acknowledge (default). + // + // TODO(bmahler): This is currently overwritten in the scheduler + // driver and executor driver, but executors will need to set this + // to a valid RFC-4122 UUID if using the HTTP API. + optional bytes uuid = 11; + // Describes whether the task has been determined to be healthy // (true) or unhealthy (false) according to the HealthCheck field in // the command info. @@ -928,10 +1195,15 @@ message ContainerInfo { optional bool privileged = 4 [default = false]; // Allowing arbitrary parameters to be passed to docker CLI. - // Note that anything passed to this field is not guranteed + // Note that anything passed to this field is not guaranteed // to be supported moving forward, as we might move away from // the docker CLI. repeated Parameter parameters = 5; + + // With this flag set to true, the docker containerizer will + // pull the docker image from the registry even if the image + // is already downloaded on the slave. + optional bool force_pull_image = 6; } required Type type = 1; @@ -940,3 +1212,68 @@ message ContainerInfo { optional DockerInfo docker = 3; } + + +/** + * Collection of labels. + */ +message Labels { + repeated Label labels = 1; +} + + +/** + * Key, value pair used to store free form user-data. + */ +message Label { + required string key = 1; + optional string value = 2; +} + + +/** + * Named port used for service discovery. + */ +message Port { + required uint32 number = 1; + optional string name = 2; + optional string protocol = 3; +} + + +/** + * Collection of ports. + */ +message Ports { + repeated Port ports = 1; +} + + +/** +* Service discovery information. +* The visibility field restricts discovery within a framework +* (FRAMEWORK), within a Mesos cluster (CLUSTER), or places no +* restrictions (EXTERNAL). +* The environment, location, and version fields provide first class +* support for common attributes used to differentiate between +* similar services. The environment may receive values such as +* PROD/QA/DEV, the location field may receive values like +* EAST-US/WEST-US/EUROPE/AMEA, and the version field may receive +* values like v2.0/v0.9. The exact use of these fields is up to each +* service discovery system. +*/ +message DiscoveryInfo { + enum Visibility { + FRAMEWORK = 0; + CLUSTER = 1; + EXTERNAL = 2; + } + + required Visibility visibility = 1; + optional string name = 2; + optional string environment = 3; + optional string location = 4; + optional string version = 5; + optional Ports ports = 6; + optional Labels labels = 7; +} diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/mesospb_test.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/mesospb_test.go index da57cf921fcb4..aef9eac801057 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/mesospb_test.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/mesospb_test.go @@ -8,56 +8,56 @@ import testing "testing" import math_rand "math/rand" import time "time" import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" -import testing1 "testing" -import math_rand1 "math/rand" -import time1 "time" -import encoding_json "encoding/json" -import testing2 "testing" -import math_rand2 "math/rand" -import time2 "time" -import github_com_gogo_protobuf_proto1 "github.com/gogo/protobuf/proto" -import math_rand3 "math/rand" -import time3 "time" -import testing3 "testing" +import github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb" import fmt "fmt" -import math_rand4 "math/rand" -import time4 "time" -import testing4 "testing" -import github_com_gogo_protobuf_proto2 "github.com/gogo/protobuf/proto" -import math_rand5 "math/rand" -import time5 "time" -import testing5 "testing" -import fmt1 "fmt" import go_parser "go/parser" -import math_rand6 "math/rand" -import time6 "time" -import testing6 "testing" -import github_com_gogo_protobuf_proto3 "github.com/gogo/protobuf/proto" +import proto "github.com/gogo/protobuf/proto" +import math "math" + +// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf func TestFrameworkIDProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedFrameworkID(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &FrameworkID{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestFrameworkIDMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedFrameworkID(popr, false) size := p.Size() data := make([]byte, size) @@ -66,20 +66,20 @@ func TestFrameworkIDMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &FrameworkID{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -124,29 +124,42 @@ func BenchmarkFrameworkIDProtoUnmarshal(b *testing.B) { } func TestOfferIDProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOfferID(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &OfferID{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestOfferIDMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOfferID(popr, false) size := p.Size() data := make([]byte, size) @@ -155,20 +168,20 @@ func TestOfferIDMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &OfferID{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -213,29 +226,42 @@ func BenchmarkOfferIDProtoUnmarshal(b *testing.B) { } func TestSlaveIDProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedSlaveID(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &SlaveID{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestSlaveIDMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedSlaveID(popr, false) size := p.Size() data := make([]byte, size) @@ -244,20 +270,20 @@ func TestSlaveIDMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &SlaveID{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -302,29 +328,42 @@ func BenchmarkSlaveIDProtoUnmarshal(b *testing.B) { } func TestTaskIDProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedTaskID(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &TaskID{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestTaskIDMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedTaskID(popr, false) size := p.Size() data := make([]byte, size) @@ -333,20 +372,20 @@ func TestTaskIDMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &TaskID{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -391,29 +430,42 @@ func BenchmarkTaskIDProtoUnmarshal(b *testing.B) { } func TestExecutorIDProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedExecutorID(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ExecutorID{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestExecutorIDMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedExecutorID(popr, false) size := p.Size() data := make([]byte, size) @@ -422,20 +474,20 @@ func TestExecutorIDMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ExecutorID{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -480,29 +532,42 @@ func BenchmarkExecutorIDProtoUnmarshal(b *testing.B) { } func TestContainerIDProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedContainerID(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ContainerID{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestContainerIDMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedContainerID(popr, false) size := p.Size() data := make([]byte, size) @@ -511,20 +576,20 @@ func TestContainerIDMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ContainerID{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -569,29 +634,42 @@ func BenchmarkContainerIDProtoUnmarshal(b *testing.B) { } func TestFrameworkInfoProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedFrameworkInfo(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &FrameworkInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestFrameworkInfoMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedFrameworkInfo(popr, false) size := p.Size() data := make([]byte, size) @@ -600,20 +678,20 @@ func TestFrameworkInfoMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &FrameworkInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -657,30 +735,145 @@ func BenchmarkFrameworkInfoProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } +func TestFrameworkInfo_CapabilityProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFrameworkInfo_Capability(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &FrameworkInfo_Capability{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + } +} + +func TestFrameworkInfo_CapabilityMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFrameworkInfo_Capability(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) + } + _, err := p.MarshalTo(data) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &FrameworkInfo_Capability{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + for i := range data { + data[i] = byte(popr.Intn(256)) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } +} + +func BenchmarkFrameworkInfo_CapabilityProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*FrameworkInfo_Capability, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedFrameworkInfo_Capability(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) + } + b.SetBytes(int64(total / b.N)) +} + +func BenchmarkFrameworkInfo_CapabilityProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedFrameworkInfo_Capability(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data + } + msg := &FrameworkInfo_Capability{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } + } + b.SetBytes(int64(total / b.N)) +} + func TestHealthCheckProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedHealthCheck(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &HealthCheck{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestHealthCheckMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedHealthCheck(popr, false) size := p.Size() data := make([]byte, size) @@ -689,20 +882,20 @@ func TestHealthCheckMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &HealthCheck{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -747,29 +940,42 @@ func BenchmarkHealthCheckProtoUnmarshal(b *testing.B) { } func TestHealthCheck_HTTPProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedHealthCheck_HTTP(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &HealthCheck_HTTP{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestHealthCheck_HTTPMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedHealthCheck_HTTP(popr, false) size := p.Size() data := make([]byte, size) @@ -778,20 +984,20 @@ func TestHealthCheck_HTTPMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &HealthCheck_HTTP{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -836,29 +1042,42 @@ func BenchmarkHealthCheck_HTTPProtoUnmarshal(b *testing.B) { } func TestCommandInfoProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedCommandInfo(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &CommandInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestCommandInfoMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedCommandInfo(popr, false) size := p.Size() data := make([]byte, size) @@ -867,20 +1086,20 @@ func TestCommandInfoMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &CommandInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -925,29 +1144,42 @@ func BenchmarkCommandInfoProtoUnmarshal(b *testing.B) { } func TestCommandInfo_URIProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedCommandInfo_URI(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &CommandInfo_URI{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestCommandInfo_URIMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedCommandInfo_URI(popr, false) size := p.Size() data := make([]byte, size) @@ -956,20 +1188,20 @@ func TestCommandInfo_URIMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &CommandInfo_URI{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -1014,29 +1246,42 @@ func BenchmarkCommandInfo_URIProtoUnmarshal(b *testing.B) { } func TestCommandInfo_ContainerInfoProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedCommandInfo_ContainerInfo(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &CommandInfo_ContainerInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestCommandInfo_ContainerInfoMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedCommandInfo_ContainerInfo(popr, false) size := p.Size() data := make([]byte, size) @@ -1045,20 +1290,20 @@ func TestCommandInfo_ContainerInfoMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &CommandInfo_ContainerInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -1103,29 +1348,42 @@ func BenchmarkCommandInfo_ContainerInfoProtoUnmarshal(b *testing.B) { } func TestExecutorInfoProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedExecutorInfo(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ExecutorInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestExecutorInfoMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedExecutorInfo(popr, false) size := p.Size() data := make([]byte, size) @@ -1134,20 +1392,20 @@ func TestExecutorInfoMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ExecutorInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -1192,29 +1450,42 @@ func BenchmarkExecutorInfoProtoUnmarshal(b *testing.B) { } func TestMasterInfoProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedMasterInfo(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &MasterInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestMasterInfoMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedMasterInfo(popr, false) size := p.Size() data := make([]byte, size) @@ -1223,20 +1494,20 @@ func TestMasterInfoMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &MasterInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -1281,29 +1552,42 @@ func BenchmarkMasterInfoProtoUnmarshal(b *testing.B) { } func TestSlaveInfoProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedSlaveInfo(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &SlaveInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestSlaveInfoMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedSlaveInfo(popr, false) size := p.Size() data := make([]byte, size) @@ -1312,20 +1596,20 @@ func TestSlaveInfoMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &SlaveInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -1370,29 +1654,42 @@ func BenchmarkSlaveInfoProtoUnmarshal(b *testing.B) { } func TestValueProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValue(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Value{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestValueMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValue(popr, false) size := p.Size() data := make([]byte, size) @@ -1401,20 +1698,20 @@ func TestValueMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Value{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -1459,29 +1756,42 @@ func BenchmarkValueProtoUnmarshal(b *testing.B) { } func TestValue_ScalarProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValue_Scalar(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Value_Scalar{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestValue_ScalarMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValue_Scalar(popr, false) size := p.Size() data := make([]byte, size) @@ -1490,20 +1800,20 @@ func TestValue_ScalarMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Value_Scalar{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -1548,29 +1858,42 @@ func BenchmarkValue_ScalarProtoUnmarshal(b *testing.B) { } func TestValue_RangeProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValue_Range(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Value_Range{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestValue_RangeMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValue_Range(popr, false) size := p.Size() data := make([]byte, size) @@ -1579,20 +1902,20 @@ func TestValue_RangeMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Value_Range{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -1637,29 +1960,42 @@ func BenchmarkValue_RangeProtoUnmarshal(b *testing.B) { } func TestValue_RangesProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValue_Ranges(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Value_Ranges{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestValue_RangesMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValue_Ranges(popr, false) size := p.Size() data := make([]byte, size) @@ -1668,20 +2004,20 @@ func TestValue_RangesMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Value_Ranges{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -1726,29 +2062,42 @@ func BenchmarkValue_RangesProtoUnmarshal(b *testing.B) { } func TestValue_SetProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValue_Set(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Value_Set{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestValue_SetMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValue_Set(popr, false) size := p.Size() data := make([]byte, size) @@ -1757,20 +2106,20 @@ func TestValue_SetMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Value_Set{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -1815,29 +2164,42 @@ func BenchmarkValue_SetProtoUnmarshal(b *testing.B) { } func TestValue_TextProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValue_Text(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Value_Text{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestValue_TextMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValue_Text(popr, false) size := p.Size() data := make([]byte, size) @@ -1846,20 +2208,20 @@ func TestValue_TextMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Value_Text{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -1904,29 +2266,42 @@ func BenchmarkValue_TextProtoUnmarshal(b *testing.B) { } func TestAttributeProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAttribute(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Attribute{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestAttributeMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAttribute(popr, false) size := p.Size() data := make([]byte, size) @@ -1935,20 +2310,20 @@ func TestAttributeMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Attribute{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -1993,29 +2368,42 @@ func BenchmarkAttributeProtoUnmarshal(b *testing.B) { } func TestResourceProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResource(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Resource{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestResourceMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResource(popr, false) size := p.Size() data := make([]byte, size) @@ -2024,20 +2412,20 @@ func TestResourceMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Resource{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -2081,31 +2469,44 @@ func BenchmarkResourceProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestResourceStatisticsProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedResourceStatistics(popr, false) +func TestResource_ReservationInfoProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_ReservationInfo(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ResourceStatistics{} + msg := &Resource_ReservationInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestResourceStatisticsMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedResourceStatistics(popr, false) +func TestResource_ReservationInfoMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_ReservationInfo(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -2113,29 +2514,29 @@ func TestResourceStatisticsMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ResourceStatistics{} + msg := &Resource_ReservationInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkResourceStatisticsProtoMarshal(b *testing.B) { +func BenchmarkResource_ReservationInfoProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*ResourceStatistics, 10000) + pops := make([]*Resource_ReservationInfo, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedResourceStatistics(popr, false) + pops[i] = NewPopulatedResource_ReservationInfo(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -2148,18 +2549,18 @@ func BenchmarkResourceStatisticsProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkResourceStatisticsProtoUnmarshal(b *testing.B) { +func BenchmarkResource_ReservationInfoProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedResourceStatistics(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedResource_ReservationInfo(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &ResourceStatistics{} + msg := &Resource_ReservationInfo{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -2170,31 +2571,44 @@ func BenchmarkResourceStatisticsProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestResourceUsageProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedResourceUsage(popr, false) +func TestResource_DiskInfoProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_DiskInfo(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ResourceUsage{} + msg := &Resource_DiskInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestResourceUsageMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedResourceUsage(popr, false) +func TestResource_DiskInfoMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_DiskInfo(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -2202,29 +2616,29 @@ func TestResourceUsageMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ResourceUsage{} + msg := &Resource_DiskInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkResourceUsageProtoMarshal(b *testing.B) { +func BenchmarkResource_DiskInfoProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*ResourceUsage, 10000) + pops := make([]*Resource_DiskInfo, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedResourceUsage(popr, false) + pops[i] = NewPopulatedResource_DiskInfo(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -2237,18 +2651,18 @@ func BenchmarkResourceUsageProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkResourceUsageProtoUnmarshal(b *testing.B) { +func BenchmarkResource_DiskInfoProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedResourceUsage(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedResource_DiskInfo(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &ResourceUsage{} + msg := &Resource_DiskInfo{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -2259,31 +2673,44 @@ func BenchmarkResourceUsageProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestPerfStatisticsProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedPerfStatistics(popr, false) +func TestResource_DiskInfo_PersistenceProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_DiskInfo_Persistence(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &PerfStatistics{} + msg := &Resource_DiskInfo_Persistence{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestPerfStatisticsMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedPerfStatistics(popr, false) +func TestResource_DiskInfo_PersistenceMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_DiskInfo_Persistence(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -2291,29 +2718,29 @@ func TestPerfStatisticsMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &PerfStatistics{} + msg := &Resource_DiskInfo_Persistence{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkPerfStatisticsProtoMarshal(b *testing.B) { +func BenchmarkResource_DiskInfo_PersistenceProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*PerfStatistics, 10000) + pops := make([]*Resource_DiskInfo_Persistence, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedPerfStatistics(popr, false) + pops[i] = NewPopulatedResource_DiskInfo_Persistence(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -2326,18 +2753,18 @@ func BenchmarkPerfStatisticsProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkPerfStatisticsProtoUnmarshal(b *testing.B) { +func BenchmarkResource_DiskInfo_PersistenceProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedPerfStatistics(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedResource_DiskInfo_Persistence(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &PerfStatistics{} + msg := &Resource_DiskInfo_Persistence{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -2348,31 +2775,44 @@ func BenchmarkPerfStatisticsProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestRequestProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedRequest(popr, false) +func TestResource_RevocableInfoProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_RevocableInfo(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Request{} + msg := &Resource_RevocableInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestRequestMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedRequest(popr, false) +func TestResource_RevocableInfoMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_RevocableInfo(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -2380,29 +2820,29 @@ func TestRequestMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Request{} + msg := &Resource_RevocableInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkRequestProtoMarshal(b *testing.B) { +func BenchmarkResource_RevocableInfoProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*Request, 10000) + pops := make([]*Resource_RevocableInfo, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedRequest(popr, false) + pops[i] = NewPopulatedResource_RevocableInfo(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -2415,18 +2855,18 @@ func BenchmarkRequestProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkRequestProtoUnmarshal(b *testing.B) { +func BenchmarkResource_RevocableInfoProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedRequest(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedResource_RevocableInfo(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &Request{} + msg := &Resource_RevocableInfo{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -2437,31 +2877,44 @@ func BenchmarkRequestProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestOfferProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedOffer(popr, false) +func TestTrafficControlStatisticsProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTrafficControlStatistics(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Offer{} + msg := &TrafficControlStatistics{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestOfferMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedOffer(popr, false) +func TestTrafficControlStatisticsMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTrafficControlStatistics(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -2469,29 +2922,29 @@ func TestOfferMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Offer{} + msg := &TrafficControlStatistics{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkOfferProtoMarshal(b *testing.B) { +func BenchmarkTrafficControlStatisticsProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*Offer, 10000) + pops := make([]*TrafficControlStatistics, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedOffer(popr, false) + pops[i] = NewPopulatedTrafficControlStatistics(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -2504,18 +2957,18 @@ func BenchmarkOfferProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkOfferProtoUnmarshal(b *testing.B) { +func BenchmarkTrafficControlStatisticsProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedOffer(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedTrafficControlStatistics(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &Offer{} + msg := &TrafficControlStatistics{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -2526,31 +2979,44 @@ func BenchmarkOfferProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestTaskInfoProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedTaskInfo(popr, false) +func TestResourceStatisticsProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceStatistics(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &TaskInfo{} + msg := &ResourceStatistics{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestTaskInfoMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedTaskInfo(popr, false) +func TestResourceStatisticsMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceStatistics(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -2558,29 +3024,29 @@ func TestTaskInfoMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &TaskInfo{} + msg := &ResourceStatistics{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkTaskInfoProtoMarshal(b *testing.B) { +func BenchmarkResourceStatisticsProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*TaskInfo, 10000) + pops := make([]*ResourceStatistics, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedTaskInfo(popr, false) + pops[i] = NewPopulatedResourceStatistics(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -2593,18 +3059,18 @@ func BenchmarkTaskInfoProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkTaskInfoProtoUnmarshal(b *testing.B) { +func BenchmarkResourceStatisticsProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedTaskInfo(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedResourceStatistics(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &TaskInfo{} + msg := &ResourceStatistics{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -2615,31 +3081,44 @@ func BenchmarkTaskInfoProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestTaskStatusProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedTaskStatus(popr, false) +func TestResourceUsageProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceUsage(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &TaskStatus{} + msg := &ResourceUsage{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestTaskStatusMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedTaskStatus(popr, false) +func TestResourceUsageMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceUsage(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -2647,29 +3126,29 @@ func TestTaskStatusMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &TaskStatus{} + msg := &ResourceUsage{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkTaskStatusProtoMarshal(b *testing.B) { +func BenchmarkResourceUsageProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*TaskStatus, 10000) + pops := make([]*ResourceUsage, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedTaskStatus(popr, false) + pops[i] = NewPopulatedResourceUsage(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -2682,18 +3161,18 @@ func BenchmarkTaskStatusProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkTaskStatusProtoUnmarshal(b *testing.B) { +func BenchmarkResourceUsageProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedTaskStatus(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedResourceUsage(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &TaskStatus{} + msg := &ResourceUsage{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -2704,31 +3183,44 @@ func BenchmarkTaskStatusProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestFiltersProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedFilters(popr, false) +func TestResourceUsage_ExecutorProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceUsage_Executor(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Filters{} + msg := &ResourceUsage_Executor{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestFiltersMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedFilters(popr, false) +func TestResourceUsage_ExecutorMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceUsage_Executor(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -2736,29 +3228,29 @@ func TestFiltersMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Filters{} + msg := &ResourceUsage_Executor{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkFiltersProtoMarshal(b *testing.B) { +func BenchmarkResourceUsage_ExecutorProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*Filters, 10000) + pops := make([]*ResourceUsage_Executor, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedFilters(popr, false) + pops[i] = NewPopulatedResourceUsage_Executor(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -2771,18 +3263,18 @@ func BenchmarkFiltersProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkFiltersProtoUnmarshal(b *testing.B) { +func BenchmarkResourceUsage_ExecutorProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedFilters(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedResourceUsage_Executor(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &Filters{} + msg := &ResourceUsage_Executor{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -2793,31 +3285,44 @@ func BenchmarkFiltersProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestEnvironmentProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedEnvironment(popr, false) +func TestPerfStatisticsProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPerfStatistics(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Environment{} + msg := &PerfStatistics{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestEnvironmentMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedEnvironment(popr, false) +func TestPerfStatisticsMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPerfStatistics(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -2825,29 +3330,29 @@ func TestEnvironmentMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Environment{} + msg := &PerfStatistics{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkEnvironmentProtoMarshal(b *testing.B) { +func BenchmarkPerfStatisticsProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*Environment, 10000) + pops := make([]*PerfStatistics, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedEnvironment(popr, false) + pops[i] = NewPopulatedPerfStatistics(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -2860,18 +3365,18 @@ func BenchmarkEnvironmentProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkEnvironmentProtoUnmarshal(b *testing.B) { +func BenchmarkPerfStatisticsProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedEnvironment(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedPerfStatistics(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &Environment{} + msg := &PerfStatistics{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -2882,31 +3387,44 @@ func BenchmarkEnvironmentProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestEnvironment_VariableProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedEnvironment_Variable(popr, false) +func TestRequestProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRequest(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Environment_Variable{} + msg := &Request{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestEnvironment_VariableMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedEnvironment_Variable(popr, false) +func TestRequestMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRequest(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -2914,29 +3432,29 @@ func TestEnvironment_VariableMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Environment_Variable{} + msg := &Request{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkEnvironment_VariableProtoMarshal(b *testing.B) { +func BenchmarkRequestProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*Environment_Variable, 10000) + pops := make([]*Request, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedEnvironment_Variable(popr, false) + pops[i] = NewPopulatedRequest(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -2949,18 +3467,18 @@ func BenchmarkEnvironment_VariableProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkEnvironment_VariableProtoUnmarshal(b *testing.B) { +func BenchmarkRequestProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedEnvironment_Variable(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedRequest(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &Environment_Variable{} + msg := &Request{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -2971,31 +3489,44 @@ func BenchmarkEnvironment_VariableProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestParameterProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedParameter(popr, false) +func TestOfferProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Parameter{} + msg := &Offer{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestParameterMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedParameter(popr, false) +func TestOfferMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -3003,29 +3534,29 @@ func TestParameterMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Parameter{} + msg := &Offer{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkParameterProtoMarshal(b *testing.B) { +func BenchmarkOfferProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*Parameter, 10000) + pops := make([]*Offer, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedParameter(popr, false) + pops[i] = NewPopulatedOffer(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -3038,18 +3569,18 @@ func BenchmarkParameterProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkParameterProtoUnmarshal(b *testing.B) { +func BenchmarkOfferProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedParameter(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedOffer(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &Parameter{} + msg := &Offer{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -3060,31 +3591,44 @@ func BenchmarkParameterProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestParametersProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedParameters(popr, false) +func TestOffer_OperationProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Parameters{} + msg := &Offer_Operation{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestParametersMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedParameters(popr, false) +func TestOffer_OperationMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -3092,29 +3636,29 @@ func TestParametersMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Parameters{} + msg := &Offer_Operation{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkParametersProtoMarshal(b *testing.B) { +func BenchmarkOffer_OperationProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*Parameters, 10000) + pops := make([]*Offer_Operation, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedParameters(popr, false) + pops[i] = NewPopulatedOffer_Operation(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -3127,18 +3671,18 @@ func BenchmarkParametersProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkParametersProtoUnmarshal(b *testing.B) { +func BenchmarkOffer_OperationProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedParameters(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedOffer_Operation(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &Parameters{} + msg := &Offer_Operation{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -3149,31 +3693,44 @@ func BenchmarkParametersProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestCredentialProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedCredential(popr, false) +func TestOffer_Operation_LaunchProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Launch(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Credential{} + msg := &Offer_Operation_Launch{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestCredentialMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedCredential(popr, false) +func TestOffer_Operation_LaunchMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Launch(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -3181,29 +3738,29 @@ func TestCredentialMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Credential{} + msg := &Offer_Operation_Launch{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkCredentialProtoMarshal(b *testing.B) { +func BenchmarkOffer_Operation_LaunchProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*Credential, 10000) + pops := make([]*Offer_Operation_Launch, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedCredential(popr, false) + pops[i] = NewPopulatedOffer_Operation_Launch(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -3216,18 +3773,18 @@ func BenchmarkCredentialProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkCredentialProtoUnmarshal(b *testing.B) { +func BenchmarkOffer_Operation_LaunchProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedCredential(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedOffer_Operation_Launch(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &Credential{} + msg := &Offer_Operation_Launch{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -3238,31 +3795,44 @@ func BenchmarkCredentialProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestCredentialsProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedCredentials(popr, false) +func TestOffer_Operation_ReserveProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Reserve(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Credentials{} + msg := &Offer_Operation_Reserve{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestCredentialsMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedCredentials(popr, false) +func TestOffer_Operation_ReserveMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Reserve(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -3270,29 +3840,29 @@ func TestCredentialsMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Credentials{} + msg := &Offer_Operation_Reserve{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkCredentialsProtoMarshal(b *testing.B) { +func BenchmarkOffer_Operation_ReserveProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*Credentials, 10000) + pops := make([]*Offer_Operation_Reserve, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedCredentials(popr, false) + pops[i] = NewPopulatedOffer_Operation_Reserve(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -3305,18 +3875,18 @@ func BenchmarkCredentialsProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkCredentialsProtoUnmarshal(b *testing.B) { +func BenchmarkOffer_Operation_ReserveProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedCredentials(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedOffer_Operation_Reserve(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &Credentials{} + msg := &Offer_Operation_Reserve{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -3327,31 +3897,44 @@ func BenchmarkCredentialsProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestACLProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedACL(popr, false) +func TestOffer_Operation_UnreserveProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Unreserve(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ACL{} + msg := &Offer_Operation_Unreserve{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestACLMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedACL(popr, false) +func TestOffer_Operation_UnreserveMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Unreserve(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -3359,29 +3942,29 @@ func TestACLMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ACL{} + msg := &Offer_Operation_Unreserve{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkACLProtoMarshal(b *testing.B) { +func BenchmarkOffer_Operation_UnreserveProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*ACL, 10000) + pops := make([]*Offer_Operation_Unreserve, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedACL(popr, false) + pops[i] = NewPopulatedOffer_Operation_Unreserve(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -3394,18 +3977,18 @@ func BenchmarkACLProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkACLProtoUnmarshal(b *testing.B) { +func BenchmarkOffer_Operation_UnreserveProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedACL(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedOffer_Operation_Unreserve(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &ACL{} + msg := &Offer_Operation_Unreserve{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -3416,31 +3999,44 @@ func BenchmarkACLProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestACL_EntityProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedACL_Entity(popr, false) +func TestOffer_Operation_CreateProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Create(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ACL_Entity{} + msg := &Offer_Operation_Create{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestACL_EntityMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedACL_Entity(popr, false) +func TestOffer_Operation_CreateMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Create(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -3448,29 +4044,29 @@ func TestACL_EntityMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ACL_Entity{} + msg := &Offer_Operation_Create{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkACL_EntityProtoMarshal(b *testing.B) { +func BenchmarkOffer_Operation_CreateProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*ACL_Entity, 10000) + pops := make([]*Offer_Operation_Create, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedACL_Entity(popr, false) + pops[i] = NewPopulatedOffer_Operation_Create(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -3483,18 +4079,18 @@ func BenchmarkACL_EntityProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkACL_EntityProtoUnmarshal(b *testing.B) { +func BenchmarkOffer_Operation_CreateProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedACL_Entity(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedOffer_Operation_Create(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &ACL_Entity{} + msg := &Offer_Operation_Create{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -3505,31 +4101,44 @@ func BenchmarkACL_EntityProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestACL_RegisterFrameworkProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedACL_RegisterFramework(popr, false) +func TestOffer_Operation_DestroyProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Destroy(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ACL_RegisterFramework{} + msg := &Offer_Operation_Destroy{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestACL_RegisterFrameworkMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedACL_RegisterFramework(popr, false) +func TestOffer_Operation_DestroyMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Destroy(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -3537,29 +4146,29 @@ func TestACL_RegisterFrameworkMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ACL_RegisterFramework{} + msg := &Offer_Operation_Destroy{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkACL_RegisterFrameworkProtoMarshal(b *testing.B) { +func BenchmarkOffer_Operation_DestroyProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*ACL_RegisterFramework, 10000) + pops := make([]*Offer_Operation_Destroy, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedACL_RegisterFramework(popr, false) + pops[i] = NewPopulatedOffer_Operation_Destroy(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -3572,18 +4181,18 @@ func BenchmarkACL_RegisterFrameworkProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkACL_RegisterFrameworkProtoUnmarshal(b *testing.B) { +func BenchmarkOffer_Operation_DestroyProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedACL_RegisterFramework(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedOffer_Operation_Destroy(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &ACL_RegisterFramework{} + msg := &Offer_Operation_Destroy{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -3594,31 +4203,44 @@ func BenchmarkACL_RegisterFrameworkProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestACL_RunTaskProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedACL_RunTask(popr, false) +func TestTaskInfoProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskInfo(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ACL_RunTask{} + msg := &TaskInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestACL_RunTaskMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedACL_RunTask(popr, false) +func TestTaskInfoMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskInfo(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -3626,29 +4248,29 @@ func TestACL_RunTaskMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ACL_RunTask{} + msg := &TaskInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkACL_RunTaskProtoMarshal(b *testing.B) { +func BenchmarkTaskInfoProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*ACL_RunTask, 10000) + pops := make([]*TaskInfo, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedACL_RunTask(popr, false) + pops[i] = NewPopulatedTaskInfo(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -3661,18 +4283,18 @@ func BenchmarkACL_RunTaskProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkACL_RunTaskProtoUnmarshal(b *testing.B) { +func BenchmarkTaskInfoProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedACL_RunTask(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedTaskInfo(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &ACL_RunTask{} + msg := &TaskInfo{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -3683,31 +4305,44 @@ func BenchmarkACL_RunTaskProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestACL_ShutdownFrameworkProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedACL_ShutdownFramework(popr, false) +func TestTaskStatusProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskStatus(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ACL_ShutdownFramework{} + msg := &TaskStatus{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestACL_ShutdownFrameworkMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedACL_ShutdownFramework(popr, false) +func TestTaskStatusMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskStatus(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -3715,29 +4350,29 @@ func TestACL_ShutdownFrameworkMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ACL_ShutdownFramework{} + msg := &TaskStatus{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkACL_ShutdownFrameworkProtoMarshal(b *testing.B) { +func BenchmarkTaskStatusProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*ACL_ShutdownFramework, 10000) + pops := make([]*TaskStatus, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedACL_ShutdownFramework(popr, false) + pops[i] = NewPopulatedTaskStatus(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -3750,18 +4385,18 @@ func BenchmarkACL_ShutdownFrameworkProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkACL_ShutdownFrameworkProtoUnmarshal(b *testing.B) { +func BenchmarkTaskStatusProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedACL_ShutdownFramework(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedTaskStatus(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &ACL_ShutdownFramework{} + msg := &TaskStatus{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -3772,31 +4407,44 @@ func BenchmarkACL_ShutdownFrameworkProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestACLsProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedACLs(popr, false) +func TestFiltersProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFilters(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ACLs{} + msg := &Filters{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestACLsMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedACLs(popr, false) +func TestFiltersMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFilters(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -3804,29 +4452,29 @@ func TestACLsMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ACLs{} + msg := &Filters{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkACLsProtoMarshal(b *testing.B) { +func BenchmarkFiltersProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*ACLs, 10000) + pops := make([]*Filters, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedACLs(popr, false) + pops[i] = NewPopulatedFilters(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -3839,18 +4487,18 @@ func BenchmarkACLsProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkACLsProtoUnmarshal(b *testing.B) { +func BenchmarkFiltersProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedACLs(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedFilters(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &ACLs{} + msg := &Filters{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -3861,31 +4509,44 @@ func BenchmarkACLsProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestRateLimitProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedRateLimit(popr, false) +func TestEnvironmentProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedEnvironment(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &RateLimit{} + msg := &Environment{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestRateLimitMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedRateLimit(popr, false) +func TestEnvironmentMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedEnvironment(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -3893,29 +4554,29 @@ func TestRateLimitMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &RateLimit{} + msg := &Environment{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkRateLimitProtoMarshal(b *testing.B) { +func BenchmarkEnvironmentProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*RateLimit, 10000) + pops := make([]*Environment, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedRateLimit(popr, false) + pops[i] = NewPopulatedEnvironment(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -3928,18 +4589,18 @@ func BenchmarkRateLimitProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkRateLimitProtoUnmarshal(b *testing.B) { +func BenchmarkEnvironmentProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedRateLimit(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedEnvironment(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &RateLimit{} + msg := &Environment{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -3950,31 +4611,44 @@ func BenchmarkRateLimitProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestRateLimitsProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedRateLimits(popr, false) +func TestEnvironment_VariableProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedEnvironment_Variable(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &RateLimits{} + msg := &Environment_Variable{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestRateLimitsMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedRateLimits(popr, false) +func TestEnvironment_VariableMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedEnvironment_Variable(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -3982,29 +4656,29 @@ func TestRateLimitsMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &RateLimits{} + msg := &Environment_Variable{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkRateLimitsProtoMarshal(b *testing.B) { +func BenchmarkEnvironment_VariableProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*RateLimits, 10000) + pops := make([]*Environment_Variable, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedRateLimits(popr, false) + pops[i] = NewPopulatedEnvironment_Variable(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -4017,18 +4691,18 @@ func BenchmarkRateLimitsProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkRateLimitsProtoUnmarshal(b *testing.B) { +func BenchmarkEnvironment_VariableProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedRateLimits(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedEnvironment_Variable(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &RateLimits{} + msg := &Environment_Variable{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -4039,31 +4713,44 @@ func BenchmarkRateLimitsProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestVolumeProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedVolume(popr, false) +func TestParameterProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedParameter(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Volume{} + msg := &Parameter{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestVolumeMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedVolume(popr, false) +func TestParameterMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedParameter(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -4071,29 +4758,29 @@ func TestVolumeMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Volume{} + msg := &Parameter{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkVolumeProtoMarshal(b *testing.B) { +func BenchmarkParameterProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*Volume, 10000) + pops := make([]*Parameter, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedVolume(popr, false) + pops[i] = NewPopulatedParameter(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -4106,18 +4793,18 @@ func BenchmarkVolumeProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkVolumeProtoUnmarshal(b *testing.B) { +func BenchmarkParameterProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedVolume(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedParameter(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &Volume{} + msg := &Parameter{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -4128,31 +4815,44 @@ func BenchmarkVolumeProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestContainerInfoProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedContainerInfo(popr, false) +func TestParametersProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedParameters(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ContainerInfo{} + msg := &Parameters{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestContainerInfoMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedContainerInfo(popr, false) +func TestParametersMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedParameters(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -4160,29 +4860,29 @@ func TestContainerInfoMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ContainerInfo{} + msg := &Parameters{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkContainerInfoProtoMarshal(b *testing.B) { +func BenchmarkParametersProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*ContainerInfo, 10000) + pops := make([]*Parameters, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedContainerInfo(popr, false) + pops[i] = NewPopulatedParameters(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -4195,18 +4895,18 @@ func BenchmarkContainerInfoProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkContainerInfoProtoUnmarshal(b *testing.B) { +func BenchmarkParametersProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedContainerInfo(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedParameters(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &ContainerInfo{} + msg := &Parameters{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -4217,31 +4917,44 @@ func BenchmarkContainerInfoProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestContainerInfo_DockerInfoProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo(popr, false) +func TestCredentialProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCredential(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ContainerInfo_DockerInfo{} + msg := &Credential{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestContainerInfo_DockerInfoMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo(popr, false) +func TestCredentialMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCredential(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -4249,29 +4962,29 @@ func TestContainerInfo_DockerInfoMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ContainerInfo_DockerInfo{} + msg := &Credential{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkContainerInfo_DockerInfoProtoMarshal(b *testing.B) { +func BenchmarkCredentialProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*ContainerInfo_DockerInfo, 10000) + pops := make([]*Credential, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedContainerInfo_DockerInfo(popr, false) + pops[i] = NewPopulatedCredential(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -4284,18 +4997,18 @@ func BenchmarkContainerInfo_DockerInfoProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkContainerInfo_DockerInfoProtoUnmarshal(b *testing.B) { +func BenchmarkCredentialProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedContainerInfo_DockerInfo(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedCredential(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &ContainerInfo_DockerInfo{} + msg := &Credential{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -4306,31 +5019,44 @@ func BenchmarkContainerInfo_DockerInfoProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestContainerInfo_DockerInfo_PortMappingProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false) +func TestCredentialsProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCredentials(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ContainerInfo_DockerInfo_PortMapping{} + msg := &Credentials{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestContainerInfo_DockerInfo_PortMappingMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false) +func TestCredentialsMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCredentials(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -4338,29 +5064,29 @@ func TestContainerInfo_DockerInfo_PortMappingMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ContainerInfo_DockerInfo_PortMapping{} + msg := &Credentials{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkContainerInfo_DockerInfo_PortMappingProtoMarshal(b *testing.B) { +func BenchmarkCredentialsProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*ContainerInfo_DockerInfo_PortMapping, 10000) + pops := make([]*Credentials, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false) + pops[i] = NewPopulatedCredentials(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -4373,18 +5099,18 @@ func BenchmarkContainerInfo_DockerInfo_PortMappingProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkContainerInfo_DockerInfo_PortMappingProtoUnmarshal(b *testing.B) { +func BenchmarkCredentialsProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedCredentials(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &ContainerInfo_DockerInfo_PortMapping{} + msg := &Credentials{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -4395,6031 +5121,10314 @@ func BenchmarkContainerInfo_DockerInfo_PortMappingProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestFrameworkIDJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedFrameworkID(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) - } - msg := &FrameworkID{} - err = encoding_json.Unmarshal(jsondata, msg) +func TestACLProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) - } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) - } -} -func TestOfferIDJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedOfferID(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + msg := &ACL{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &OfferID{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestSlaveIDJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedSlaveID(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func TestACLMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - msg := &SlaveID{} - err = encoding_json.Unmarshal(jsondata, msg) + _, err := p.MarshalTo(data) if err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, err = %v", seed, err) } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) - } -} -func TestTaskIDJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedTaskID(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + msg := &ACL{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &TaskID{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestExecutorIDJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedExecutorID(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) - } - msg := &ExecutorID{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + +func BenchmarkACLProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ACL, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedACL(popr, false) } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } + b.SetBytes(int64(total / b.N)) } -func TestContainerIDJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedContainerID(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) - } - msg := &ContainerID{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + +func BenchmarkACLProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedACL(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + msg := &ACL{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestFrameworkInfoJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedFrameworkInfo(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) - } - msg := &FrameworkInfo{} - err = encoding_json.Unmarshal(jsondata, msg) + +func TestACL_EntityProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_Entity(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) - } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestHealthCheckJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedHealthCheck(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + msg := &ACL_Entity{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &HealthCheck{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestHealthCheck_HTTPJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedHealthCheck_HTTP(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func TestACL_EntityMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_Entity(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - msg := &HealthCheck_HTTP{} - err = encoding_json.Unmarshal(jsondata, msg) + _, err := p.MarshalTo(data) if err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) - } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestCommandInfoJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedCommandInfo(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + msg := &ACL_Entity{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &CommandInfo{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestCommandInfo_URIJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedCommandInfo_URI(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func BenchmarkACL_EntityProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ACL_Entity, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedACL_Entity(popr, false) } - msg := &CommandInfo_URI{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + b.SetBytes(int64(total / b.N)) +} + +func BenchmarkACL_EntityProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedACL_Entity(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + msg := &ACL_Entity{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestCommandInfo_ContainerInfoJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedCommandInfo_ContainerInfo(popr, true) - jsondata, err := encoding_json.Marshal(p) + +func TestACL_RegisterFrameworkProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_RegisterFramework(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &CommandInfo_ContainerInfo{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + msg := &ACL_RegisterFramework{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestExecutorInfoJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedExecutorInfo(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func TestACL_RegisterFrameworkMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_RegisterFramework(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - msg := &ExecutorInfo{} - err = encoding_json.Unmarshal(jsondata, msg) + _, err := p.MarshalTo(data) if err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, err = %v", seed, err) } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) - } -} -func TestMasterInfoJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedMasterInfo(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + msg := &ACL_RegisterFramework{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &MasterInfo{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestSlaveInfoJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedSlaveInfo(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func BenchmarkACL_RegisterFrameworkProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ACL_RegisterFramework, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedACL_RegisterFramework(popr, false) } - msg := &SlaveInfo{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + b.SetBytes(int64(total / b.N)) +} + +func BenchmarkACL_RegisterFrameworkProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedACL_RegisterFramework(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + msg := &ACL_RegisterFramework{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestValueJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedValue(popr, true) - jsondata, err := encoding_json.Marshal(p) + +func TestACL_RunTaskProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_RunTask(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Value{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + msg := &ACL_RunTask{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestValue_ScalarJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedValue_Scalar(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func TestACL_RunTaskMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_RunTask(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - msg := &Value_Scalar{} - err = encoding_json.Unmarshal(jsondata, msg) + _, err := p.MarshalTo(data) if err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) - } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestValue_RangeJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedValue_Range(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + msg := &ACL_RunTask{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Value_Range{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestValue_RangesJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedValue_Ranges(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func BenchmarkACL_RunTaskProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ACL_RunTask, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedACL_RunTask(popr, false) } - msg := &Value_Ranges{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + b.SetBytes(int64(total / b.N)) +} + +func BenchmarkACL_RunTaskProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedACL_RunTask(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + msg := &ACL_RunTask{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestValue_SetJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedValue_Set(popr, true) - jsondata, err := encoding_json.Marshal(p) + +func TestACL_ShutdownFrameworkProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_ShutdownFramework(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Value_Set{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + msg := &ACL_ShutdownFramework{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestValue_TextJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedValue_Text(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func TestACL_ShutdownFrameworkMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_ShutdownFramework(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - msg := &Value_Text{} - err = encoding_json.Unmarshal(jsondata, msg) + _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) - } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) - } -} -func TestAttributeJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedAttribute(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + msg := &ACL_ShutdownFramework{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Attribute{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestResourceJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedResource(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func BenchmarkACL_ShutdownFrameworkProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ACL_ShutdownFramework, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedACL_ShutdownFramework(popr, false) } - msg := &Resource{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + b.SetBytes(int64(total / b.N)) +} + +func BenchmarkACL_ShutdownFrameworkProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedACL_ShutdownFramework(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + msg := &ACL_ShutdownFramework{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestResourceStatisticsJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedResourceStatistics(popr, true) - jsondata, err := encoding_json.Marshal(p) + +func TestACLsProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACLs(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ResourceStatistics{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + msg := &ACLs{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestResourceUsageJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedResourceUsage(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func TestACLsMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACLs(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - msg := &ResourceUsage{} - err = encoding_json.Unmarshal(jsondata, msg) + _, err := p.MarshalTo(data) if err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) - } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestPerfStatisticsJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedPerfStatistics(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + msg := &ACLs{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &PerfStatistics{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestRequestJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedRequest(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func BenchmarkACLsProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ACLs, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedACLs(popr, false) } - msg := &Request{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + b.SetBytes(int64(total / b.N)) +} + +func BenchmarkACLsProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedACLs(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + msg := &ACLs{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestOfferJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedOffer(popr, true) - jsondata, err := encoding_json.Marshal(p) + +func TestRateLimitProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRateLimit(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Offer{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + msg := &RateLimit{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestTaskInfoJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedTaskInfo(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func TestRateLimitMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRateLimit(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - msg := &TaskInfo{} - err = encoding_json.Unmarshal(jsondata, msg) + _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &RateLimit{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestTaskStatusJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedTaskStatus(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) - } - msg := &TaskStatus{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + +func BenchmarkRateLimitProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*RateLimit, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedRateLimit(popr, false) } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } + b.SetBytes(int64(total / b.N)) } -func TestFiltersJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedFilters(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) - } - msg := &Filters{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + +func BenchmarkRateLimitProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedRateLimit(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + msg := &RateLimit{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestEnvironmentJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedEnvironment(popr, true) - jsondata, err := encoding_json.Marshal(p) + +func TestRateLimitsProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRateLimits(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Environment{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + msg := &RateLimits{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestEnvironment_VariableJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedEnvironment_Variable(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func TestRateLimitsMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRateLimits(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - msg := &Environment_Variable{} - err = encoding_json.Unmarshal(jsondata, msg) + _, err := p.MarshalTo(data) if err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) - } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestParameterJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedParameter(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + msg := &RateLimits{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Parameter{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestParametersJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedParameters(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func BenchmarkRateLimitsProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*RateLimits, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedRateLimits(popr, false) } - msg := &Parameters{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + b.SetBytes(int64(total / b.N)) +} + +func BenchmarkRateLimitsProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedRateLimits(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + msg := &RateLimits{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestCredentialJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedCredential(popr, true) - jsondata, err := encoding_json.Marshal(p) + +func TestVolumeProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedVolume(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Credential{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + msg := &Volume{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestCredentialsJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedCredentials(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func TestVolumeMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedVolume(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - msg := &Credentials{} - err = encoding_json.Unmarshal(jsondata, msg) + _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Volume{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestACLJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedACL(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func BenchmarkVolumeProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Volume, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedVolume(popr, false) } - msg := &ACL{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + b.SetBytes(int64(total / b.N)) +} + +func BenchmarkVolumeProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedVolume(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + msg := &Volume{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestACL_EntityJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedACL_Entity(popr, true) - jsondata, err := encoding_json.Marshal(p) + +func TestContainerInfoProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ACL_Entity{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + msg := &ContainerInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestACL_RegisterFrameworkJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedACL_RegisterFramework(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func TestContainerInfoMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - msg := &ACL_RegisterFramework{} - err = encoding_json.Unmarshal(jsondata, msg) + _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &ContainerInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestACL_RunTaskJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedACL_RunTask(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) - } - msg := &ACL_RunTask{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + +func BenchmarkContainerInfoProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ContainerInfo, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedContainerInfo(popr, false) } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } + b.SetBytes(int64(total / b.N)) } -func TestACL_ShutdownFrameworkJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedACL_ShutdownFramework(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) - } - msg := &ACL_ShutdownFramework{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + +func BenchmarkContainerInfoProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedContainerInfo(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + msg := &ContainerInfo{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestACLsJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedACLs(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) - } - msg := &ACLs{} - err = encoding_json.Unmarshal(jsondata, msg) + +func TestContainerInfo_DockerInfoProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo_DockerInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, err = %v", seed, err) } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) - } -} -func TestRateLimitJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedRateLimit(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + msg := &ContainerInfo_DockerInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &RateLimit{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestRateLimitsJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedRateLimits(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func TestContainerInfo_DockerInfoMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo_DockerInfo(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - msg := &RateLimits{} - err = encoding_json.Unmarshal(jsondata, msg) + _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) - } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) - } -} -func TestVolumeJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedVolume(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + msg := &ContainerInfo_DockerInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Volume{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestContainerInfoJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedContainerInfo(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func BenchmarkContainerInfo_DockerInfoProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ContainerInfo_DockerInfo, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedContainerInfo_DockerInfo(popr, false) } - msg := &ContainerInfo{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + b.SetBytes(int64(total / b.N)) +} + +func BenchmarkContainerInfo_DockerInfoProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedContainerInfo_DockerInfo(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + msg := &ContainerInfo_DockerInfo{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestContainerInfo_DockerInfoJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo(popr, true) - jsondata, err := encoding_json.Marshal(p) + +func TestContainerInfo_DockerInfo_PortMappingProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ContainerInfo_DockerInfo{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + msg := &ContainerInfo_DockerInfo_PortMapping{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestContainerInfo_DockerInfo_PortMappingJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, true) - jsondata, err := encoding_json.Marshal(p) + +func TestContainerInfo_DockerInfo_PortMappingMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) + } + _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ContainerInfo_DockerInfo_PortMapping{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestFrameworkIDProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedFrameworkID(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &FrameworkID{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + +func BenchmarkContainerInfo_DockerInfo_PortMappingProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ContainerInfo_DockerInfo_PortMapping, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false) } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } + b.SetBytes(int64(total / b.N)) } -func TestFrameworkIDProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedFrameworkID(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &FrameworkID{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) +func BenchmarkContainerInfo_DockerInfo_PortMappingProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + msg := &ContainerInfo_DockerInfo_PortMapping{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestOfferIDProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedOfferID(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &OfferID{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestLabelsProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedLabels(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Labels{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestOfferIDProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedOfferID(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &OfferID{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestLabelsMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedLabels(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + _, err := p.MarshalTo(data) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + msg := &Labels{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} - -func TestSlaveIDProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedSlaveID(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &SlaveID{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestSlaveIDProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedSlaveID(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &SlaveID{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) +func BenchmarkLabelsProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Labels, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedLabels(popr, false) } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } + b.SetBytes(int64(total / b.N)) } -func TestTaskIDProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedTaskID(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &TaskID{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) +func BenchmarkLabelsProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedLabels(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + msg := &Labels{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestTaskIDProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedTaskID(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &TaskID{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestLabelProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedLabel(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Label{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestExecutorIDProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedExecutorID(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &ExecutorID{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestLabelMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedLabel(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + _, err := p.MarshalTo(data) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + msg := &Label{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} - -func TestExecutorIDProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedExecutorID(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &ExecutorID{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestContainerIDProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedContainerID(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &ContainerID{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) +func BenchmarkLabelProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Label, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedLabel(popr, false) } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } + b.SetBytes(int64(total / b.N)) } -func TestContainerIDProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedContainerID(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &ContainerID{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) +func BenchmarkLabelProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedLabel(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + msg := &Label{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestFrameworkInfoProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedFrameworkInfo(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &FrameworkInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestPortProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPort(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Port{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestFrameworkInfoProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedFrameworkInfo(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &FrameworkInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestPortMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPort(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + _, err := p.MarshalTo(data) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + msg := &Port{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} - -func TestHealthCheckProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedHealthCheck(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &HealthCheck{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestHealthCheckProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedHealthCheck(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &HealthCheck{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) +func BenchmarkPortProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Port, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedPort(popr, false) } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } + b.SetBytes(int64(total / b.N)) } -func TestHealthCheck_HTTPProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedHealthCheck_HTTP(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &HealthCheck_HTTP{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) +func BenchmarkPortProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedPort(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + msg := &Port{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestHealthCheck_HTTPProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedHealthCheck_HTTP(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &HealthCheck_HTTP{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestPortsProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPorts(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Ports{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestCommandInfoProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedCommandInfo(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &CommandInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestPortsMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPorts(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + _, err := p.MarshalTo(data) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + msg := &Ports{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} - -func TestCommandInfoProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedCommandInfo(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &CommandInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestCommandInfo_URIProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedCommandInfo_URI(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &CommandInfo_URI{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) +func BenchmarkPortsProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Ports, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedPorts(popr, false) } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } + b.SetBytes(int64(total / b.N)) } -func TestCommandInfo_URIProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedCommandInfo_URI(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &CommandInfo_URI{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) +func BenchmarkPortsProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedPorts(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + msg := &Ports{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestCommandInfo_ContainerInfoProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedCommandInfo_ContainerInfo(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &CommandInfo_ContainerInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestDiscoveryInfoProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedDiscoveryInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &DiscoveryInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestCommandInfo_ContainerInfoProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedCommandInfo_ContainerInfo(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &CommandInfo_ContainerInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestDiscoveryInfoMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedDiscoveryInfo(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + _, err := p.MarshalTo(data) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + msg := &DiscoveryInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} - -func TestExecutorInfoProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedExecutorInfo(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &ExecutorInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestExecutorInfoProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedExecutorInfo(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &ExecutorInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) +func BenchmarkDiscoveryInfoProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*DiscoveryInfo, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedDiscoveryInfo(popr, false) } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } + b.SetBytes(int64(total / b.N)) } -func TestMasterInfoProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedMasterInfo(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &MasterInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) +func BenchmarkDiscoveryInfoProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedDiscoveryInfo(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + msg := &DiscoveryInfo{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestMasterInfoProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedMasterInfo(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &MasterInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestFrameworkIDJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFrameworkID(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &FrameworkID{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestSlaveInfoProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedSlaveInfo(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &SlaveInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestOfferIDJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOfferID(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &OfferID{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestSlaveInfoProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedSlaveInfo(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &SlaveInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestSlaveIDJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedSlaveID(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &SlaveID{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestValueProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedValue(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Value{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestTaskIDJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskID(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &TaskID{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestValueProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedValue(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Value{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestExecutorIDJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedExecutorID(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &ExecutorID{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestValue_ScalarProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedValue_Scalar(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Value_Scalar{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestContainerIDJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerID(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &ContainerID{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestValue_ScalarProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedValue_Scalar(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Value_Scalar{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestFrameworkInfoJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFrameworkInfo(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &FrameworkInfo{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestValue_RangeProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedValue_Range(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Value_Range{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestFrameworkInfo_CapabilityJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFrameworkInfo_Capability(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &FrameworkInfo_Capability{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestValue_RangeProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedValue_Range(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Value_Range{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestHealthCheckJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedHealthCheck(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &HealthCheck{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestValue_RangesProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedValue_Ranges(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Value_Ranges{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestHealthCheck_HTTPJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedHealthCheck_HTTP(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &HealthCheck_HTTP{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestValue_RangesProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedValue_Ranges(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Value_Ranges{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestCommandInfoJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCommandInfo(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &CommandInfo{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestValue_SetProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedValue_Set(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Value_Set{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestCommandInfo_URIJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCommandInfo_URI(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &CommandInfo_URI{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestValue_SetProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedValue_Set(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Value_Set{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestCommandInfo_ContainerInfoJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCommandInfo_ContainerInfo(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &CommandInfo_ContainerInfo{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestValue_TextProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedValue_Text(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Value_Text{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestExecutorInfoJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedExecutorInfo(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &ExecutorInfo{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestValue_TextProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedValue_Text(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Value_Text{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestMasterInfoJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedMasterInfo(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &MasterInfo{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestAttributeProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedAttribute(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Attribute{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestSlaveInfoJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedSlaveInfo(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &SlaveInfo{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestAttributeProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedAttribute(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Attribute{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestValueJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Value{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestResourceProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedResource(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Resource{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestValue_ScalarJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Scalar(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Value_Scalar{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestResourceProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedResource(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Resource{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestValue_RangeJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Range(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Value_Range{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestResourceStatisticsProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedResourceStatistics(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &ResourceStatistics{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestValue_RangesJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Ranges(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Value_Ranges{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestResourceStatisticsProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedResourceStatistics(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &ResourceStatistics{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestValue_SetJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Set(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Value_Set{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestResourceUsageProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedResourceUsage(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &ResourceUsage{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestValue_TextJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Text(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Value_Text{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestResourceUsageProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedResourceUsage(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &ResourceUsage{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestAttributeJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedAttribute(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Attribute{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestPerfStatisticsProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedPerfStatistics(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &PerfStatistics{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestResourceJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Resource{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestPerfStatisticsProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedPerfStatistics(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &PerfStatistics{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestResource_ReservationInfoJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_ReservationInfo(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Resource_ReservationInfo{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestRequestProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedRequest(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Request{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestResource_DiskInfoJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_DiskInfo(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Resource_DiskInfo{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestRequestProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedRequest(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Request{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestResource_DiskInfo_PersistenceJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_DiskInfo_Persistence(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Resource_DiskInfo_Persistence{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestOfferProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedOffer(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Offer{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestResource_RevocableInfoJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_RevocableInfo(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Resource_RevocableInfo{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestOfferProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedOffer(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Offer{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestTrafficControlStatisticsJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTrafficControlStatistics(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &TrafficControlStatistics{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestTaskInfoProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedTaskInfo(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &TaskInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestResourceStatisticsJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceStatistics(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &ResourceStatistics{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestTaskInfoProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedTaskInfo(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &TaskInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestResourceUsageJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceUsage(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &ResourceUsage{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestTaskStatusProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedTaskStatus(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &TaskStatus{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestResourceUsage_ExecutorJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceUsage_Executor(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &ResourceUsage_Executor{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestTaskStatusProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedTaskStatus(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &TaskStatus{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestPerfStatisticsJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPerfStatistics(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &PerfStatistics{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestFiltersProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedFilters(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Filters{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestRequestJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRequest(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Request{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestFiltersProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedFilters(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Filters{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestOfferJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Offer{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestEnvironmentProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedEnvironment(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Environment{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestOffer_OperationJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Offer_Operation{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestEnvironmentProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedEnvironment(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Environment{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestOffer_Operation_LaunchJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Launch(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Offer_Operation_Launch{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestEnvironment_VariableProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedEnvironment_Variable(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Environment_Variable{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestOffer_Operation_ReserveJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Reserve(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Offer_Operation_Reserve{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestEnvironment_VariableProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedEnvironment_Variable(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Environment_Variable{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestOffer_Operation_UnreserveJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Unreserve(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Offer_Operation_Unreserve{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestParameterProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedParameter(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Parameter{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestOffer_Operation_CreateJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Create(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Offer_Operation_Create{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestParameterProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedParameter(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Parameter{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestOffer_Operation_DestroyJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Destroy(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Offer_Operation_Destroy{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestParametersProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedParameters(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Parameters{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestTaskInfoJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskInfo(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &TaskInfo{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestParametersProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedParameters(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Parameters{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestTaskStatusJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskStatus(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &TaskStatus{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestCredentialProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedCredential(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Credential{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestFiltersJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFilters(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Filters{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestCredentialProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedCredential(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Credential{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestEnvironmentJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedEnvironment(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Environment{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestCredentialsProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedCredentials(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Credentials{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestEnvironment_VariableJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedEnvironment_Variable(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Environment_Variable{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestCredentialsProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedCredentials(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Credentials{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestParameterJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedParameter(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Parameter{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestACLProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedACL(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &ACL{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestParametersJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedParameters(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Parameters{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestACLProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedACL(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &ACL{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestCredentialJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCredential(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Credential{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestACL_EntityProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedACL_Entity(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &ACL_Entity{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestCredentialsJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCredentials(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Credentials{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestACL_EntityProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedACL_Entity(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &ACL_Entity{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestACLJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &ACL{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestACL_RegisterFrameworkProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedACL_RegisterFramework(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &ACL_RegisterFramework{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestACL_EntityJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_Entity(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &ACL_Entity{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestACL_RegisterFrameworkProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) +func TestACL_RegisterFrameworkJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedACL_RegisterFramework(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } msg := &ACL_RegisterFramework{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestACL_RunTaskProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) +func TestACL_RunTaskJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedACL_RunTask(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } msg := &ACL_RunTask{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestACL_RunTaskProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedACL_RunTask(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &ACL_RunTask{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestACL_ShutdownFrameworkJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_ShutdownFramework(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &ACL_ShutdownFramework{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestACL_ShutdownFrameworkProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedACL_ShutdownFramework(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &ACL_ShutdownFramework{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestACLsJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACLs(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &ACLs{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestACL_ShutdownFrameworkProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedACL_ShutdownFramework(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &ACL_ShutdownFramework{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestRateLimitJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRateLimit(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &RateLimit{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestACLsProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedACLs(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &ACLs{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestRateLimitsJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRateLimits(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &RateLimits{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestACLsProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedACLs(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &ACLs{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestVolumeJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedVolume(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Volume{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestRateLimitProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedRateLimit(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &RateLimit{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestContainerInfoJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &ContainerInfo{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestRateLimitProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedRateLimit(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &RateLimit{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestContainerInfo_DockerInfoJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo_DockerInfo(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &ContainerInfo_DockerInfo{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestRateLimitsProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedRateLimits(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &RateLimits{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestContainerInfo_DockerInfo_PortMappingJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &ContainerInfo_DockerInfo_PortMapping{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestRateLimitsProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedRateLimits(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &RateLimits{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestLabelsJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedLabels(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Labels{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestVolumeProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedVolume(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Volume{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestLabelJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedLabel(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Label{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestVolumeProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedVolume(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Volume{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestPortJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPort(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Port{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestContainerInfoProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedContainerInfo(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &ContainerInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestPortsJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPorts(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Ports{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestContainerInfoProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedContainerInfo(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &ContainerInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestDiscoveryInfoJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedDiscoveryInfo(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &DiscoveryInfo{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestContainerInfo_DockerInfoProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &ContainerInfo_DockerInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestFrameworkIDProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFrameworkID(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &FrameworkID{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestContainerInfo_DockerInfoProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &ContainerInfo_DockerInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestFrameworkIDProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFrameworkID(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &FrameworkID{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestContainerInfo_DockerInfo_PortMappingProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &ContainerInfo_DockerInfo_PortMapping{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestOfferIDProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOfferID(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &OfferID{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestContainerInfo_DockerInfo_PortMappingProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &ContainerInfo_DockerInfo_PortMapping{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestOfferIDProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOfferID(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &OfferID{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestFrameworkIDStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedFrameworkID(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) +func TestSlaveIDProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedSlaveID(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &SlaveID{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestOfferIDStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedOfferID(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestSlaveIDStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedSlaveID(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestTaskIDStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedTaskID(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + +func TestSlaveIDProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedSlaveID(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &SlaveID{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestExecutorIDStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedExecutorID(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestContainerIDStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedContainerID(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestFrameworkInfoStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedFrameworkInfo(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + +func TestTaskIDProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskID(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &TaskID{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestHealthCheckStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedHealthCheck(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestHealthCheck_HTTPStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedHealthCheck_HTTP(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestCommandInfoStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedCommandInfo(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + +func TestTaskIDProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskID(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &TaskID{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestCommandInfo_URIStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedCommandInfo_URI(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestCommandInfo_ContainerInfoStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedCommandInfo_ContainerInfo(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestExecutorInfoStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedExecutorInfo(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + +func TestExecutorIDProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedExecutorID(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &ExecutorID{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestMasterInfoStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedMasterInfo(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestSlaveInfoStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedSlaveInfo(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestValueStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedValue(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + +func TestExecutorIDProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedExecutorID(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &ExecutorID{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestValue_ScalarStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedValue_Scalar(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestValue_RangeStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedValue_Range(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestValue_RangesStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedValue_Ranges(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestValue_SetStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedValue_Set(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + +func TestContainerIDProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerID(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &ContainerID{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestValue_TextStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedValue_Text(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestAttributeStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedAttribute(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestResourceStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedResource(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + +func TestContainerIDProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerID(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &ContainerID{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestResourceStatisticsStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedResourceStatistics(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestResourceUsageStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedResourceUsage(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestPerfStatisticsStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedPerfStatistics(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + +func TestFrameworkInfoProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFrameworkInfo(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &FrameworkInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestRequestStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedRequest(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestOfferStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedOffer(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestTaskInfoStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedTaskInfo(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + +func TestFrameworkInfoProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFrameworkInfo(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &FrameworkInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestTaskStatusStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedTaskStatus(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestFiltersStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedFilters(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestEnvironmentStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedEnvironment(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + +func TestFrameworkInfo_CapabilityProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFrameworkInfo_Capability(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &FrameworkInfo_Capability{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestEnvironment_VariableStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedEnvironment_Variable(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestParameterStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedParameter(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestParametersStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedParameters(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + +func TestFrameworkInfo_CapabilityProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFrameworkInfo_Capability(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &FrameworkInfo_Capability{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestCredentialStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedCredential(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestCredentialsStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedCredentials(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestACLStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedACL(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + +func TestHealthCheckProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedHealthCheck(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &HealthCheck{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestACL_EntityStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedACL_Entity(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestACL_RegisterFrameworkStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedACL_RegisterFramework(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestACL_RunTaskStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedACL_RunTask(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + +func TestHealthCheckProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedHealthCheck(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &HealthCheck{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestACL_ShutdownFrameworkStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedACL_ShutdownFramework(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestACLsStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedACLs(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestRateLimitStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedRateLimit(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + +func TestHealthCheck_HTTPProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedHealthCheck_HTTP(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &HealthCheck_HTTP{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestRateLimitsStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedRateLimits(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestVolumeStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedVolume(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestContainerInfoStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedContainerInfo(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + +func TestHealthCheck_HTTPProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedHealthCheck_HTTP(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &HealthCheck_HTTP{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestContainerInfo_DockerInfoStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestContainerInfo_DockerInfo_PortMappingStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestFrameworkIDSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedFrameworkID(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + +func TestCommandInfoProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCommandInfo(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &CommandInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkFrameworkIDSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*FrameworkID, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedFrameworkID(popr, false) +func TestCommandInfoProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCommandInfo(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &CommandInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestOfferIDSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedOfferID(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) +func TestCommandInfo_URIProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCommandInfo_URI(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &CommandInfo_URI{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) - } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkOfferIDSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*OfferID, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedOfferID(popr, false) +func TestCommandInfo_URIProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCommandInfo_URI(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &CommandInfo_URI{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestSlaveIDSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedSlaveID(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestCommandInfo_ContainerInfoProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCommandInfo_ContainerInfo(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &CommandInfo_ContainerInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkSlaveIDSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*SlaveID, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedSlaveID(popr, false) +func TestCommandInfo_ContainerInfoProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCommandInfo_ContainerInfo(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &CommandInfo_ContainerInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestTaskIDSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedTaskID(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestExecutorInfoProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedExecutorInfo(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &ExecutorInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkTaskIDSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*TaskID, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedTaskID(popr, false) +func TestExecutorInfoProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedExecutorInfo(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &ExecutorInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestExecutorIDSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedExecutorID(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestMasterInfoProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedMasterInfo(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &MasterInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkExecutorIDSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*ExecutorID, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedExecutorID(popr, false) +func TestMasterInfoProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedMasterInfo(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &MasterInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestContainerIDSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedContainerID(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestSlaveInfoProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedSlaveInfo(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &SlaveInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkContainerIDSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*ContainerID, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedContainerID(popr, false) +func TestSlaveInfoProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedSlaveInfo(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &SlaveInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestFrameworkInfoSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedFrameworkInfo(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestValueProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Value{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkFrameworkInfoSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*FrameworkInfo, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedFrameworkInfo(popr, false) +func TestValueProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Value{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestHealthCheckSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedHealthCheck(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestValue_ScalarProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Scalar(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Value_Scalar{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkHealthCheckSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*HealthCheck, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedHealthCheck(popr, false) +func TestValue_ScalarProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Scalar(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Value_Scalar{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestHealthCheck_HTTPSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedHealthCheck_HTTP(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestValue_RangeProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Range(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Value_Range{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkHealthCheck_HTTPSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*HealthCheck_HTTP, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedHealthCheck_HTTP(popr, false) +func TestValue_RangeProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Range(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Value_Range{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestCommandInfoSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedCommandInfo(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestValue_RangesProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Ranges(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Value_Ranges{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkCommandInfoSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*CommandInfo, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedCommandInfo(popr, false) +func TestValue_RangesProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Ranges(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Value_Ranges{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestCommandInfo_URISize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedCommandInfo_URI(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestValue_SetProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Set(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Value_Set{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkCommandInfo_URISize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*CommandInfo_URI, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedCommandInfo_URI(popr, false) +func TestValue_SetProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Set(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Value_Set{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestCommandInfo_ContainerInfoSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedCommandInfo_ContainerInfo(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestValue_TextProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Text(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Value_Text{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkCommandInfo_ContainerInfoSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*CommandInfo_ContainerInfo, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedCommandInfo_ContainerInfo(popr, false) +func TestValue_TextProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Text(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Value_Text{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestExecutorInfoSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedExecutorInfo(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestAttributeProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedAttribute(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Attribute{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkExecutorInfoSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*ExecutorInfo, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedExecutorInfo(popr, false) +func TestAttributeProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedAttribute(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Attribute{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestMasterInfoSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedMasterInfo(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestResourceProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Resource{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkMasterInfoSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*MasterInfo, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedMasterInfo(popr, false) +func TestResourceProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Resource{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestSlaveInfoSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedSlaveInfo(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) +func TestResource_ReservationInfoProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_ReservationInfo(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Resource_ReservationInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) - } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkSlaveInfoSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*SlaveInfo, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedSlaveInfo(popr, false) +func TestResource_ReservationInfoProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_ReservationInfo(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Resource_ReservationInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestValueSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedValue(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestResource_DiskInfoProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_DiskInfo(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Resource_DiskInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkValueSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Value, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedValue(popr, false) +func TestResource_DiskInfoProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_DiskInfo(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Resource_DiskInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestValue_ScalarSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedValue_Scalar(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestResource_DiskInfo_PersistenceProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_DiskInfo_Persistence(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Resource_DiskInfo_Persistence{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkValue_ScalarSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Value_Scalar, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedValue_Scalar(popr, false) +func TestResource_DiskInfo_PersistenceProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_DiskInfo_Persistence(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Resource_DiskInfo_Persistence{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestValue_RangeSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedValue_Range(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestResource_RevocableInfoProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_RevocableInfo(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Resource_RevocableInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkValue_RangeSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Value_Range, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedValue_Range(popr, false) +func TestResource_RevocableInfoProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_RevocableInfo(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Resource_RevocableInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestValue_RangesSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedValue_Ranges(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) +func TestTrafficControlStatisticsProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTrafficControlStatistics(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &TrafficControlStatistics{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) - } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkValue_RangesSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Value_Ranges, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedValue_Ranges(popr, false) +func TestTrafficControlStatisticsProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTrafficControlStatistics(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &TrafficControlStatistics{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestValue_SetSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedValue_Set(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestResourceStatisticsProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceStatistics(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &ResourceStatistics{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkValue_SetSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Value_Set, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedValue_Set(popr, false) +func TestResourceStatisticsProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceStatistics(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &ResourceStatistics{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestValue_TextSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedValue_Text(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestResourceUsageProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceUsage(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &ResourceUsage{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkValue_TextSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Value_Text, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedValue_Text(popr, false) +func TestResourceUsageProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceUsage(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &ResourceUsage{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestAttributeSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedAttribute(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestResourceUsage_ExecutorProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceUsage_Executor(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &ResourceUsage_Executor{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkAttributeSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Attribute, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedAttribute(popr, false) +func TestResourceUsage_ExecutorProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceUsage_Executor(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &ResourceUsage_Executor{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestResourceSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedResource(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestPerfStatisticsProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPerfStatistics(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &PerfStatistics{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkResourceSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Resource, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedResource(popr, false) +func TestPerfStatisticsProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPerfStatistics(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &PerfStatistics{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestResourceStatisticsSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedResourceStatistics(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestRequestProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRequest(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Request{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkResourceStatisticsSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*ResourceStatistics, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedResourceStatistics(popr, false) +func TestRequestProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRequest(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Request{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestResourceUsageSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedResourceUsage(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestOfferProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Offer{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkResourceUsageSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*ResourceUsage, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedResourceUsage(popr, false) +func TestOfferProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Offer{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestPerfStatisticsSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedPerfStatistics(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestOffer_OperationProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Offer_Operation{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkPerfStatisticsSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*PerfStatistics, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedPerfStatistics(popr, false) +func TestOffer_OperationProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Offer_Operation{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestRequestSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedRequest(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) +func TestOffer_Operation_LaunchProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Launch(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Offer_Operation_Launch{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) - } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkRequestSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Request, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedRequest(popr, false) +func TestOffer_Operation_LaunchProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Launch(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Offer_Operation_Launch{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestOfferSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedOffer(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestOffer_Operation_ReserveProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Reserve(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Offer_Operation_Reserve{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkOfferSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Offer, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedOffer(popr, false) +func TestOffer_Operation_ReserveProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Reserve(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Offer_Operation_Reserve{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestTaskInfoSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedTaskInfo(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestOffer_Operation_UnreserveProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Unreserve(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Offer_Operation_Unreserve{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkTaskInfoSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*TaskInfo, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedTaskInfo(popr, false) +func TestOffer_Operation_UnreserveProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Unreserve(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Offer_Operation_Unreserve{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestTaskStatusSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedTaskStatus(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestOffer_Operation_CreateProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Create(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Offer_Operation_Create{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkTaskStatusSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*TaskStatus, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedTaskStatus(popr, false) +func TestOffer_Operation_CreateProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Create(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Offer_Operation_Create{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestFiltersSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedFilters(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) +func TestOffer_Operation_DestroyProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Destroy(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Offer_Operation_Destroy{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) - } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkFiltersSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Filters, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedFilters(popr, false) +func TestOffer_Operation_DestroyProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Destroy(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Offer_Operation_Destroy{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestEnvironmentSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedEnvironment(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestTaskInfoProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskInfo(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &TaskInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkEnvironmentSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Environment, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedEnvironment(popr, false) +func TestTaskInfoProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskInfo(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &TaskInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestEnvironment_VariableSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedEnvironment_Variable(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestTaskStatusProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskStatus(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &TaskStatus{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkEnvironment_VariableSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Environment_Variable, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedEnvironment_Variable(popr, false) +func TestTaskStatusProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskStatus(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &TaskStatus{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestParameterSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedParameter(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestFiltersProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFilters(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Filters{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkParameterSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Parameter, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedParameter(popr, false) +func TestFiltersProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFilters(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Filters{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - b.SetBytes(int64(total / b.N)) -} - -func TestParametersSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedParameters(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +} + +func TestEnvironmentProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedEnvironment(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Environment{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkParametersSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Parameters, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedParameters(popr, false) +func TestEnvironmentProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedEnvironment(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Environment{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestCredentialSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedCredential(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestEnvironment_VariableProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedEnvironment_Variable(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Environment_Variable{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkCredentialSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Credential, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedCredential(popr, false) +func TestEnvironment_VariableProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedEnvironment_Variable(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Environment_Variable{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestCredentialsSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedCredentials(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestParameterProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedParameter(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Parameter{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkCredentialsSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Credentials, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedCredentials(popr, false) +func TestParameterProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedParameter(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Parameter{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestACLSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedACL(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestParametersProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedParameters(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Parameters{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkACLSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*ACL, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedACL(popr, false) +func TestParametersProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedParameters(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Parameters{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestACL_EntitySize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedACL_Entity(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestCredentialProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCredential(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Credential{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkACL_EntitySize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*ACL_Entity, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedACL_Entity(popr, false) +func TestCredentialProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCredential(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Credential{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestACL_RegisterFrameworkSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedACL_RegisterFramework(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestCredentialsProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCredentials(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Credentials{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkACL_RegisterFrameworkSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*ACL_RegisterFramework, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedACL_RegisterFramework(popr, false) +func TestCredentialsProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCredentials(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Credentials{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestACL_RunTaskSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedACL_RunTask(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestACLProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &ACL{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkACL_RunTaskSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*ACL_RunTask, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedACL_RunTask(popr, false) +func TestACLProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &ACL{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestACL_ShutdownFrameworkSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedACL_ShutdownFramework(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestACL_EntityProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_Entity(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &ACL_Entity{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkACL_ShutdownFrameworkSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*ACL_ShutdownFramework, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedACL_ShutdownFramework(popr, false) +func TestACL_EntityProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_Entity(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &ACL_Entity{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestACLsSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedACLs(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestACL_RegisterFrameworkProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_RegisterFramework(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &ACL_RegisterFramework{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkACLsSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*ACLs, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedACLs(popr, false) +func TestACL_RegisterFrameworkProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_RegisterFramework(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &ACL_RegisterFramework{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestRateLimitSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedRateLimit(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestACL_RunTaskProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_RunTask(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &ACL_RunTask{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkRateLimitSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*RateLimit, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedRateLimit(popr, false) +func TestACL_RunTaskProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_RunTask(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &ACL_RunTask{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestRateLimitsSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedRateLimits(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestACL_ShutdownFrameworkProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_ShutdownFramework(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &ACL_ShutdownFramework{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkRateLimitsSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*RateLimits, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedRateLimits(popr, false) +func TestACL_ShutdownFrameworkProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_ShutdownFramework(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &ACL_ShutdownFramework{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestVolumeSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedVolume(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestACLsProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACLs(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &ACLs{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkVolumeSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Volume, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedVolume(popr, false) +func TestACLsProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACLs(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &ACLs{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestContainerInfoSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedContainerInfo(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestRateLimitProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRateLimit(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &RateLimit{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkContainerInfoSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*ContainerInfo, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedContainerInfo(popr, false) +func TestRateLimitProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRateLimit(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &RateLimit{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestContainerInfo_DockerInfoSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestRateLimitsProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRateLimits(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &RateLimits{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkContainerInfo_DockerInfoSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*ContainerInfo_DockerInfo, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedContainerInfo_DockerInfo(popr, false) +func TestRateLimitsProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRateLimits(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &RateLimits{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestContainerInfo_DockerInfo_PortMappingSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestVolumeProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedVolume(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Volume{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkContainerInfo_DockerInfo_PortMappingSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*ContainerInfo_DockerInfo_PortMapping, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false) +func TestVolumeProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedVolume(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Volume{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestFrameworkIDGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedFrameworkID(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) +func TestContainerInfoProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &ContainerInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestOfferIDGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedOfferID(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + +func TestContainerInfoProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &ContainerInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestSlaveIDGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedSlaveID(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + +func TestContainerInfo_DockerInfoProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo_DockerInfo(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &ContainerInfo_DockerInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestTaskIDGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedTaskID(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + +func TestContainerInfo_DockerInfoProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo_DockerInfo(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &ContainerInfo_DockerInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestExecutorIDGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedExecutorID(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + +func TestContainerInfo_DockerInfo_PortMappingProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &ContainerInfo_DockerInfo_PortMapping{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestContainerIDGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedContainerID(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + +func TestContainerInfo_DockerInfo_PortMappingProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &ContainerInfo_DockerInfo_PortMapping{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestFrameworkInfoGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedFrameworkInfo(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + +func TestLabelsProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedLabels(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Labels{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestHealthCheckGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedHealthCheck(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + +func TestLabelsProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedLabels(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Labels{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestHealthCheck_HTTPGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedHealthCheck_HTTP(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + +func TestLabelProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedLabel(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Label{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestCommandInfoGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedCommandInfo(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + +func TestLabelProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedLabel(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Label{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestCommandInfo_URIGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedCommandInfo_URI(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + +func TestPortProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPort(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Port{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestCommandInfo_ContainerInfoGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedCommandInfo_ContainerInfo(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + +func TestPortProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPort(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Port{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestExecutorInfoGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedExecutorInfo(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + +func TestPortsProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPorts(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Ports{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestMasterInfoGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedMasterInfo(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + +func TestPortsProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPorts(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Ports{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestSlaveInfoGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedSlaveInfo(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + +func TestDiscoveryInfoProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedDiscoveryInfo(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &DiscoveryInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestValueGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedValue(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + +func TestDiscoveryInfoProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedDiscoveryInfo(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &DiscoveryInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestValue_ScalarGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedValue_Scalar(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - _, err := go_parser.ParseExpr(s1) +} + +func TestFrameworkIDVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedFrameworkID(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } -} -func TestValue_RangeGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedValue_Range(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { + msg := &FrameworkID{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } -} -func TestValue_RangesGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedValue_Ranges(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } - _, err := go_parser.ParseExpr(s1) +} +func TestOfferIDVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOfferID(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } -} -func TestValue_SetGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedValue_Set(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { + msg := &OfferID{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } -} -func TestValue_TextGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedValue_Text(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } - _, err := go_parser.ParseExpr(s1) +} +func TestSlaveIDVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedSlaveID(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } -} -func TestAttributeGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedAttribute(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { + msg := &SlaveID{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } -} -func TestResourceGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedResource(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } - _, err := go_parser.ParseExpr(s1) +} +func TestTaskIDVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedTaskID(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } -} -func TestResourceStatisticsGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedResourceStatistics(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { + msg := &TaskID{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } -} -func TestResourceUsageGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedResourceUsage(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } - _, err := go_parser.ParseExpr(s1) +} +func TestExecutorIDVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedExecutorID(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } -} -func TestPerfStatisticsGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedPerfStatistics(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { + msg := &ExecutorID{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } -} -func TestRequestGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedRequest(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } - _, err := go_parser.ParseExpr(s1) +} +func TestContainerIDVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedContainerID(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } -} -func TestOfferGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedOffer(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { + msg := &ContainerID{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } -} -func TestTaskInfoGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedTaskInfo(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } - _, err := go_parser.ParseExpr(s1) +} +func TestFrameworkInfoVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedFrameworkInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } -} -func TestTaskStatusGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedTaskStatus(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { + msg := &FrameworkInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } -} -func TestFiltersGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedFilters(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } - _, err := go_parser.ParseExpr(s1) +} +func TestFrameworkInfo_CapabilityVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedFrameworkInfo_Capability(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } -} -func TestEnvironmentGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedEnvironment(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { + msg := &FrameworkInfo_Capability{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } -} -func TestEnvironment_VariableGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedEnvironment_Variable(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } - _, err := go_parser.ParseExpr(s1) +} +func TestHealthCheckVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedHealthCheck(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } -} -func TestParameterGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedParameter(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + msg := &HealthCheck{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) } - _, err := go_parser.ParseExpr(s1) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestHealthCheck_HTTPVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedHealthCheck_HTTP(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } -} -func TestParametersGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedParameters(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { + msg := &HealthCheck_HTTP{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } -} -func TestCredentialGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedCredential(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestCredentialsGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedCredentials(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) +func TestCommandInfoVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedCommandInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } -} -func TestACLGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedACL(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { + msg := &CommandInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } -} -func TestACL_EntityGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedACL_Entity(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestACL_RegisterFrameworkGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedACL_RegisterFramework(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) +func TestCommandInfo_URIVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedCommandInfo_URI(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } -} -func TestACL_RunTaskGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedACL_RunTask(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { + msg := &CommandInfo_URI{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } -} -func TestACL_ShutdownFrameworkGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedACL_ShutdownFramework(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestACLsGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedACLs(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) +func TestCommandInfo_ContainerInfoVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedCommandInfo_ContainerInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } -} -func TestRateLimitGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedRateLimit(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { + msg := &CommandInfo_ContainerInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } -} -func TestRateLimitsGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedRateLimits(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestVolumeGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedVolume(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) +func TestExecutorInfoVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedExecutorInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } -} -func TestContainerInfoGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedContainerInfo(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { + msg := &ExecutorInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } -} -func TestContainerInfo_DockerInfoGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } - _, err := go_parser.ParseExpr(s1) +} +func TestMasterInfoVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedMasterInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } -} -func TestContainerInfo_DockerInfo_PortMappingGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { + msg := &MasterInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } } -func TestFrameworkIDVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedFrameworkID(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestSlaveInfoVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedSlaveInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &FrameworkID{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &SlaveInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestOfferIDVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedOfferID(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestValueVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &OfferID{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Value{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestSlaveIDVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedSlaveID(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestValue_ScalarVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue_Scalar(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &SlaveID{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Value_Scalar{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestTaskIDVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedTaskID(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestValue_RangeVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue_Range(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &TaskID{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Value_Range{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestExecutorIDVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedExecutorID(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestValue_RangesVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue_Ranges(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &ExecutorID{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Value_Ranges{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestContainerIDVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedContainerID(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestValue_SetVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue_Set(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &ContainerID{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Value_Set{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestFrameworkInfoVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedFrameworkInfo(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestValue_TextVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue_Text(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &FrameworkInfo{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Value_Text{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestHealthCheckVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedHealthCheck(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestAttributeVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedAttribute(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &HealthCheck{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Attribute{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestHealthCheck_HTTPVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedHealthCheck_HTTP(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestResourceVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResource(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &HealthCheck_HTTP{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Resource{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestCommandInfoVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedCommandInfo(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestResource_ReservationInfoVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResource_ReservationInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &CommandInfo{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Resource_ReservationInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestCommandInfo_URIVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedCommandInfo_URI(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestResource_DiskInfoVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResource_DiskInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &CommandInfo_URI{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Resource_DiskInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestCommandInfo_ContainerInfoVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedCommandInfo_ContainerInfo(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestResource_DiskInfo_PersistenceVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResource_DiskInfo_Persistence(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &CommandInfo_ContainerInfo{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Resource_DiskInfo_Persistence{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestExecutorInfoVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedExecutorInfo(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestResource_RevocableInfoVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResource_RevocableInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &ExecutorInfo{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Resource_RevocableInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestMasterInfoVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedMasterInfo(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestTrafficControlStatisticsVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedTrafficControlStatistics(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &MasterInfo{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &TrafficControlStatistics{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestSlaveInfoVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedSlaveInfo(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestResourceStatisticsVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResourceStatistics(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &SlaveInfo{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &ResourceStatistics{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestValueVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedValue(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestResourceUsageVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResourceUsage(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &Value{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &ResourceUsage{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestValue_ScalarVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedValue_Scalar(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { +func TestResourceUsage_ExecutorVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResourceUsage_Executor(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { panic(err) } - msg := &Value_Scalar{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &ResourceUsage_Executor{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestValue_RangeVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedValue_Range(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestPerfStatisticsVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedPerfStatistics(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &Value_Range{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &PerfStatistics{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestValue_RangesVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedValue_Ranges(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestRequestVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedRequest(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &Value_Ranges{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Request{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestValue_SetVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedValue_Set(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestOfferVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &Value_Set{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Offer{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestValue_TextVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedValue_Text(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestOffer_OperationVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &Value_Text{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Offer_Operation{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestAttributeVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedAttribute(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestOffer_Operation_LaunchVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation_Launch(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &Attribute{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Offer_Operation_Launch{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestResourceVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedResource(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestOffer_Operation_ReserveVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation_Reserve(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &Resource{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Offer_Operation_Reserve{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestResourceStatisticsVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedResourceStatistics(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestOffer_Operation_UnreserveVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation_Unreserve(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &ResourceStatistics{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Offer_Operation_Unreserve{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestResourceUsageVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedResourceUsage(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestOffer_Operation_CreateVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation_Create(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &ResourceUsage{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Offer_Operation_Create{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestPerfStatisticsVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedPerfStatistics(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestOffer_Operation_DestroyVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation_Destroy(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &PerfStatistics{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Offer_Operation_Destroy{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestRequestVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedRequest(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestTaskInfoVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedTaskInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &Request{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &TaskInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestOfferVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedOffer(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestTaskStatusVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedTaskStatus(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &Offer{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &TaskStatus{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestTaskInfoVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedTaskInfo(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestFiltersVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedFilters(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &TaskInfo{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Filters{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestTaskStatusVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedTaskStatus(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestEnvironmentVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedEnvironment(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &TaskStatus{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Environment{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestFiltersVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedFilters(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestEnvironment_VariableVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedEnvironment_Variable(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &Filters{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Environment_Variable{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestEnvironmentVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedEnvironment(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestParameterVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedParameter(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &Environment{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Parameter{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestParametersVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedParameters(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Parameters{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestCredentialVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedCredential(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Credential{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestCredentialsVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedCredentials(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Credentials{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestACLVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedACL(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &ACL{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestACL_EntityVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedACL_Entity(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &ACL_Entity{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestACL_RegisterFrameworkVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedACL_RegisterFramework(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &ACL_RegisterFramework{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestACL_RunTaskVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedACL_RunTask(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &ACL_RunTask{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestACL_ShutdownFrameworkVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedACL_ShutdownFramework(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &ACL_ShutdownFramework{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestACLsVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedACLs(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &ACLs{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestEnvironment_VariableVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestRateLimitVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedRateLimit(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &RateLimit{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestRateLimitsVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedRateLimits(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &RateLimits{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestVolumeVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedVolume(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Volume{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestContainerInfoVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedContainerInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &ContainerInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestContainerInfo_DockerInfoVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedContainerInfo_DockerInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &ContainerInfo_DockerInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestContainerInfo_DockerInfo_PortMappingVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &ContainerInfo_DockerInfo_PortMapping{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestLabelsVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedLabels(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Labels{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestLabelVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedLabel(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Label{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestPortVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedPort(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Port{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestPortsVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedPorts(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Ports{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestDiscoveryInfoVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedDiscoveryInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &DiscoveryInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestFrameworkIDGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedFrameworkID(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestOfferIDGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOfferID(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestSlaveIDGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedSlaveID(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestTaskIDGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedTaskID(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestExecutorIDGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedExecutorID(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestContainerIDGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedContainerID(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestFrameworkInfoGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedFrameworkInfo(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestFrameworkInfo_CapabilityGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedFrameworkInfo_Capability(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestHealthCheckGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedHealthCheck(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestHealthCheck_HTTPGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedHealthCheck_HTTP(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestCommandInfoGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedCommandInfo(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestCommandInfo_URIGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedCommandInfo_URI(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestCommandInfo_ContainerInfoGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedCommandInfo_ContainerInfo(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestExecutorInfoGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedExecutorInfo(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestMasterInfoGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedMasterInfo(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestSlaveInfoGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedSlaveInfo(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestValueGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestValue_ScalarGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue_Scalar(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestValue_RangeGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue_Range(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestValue_RangesGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue_Ranges(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestValue_SetGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue_Set(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestValue_TextGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue_Text(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestAttributeGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedAttribute(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestResourceGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResource(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestResource_ReservationInfoGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResource_ReservationInfo(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestResource_DiskInfoGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResource_DiskInfo(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestResource_DiskInfo_PersistenceGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResource_DiskInfo_Persistence(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestResource_RevocableInfoGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResource_RevocableInfo(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestTrafficControlStatisticsGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedTrafficControlStatistics(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestResourceStatisticsGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResourceStatistics(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestResourceUsageGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResourceUsage(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestResourceUsage_ExecutorGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResourceUsage_Executor(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestPerfStatisticsGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedPerfStatistics(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestRequestGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedRequest(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestOfferGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestOffer_OperationGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestOffer_Operation_LaunchGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation_Launch(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestOffer_Operation_ReserveGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation_Reserve(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestOffer_Operation_UnreserveGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation_Unreserve(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestOffer_Operation_CreateGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation_Create(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestOffer_Operation_DestroyGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation_Destroy(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestTaskInfoGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedTaskInfo(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestTaskStatusGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedTaskStatus(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestFiltersGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedFilters(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestEnvironmentGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedEnvironment(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestEnvironment_VariableGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedEnvironment_Variable(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestParameterGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedParameter(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestParametersGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedParameters(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestCredentialGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedCredential(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestCredentialsGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedCredentials(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestACLGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedACL(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestACL_EntityGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedACL_Entity(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestACL_RegisterFrameworkGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedACL_RegisterFramework(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestACL_RunTaskGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedACL_RunTask(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestACL_ShutdownFrameworkGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedACL_ShutdownFramework(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestACLsGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedACLs(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestRateLimitGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedRateLimit(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestRateLimitsGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedRateLimits(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestVolumeGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedVolume(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestContainerInfoGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedContainerInfo(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestContainerInfo_DockerInfoGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedContainerInfo_DockerInfo(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestContainerInfo_DockerInfo_PortMappingGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestLabelsGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedLabels(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestLabelGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedLabel(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestPortGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedPort(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestPortsGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedPorts(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestDiscoveryInfoGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedDiscoveryInfo(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestFrameworkIDSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFrameworkID(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkFrameworkIDSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*FrameworkID, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedFrameworkID(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestOfferIDSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOfferID(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkOfferIDSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*OfferID, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedOfferID(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestSlaveIDSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedSlaveID(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkSlaveIDSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*SlaveID, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedSlaveID(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestTaskIDSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskID(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkTaskIDSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*TaskID, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedTaskID(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestExecutorIDSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedExecutorID(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkExecutorIDSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ExecutorID, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedExecutorID(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestContainerIDSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerID(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkContainerIDSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ContainerID, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedContainerID(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestFrameworkInfoSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFrameworkInfo(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkFrameworkInfoSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*FrameworkInfo, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedFrameworkInfo(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestFrameworkInfo_CapabilitySize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFrameworkInfo_Capability(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkFrameworkInfo_CapabilitySize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*FrameworkInfo_Capability, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedFrameworkInfo_Capability(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestHealthCheckSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedHealthCheck(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkHealthCheckSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*HealthCheck, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedHealthCheck(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestHealthCheck_HTTPSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedHealthCheck_HTTP(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkHealthCheck_HTTPSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*HealthCheck_HTTP, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedHealthCheck_HTTP(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestCommandInfoSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCommandInfo(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkCommandInfoSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*CommandInfo, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedCommandInfo(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestCommandInfo_URISize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCommandInfo_URI(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkCommandInfo_URISize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*CommandInfo_URI, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedCommandInfo_URI(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestCommandInfo_ContainerInfoSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCommandInfo_ContainerInfo(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkCommandInfo_ContainerInfoSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*CommandInfo_ContainerInfo, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedCommandInfo_ContainerInfo(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestExecutorInfoSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedExecutorInfo(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkExecutorInfoSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ExecutorInfo, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedExecutorInfo(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestMasterInfoSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedMasterInfo(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkMasterInfoSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*MasterInfo, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedMasterInfo(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestSlaveInfoSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedSlaveInfo(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkSlaveInfoSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*SlaveInfo, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedSlaveInfo(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestValueSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkValueSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Value, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedValue(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestValue_ScalarSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Scalar(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkValue_ScalarSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Value_Scalar, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedValue_Scalar(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestValue_RangeSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Range(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkValue_RangeSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Value_Range, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedValue_Range(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestValue_RangesSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Ranges(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkValue_RangesSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Value_Ranges, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedValue_Ranges(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestValue_SetSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Set(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkValue_SetSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Value_Set, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedValue_Set(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestValue_TextSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Text(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkValue_TextSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Value_Text, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedValue_Text(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestAttributeSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedAttribute(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkAttributeSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Attribute, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedAttribute(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestResourceSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkResourceSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Resource, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedResource(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestResource_ReservationInfoSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_ReservationInfo(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkResource_ReservationInfoSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Resource_ReservationInfo, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedResource_ReservationInfo(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestResource_DiskInfoSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_DiskInfo(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkResource_DiskInfoSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Resource_DiskInfo, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedResource_DiskInfo(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestResource_DiskInfo_PersistenceSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_DiskInfo_Persistence(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkResource_DiskInfo_PersistenceSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Resource_DiskInfo_Persistence, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedResource_DiskInfo_Persistence(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestResource_RevocableInfoSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_RevocableInfo(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkResource_RevocableInfoSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Resource_RevocableInfo, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedResource_RevocableInfo(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestTrafficControlStatisticsSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTrafficControlStatistics(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkTrafficControlStatisticsSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*TrafficControlStatistics, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedTrafficControlStatistics(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestResourceStatisticsSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceStatistics(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkResourceStatisticsSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ResourceStatistics, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedResourceStatistics(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestResourceUsageSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceUsage(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkResourceUsageSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ResourceUsage, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedResourceUsage(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestResourceUsage_ExecutorSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceUsage_Executor(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkResourceUsage_ExecutorSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ResourceUsage_Executor, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedResourceUsage_Executor(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestPerfStatisticsSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPerfStatistics(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkPerfStatisticsSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*PerfStatistics, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedPerfStatistics(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestRequestSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRequest(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkRequestSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Request, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedRequest(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestOfferSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkOfferSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Offer, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedOffer(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestOffer_OperationSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkOffer_OperationSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Offer_Operation, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedOffer_Operation(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestOffer_Operation_LaunchSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Launch(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkOffer_Operation_LaunchSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Offer_Operation_Launch, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedOffer_Operation_Launch(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestOffer_Operation_ReserveSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Reserve(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkOffer_Operation_ReserveSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Offer_Operation_Reserve, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedOffer_Operation_Reserve(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestOffer_Operation_UnreserveSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Unreserve(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkOffer_Operation_UnreserveSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Offer_Operation_Unreserve, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedOffer_Operation_Unreserve(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestOffer_Operation_CreateSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Create(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkOffer_Operation_CreateSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Offer_Operation_Create, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedOffer_Operation_Create(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestOffer_Operation_DestroySize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Destroy(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkOffer_Operation_DestroySize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Offer_Operation_Destroy, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedOffer_Operation_Destroy(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestTaskInfoSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskInfo(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkTaskInfoSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*TaskInfo, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedTaskInfo(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestTaskStatusSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskStatus(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkTaskStatusSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*TaskStatus, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedTaskStatus(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestFiltersSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFilters(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkFiltersSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Filters, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedFilters(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestEnvironmentSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedEnvironment(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkEnvironmentSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Environment, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedEnvironment(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestEnvironment_VariableSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedEnvironment_Variable(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkEnvironment_VariableSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Environment_Variable, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedEnvironment_Variable(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestParameterSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedParameter(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkParameterSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Parameter, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedParameter(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestParametersSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedParameters(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkParametersSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Parameters, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedParameters(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestCredentialSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCredential(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkCredentialSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Credential, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedCredential(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestCredentialsSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCredentials(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkCredentialsSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Credentials, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedCredentials(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestACLSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkACLSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ACL, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedACL(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestACL_EntitySize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_Entity(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkACL_EntitySize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ACL_Entity, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedACL_Entity(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestACL_RegisterFrameworkSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_RegisterFramework(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkACL_RegisterFrameworkSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ACL_RegisterFramework, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedACL_RegisterFramework(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestACL_RunTaskSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_RunTask(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkACL_RunTaskSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ACL_RunTask, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedACL_RunTask(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestACL_ShutdownFrameworkSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_ShutdownFramework(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkACL_ShutdownFrameworkSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ACL_ShutdownFramework, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedACL_ShutdownFramework(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestACLsSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACLs(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkACLsSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ACLs, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedACLs(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestRateLimitSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRateLimit(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkRateLimitSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*RateLimit, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedRateLimit(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestRateLimitsSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRateLimits(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkRateLimitsSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*RateLimits, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedRateLimits(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestVolumeSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedVolume(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkVolumeSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Volume, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedVolume(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestContainerInfoSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkContainerInfoSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ContainerInfo, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedContainerInfo(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestContainerInfo_DockerInfoSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo_DockerInfo(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkContainerInfo_DockerInfoSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ContainerInfo_DockerInfo, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedContainerInfo_DockerInfo(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestContainerInfo_DockerInfo_PortMappingSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkContainerInfo_DockerInfo_PortMappingSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ContainerInfo_DockerInfo_PortMapping, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestLabelsSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedLabels(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkLabelsSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Labels, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedLabels(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestLabelSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedLabel(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkLabelSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Label, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedLabel(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestPortSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPort(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkPortSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Port, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedPort(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestPortsSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPorts(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkPortsSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Ports, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedPorts(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestDiscoveryInfoSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedDiscoveryInfo(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkDiscoveryInfoSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*DiscoveryInfo, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedDiscoveryInfo(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestFrameworkIDStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedFrameworkID(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestOfferIDStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOfferID(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestSlaveIDStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedSlaveID(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestTaskIDStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedTaskID(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestExecutorIDStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedExecutorID(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestContainerIDStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedContainerID(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestFrameworkInfoStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedFrameworkInfo(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestFrameworkInfo_CapabilityStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedFrameworkInfo_Capability(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestHealthCheckStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedHealthCheck(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestHealthCheck_HTTPStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedHealthCheck_HTTP(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestCommandInfoStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedCommandInfo(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestCommandInfo_URIStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedCommandInfo_URI(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestCommandInfo_ContainerInfoStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedCommandInfo_ContainerInfo(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestExecutorInfoStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedExecutorInfo(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestMasterInfoStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedMasterInfo(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestSlaveInfoStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedSlaveInfo(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestValueStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestValue_ScalarStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue_Scalar(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestValue_RangeStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue_Range(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestValue_RangesStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue_Ranges(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestValue_SetStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue_Set(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestValue_TextStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue_Text(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestAttributeStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedAttribute(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestResourceStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResource(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestResource_ReservationInfoStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResource_ReservationInfo(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestResource_DiskInfoStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResource_DiskInfo(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestResource_DiskInfo_PersistenceStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResource_DiskInfo_Persistence(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestResource_RevocableInfoStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResource_RevocableInfo(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestTrafficControlStatisticsStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedTrafficControlStatistics(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestResourceStatisticsStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResourceStatistics(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestResourceUsageStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResourceUsage(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestResourceUsage_ExecutorStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResourceUsage_Executor(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestPerfStatisticsStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedPerfStatistics(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestRequestStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedRequest(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestOfferStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestOffer_OperationStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestOffer_Operation_LaunchStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation_Launch(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestOffer_Operation_ReserveStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation_Reserve(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestOffer_Operation_UnreserveStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation_Unreserve(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestOffer_Operation_CreateStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation_Create(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestOffer_Operation_DestroyStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation_Destroy(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestTaskInfoStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedTaskInfo(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestTaskStatusStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedTaskStatus(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestFiltersStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedFilters(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestEnvironmentStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedEnvironment(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestEnvironment_VariableStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedEnvironment_Variable(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) - } - msg := &Environment_Variable{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestParameterVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestParameterStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedParameter(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) - } - msg := &Parameter{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestParametersVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestParametersStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedParameters(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) - } - msg := &Parameters{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestCredentialVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestCredentialStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedCredential(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) - } - msg := &Credential{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestCredentialsVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestCredentialsStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedCredentials(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) - } - msg := &Credentials{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestACLVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestACLStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedACL(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) - } - msg := &ACL{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestACL_EntityVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestACL_EntityStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedACL_Entity(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) - } - msg := &ACL_Entity{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestACL_RegisterFrameworkVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestACL_RegisterFrameworkStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedACL_RegisterFramework(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) - } - msg := &ACL_RegisterFramework{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestACL_RunTaskVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestACL_RunTaskStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedACL_RunTask(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) - } - msg := &ACL_RunTask{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestACL_ShutdownFrameworkVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestACL_ShutdownFrameworkStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedACL_ShutdownFramework(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) - } - msg := &ACL_ShutdownFramework{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestACLsVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestACLsStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedACLs(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) - } - msg := &ACLs{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestRateLimitVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestRateLimitStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedRateLimit(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) - } - msg := &RateLimit{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestRateLimitsVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestRateLimitsStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedRateLimits(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) - } - msg := &RateLimits{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestVolumeVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestVolumeStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedVolume(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) - } - msg := &Volume{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestContainerInfoVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestContainerInfoStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedContainerInfo(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) - } - msg := &ContainerInfo{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestContainerInfo_DockerInfoVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestContainerInfo_DockerInfoStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedContainerInfo_DockerInfo(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } - msg := &ContainerInfo_DockerInfo{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) +} +func TestContainerInfo_DockerInfo_PortMappingStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) +} +func TestLabelsStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedLabels(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestContainerInfo_DockerInfo_PortMappingVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) +func TestLabelStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedLabel(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } - msg := &ContainerInfo_DockerInfo_PortMapping{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) +} +func TestPortStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedPort(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) +} +func TestPortsStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedPorts(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestDiscoveryInfoStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedDiscoveryInfo(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/messages.pb.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/messages.pb.go index 72d1ef70f2a02..7b62a9524f113 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/messages.pb.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/messages.pb.go @@ -5,12 +5,14 @@ package mesosproto import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" import math "math" -// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto/gogo.pb" +// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal +var _ = fmt.Errorf var _ = math.Inf type StatusUpdateRecord_Type int32 @@ -71,7 +73,13 @@ type Task struct { // NOTE: Either both the fields must be set or both must be unset. StatusUpdateState *TaskState `protobuf:"varint,9,opt,name=status_update_state,enum=mesosproto.TaskState" json:"status_update_state,omitempty"` StatusUpdateUuid []byte `protobuf:"bytes,10,opt,name=status_update_uuid" json:"status_update_uuid,omitempty"` - XXX_unrecognized []byte `json:"-"` + Labels *Labels `protobuf:"bytes,11,opt,name=labels" json:"labels,omitempty"` + // Service discovery information for the task. It is not interpreted + // or acted upon by Mesos. It is up to a service discovery system + // to use this information as needed and to handle tasks without + // service discovery information. + Discovery *DiscoveryInfo `protobuf:"bytes,12,opt,name=discovery" json:"discovery,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *Task) Reset() { *m = Task{} } @@ -148,33 +156,18 @@ func (m *Task) GetStatusUpdateUuid() []byte { return nil } -// Describes a role, which are used to group frameworks for allocation -// decisions, depending on the allocation policy being used. -// The weight field can be used to indicate forms of priority. -type RoleInfo struct { - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - Weight *float64 `protobuf:"fixed64,2,opt,name=weight,def=1" json:"weight,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *RoleInfo) Reset() { *m = RoleInfo{} } -func (m *RoleInfo) String() string { return proto.CompactTextString(m) } -func (*RoleInfo) ProtoMessage() {} - -const Default_RoleInfo_Weight float64 = 1 - -func (m *RoleInfo) GetName() string { - if m != nil && m.Name != nil { - return *m.Name +func (m *Task) GetLabels() *Labels { + if m != nil { + return m.Labels } - return "" + return nil } -func (m *RoleInfo) GetWeight() float64 { - if m != nil && m.Weight != nil { - return *m.Weight +func (m *Task) GetDiscovery() *DiscoveryInfo { + if m != nil { + return m.Discovery } - return Default_RoleInfo_Weight + return nil } // TODO(vinod): Create a new UUID message type. @@ -184,7 +177,10 @@ type StatusUpdate struct { SlaveId *SlaveID `protobuf:"bytes,3,opt,name=slave_id" json:"slave_id,omitempty"` Status *TaskStatus `protobuf:"bytes,4,req,name=status" json:"status,omitempty"` Timestamp *float64 `protobuf:"fixed64,5,req,name=timestamp" json:"timestamp,omitempty"` - Uuid []byte `protobuf:"bytes,6,req,name=uuid" json:"uuid,omitempty"` + // This is being deprecated in favor of TaskStatus.uuid. In 0.23.0, + // we set the TaskStatus 'uuid' in the executor driver for all + // retryable status updates. + Uuid []byte `protobuf:"bytes,6,opt,name=uuid" json:"uuid,omitempty"` // This corresponds to the latest state of the task according to the // slave. Note that this state might be different than the state in // 'status' because status update manager queues updates. In other @@ -635,7 +631,8 @@ func (m *ReviveOffersMessage) GetFrameworkId() *FrameworkID { } type RunTaskMessage struct { - FrameworkId *FrameworkID `protobuf:"bytes,1,req,name=framework_id" json:"framework_id,omitempty"` + // TODO(karya): Remove framework_id after MESOS-2559 has shipped. + FrameworkId *FrameworkID `protobuf:"bytes,1,opt,name=framework_id" json:"framework_id,omitempty"` Framework *FrameworkInfo `protobuf:"bytes,2,req,name=framework" json:"framework,omitempty"` Pid *string `protobuf:"bytes,3,req,name=pid" json:"pid,omitempty"` Task *TaskInfo `protobuf:"bytes,4,req,name=task" json:"task,omitempty"` @@ -830,6 +827,10 @@ func (m *FrameworkErrorMessage) GetMessage() string { type RegisterSlaveMessage struct { Slave *SlaveInfo `protobuf:"bytes,1,req,name=slave" json:"slave,omitempty"` + // Resources that are checkpointed by the slave (e.g., persistent + // volume or dynamic reservation). Frameworks need to release + // checkpointed resources explicitly. + CheckpointedResources []*Resource `protobuf:"bytes,3,rep,name=checkpointed_resources" json:"checkpointed_resources,omitempty"` // NOTE: This is a hack for the master to detect the slave's // version. If unset the slave is < 0.21.0. // TODO(bmahler): Do proper versioning: MESOS-986. @@ -848,6 +849,13 @@ func (m *RegisterSlaveMessage) GetSlave() *SlaveInfo { return nil } +func (m *RegisterSlaveMessage) GetCheckpointedResources() []*Resource { + if m != nil { + return m.CheckpointedResources + } + return nil +} + func (m *RegisterSlaveMessage) GetVersion() string { if m != nil && m.Version != nil { return *m.Version @@ -856,14 +864,14 @@ func (m *RegisterSlaveMessage) GetVersion() string { } type ReregisterSlaveMessage struct { - // TODO(bmahler): slave_id is deprecated. - // 0.21.0: Now an optional field. Always written, never read. - // 0.22.0: Remove this field. - SlaveId *SlaveID `protobuf:"bytes,1,opt,name=slave_id" json:"slave_id,omitempty"` - Slave *SlaveInfo `protobuf:"bytes,2,req,name=slave" json:"slave,omitempty"` - ExecutorInfos []*ExecutorInfo `protobuf:"bytes,4,rep,name=executor_infos" json:"executor_infos,omitempty"` - Tasks []*Task `protobuf:"bytes,3,rep,name=tasks" json:"tasks,omitempty"` - CompletedFrameworks []*Archive_Framework `protobuf:"bytes,5,rep,name=completed_frameworks" json:"completed_frameworks,omitempty"` + Slave *SlaveInfo `protobuf:"bytes,2,req,name=slave" json:"slave,omitempty"` + // Resources that are checkpointed by the slave (e.g., persistent + // volume or dynamic reservation). Frameworks need to release + // checkpointed resources explicitly. + CheckpointedResources []*Resource `protobuf:"bytes,7,rep,name=checkpointed_resources" json:"checkpointed_resources,omitempty"` + ExecutorInfos []*ExecutorInfo `protobuf:"bytes,4,rep,name=executor_infos" json:"executor_infos,omitempty"` + Tasks []*Task `protobuf:"bytes,3,rep,name=tasks" json:"tasks,omitempty"` + CompletedFrameworks []*Archive_Framework `protobuf:"bytes,5,rep,name=completed_frameworks" json:"completed_frameworks,omitempty"` // NOTE: This is a hack for the master to detect the slave's // version. If unset the slave is < 0.21.0. // TODO(bmahler): Do proper versioning: MESOS-986. @@ -875,16 +883,16 @@ func (m *ReregisterSlaveMessage) Reset() { *m = ReregisterSlaveMessage{} func (m *ReregisterSlaveMessage) String() string { return proto.CompactTextString(m) } func (*ReregisterSlaveMessage) ProtoMessage() {} -func (m *ReregisterSlaveMessage) GetSlaveId() *SlaveID { +func (m *ReregisterSlaveMessage) GetSlave() *SlaveInfo { if m != nil { - return m.SlaveId + return m.Slave } return nil } -func (m *ReregisterSlaveMessage) GetSlave() *SlaveInfo { +func (m *ReregisterSlaveMessage) GetCheckpointedResources() []*Resource { if m != nil { - return m.Slave + return m.CheckpointedResources } return nil } @@ -918,8 +926,9 @@ func (m *ReregisterSlaveMessage) GetVersion() string { } type SlaveRegisteredMessage struct { - SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` - XXX_unrecognized []byte `json:"-"` + SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` + Connection *MasterSlaveConnection `protobuf:"bytes,2,opt,name=connection" json:"connection,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *SlaveRegisteredMessage) Reset() { *m = SlaveRegisteredMessage{} } @@ -933,9 +942,17 @@ func (m *SlaveRegisteredMessage) GetSlaveId() *SlaveID { return nil } +func (m *SlaveRegisteredMessage) GetConnection() *MasterSlaveConnection { + if m != nil { + return m.Connection + } + return nil +} + type SlaveReregisteredMessage struct { SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` Reconciliations []*ReconcileTasksMessage `protobuf:"bytes,2,rep,name=reconciliations" json:"reconciliations,omitempty"` + Connection *MasterSlaveConnection `protobuf:"bytes,3,opt,name=connection" json:"connection,omitempty"` XXX_unrecognized []byte `json:"-"` } @@ -957,6 +974,13 @@ func (m *SlaveReregisteredMessage) GetReconciliations() []*ReconcileTasksMessage return nil } +func (m *SlaveReregisteredMessage) GetConnection() *MasterSlaveConnection { + if m != nil { + return m.Connection + } + return nil +} + type UnregisterSlaveMessage struct { SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` XXX_unrecognized []byte `json:"-"` @@ -973,6 +997,25 @@ func (m *UnregisterSlaveMessage) GetSlaveId() *SlaveID { return nil } +type MasterSlaveConnection struct { + // Product of max_slave_ping_timeouts * slave_ping_timeout. + // If no pings are received within the total timeout, + // the master will remove the slave. + TotalPingTimeoutSeconds *float64 `protobuf:"fixed64,1,opt,name=total_ping_timeout_seconds" json:"total_ping_timeout_seconds,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *MasterSlaveConnection) Reset() { *m = MasterSlaveConnection{} } +func (m *MasterSlaveConnection) String() string { return proto.CompactTextString(m) } +func (*MasterSlaveConnection) ProtoMessage() {} + +func (m *MasterSlaveConnection) GetTotalPingTimeoutSeconds() float64 { + if m != nil && m.TotalPingTimeoutSeconds != nil { + return *m.TotalPingTimeoutSeconds + } + return 0 +} + // This message is periodically sent by the master to the slave. // If the slave is connected to the master, "connected" is true. type PingSlaveMessage struct { @@ -1018,16 +1061,34 @@ func (m *ShutdownFrameworkMessage) GetFrameworkId() *FrameworkID { return nil } -// Tells the executor to initiate a shut down by invoking -// Executor::shutdown. +// Tells a slave (and consequently executor) to shutdown an executor. type ShutdownExecutorMessage struct { - XXX_unrecognized []byte `json:"-"` + // TODO(vinod): Make these fields required. These are made optional + // for backwards compatibility between 0.23.0 slave and pre 0.23.0 + // executor driver. + ExecutorId *ExecutorID `protobuf:"bytes,1,opt,name=executor_id" json:"executor_id,omitempty"` + FrameworkId *FrameworkID `protobuf:"bytes,2,opt,name=framework_id" json:"framework_id,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *ShutdownExecutorMessage) Reset() { *m = ShutdownExecutorMessage{} } func (m *ShutdownExecutorMessage) String() string { return proto.CompactTextString(m) } func (*ShutdownExecutorMessage) ProtoMessage() {} +func (m *ShutdownExecutorMessage) GetExecutorId() *ExecutorID { + if m != nil { + return m.ExecutorId + } + return nil +} + +func (m *ShutdownExecutorMessage) GetFrameworkId() *FrameworkID { + if m != nil { + return m.FrameworkId + } + return nil +} + type UpdateFrameworkMessage struct { FrameworkId *FrameworkID `protobuf:"bytes,1,req,name=framework_id" json:"framework_id,omitempty"` Pid *string `protobuf:"bytes,2,req,name=pid" json:"pid,omitempty"` @@ -1052,6 +1113,52 @@ func (m *UpdateFrameworkMessage) GetPid() string { return "" } +// This message is sent to the slave whenever there is an update of +// the resources that need to be checkpointed (e.g., persistent volume +// or dynamic reservation). +type CheckpointResourcesMessage struct { + Resources []*Resource `protobuf:"bytes,1,rep,name=resources" json:"resources,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *CheckpointResourcesMessage) Reset() { *m = CheckpointResourcesMessage{} } +func (m *CheckpointResourcesMessage) String() string { return proto.CompactTextString(m) } +func (*CheckpointResourcesMessage) ProtoMessage() {} + +func (m *CheckpointResourcesMessage) GetResources() []*Resource { + if m != nil { + return m.Resources + } + return nil +} + +// This message is sent by the slave to the master to inform the +// master about the total amount of oversubscribed (allocated and +// allocatable) resources. +type UpdateSlaveMessage struct { + SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` + OversubscribedResources []*Resource `protobuf:"bytes,2,rep,name=oversubscribed_resources" json:"oversubscribed_resources,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *UpdateSlaveMessage) Reset() { *m = UpdateSlaveMessage{} } +func (m *UpdateSlaveMessage) String() string { return proto.CompactTextString(m) } +func (*UpdateSlaveMessage) ProtoMessage() {} + +func (m *UpdateSlaveMessage) GetSlaveId() *SlaveID { + if m != nil { + return m.SlaveId + } + return nil +} + +func (m *UpdateSlaveMessage) GetOversubscribedResources() []*Resource { + if m != nil { + return m.OversubscribedResources + } + return nil +} + type RegisterExecutorMessage struct { FrameworkId *FrameworkID `protobuf:"bytes,1,req,name=framework_id" json:"framework_id,omitempty"` ExecutorId *ExecutorID `protobuf:"bytes,2,req,name=executor_id" json:"executor_id,omitempty"` @@ -1260,110 +1367,6 @@ func (m *ShutdownMessage) GetMessage() string { return "" } -type AuthenticateMessage struct { - Pid *string `protobuf:"bytes,1,req,name=pid" json:"pid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *AuthenticateMessage) Reset() { *m = AuthenticateMessage{} } -func (m *AuthenticateMessage) String() string { return proto.CompactTextString(m) } -func (*AuthenticateMessage) ProtoMessage() {} - -func (m *AuthenticateMessage) GetPid() string { - if m != nil && m.Pid != nil { - return *m.Pid - } - return "" -} - -type AuthenticationMechanismsMessage struct { - Mechanisms []string `protobuf:"bytes,1,rep,name=mechanisms" json:"mechanisms,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *AuthenticationMechanismsMessage) Reset() { *m = AuthenticationMechanismsMessage{} } -func (m *AuthenticationMechanismsMessage) String() string { return proto.CompactTextString(m) } -func (*AuthenticationMechanismsMessage) ProtoMessage() {} - -func (m *AuthenticationMechanismsMessage) GetMechanisms() []string { - if m != nil { - return m.Mechanisms - } - return nil -} - -type AuthenticationStartMessage struct { - Mechanism *string `protobuf:"bytes,1,req,name=mechanism" json:"mechanism,omitempty"` - Data *string `protobuf:"bytes,2,opt,name=data" json:"data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *AuthenticationStartMessage) Reset() { *m = AuthenticationStartMessage{} } -func (m *AuthenticationStartMessage) String() string { return proto.CompactTextString(m) } -func (*AuthenticationStartMessage) ProtoMessage() {} - -func (m *AuthenticationStartMessage) GetMechanism() string { - if m != nil && m.Mechanism != nil { - return *m.Mechanism - } - return "" -} - -func (m *AuthenticationStartMessage) GetData() string { - if m != nil && m.Data != nil { - return *m.Data - } - return "" -} - -type AuthenticationStepMessage struct { - Data []byte `protobuf:"bytes,1,req,name=data" json:"data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *AuthenticationStepMessage) Reset() { *m = AuthenticationStepMessage{} } -func (m *AuthenticationStepMessage) String() string { return proto.CompactTextString(m) } -func (*AuthenticationStepMessage) ProtoMessage() {} - -func (m *AuthenticationStepMessage) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -type AuthenticationCompletedMessage struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *AuthenticationCompletedMessage) Reset() { *m = AuthenticationCompletedMessage{} } -func (m *AuthenticationCompletedMessage) String() string { return proto.CompactTextString(m) } -func (*AuthenticationCompletedMessage) ProtoMessage() {} - -type AuthenticationFailedMessage struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *AuthenticationFailedMessage) Reset() { *m = AuthenticationFailedMessage{} } -func (m *AuthenticationFailedMessage) String() string { return proto.CompactTextString(m) } -func (*AuthenticationFailedMessage) ProtoMessage() {} - -type AuthenticationErrorMessage struct { - Error *string `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *AuthenticationErrorMessage) Reset() { *m = AuthenticationErrorMessage{} } -func (m *AuthenticationErrorMessage) String() string { return proto.CompactTextString(m) } -func (*AuthenticationErrorMessage) ProtoMessage() {} - -func (m *AuthenticationErrorMessage) GetError() string { - if m != nil && m.Error != nil { - return *m.Error - } - return "" -} - // * // Describes Completed Frameworks, etc. for archival. type Archive struct { @@ -1465,86 +1468,24 @@ func (m *TaskHealthStatus) GetConsecutiveFailures() int32 { return 0 } -// Collection of Modules. -type Modules struct { - Libraries []*Modules_Library `protobuf:"bytes,1,rep,name=libraries" json:"libraries,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Modules) Reset() { *m = Modules{} } -func (m *Modules) String() string { return proto.CompactTextString(m) } -func (*Modules) ProtoMessage() {} - -func (m *Modules) GetLibraries() []*Modules_Library { - if m != nil { - return m.Libraries - } - return nil -} - -type Modules_Library struct { - // If "file" contains a slash ("/"), then it is interpreted as a - // (relative or absolute) pathname. Otherwise a standard library - // search is performed. - File *string `protobuf:"bytes,1,opt,name=file" json:"file,omitempty"` - // We will add the proper prefix ("lib") and suffix (".so" for - // Linux and ".dylib" for OS X) to the "name". - Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` - Modules []*Modules_Library_Module `protobuf:"bytes,3,rep,name=modules" json:"modules,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Modules_Library) Reset() { *m = Modules_Library{} } -func (m *Modules_Library) String() string { return proto.CompactTextString(m) } -func (*Modules_Library) ProtoMessage() {} - -func (m *Modules_Library) GetFile() string { - if m != nil && m.File != nil { - return *m.File - } - return "" -} - -func (m *Modules_Library) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *Modules_Library) GetModules() []*Modules_Library_Module { - if m != nil { - return m.Modules - } - return nil -} - -type Modules_Library_Module struct { - // Module name. - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - // Module-specific parameters. - Parameters []*Parameter `protobuf:"bytes,2,rep,name=parameters" json:"parameters,omitempty"` - XXX_unrecognized []byte `json:"-"` +// * +// Message to signal completion of an event within a module. +type HookExecuted struct { + Module *string `protobuf:"bytes,1,opt,name=module" json:"module,omitempty"` + XXX_unrecognized []byte `json:"-"` } -func (m *Modules_Library_Module) Reset() { *m = Modules_Library_Module{} } -func (m *Modules_Library_Module) String() string { return proto.CompactTextString(m) } -func (*Modules_Library_Module) ProtoMessage() {} +func (m *HookExecuted) Reset() { *m = HookExecuted{} } +func (m *HookExecuted) String() string { return proto.CompactTextString(m) } +func (*HookExecuted) ProtoMessage() {} -func (m *Modules_Library_Module) GetName() string { - if m != nil && m.Name != nil { - return *m.Name +func (m *HookExecuted) GetModule() string { + if m != nil && m.Module != nil { + return *m.Module } return "" } -func (m *Modules_Library_Module) GetParameters() []*Parameter { - if m != nil { - return m.Parameters - } - return nil -} - func init() { proto.RegisterEnum("mesosproto.StatusUpdateRecord_Type", StatusUpdateRecord_Type_name, StatusUpdateRecord_Type_value) } diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/messages.proto b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/messages.proto index 0182f419e88c9..d58c99e9da16c 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/messages.proto +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/messages.proto @@ -54,15 +54,14 @@ message Task { // NOTE: Either both the fields must be set or both must be unset. optional TaskState status_update_state = 9; optional bytes status_update_uuid = 10; -} + optional Labels labels = 11; -// Describes a role, which are used to group frameworks for allocation -// decisions, depending on the allocation policy being used. -// The weight field can be used to indicate forms of priority. -message RoleInfo { - required string name = 1; - optional double weight = 2 [default = 1]; + // Service discovery information for the task. It is not interpreted + // or acted upon by Mesos. It is up to a service discovery system + // to use this information as needed and to handle tasks without + // service discovery information. + optional DiscoveryInfo discovery = 12; } @@ -73,7 +72,11 @@ message StatusUpdate { optional SlaveID slave_id = 3; required TaskStatus status = 4; required double timestamp = 5; - required bytes uuid = 6; + + // This is being deprecated in favor of TaskStatus.uuid. In 0.23.0, + // we set the TaskStatus 'uuid' in the executor driver for all + // retryable status updates. + optional bytes uuid = 6; // This corresponds to the latest state of the task according to the // slave. Note that this state might be different than the state in @@ -188,7 +191,8 @@ message ReviveOffersMessage { message RunTaskMessage { - required FrameworkID framework_id = 1; + // TODO(karya): Remove framework_id after MESOS-2559 has shipped. + optional FrameworkID framework_id = 1 [deprecated = true]; required FrameworkInfo framework = 2; required string pid = 3; required TaskInfo task = 4; @@ -244,6 +248,11 @@ message FrameworkErrorMessage { message RegisterSlaveMessage { required SlaveInfo slave = 1; + // Resources that are checkpointed by the slave (e.g., persistent + // volume or dynamic reservation). Frameworks need to release + // checkpointed resources explicitly. + repeated Resource checkpointed_resources = 3; + // NOTE: This is a hack for the master to detect the slave's // version. If unset the slave is < 0.21.0. // TODO(bmahler): Do proper versioning: MESOS-986. @@ -252,11 +261,13 @@ message RegisterSlaveMessage { message ReregisterSlaveMessage { - // TODO(bmahler): slave_id is deprecated. - // 0.21.0: Now an optional field. Always written, never read. - // 0.22.0: Remove this field. - optional SlaveID slave_id = 1; required SlaveInfo slave = 2; + + // Resources that are checkpointed by the slave (e.g., persistent + // volume or dynamic reservation). Frameworks need to release + // checkpointed resources explicitly. + repeated Resource checkpointed_resources = 7; + repeated ExecutorInfo executor_infos = 4; repeated Task tasks = 3; repeated Archive.Framework completed_frameworks = 5; @@ -270,6 +281,7 @@ message ReregisterSlaveMessage { message SlaveRegisteredMessage { required SlaveID slave_id = 1; + optional MasterSlaveConnection connection = 2; } @@ -277,6 +289,7 @@ message SlaveReregisteredMessage { required SlaveID slave_id = 1; repeated ReconcileTasksMessage reconciliations = 2; + optional MasterSlaveConnection connection = 3; } @@ -285,6 +298,14 @@ message UnregisterSlaveMessage { } +message MasterSlaveConnection { + // Product of max_slave_ping_timeouts * slave_ping_timeout. + // If no pings are received within the total timeout, + // the master will remove the slave. + optional double total_ping_timeout_seconds = 1; +} + + // This message is periodically sent by the master to the slave. // If the slave is connected to the master, "connected" is true. message PingSlaveMessage { @@ -303,9 +324,14 @@ message ShutdownFrameworkMessage { } -// Tells the executor to initiate a shut down by invoking -// Executor::shutdown. -message ShutdownExecutorMessage {} +// Tells a slave (and consequently executor) to shutdown an executor. +message ShutdownExecutorMessage { + // TODO(vinod): Make these fields required. These are made optional + // for backwards compatibility between 0.23.0 slave and pre 0.23.0 + // executor driver. + optional ExecutorID executor_id = 1; + optional FrameworkID framework_id = 2; +} message UpdateFrameworkMessage { @@ -314,6 +340,23 @@ message UpdateFrameworkMessage { } +// This message is sent to the slave whenever there is an update of +// the resources that need to be checkpointed (e.g., persistent volume +// or dynamic reservation). +message CheckpointResourcesMessage { + repeated Resource resources = 1; +} + + +// This message is sent by the slave to the master to inform the +// master about the total amount of oversubscribed (allocated and +// allocatable) resources. +message UpdateSlaveMessage { + required SlaveID slave_id = 1; + repeated Resource oversubscribed_resources = 2; +} + + message RegisterExecutorMessage { required FrameworkID framework_id = 1; required ExecutorID executor_id = 2; @@ -361,38 +404,6 @@ message ShutdownMessage { } -message AuthenticateMessage { - required string pid = 1; // PID that needs to be authenticated. -} - - -message AuthenticationMechanismsMessage { - repeated string mechanisms = 1; // List of available SASL mechanisms. -} - - -message AuthenticationStartMessage { - required string mechanism = 1; - optional string data = 2; -} - - -message AuthenticationStepMessage { - required bytes data = 1; -} - - -message AuthenticationCompletedMessage {} - - -message AuthenticationFailedMessage {} - - -message AuthenticationErrorMessage { - optional string error = 1; -} - - // TODO(adam-mesos): Move this to an 'archive' package. /** * Describes Completed Frameworks, etc. for archival. @@ -426,28 +437,9 @@ message TaskHealthStatus { } -// Collection of Modules. -message Modules { - message Library { - // If "file" contains a slash ("/"), then it is interpreted as a - // (relative or absolute) pathname. Otherwise a standard library - // search is performed. - optional string file = 1; - - // We will add the proper prefix ("lib") and suffix (".so" for - // Linux and ".dylib" for OS X) to the "name". - optional string name = 2; - - message Module { - // Module name. - optional string name = 1; - - // Module-specific parameters. - repeated Parameter parameters = 2; - } - - repeated Module modules = 3; - } - - repeated Library libraries = 1; +/** + * Message to signal completion of an event within a module. + */ +message HookExecuted { + optional string module = 1; } diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/registry.pb.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/registry.pb.go index 77e782234698e..0157ec37670cd 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/registry.pb.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/registry.pb.go @@ -5,12 +5,14 @@ package mesosproto import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" import math "math" -// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto/gogo.pb" +// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal +var _ = fmt.Errorf var _ = math.Inf type Registry struct { @@ -86,6 +88,3 @@ func (m *Registry_Slaves) GetSlaves() []*Registry_Slave { } return nil } - -func init() { -} diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/scheduler.pb.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/scheduler.pb.go index f90c727ae0bf3..29a56ce181ae4 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/scheduler.pb.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/scheduler.pb.go @@ -5,12 +5,14 @@ package mesosproto import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" import math "math" -// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto/gogo.pb" +// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal +var _ = fmt.Errorf var _ = math.Inf // Possible event types, followed by message definitions if @@ -18,35 +20,32 @@ var _ = math.Inf type Event_Type int32 const ( - Event_REGISTERED Event_Type = 1 - Event_REREGISTERED Event_Type = 2 - Event_OFFERS Event_Type = 3 - Event_RESCIND Event_Type = 4 - Event_UPDATE Event_Type = 5 - Event_MESSAGE Event_Type = 6 - Event_FAILURE Event_Type = 7 - Event_ERROR Event_Type = 8 + Event_SUBSCRIBED Event_Type = 1 + Event_OFFERS Event_Type = 2 + Event_RESCIND Event_Type = 3 + Event_UPDATE Event_Type = 4 + Event_MESSAGE Event_Type = 5 + Event_FAILURE Event_Type = 6 + Event_ERROR Event_Type = 7 ) var Event_Type_name = map[int32]string{ - 1: "REGISTERED", - 2: "REREGISTERED", - 3: "OFFERS", - 4: "RESCIND", - 5: "UPDATE", - 6: "MESSAGE", - 7: "FAILURE", - 8: "ERROR", + 1: "SUBSCRIBED", + 2: "OFFERS", + 3: "RESCIND", + 4: "UPDATE", + 5: "MESSAGE", + 6: "FAILURE", + 7: "ERROR", } var Event_Type_value = map[string]int32{ - "REGISTERED": 1, - "REREGISTERED": 2, - "OFFERS": 3, - "RESCIND": 4, - "UPDATE": 5, - "MESSAGE": 6, - "FAILURE": 7, - "ERROR": 8, + "SUBSCRIBED": 1, + "OFFERS": 2, + "RESCIND": 3, + "UPDATE": 4, + "MESSAGE": 5, + "FAILURE": 6, + "ERROR": 7, } func (x Event_Type) Enum() *Event_Type { @@ -71,44 +70,41 @@ func (x *Event_Type) UnmarshalJSON(data []byte) error { type Call_Type int32 const ( - Call_REGISTER Call_Type = 1 - Call_REREGISTER Call_Type = 2 - Call_UNREGISTER Call_Type = 3 - Call_REQUEST Call_Type = 4 - Call_DECLINE Call_Type = 5 - Call_REVIVE Call_Type = 6 - Call_LAUNCH Call_Type = 7 - Call_KILL Call_Type = 8 - Call_ACKNOWLEDGE Call_Type = 9 - Call_RECONCILE Call_Type = 10 - Call_MESSAGE Call_Type = 11 + Call_SUBSCRIBE Call_Type = 1 + Call_TEARDOWN Call_Type = 2 + Call_ACCEPT Call_Type = 3 + Call_DECLINE Call_Type = 4 + Call_REVIVE Call_Type = 5 + Call_KILL Call_Type = 6 + Call_SHUTDOWN Call_Type = 7 + Call_ACKNOWLEDGE Call_Type = 8 + Call_RECONCILE Call_Type = 9 + Call_MESSAGE Call_Type = 10 ) var Call_Type_name = map[int32]string{ - 1: "REGISTER", - 2: "REREGISTER", - 3: "UNREGISTER", - 4: "REQUEST", - 5: "DECLINE", - 6: "REVIVE", - 7: "LAUNCH", - 8: "KILL", - 9: "ACKNOWLEDGE", - 10: "RECONCILE", - 11: "MESSAGE", + 1: "SUBSCRIBE", + 2: "TEARDOWN", + 3: "ACCEPT", + 4: "DECLINE", + 5: "REVIVE", + 6: "KILL", + 7: "SHUTDOWN", + 8: "ACKNOWLEDGE", + 9: "RECONCILE", + 10: "MESSAGE", } var Call_Type_value = map[string]int32{ - "REGISTER": 1, - "REREGISTER": 2, - "UNREGISTER": 3, - "REQUEST": 4, - "DECLINE": 5, - "REVIVE": 6, - "LAUNCH": 7, - "KILL": 8, - "ACKNOWLEDGE": 9, - "RECONCILE": 10, - "MESSAGE": 11, + "SUBSCRIBE": 1, + "TEARDOWN": 2, + "ACCEPT": 3, + "DECLINE": 4, + "REVIVE": 5, + "KILL": 6, + "SHUTDOWN": 7, + "ACKNOWLEDGE": 8, + "RECONCILE": 9, + "MESSAGE": 10, } func (x Call_Type) Enum() *Call_Type { @@ -129,23 +125,23 @@ func (x *Call_Type) UnmarshalJSON(data []byte) error { } // * -// Low-level scheduler event API. +// Scheduler event API. // // An event is described using the standard protocol buffer "union" -// trick, see https://developers.google.com/protocol-buffers/docs/techniques#union. +// trick, see: +// https://developers.google.com/protocol-buffers/docs/techniques#union. type Event struct { // Type of the event, indicates which optional field below should be // present if that type has a nested message definition. - Type *Event_Type `protobuf:"varint,1,req,name=type,enum=mesosproto.Event_Type" json:"type,omitempty"` - Registered *Event_Registered `protobuf:"bytes,2,opt,name=registered" json:"registered,omitempty"` - Reregistered *Event_Reregistered `protobuf:"bytes,3,opt,name=reregistered" json:"reregistered,omitempty"` - Offers *Event_Offers `protobuf:"bytes,4,opt,name=offers" json:"offers,omitempty"` - Rescind *Event_Rescind `protobuf:"bytes,5,opt,name=rescind" json:"rescind,omitempty"` - Update *Event_Update `protobuf:"bytes,6,opt,name=update" json:"update,omitempty"` - Message *Event_Message `protobuf:"bytes,7,opt,name=message" json:"message,omitempty"` - Failure *Event_Failure `protobuf:"bytes,8,opt,name=failure" json:"failure,omitempty"` - Error *Event_Error `protobuf:"bytes,9,opt,name=error" json:"error,omitempty"` - XXX_unrecognized []byte `json:"-"` + Type *Event_Type `protobuf:"varint,1,req,name=type,enum=mesosproto.Event_Type" json:"type,omitempty"` + Subscribed *Event_Subscribed `protobuf:"bytes,2,opt,name=subscribed" json:"subscribed,omitempty"` + Offers *Event_Offers `protobuf:"bytes,3,opt,name=offers" json:"offers,omitempty"` + Rescind *Event_Rescind `protobuf:"bytes,4,opt,name=rescind" json:"rescind,omitempty"` + Update *Event_Update `protobuf:"bytes,5,opt,name=update" json:"update,omitempty"` + Message *Event_Message `protobuf:"bytes,6,opt,name=message" json:"message,omitempty"` + Failure *Event_Failure `protobuf:"bytes,7,opt,name=failure" json:"failure,omitempty"` + Error *Event_Error `protobuf:"bytes,8,opt,name=error" json:"error,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *Event) Reset() { *m = Event{} } @@ -156,19 +152,12 @@ func (m *Event) GetType() Event_Type { if m != nil && m.Type != nil { return *m.Type } - return Event_REGISTERED -} - -func (m *Event) GetRegistered() *Event_Registered { - if m != nil { - return m.Registered - } - return nil + return Event_SUBSCRIBED } -func (m *Event) GetReregistered() *Event_Reregistered { +func (m *Event) GetSubscribed() *Event_Subscribed { if m != nil { - return m.Reregistered + return m.Subscribed } return nil } @@ -215,54 +204,27 @@ func (m *Event) GetError() *Event_Error { return nil } -type Event_Registered struct { +// First event received when the scheduler subscribes. +type Event_Subscribed struct { FrameworkId *FrameworkID `protobuf:"bytes,1,req,name=framework_id" json:"framework_id,omitempty"` - MasterInfo *MasterInfo `protobuf:"bytes,2,req,name=master_info" json:"master_info,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *Event_Registered) Reset() { *m = Event_Registered{} } -func (m *Event_Registered) String() string { return proto.CompactTextString(m) } -func (*Event_Registered) ProtoMessage() {} +func (m *Event_Subscribed) Reset() { *m = Event_Subscribed{} } +func (m *Event_Subscribed) String() string { return proto.CompactTextString(m) } +func (*Event_Subscribed) ProtoMessage() {} -func (m *Event_Registered) GetFrameworkId() *FrameworkID { +func (m *Event_Subscribed) GetFrameworkId() *FrameworkID { if m != nil { return m.FrameworkId } return nil } -func (m *Event_Registered) GetMasterInfo() *MasterInfo { - if m != nil { - return m.MasterInfo - } - return nil -} - -type Event_Reregistered struct { - FrameworkId *FrameworkID `protobuf:"bytes,1,req,name=framework_id" json:"framework_id,omitempty"` - MasterInfo *MasterInfo `protobuf:"bytes,2,req,name=master_info" json:"master_info,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Event_Reregistered) Reset() { *m = Event_Reregistered{} } -func (m *Event_Reregistered) String() string { return proto.CompactTextString(m) } -func (*Event_Reregistered) ProtoMessage() {} - -func (m *Event_Reregistered) GetFrameworkId() *FrameworkID { - if m != nil { - return m.FrameworkId - } - return nil -} - -func (m *Event_Reregistered) GetMasterInfo() *MasterInfo { - if m != nil { - return m.MasterInfo - } - return nil -} - +// Received whenever there are new resources that are offered to the +// scheduler. Each offer corresponds to a set of resources on a +// slave. Until the scheduler accepts or declines an offer the +// resources are considered allocated to the scheduler. type Event_Offers struct { Offers []*Offer `protobuf:"bytes,1,rep,name=offers" json:"offers,omitempty"` XXX_unrecognized []byte `json:"-"` @@ -279,6 +241,10 @@ func (m *Event_Offers) GetOffers() []*Offer { return nil } +// Received when a particular offer is no longer valid (e.g., the +// slave corresponding to the offer has been removed) and hence +// needs to be rescinded. Any future calls ('Accept' / 'Decline') made +// by the scheduler regarding this offer will be invalid. type Event_Rescind struct { OfferId *OfferID `protobuf:"bytes,1,req,name=offer_id" json:"offer_id,omitempty"` XXX_unrecognized []byte `json:"-"` @@ -295,9 +261,17 @@ func (m *Event_Rescind) GetOfferId() *OfferID { return nil } +// Received whenever there is a status update that is generated by +// the executor or slave or master. Status updates should be used by +// executors to reliably communicate the status of the tasks that +// they manage. It is crucial that a terminal update (see TaskState +// in mesos.proto) is sent by the executor as soon as the task +// terminates, in order for Mesos to release the resources allocated +// to the task. It is also the responsibility of the scheduler to +// explicitly acknowledge the receipt of a status update. See +// 'Acknowledge' in the 'Call' section below for the semantics. type Event_Update struct { - Uuid []byte `protobuf:"bytes,1,req,name=uuid" json:"uuid,omitempty"` - Status *TaskStatus `protobuf:"bytes,2,req,name=status" json:"status,omitempty"` + Status *TaskStatus `protobuf:"bytes,1,req,name=status" json:"status,omitempty"` XXX_unrecognized []byte `json:"-"` } @@ -305,13 +279,6 @@ func (m *Event_Update) Reset() { *m = Event_Update{} } func (m *Event_Update) String() string { return proto.CompactTextString(m) } func (*Event_Update) ProtoMessage() {} -func (m *Event_Update) GetUuid() []byte { - if m != nil { - return m.Uuid - } - return nil -} - func (m *Event_Update) GetStatus() *TaskStatus { if m != nil { return m.Status @@ -319,6 +286,11 @@ func (m *Event_Update) GetStatus() *TaskStatus { return nil } +// Received when a custom message generated by the executor is +// forwarded by the master. Note that this message is not +// interpreted by Mesos and is only forwarded (without reliability +// guarantees) to the scheduler. It is up to the executor to retry +// if the message is dropped for any reason. type Event_Message struct { SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` ExecutorId *ExecutorID `protobuf:"bytes,2,req,name=executor_id" json:"executor_id,omitempty"` @@ -351,6 +323,16 @@ func (m *Event_Message) GetData() []byte { return nil } +// Received when a slave is removed from the cluster (e.g., failed +// health checks) or when an executor is terminated. Note that, this +// event coincides with receipt of terminal UPDATE events for any +// active tasks belonging to the slave or executor and receipt of +// 'Rescind' events for any outstanding offers belonging to the +// slave. Note that there is no guaranteed order between the +// 'Failure', 'Update' and 'Rescind' events when a slave or executor +// is removed. +// TODO(vinod): Consider splitting the lost slave and terminated +// executor into separate events and ensure it's reliably generated. type Event_Failure struct { SlaveId *SlaveID `protobuf:"bytes,1,opt,name=slave_id" json:"slave_id,omitempty"` // If this was just a failure of an executor on a slave then @@ -386,6 +368,13 @@ func (m *Event_Failure) GetStatus() int32 { return 0 } +// Received when an invalid framework (e.g., unauthenticated, +// unauthorized) attempts to subscribe with the master. Error can +// also be received if scheduler sends invalid Calls (e.g., not +// properly initialized). +// TODO(vinod): Remove this once the old scheduler driver is no +// longer supported. With HTTP API all errors will be signaled via +// HTTP response codes. type Event_Error struct { Message *string `protobuf:"bytes,1,req,name=message" json:"message,omitempty"` XXX_unrecognized []byte `json:"-"` @@ -403,25 +392,29 @@ func (m *Event_Error) GetMessage() string { } // * -// Low-level scheduler call API. +// Scheduler call API. // // Like Event, a Call is described using the standard protocol buffer // "union" trick (see above). type Call struct { - // Identifies who generated this call. Always necessary, but the - // only thing that needs to be set for certain calls, e.g., - // REGISTER, REREGISTER, and UNREGISTER. - FrameworkInfo *FrameworkInfo `protobuf:"bytes,1,req,name=framework_info" json:"framework_info,omitempty"` + // Identifies who generated this call. Master assigns a framework id + // when a new scheduler subscribes for the first time. Once assigned, + // the scheduler must set the 'framework_id' here and within its + // FrameworkInfo (in any further 'Subscribe' calls). This allows the + // master to identify a scheduler correctly across disconnections, + // failovers, etc. + FrameworkId *FrameworkID `protobuf:"bytes,1,opt,name=framework_id" json:"framework_id,omitempty"` // Type of the call, indicates which optional field below should be // present if that type has a nested message definition. Type *Call_Type `protobuf:"varint,2,req,name=type,enum=mesosproto.Call_Type" json:"type,omitempty"` - Request *Call_Request `protobuf:"bytes,3,opt,name=request" json:"request,omitempty"` - Decline *Call_Decline `protobuf:"bytes,4,opt,name=decline" json:"decline,omitempty"` - Launch *Call_Launch `protobuf:"bytes,5,opt,name=launch" json:"launch,omitempty"` + Subscribe *Call_Subscribe `protobuf:"bytes,3,opt,name=subscribe" json:"subscribe,omitempty"` + Accept *Call_Accept `protobuf:"bytes,4,opt,name=accept" json:"accept,omitempty"` + Decline *Call_Decline `protobuf:"bytes,5,opt,name=decline" json:"decline,omitempty"` Kill *Call_Kill `protobuf:"bytes,6,opt,name=kill" json:"kill,omitempty"` - Acknowledge *Call_Acknowledge `protobuf:"bytes,7,opt,name=acknowledge" json:"acknowledge,omitempty"` - Reconcile *Call_Reconcile `protobuf:"bytes,8,opt,name=reconcile" json:"reconcile,omitempty"` - Message *Call_Message `protobuf:"bytes,9,opt,name=message" json:"message,omitempty"` + Shutdown *Call_Shutdown `protobuf:"bytes,7,opt,name=shutdown" json:"shutdown,omitempty"` + Acknowledge *Call_Acknowledge `protobuf:"bytes,8,opt,name=acknowledge" json:"acknowledge,omitempty"` + Reconcile *Call_Reconcile `protobuf:"bytes,9,opt,name=reconcile" json:"reconcile,omitempty"` + Message *Call_Message `protobuf:"bytes,10,opt,name=message" json:"message,omitempty"` XXX_unrecognized []byte `json:"-"` } @@ -429,9 +422,9 @@ func (m *Call) Reset() { *m = Call{} } func (m *Call) String() string { return proto.CompactTextString(m) } func (*Call) ProtoMessage() {} -func (m *Call) GetFrameworkInfo() *FrameworkInfo { +func (m *Call) GetFrameworkId() *FrameworkID { if m != nil { - return m.FrameworkInfo + return m.FrameworkId } return nil } @@ -440,26 +433,26 @@ func (m *Call) GetType() Call_Type { if m != nil && m.Type != nil { return *m.Type } - return Call_REGISTER + return Call_SUBSCRIBE } -func (m *Call) GetRequest() *Call_Request { +func (m *Call) GetSubscribe() *Call_Subscribe { if m != nil { - return m.Request + return m.Subscribe } return nil } -func (m *Call) GetDecline() *Call_Decline { +func (m *Call) GetAccept() *Call_Accept { if m != nil { - return m.Decline + return m.Accept } return nil } -func (m *Call) GetLaunch() *Call_Launch { +func (m *Call) GetDecline() *Call_Decline { if m != nil { - return m.Launch + return m.Decline } return nil } @@ -471,6 +464,13 @@ func (m *Call) GetKill() *Call_Kill { return nil } +func (m *Call) GetShutdown() *Call_Shutdown { + if m != nil { + return m.Shutdown + } + return nil +} + func (m *Call) GetAcknowledge() *Call_Acknowledge { if m != nil { return m.Acknowledge @@ -492,22 +492,105 @@ func (m *Call) GetMessage() *Call_Message { return nil } -type Call_Request struct { - Requests []*Request `protobuf:"bytes,1,rep,name=requests" json:"requests,omitempty"` - XXX_unrecognized []byte `json:"-"` +// Subscribes the scheduler with the master to receive events. A +// scheduler must send other calls only after it has received the +// SUBCRIBED event. +type Call_Subscribe struct { + // See the comments below on 'framework_id' on the semantics for + // 'framework_info.id'. + FrameworkInfo *FrameworkInfo `protobuf:"bytes,1,req,name=framework_info" json:"framework_info,omitempty"` + // 'force' field is only relevant when 'framework_info.id' is set. + // It tells the master what to do in case an instance of the + // scheduler attempts to subscribe when another instance of it is + // already connected (e.g., split brain due to network partition). + // If 'force' is true, this scheduler instance is allowed and the + // old connected scheduler instance is disconnected. If false, + // this scheduler instance is disallowed subscription in favor of + // the already connected scheduler instance. + // + // It is recommended to set this to true only when a newly elected + // scheduler instance is attempting to subscribe but not when a + // scheduler is retrying subscription (e.g., disconnection or + // master failover; see sched/sched.cpp for an example). + Force *bool `protobuf:"varint,2,opt,name=force" json:"force,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Call_Subscribe) Reset() { *m = Call_Subscribe{} } +func (m *Call_Subscribe) String() string { return proto.CompactTextString(m) } +func (*Call_Subscribe) ProtoMessage() {} + +func (m *Call_Subscribe) GetFrameworkInfo() *FrameworkInfo { + if m != nil { + return m.FrameworkInfo + } + return nil +} + +func (m *Call_Subscribe) GetForce() bool { + if m != nil && m.Force != nil { + return *m.Force + } + return false +} + +// Accepts an offer, performing the specified operations +// in a sequential manner. +// +// E.g. Launch a task with a newly reserved persistent volume: +// +// Accept { +// offer_ids: [ ... ] +// operations: [ +// { type: RESERVE, +// reserve: { resources: [ disk(role):2 ] } } +// { type: CREATE, +// create: { volumes: [ disk(role):1+persistence ] } } +// { type: LAUNCH, +// launch: { task_infos ... disk(role):1;disk(role):1+persistence } } +// ] +// } +// +// Note that any of the offer’s resources not used in the 'Accept' +// call (e.g., to launch a task) are considered unused and might be +// reoffered to other frameworks. In other words, the same OfferID +// cannot be used in more than one 'Accept' call. +type Call_Accept struct { + OfferIds []*OfferID `protobuf:"bytes,1,rep,name=offer_ids" json:"offer_ids,omitempty"` + Operations []*Offer_Operation `protobuf:"bytes,2,rep,name=operations" json:"operations,omitempty"` + Filters *Filters `protobuf:"bytes,3,opt,name=filters" json:"filters,omitempty"` + XXX_unrecognized []byte `json:"-"` } -func (m *Call_Request) Reset() { *m = Call_Request{} } -func (m *Call_Request) String() string { return proto.CompactTextString(m) } -func (*Call_Request) ProtoMessage() {} +func (m *Call_Accept) Reset() { *m = Call_Accept{} } +func (m *Call_Accept) String() string { return proto.CompactTextString(m) } +func (*Call_Accept) ProtoMessage() {} + +func (m *Call_Accept) GetOfferIds() []*OfferID { + if m != nil { + return m.OfferIds + } + return nil +} -func (m *Call_Request) GetRequests() []*Request { +func (m *Call_Accept) GetOperations() []*Offer_Operation { if m != nil { - return m.Requests + return m.Operations } return nil } +func (m *Call_Accept) GetFilters() *Filters { + if m != nil { + return m.Filters + } + return nil +} + +// Declines an offer, signaling the master to potentially reoffer +// the resources to a different framework. Note that this is same +// as sending an Accept call with no operations. See comments on +// top of 'Accept' for semantics. type Call_Decline struct { OfferIds []*OfferID `protobuf:"bytes,1,rep,name=offer_ids" json:"offer_ids,omitempty"` Filters *Filters `protobuf:"bytes,2,opt,name=filters" json:"filters,omitempty"` @@ -532,54 +615,73 @@ func (m *Call_Decline) GetFilters() *Filters { return nil } -type Call_Launch struct { - TaskInfos []*TaskInfo `protobuf:"bytes,1,rep,name=task_infos" json:"task_infos,omitempty"` - OfferIds []*OfferID `protobuf:"bytes,2,rep,name=offer_ids" json:"offer_ids,omitempty"` - Filters *Filters `protobuf:"bytes,3,opt,name=filters" json:"filters,omitempty"` - XXX_unrecognized []byte `json:"-"` +// Kills a specific task. If the scheduler has a custom executor, +// the kill is forwarded to the executor and it is up to the +// executor to kill the task and send a TASK_KILLED (or TASK_FAILED) +// update. Note that Mesos releases the resources for a task once it +// receives a terminal update (See TaskState in mesos.proto) for it. +// If the task is unknown to the master, a TASK_LOST update is +// generated. +type Call_Kill struct { + TaskId *TaskID `protobuf:"bytes,1,req,name=task_id" json:"task_id,omitempty"` + SlaveId *SlaveID `protobuf:"bytes,2,opt,name=slave_id" json:"slave_id,omitempty"` + XXX_unrecognized []byte `json:"-"` } -func (m *Call_Launch) Reset() { *m = Call_Launch{} } -func (m *Call_Launch) String() string { return proto.CompactTextString(m) } -func (*Call_Launch) ProtoMessage() {} +func (m *Call_Kill) Reset() { *m = Call_Kill{} } +func (m *Call_Kill) String() string { return proto.CompactTextString(m) } +func (*Call_Kill) ProtoMessage() {} -func (m *Call_Launch) GetTaskInfos() []*TaskInfo { +func (m *Call_Kill) GetTaskId() *TaskID { if m != nil { - return m.TaskInfos + return m.TaskId } return nil } -func (m *Call_Launch) GetOfferIds() []*OfferID { +func (m *Call_Kill) GetSlaveId() *SlaveID { if m != nil { - return m.OfferIds + return m.SlaveId } return nil } -func (m *Call_Launch) GetFilters() *Filters { +// Shuts down a custom executor. When the executor gets a shutdown +// event, it is expected to kill all its tasks (and send TASK_KILLED +// updates) and terminate. If the executor doesn’t terminate within +// a certain timeout (configurable via +// '--executor_shutdown_grace_period' slave flag), the slave will +// forcefully destroy the container (executor and its tasks) and +// transition its active tasks to TASK_LOST. +type Call_Shutdown struct { + ExecutorId *ExecutorID `protobuf:"bytes,1,req,name=executor_id" json:"executor_id,omitempty"` + SlaveId *SlaveID `protobuf:"bytes,2,req,name=slave_id" json:"slave_id,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Call_Shutdown) Reset() { *m = Call_Shutdown{} } +func (m *Call_Shutdown) String() string { return proto.CompactTextString(m) } +func (*Call_Shutdown) ProtoMessage() {} + +func (m *Call_Shutdown) GetExecutorId() *ExecutorID { if m != nil { - return m.Filters + return m.ExecutorId } return nil } -type Call_Kill struct { - TaskId *TaskID `protobuf:"bytes,1,req,name=task_id" json:"task_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Call_Kill) Reset() { *m = Call_Kill{} } -func (m *Call_Kill) String() string { return proto.CompactTextString(m) } -func (*Call_Kill) ProtoMessage() {} - -func (m *Call_Kill) GetTaskId() *TaskID { +func (m *Call_Shutdown) GetSlaveId() *SlaveID { if m != nil { - return m.TaskId + return m.SlaveId } return nil } +// Acknowledges the receipt of status update. Schedulers are +// responsible for explicitly acknowledging the receipt of status +// updates that have 'Update.status().uuid()' field set. Such status +// updates are retried by the slave until they are acknowledged by +// the scheduler. type Call_Acknowledge struct { SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` TaskId *TaskID `protobuf:"bytes,2,req,name=task_id" json:"task_id,omitempty"` @@ -612,30 +714,56 @@ func (m *Call_Acknowledge) GetUuid() []byte { return nil } -// Allows the framework to query the status for non-terminal tasks. +// Allows the scheduler to query the status for non-terminal tasks. // This causes the master to send back the latest task status for -// each task in 'statuses', if possible. Tasks that are no longer -// known will result in a TASK_LOST update. If statuses is empty, -// then the master will send the latest status for each task -// currently known. -// TODO(bmahler): Add a guiding document for reconciliation or -// document reconciliation in-depth here. +// each task in 'tasks', if possible. Tasks that are no longer known +// will result in a TASK_LOST update. If 'statuses' is empty, then +// the master will send the latest status for each task currently +// known. type Call_Reconcile struct { - Statuses []*TaskStatus `protobuf:"bytes,1,rep,name=statuses" json:"statuses,omitempty"` - XXX_unrecognized []byte `json:"-"` + Tasks []*Call_Reconcile_Task `protobuf:"bytes,1,rep,name=tasks" json:"tasks,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *Call_Reconcile) Reset() { *m = Call_Reconcile{} } func (m *Call_Reconcile) String() string { return proto.CompactTextString(m) } func (*Call_Reconcile) ProtoMessage() {} -func (m *Call_Reconcile) GetStatuses() []*TaskStatus { +func (m *Call_Reconcile) GetTasks() []*Call_Reconcile_Task { + if m != nil { + return m.Tasks + } + return nil +} + +// TODO(vinod): Support arbitrary queries than just state of tasks. +type Call_Reconcile_Task struct { + TaskId *TaskID `protobuf:"bytes,1,req,name=task_id" json:"task_id,omitempty"` + SlaveId *SlaveID `protobuf:"bytes,2,opt,name=slave_id" json:"slave_id,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Call_Reconcile_Task) Reset() { *m = Call_Reconcile_Task{} } +func (m *Call_Reconcile_Task) String() string { return proto.CompactTextString(m) } +func (*Call_Reconcile_Task) ProtoMessage() {} + +func (m *Call_Reconcile_Task) GetTaskId() *TaskID { if m != nil { - return m.Statuses + return m.TaskId + } + return nil +} + +func (m *Call_Reconcile_Task) GetSlaveId() *SlaveID { + if m != nil { + return m.SlaveId } return nil } +// Sends arbitrary binary data to the executor. Note that Mesos +// neither interprets this data nor makes any guarantees about the +// delivery of this message to the executor. type Call_Message struct { SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` ExecutorId *ExecutorID `protobuf:"bytes,2,req,name=executor_id" json:"executor_id,omitempty"` diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/scheduler.proto b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/scheduler.proto index 6117bb1211f40..dfa20500f976e 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/scheduler.proto +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/scheduler.proto @@ -23,54 +23,80 @@ import "github.com/gogo/protobuf/gogoproto/gogo.proto"; /** - * Low-level scheduler event API. + * Scheduler event API. * * An event is described using the standard protocol buffer "union" - * trick, see https://developers.google.com/protocol-buffers/docs/techniques#union. + * trick, see: + * https://developers.google.com/protocol-buffers/docs/techniques#union. */ message Event { // Possible event types, followed by message definitions if // applicable. enum Type { - REGISTERED = 1; - REREGISTERED = 2; - OFFERS = 3; - RESCIND = 4; - UPDATE = 5; - MESSAGE = 6; - FAILURE = 7; - ERROR = 8; + SUBSCRIBED = 1; // See 'Subscribed' below. + OFFERS = 2; // See 'Offers' below. + RESCIND = 3; // See 'Rescind' below. + UPDATE = 4; // See 'Update' below. + MESSAGE = 5; // See 'Message' below. + FAILURE = 6; // See 'Failure' below. + ERROR = 7; // See 'Error' below. } - message Registered { + // First event received when the scheduler subscribes. + message Subscribed { required FrameworkID framework_id = 1; - required MasterInfo master_info = 2; - } - - message Reregistered { - required FrameworkID framework_id = 1; - required MasterInfo master_info = 2; } + // Received whenever there are new resources that are offered to the + // scheduler. Each offer corresponds to a set of resources on a + // slave. Until the scheduler accepts or declines an offer the + // resources are considered allocated to the scheduler. message Offers { repeated Offer offers = 1; } + // Received when a particular offer is no longer valid (e.g., the + // slave corresponding to the offer has been removed) and hence + // needs to be rescinded. Any future calls ('Accept' / 'Decline') made + // by the scheduler regarding this offer will be invalid. message Rescind { required OfferID offer_id = 1; } + // Received whenever there is a status update that is generated by + // the executor or slave or master. Status updates should be used by + // executors to reliably communicate the status of the tasks that + // they manage. It is crucial that a terminal update (see TaskState + // in mesos.proto) is sent by the executor as soon as the task + // terminates, in order for Mesos to release the resources allocated + // to the task. It is also the responsibility of the scheduler to + // explicitly acknowledge the receipt of a status update. See + // 'Acknowledge' in the 'Call' section below for the semantics. message Update { - required bytes uuid = 1; // TODO(benh): Replace with UpdateID. - required TaskStatus status = 2; + required TaskStatus status = 1; } + // Received when a custom message generated by the executor is + // forwarded by the master. Note that this message is not + // interpreted by Mesos and is only forwarded (without reliability + // guarantees) to the scheduler. It is up to the executor to retry + // if the message is dropped for any reason. message Message { required SlaveID slave_id = 1; required ExecutorID executor_id = 2; required bytes data = 3; } + // Received when a slave is removed from the cluster (e.g., failed + // health checks) or when an executor is terminated. Note that, this + // event coincides with receipt of terminal UPDATE events for any + // active tasks belonging to the slave or executor and receipt of + // 'Rescind' events for any outstanding offers belonging to the + // slave. Note that there is no guaranteed order between the + // 'Failure', 'Update' and 'Rescind' events when a slave or executor + // is removed. + // TODO(vinod): Consider splitting the lost slave and terminated + // executor into separate events and ensure it's reliably generated. message Failure { optional SlaveID slave_id = 1; @@ -81,29 +107,33 @@ message Event { optional int32 status = 3; } + // Received when an invalid framework (e.g., unauthenticated, + // unauthorized) attempts to subscribe with the master. Error can + // also be received if scheduler sends invalid Calls (e.g., not + // properly initialized). + // TODO(vinod): Remove this once the old scheduler driver is no + // longer supported. With HTTP API all errors will be signaled via + // HTTP response codes. message Error { required string message = 1; } - // TODO(benh): Add a 'from' or 'sender'. - // Type of the event, indicates which optional field below should be // present if that type has a nested message definition. required Type type = 1; - optional Registered registered = 2; - optional Reregistered reregistered = 3; - optional Offers offers = 4; - optional Rescind rescind = 5; - optional Update update = 6; - optional Message message = 7; - optional Failure failure = 8; - optional Error error = 9; + optional Subscribed subscribed = 2; + optional Offers offers = 3; + optional Rescind rescind = 4; + optional Update update = 5; + optional Message message = 6; + optional Failure failure = 7; + optional Error error = 8; } /** - * Low-level scheduler call API. + * Scheduler call API. * * Like Event, a Call is described using the standard protocol buffer * "union" trick (see above). @@ -112,20 +142,19 @@ message Call { // Possible call types, followed by message definitions if // applicable. enum Type { - REGISTER = 1; - REREGISTER = 2; - UNREGISTER = 3; - REQUEST = 4; - DECLINE = 5; - REVIVE = 6; - LAUNCH = 7; - KILL = 8; - ACKNOWLEDGE = 9; - RECONCILE = 10; - MESSAGE = 11; + SUBSCRIBE = 1; // See 'Subscribe' below. + TEARDOWN = 2; // Shuts down all tasks/executors and removes framework. + ACCEPT = 3; // See 'Accept' below. + DECLINE = 4; // See 'Decline' below. + REVIVE = 5; // Removes any previous filters set via ACCEPT or DECLINE. + KILL = 6; // See 'Kill' below. + SHUTDOWN = 7; // See 'Shutdown' below. + ACKNOWLEDGE = 8; // See 'Acknowledge' below. + RECONCILE = 9; // See 'Reconcile' below. + MESSAGE = 10; // See 'Message' below. // TODO(benh): Consider adding an 'ACTIVATE' and 'DEACTIVATE' for - // already registered frameworks as a way of stopping offers from + // already subscribed frameworks as a way of stopping offers from // being generated and other events from being sent by the master. // Note that this functionality existed originally to support // SchedulerDriver::abort which was only necessary to handle @@ -133,63 +162,144 @@ message Call { // something that is not an issue with the Event/Call API. } - message Request { - repeated mesosproto.Request requests = 1; + // Subscribes the scheduler with the master to receive events. A + // scheduler must send other calls only after it has received the + // SUBCRIBED event. + message Subscribe { + // See the comments below on 'framework_id' on the semantics for + // 'framework_info.id'. + required FrameworkInfo framework_info = 1; + + // 'force' field is only relevant when 'framework_info.id' is set. + // It tells the master what to do in case an instance of the + // scheduler attempts to subscribe when another instance of it is + // already connected (e.g., split brain due to network partition). + // If 'force' is true, this scheduler instance is allowed and the + // old connected scheduler instance is disconnected. If false, + // this scheduler instance is disallowed subscription in favor of + // the already connected scheduler instance. + // + // It is recommended to set this to true only when a newly elected + // scheduler instance is attempting to subscribe but not when a + // scheduler is retrying subscription (e.g., disconnection or + // master failover; see sched/sched.cpp for an example). + optional bool force = 2; } - message Decline { + // Accepts an offer, performing the specified operations + // in a sequential manner. + // + // E.g. Launch a task with a newly reserved persistent volume: + // + // Accept { + // offer_ids: [ ... ] + // operations: [ + // { type: RESERVE, + // reserve: { resources: [ disk(role):2 ] } } + // { type: CREATE, + // create: { volumes: [ disk(role):1+persistence ] } } + // { type: LAUNCH, + // launch: { task_infos ... disk(role):1;disk(role):1+persistence } } + // ] + // } + // + // Note that any of the offer’s resources not used in the 'Accept' + // call (e.g., to launch a task) are considered unused and might be + // reoffered to other frameworks. In other words, the same OfferID + // cannot be used in more than one 'Accept' call. + message Accept { repeated OfferID offer_ids = 1; - optional Filters filters = 2; + repeated Offer.Operation operations = 2; + optional Filters filters = 3; } - message Launch { - repeated TaskInfo task_infos = 1; - repeated OfferID offer_ids = 2; - optional Filters filters = 3; + // Declines an offer, signaling the master to potentially reoffer + // the resources to a different framework. Note that this is same + // as sending an Accept call with no operations. See comments on + // top of 'Accept' for semantics. + message Decline { + repeated OfferID offer_ids = 1; + optional Filters filters = 2; } + // Kills a specific task. If the scheduler has a custom executor, + // the kill is forwarded to the executor and it is up to the + // executor to kill the task and send a TASK_KILLED (or TASK_FAILED) + // update. Note that Mesos releases the resources for a task once it + // receives a terminal update (See TaskState in mesos.proto) for it. + // If the task is unknown to the master, a TASK_LOST update is + // generated. message Kill { required TaskID task_id = 1; + optional SlaveID slave_id = 2; } + // Shuts down a custom executor. When the executor gets a shutdown + // event, it is expected to kill all its tasks (and send TASK_KILLED + // updates) and terminate. If the executor doesn’t terminate within + // a certain timeout (configurable via + // '--executor_shutdown_grace_period' slave flag), the slave will + // forcefully destroy the container (executor and its tasks) and + // transition its active tasks to TASK_LOST. + message Shutdown { + required ExecutorID executor_id = 1; + required SlaveID slave_id = 2; + } + + // Acknowledges the receipt of status update. Schedulers are + // responsible for explicitly acknowledging the receipt of status + // updates that have 'Update.status().uuid()' field set. Such status + // updates are retried by the slave until they are acknowledged by + // the scheduler. message Acknowledge { required SlaveID slave_id = 1; required TaskID task_id = 2; required bytes uuid = 3; } - // Allows the framework to query the status for non-terminal tasks. + // Allows the scheduler to query the status for non-terminal tasks. // This causes the master to send back the latest task status for - // each task in 'statuses', if possible. Tasks that are no longer - // known will result in a TASK_LOST update. If statuses is empty, - // then the master will send the latest status for each task - // currently known. - // TODO(bmahler): Add a guiding document for reconciliation or - // document reconciliation in-depth here. + // each task in 'tasks', if possible. Tasks that are no longer known + // will result in a TASK_LOST update. If 'statuses' is empty, then + // the master will send the latest status for each task currently + // known. message Reconcile { - repeated TaskStatus statuses = 1; // Should be non-terminal only. + // TODO(vinod): Support arbitrary queries than just state of tasks. + message Task { + required TaskID task_id = 1; + optional SlaveID slave_id = 2; + } + + repeated Task tasks = 1; } + // Sends arbitrary binary data to the executor. Note that Mesos + // neither interprets this data nor makes any guarantees about the + // delivery of this message to the executor. message Message { required SlaveID slave_id = 1; required ExecutorID executor_id = 2; required bytes data = 3; } - // Identifies who generated this call. Always necessary, but the - // only thing that needs to be set for certain calls, e.g., - // REGISTER, REREGISTER, and UNREGISTER. - required FrameworkInfo framework_info = 1; + // Identifies who generated this call. Master assigns a framework id + // when a new scheduler subscribes for the first time. Once assigned, + // the scheduler must set the 'framework_id' here and within its + // FrameworkInfo (in any further 'Subscribe' calls). This allows the + // master to identify a scheduler correctly across disconnections, + // failovers, etc. + optional FrameworkID framework_id = 1; // Type of the call, indicates which optional field below should be // present if that type has a nested message definition. required Type type = 2; - optional Request request = 3; - optional Decline decline = 4; - optional Launch launch = 5; + optional Subscribe subscribe = 3; + optional Accept accept = 4; + optional Decline decline = 5; optional Kill kill = 6; - optional Acknowledge acknowledge = 7; - optional Reconcile reconcile = 8; - optional Message message = 9; + optional Shutdown shutdown = 7; + optional Acknowledge acknowledge = 8; + optional Reconcile reconcile = 9; + optional Message message = 10; } diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/state.pb.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/state.pb.go index b584062be0020..db42a71b36fe5 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/state.pb.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/state.pb.go @@ -5,30 +5,24 @@ package mesosproto import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" import math "math" -// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto/gogo.pb" +// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" -import io2 "io" -import fmt8 "fmt" -import github_com_gogo_protobuf_proto4 "github.com/gogo/protobuf/proto" +import bytes "bytes" -import fmt9 "fmt" -import strings4 "strings" -import reflect4 "reflect" +import strings "strings" +import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" +import sort "sort" +import strconv "strconv" +import reflect "reflect" -import fmt10 "fmt" -import strings5 "strings" -import github_com_gogo_protobuf_proto5 "github.com/gogo/protobuf/proto" -import sort2 "sort" -import strconv2 "strconv" -import reflect5 "reflect" - -import fmt11 "fmt" -import bytes2 "bytes" +import io "io" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal +var _ = fmt.Errorf var _ = math.Inf type Operation_Type int32 @@ -192,795 +186,508 @@ func (m *Operation_Expunge) GetName() string { func init() { proto.RegisterEnum("mesosproto.Operation_Type", Operation_Type_name, Operation_Type_value) } -func (m *Entry) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io2.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt8.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io2.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io2.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Name = &s - index = postIndex - case 2: - if wireType != 2 { - return fmt8.Errorf("proto: wrong wireType = %d for field Uuid", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io2.ErrUnexpectedEOF - } - b := data[index] - index++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + byteLen - if postIndex > l { - return io2.ErrUnexpectedEOF - } - m.Uuid = append([]byte{}, data[index:postIndex]...) - index = postIndex - case 3: - if wireType != 2 { - return fmt8.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io2.ErrUnexpectedEOF - } - b := data[index] - index++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + byteLen - if postIndex > l { - return io2.ErrUnexpectedEOF - } - m.Value = append([]byte{}, data[index:postIndex]...) - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto4.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io2.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy +func (this *Entry) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } + return fmt.Errorf("that == nil && this != nil") } - return nil -} -func (m *Operation) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io2.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } + + that1, ok := that.(*Entry) + if !ok { + return fmt.Errorf("that is not of type *Entry") + } + if that1 == nil { + if this == nil { + return nil } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt8.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v Operation_Type - for shift := uint(0); ; shift += 7 { - if index >= l { - return io2.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (Operation_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - case 2: - if wireType != 2 { - return fmt8.Errorf("proto: wrong wireType = %d for field Snapshot", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io2.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io2.ErrUnexpectedEOF - } - if m.Snapshot == nil { - m.Snapshot = &Operation_Snapshot{} - } - if err := m.Snapshot.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 4: - if wireType != 2 { - return fmt8.Errorf("proto: wrong wireType = %d for field Diff", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io2.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io2.ErrUnexpectedEOF - } - if m.Diff == nil { - m.Diff = &Operation_Diff{} - } - if err := m.Diff.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 3: - if wireType != 2 { - return fmt8.Errorf("proto: wrong wireType = %d for field Expunge", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io2.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io2.ErrUnexpectedEOF - } - if m.Expunge == nil { - m.Expunge = &Operation_Expunge{} - } - if err := m.Expunge.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto4.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io2.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return fmt.Errorf("that is type *Entry but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Entrybut is not nil && this == nil") + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) } + } else if this.Name != nil { + return fmt.Errorf("this.Name == nil && that.Name != nil") + } else if that1.Name != nil { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) + } + if !bytes.Equal(this.Uuid, that1.Uuid) { + return fmt.Errorf("Uuid this(%v) Not Equal that(%v)", this.Uuid, that1.Uuid) + } + if !bytes.Equal(this.Value, that1.Value) { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *Operation_Snapshot) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io2.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *Entry) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt8.Errorf("proto: wrong wireType = %d for field Entry", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io2.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io2.ErrUnexpectedEOF - } - if m.Entry == nil { - m.Entry = &Entry{} - } - if err := m.Entry.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto4.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io2.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return false + } + + that1, ok := that.(*Entry) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true } + return false + } else if this == nil { + return false } - return nil -} -func (m *Operation_Diff) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io2.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt8.Errorf("proto: wrong wireType = %d for field Entry", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io2.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io2.ErrUnexpectedEOF - } - if m.Entry == nil { - m.Entry = &Entry{} - } - if err := m.Entry.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto4.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io2.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return false } + } else if this.Name != nil { + return false + } else if that1.Name != nil { + return false } - return nil -} -func (m *Operation_Expunge) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io2.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt8.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io2.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io2.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Name = &s - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto4.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io2.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy - } + if !bytes.Equal(this.Uuid, that1.Uuid) { + return false } - return nil -} -func (this *Entry) String() string { - if this == nil { - return "nil" + if !bytes.Equal(this.Value, that1.Value) { + return false } - s := strings4.Join([]string{`&Entry{`, - `Name:` + valueToStringState(this.Name) + `,`, - `Uuid:` + valueToStringState(this.Uuid) + `,`, - `Value:` + valueToStringState(this.Value) + `,`, - `XXX_unrecognized:` + fmt9.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Operation) String() string { - if this == nil { - return "nil" + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false } - s := strings4.Join([]string{`&Operation{`, - `Type:` + valueToStringState(this.Type) + `,`, - `Snapshot:` + strings4.Replace(fmt9.Sprintf("%v", this.Snapshot), "Operation_Snapshot", "Operation_Snapshot", 1) + `,`, - `Diff:` + strings4.Replace(fmt9.Sprintf("%v", this.Diff), "Operation_Diff", "Operation_Diff", 1) + `,`, - `Expunge:` + strings4.Replace(fmt9.Sprintf("%v", this.Expunge), "Operation_Expunge", "Operation_Expunge", 1) + `,`, - `XXX_unrecognized:` + fmt9.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + return true } -func (this *Operation_Snapshot) String() string { - if this == nil { - return "nil" +func (this *Operation) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") } - s := strings4.Join([]string{`&Operation_Snapshot{`, - `Entry:` + strings4.Replace(fmt9.Sprintf("%v", this.Entry), "Entry", "Entry", 1) + `,`, - `XXX_unrecognized:` + fmt9.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Operation_Diff) String() string { - if this == nil { - return "nil" + + that1, ok := that.(*Operation) + if !ok { + return fmt.Errorf("that is not of type *Operation") } - s := strings4.Join([]string{`&Operation_Diff{`, - `Entry:` + strings4.Replace(fmt9.Sprintf("%v", this.Entry), "Entry", "Entry", 1) + `,`, - `XXX_unrecognized:` + fmt9.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Operation_Expunge) String() string { - if this == nil { - return "nil" + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Operation but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Operationbut is not nil && this == nil") } - s := strings4.Join([]string{`&Operation_Expunge{`, - `Name:` + valueToStringState(this.Name) + `,`, - `XXX_unrecognized:` + fmt9.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func valueToStringState(v interface{}) string { - rv := reflect4.ValueOf(v) - if rv.IsNil() { - return "nil" + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) + } + } else if this.Type != nil { + return fmt.Errorf("this.Type == nil && that.Type != nil") + } else if that1.Type != nil { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) } - pv := reflect4.Indirect(rv).Interface() - return fmt9.Sprintf("*%v", pv) -} -func (m *Entry) Size() (n int) { - var l int - _ = l - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovState(uint64(l)) + if !this.Snapshot.Equal(that1.Snapshot) { + return fmt.Errorf("Snapshot this(%v) Not Equal that(%v)", this.Snapshot, that1.Snapshot) } - if m.Uuid != nil { - l = len(m.Uuid) - n += 1 + l + sovState(uint64(l)) + if !this.Diff.Equal(that1.Diff) { + return fmt.Errorf("Diff this(%v) Not Equal that(%v)", this.Diff, that1.Diff) } - if m.Value != nil { - l = len(m.Value) - n += 1 + l + sovState(uint64(l)) + if !this.Expunge.Equal(that1.Expunge) { + return fmt.Errorf("Expunge this(%v) Not Equal that(%v)", this.Expunge, that1.Expunge) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } - return n + return nil } +func (this *Operation) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } -func (m *Operation) Size() (n int) { - var l int - _ = l - if m.Type != nil { - n += 1 + sovState(uint64(*m.Type)) + that1, ok := that.(*Operation) + if !ok { + return false } - if m.Snapshot != nil { - l = m.Snapshot.Size() - n += 1 + l + sovState(uint64(l)) + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false } - if m.Diff != nil { - l = m.Diff.Size() - n += 1 + l + sovState(uint64(l)) + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return false + } + } else if this.Type != nil { + return false + } else if that1.Type != nil { + return false } - if m.Expunge != nil { - l = m.Expunge.Size() - n += 1 + l + sovState(uint64(l)) + if !this.Snapshot.Equal(that1.Snapshot) { + return false } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if !this.Diff.Equal(that1.Diff) { + return false } - return n -} - -func (m *Operation_Snapshot) Size() (n int) { - var l int - _ = l - if m.Entry != nil { - l = m.Entry.Size() - n += 1 + l + sovState(uint64(l)) + if !this.Expunge.Equal(that1.Expunge) { + return false } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false } - return n + return true } +func (this *Operation_Snapshot) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } -func (m *Operation_Diff) Size() (n int) { - var l int - _ = l - if m.Entry != nil { - l = m.Entry.Size() - n += 1 + l + sovState(uint64(l)) + that1, ok := that.(*Operation_Snapshot) + if !ok { + return fmt.Errorf("that is not of type *Operation_Snapshot") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Operation_Snapshot but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Operation_Snapshotbut is not nil && this == nil") } - return n + if !this.Entry.Equal(that1.Entry) { + return fmt.Errorf("Entry this(%v) Not Equal that(%v)", this.Entry, that1.Entry) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil } - -func (m *Operation_Expunge) Size() (n int) { - var l int - _ = l - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovState(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) +func (this *Operation_Snapshot) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false } - return n -} -func sovState(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } + that1, ok := that.(*Operation_Snapshot) + if !ok { + return false } - return n -} -func sozState(x uint64) (n int) { - return sovState(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func NewPopulatedEntry(r randyState, easy bool) *Entry { - this := &Entry{} - v1 := randStringState(r) - this.Name = &v1 - v2 := r.Intn(100) - this.Uuid = make([]byte, v2) - for i := 0; i < v2; i++ { - this.Uuid[i] = byte(r.Intn(256)) + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false } - v3 := r.Intn(100) - this.Value = make([]byte, v3) - for i := 0; i < v3; i++ { - this.Value[i] = byte(r.Intn(256)) + if !this.Entry.Equal(that1.Entry) { + return false } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedState(r, 4) + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false } - return this + return true } +func (this *Operation_Diff) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } -func NewPopulatedOperation(r randyState, easy bool) *Operation { - this := &Operation{} - v4 := Operation_Type([]int32{1, 3, 2}[r.Intn(3)]) - this.Type = &v4 - if r.Intn(10) != 0 { - this.Snapshot = NewPopulatedOperation_Snapshot(r, easy) + that1, ok := that.(*Operation_Diff) + if !ok { + return fmt.Errorf("that is not of type *Operation_Diff") } - if r.Intn(10) != 0 { - this.Diff = NewPopulatedOperation_Diff(r, easy) + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Operation_Diff but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Operation_Diffbut is not nil && this == nil") } - if r.Intn(10) != 0 { - this.Expunge = NewPopulatedOperation_Expunge(r, easy) + if !this.Entry.Equal(that1.Entry) { + return fmt.Errorf("Entry this(%v) Not Equal that(%v)", this.Entry, that1.Entry) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedState(r, 5) + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } - return this + return nil } - -func NewPopulatedOperation_Snapshot(r randyState, easy bool) *Operation_Snapshot { - this := &Operation_Snapshot{} - this.Entry = NewPopulatedEntry(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedState(r, 2) +func (this *Operation_Diff) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false } - return this -} -func NewPopulatedOperation_Diff(r randyState, easy bool) *Operation_Diff { - this := &Operation_Diff{} - this.Entry = NewPopulatedEntry(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedState(r, 2) + that1, ok := that.(*Operation_Diff) + if !ok { + return false } - return this -} - -func NewPopulatedOperation_Expunge(r randyState, easy bool) *Operation_Expunge { - this := &Operation_Expunge{} - v5 := randStringState(r) - this.Name = &v5 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedState(r, 2) + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false } - return this -} - -type randyState interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneState(r randyState) rune { - res := rune(r.Uint32() % 1112064) - if 55296 <= res { - res += 2047 + if !this.Entry.Equal(that1.Entry) { + return false } - return res -} -func randStringState(r randyState) string { - v6 := r.Intn(100) - tmps := make([]rune, v6) - for i := 0; i < v6; i++ { - tmps[i] = randUTF8RuneState(r) + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false } - return string(tmps) + return true } -func randUnrecognizedState(r randyState, maxFieldNumber int) (data []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 +func (this *Operation_Expunge) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } - fieldNumber := maxFieldNumber + r.Intn(100) - data = randFieldState(data, r, fieldNumber, wire) + return fmt.Errorf("that == nil && this != nil") } - return data -} -func randFieldState(data []byte, r randyState, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - data = encodeVarintPopulateState(data, uint64(key)) - v7 := r.Int63() - if r.Intn(2) == 0 { - v7 *= -1 + + that1, ok := that.(*Operation_Expunge) + if !ok { + return fmt.Errorf("that is not of type *Operation_Expunge") + } + if that1 == nil { + if this == nil { + return nil } - data = encodeVarintPopulateState(data, uint64(v7)) - case 1: - data = encodeVarintPopulateState(data, uint64(key)) - data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - data = encodeVarintPopulateState(data, uint64(key)) - ll := r.Intn(100) - data = encodeVarintPopulateState(data, uint64(ll)) - for j := 0; j < ll; j++ { - data = append(data, byte(r.Intn(256))) + return fmt.Errorf("that is type *Operation_Expunge but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Operation_Expungebut is not nil && this == nil") + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) } - default: - data = encodeVarintPopulateState(data, uint64(key)) - data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) + } else if this.Name != nil { + return fmt.Errorf("this.Name == nil && that.Name != nil") + } else if that1.Name != nil { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) } - return data -} -func encodeVarintPopulateState(data []byte, v uint64) []byte { - for v >= 1<<7 { - data = append(data, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } - data = append(data, uint8(v)) - return data + return nil } -func (m *Entry) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err +func (this *Operation_Expunge) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false } - return data[:n], nil -} -func (m *Entry) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Name != nil { - data[i] = 0xa - i++ - i = encodeVarintState(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) + that1, ok := that.(*Operation_Expunge) + if !ok { + return false } - if m.Uuid != nil { - data[i] = 0x12 - i++ - i = encodeVarintState(data, i, uint64(len(m.Uuid))) - i += copy(data[i:], m.Uuid) + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false } - if m.Value != nil { - data[i] = 0x1a - i++ - i = encodeVarintState(data, i, uint64(len(m.Value))) - i += copy(data[i:], m.Value) + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return false + } + } else if this.Name != nil { + return false + } else if that1.Name != nil { + return false } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Entry) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 7) + s = append(s, "&mesosproto.Entry{") + if this.Name != nil { + s = append(s, "Name: "+valueToGoStringState(this.Name, "string")+",\n") + } + if this.Uuid != nil { + s = append(s, "Uuid: "+valueToGoStringState(this.Uuid, "byte")+",\n") + } + if this.Value != nil { + s = append(s, "Value: "+valueToGoStringState(this.Value, "byte")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Operation) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 8) + s = append(s, "&mesosproto.Operation{") + if this.Type != nil { + s = append(s, "Type: "+valueToGoStringState(this.Type, "mesosproto.Operation_Type")+",\n") + } + if this.Snapshot != nil { + s = append(s, "Snapshot: "+fmt.Sprintf("%#v", this.Snapshot)+",\n") + } + if this.Diff != nil { + s = append(s, "Diff: "+fmt.Sprintf("%#v", this.Diff)+",\n") + } + if this.Expunge != nil { + s = append(s, "Expunge: "+fmt.Sprintf("%#v", this.Expunge)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Operation_Snapshot) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Operation_Snapshot{") + if this.Entry != nil { + s = append(s, "Entry: "+fmt.Sprintf("%#v", this.Entry)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Operation_Diff) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Operation_Diff{") + if this.Entry != nil { + s = append(s, "Entry: "+fmt.Sprintf("%#v", this.Entry)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Operation_Expunge) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Operation_Expunge{") + if this.Name != nil { + s = append(s, "Name: "+valueToGoStringState(this.Name, "string")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringState(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) +} +func extensionToGoStringState(e map[int32]github_com_gogo_protobuf_proto.Extension) string { + if e == nil { + return "nil" + } + s := "map[int32]proto.Extension{" + keys := make([]int, 0, len(e)) + for k := range e { + keys = append(keys, int(k)) + } + sort.Ints(keys) + ss := []string{} + for _, k := range keys { + ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString()) + } + s += strings.Join(ss, ",") + "}" + return s +} +func (m *Entry) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err + } + return data[:n], nil +} + +func (m *Entry) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Name == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") + } else { + data[i] = 0xa + i++ + i = encodeVarintState(data, i, uint64(len(*m.Name))) + i += copy(data[i:], *m.Name) + } + if m.Uuid == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("uuid") + } else { + data[i] = 0x12 + i++ + i = encodeVarintState(data, i, uint64(len(m.Uuid))) + i += copy(data[i:], m.Uuid) + } + if m.Value == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") + } else { + data[i] = 0x1a + i++ + i = encodeVarintState(data, i, uint64(len(m.Value))) + i += copy(data[i:], m.Value) + } + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } return i, nil } @@ -995,12 +702,14 @@ func (m *Operation) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Operation) MarshalTo(data []byte) (n int, err error) { +func (m *Operation) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Type != nil { + if m.Type == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") + } else { data[i] = 0x8 i++ i = encodeVarintState(data, i, uint64(*m.Type)) @@ -1015,21 +724,21 @@ func (m *Operation) MarshalTo(data []byte) (n int, err error) { } i += n1 } - if m.Diff != nil { - data[i] = 0x22 + if m.Expunge != nil { + data[i] = 0x1a i++ - i = encodeVarintState(data, i, uint64(m.Diff.Size())) - n2, err := m.Diff.MarshalTo(data[i:]) + i = encodeVarintState(data, i, uint64(m.Expunge.Size())) + n2, err := m.Expunge.MarshalTo(data[i:]) if err != nil { return 0, err } i += n2 } - if m.Expunge != nil { - data[i] = 0x1a + if m.Diff != nil { + data[i] = 0x22 i++ - i = encodeVarintState(data, i, uint64(m.Expunge.Size())) - n3, err := m.Expunge.MarshalTo(data[i:]) + i = encodeVarintState(data, i, uint64(m.Diff.Size())) + n3, err := m.Diff.MarshalTo(data[i:]) if err != nil { return 0, err } @@ -1051,12 +760,14 @@ func (m *Operation_Snapshot) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Operation_Snapshot) MarshalTo(data []byte) (n int, err error) { +func (m *Operation_Snapshot) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Entry != nil { + if m.Entry == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("entry") + } else { data[i] = 0xa i++ i = encodeVarintState(data, i, uint64(m.Entry.Size())) @@ -1082,12 +793,14 @@ func (m *Operation_Diff) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Operation_Diff) MarshalTo(data []byte) (n int, err error) { +func (m *Operation_Diff) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Entry != nil { + if m.Entry == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("entry") + } else { data[i] = 0xa i++ i = encodeVarintState(data, i, uint64(m.Entry.Size())) @@ -1113,12 +826,14 @@ func (m *Operation_Expunge) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Operation_Expunge) MarshalTo(data []byte) (n int, err error) { +func (m *Operation_Expunge) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Name != nil { + if m.Name == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") + } else { data[i] = 0xa i++ i = encodeVarintState(data, i, uint64(len(*m.Name))) @@ -1157,424 +872,932 @@ func encodeVarintState(data []byte, offset int, v uint64) int { data[offset] = uint8(v) return offset + 1 } -func (this *Entry) GoString() string { - if this == nil { - return "nil" - } - s := strings5.Join([]string{`&mesosproto.Entry{` + - `Name:` + valueToGoStringState(this.Name, "string"), - `Uuid:` + valueToGoStringState(this.Uuid, "byte"), - `Value:` + valueToGoStringState(this.Value, "byte"), - `XXX_unrecognized:` + fmt10.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Operation) GoString() string { - if this == nil { - return "nil" - } - s := strings5.Join([]string{`&mesosproto.Operation{` + - `Type:` + valueToGoStringState(this.Type, "mesosproto.Operation_Type"), - `Snapshot:` + fmt10.Sprintf("%#v", this.Snapshot), - `Diff:` + fmt10.Sprintf("%#v", this.Diff), - `Expunge:` + fmt10.Sprintf("%#v", this.Expunge), - `XXX_unrecognized:` + fmt10.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Operation_Snapshot) GoString() string { - if this == nil { - return "nil" +func NewPopulatedEntry(r randyState, easy bool) *Entry { + this := &Entry{} + v1 := randStringState(r) + this.Name = &v1 + v2 := r.Intn(100) + this.Uuid = make([]byte, v2) + for i := 0; i < v2; i++ { + this.Uuid[i] = byte(r.Intn(256)) } - s := strings5.Join([]string{`&mesosproto.Operation_Snapshot{` + - `Entry:` + fmt10.Sprintf("%#v", this.Entry), - `XXX_unrecognized:` + fmt10.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Operation_Diff) GoString() string { - if this == nil { - return "nil" + v3 := r.Intn(100) + this.Value = make([]byte, v3) + for i := 0; i < v3; i++ { + this.Value[i] = byte(r.Intn(256)) } - s := strings5.Join([]string{`&mesosproto.Operation_Diff{` + - `Entry:` + fmt10.Sprintf("%#v", this.Entry), - `XXX_unrecognized:` + fmt10.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Operation_Expunge) GoString() string { - if this == nil { - return "nil" + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedState(r, 4) } - s := strings5.Join([]string{`&mesosproto.Operation_Expunge{` + - `Name:` + valueToGoStringState(this.Name, "string"), - `XXX_unrecognized:` + fmt10.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + return this } -func valueToGoStringState(v interface{}, typ string) string { - rv := reflect5.ValueOf(v) - if rv.IsNil() { - return "nil" + +func NewPopulatedOperation(r randyState, easy bool) *Operation { + this := &Operation{} + v4 := Operation_Type([]int32{1, 3, 2}[r.Intn(3)]) + this.Type = &v4 + if r.Intn(10) != 0 { + this.Snapshot = NewPopulatedOperation_Snapshot(r, easy) } - pv := reflect5.Indirect(rv).Interface() - return fmt10.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func extensionToGoStringState(e map[int32]github_com_gogo_protobuf_proto5.Extension) string { - if e == nil { - return "nil" + if r.Intn(10) != 0 { + this.Expunge = NewPopulatedOperation_Expunge(r, easy) } - s := "map[int32]proto.Extension{" - keys := make([]int, 0, len(e)) - for k := range e { - keys = append(keys, int(k)) + if r.Intn(10) != 0 { + this.Diff = NewPopulatedOperation_Diff(r, easy) } - sort2.Ints(keys) - ss := []string{} - for _, k := range keys { - ss = append(ss, strconv2.Itoa(k)+": "+e[int32(k)].GoString()) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedState(r, 5) } - s += strings5.Join(ss, ",") + "}" - return s + return this } -func (this *Entry) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt11.Errorf("that == nil && this != nil") - } - that1, ok := that.(*Entry) - if !ok { - return fmt11.Errorf("that is not of type *Entry") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt11.Errorf("that is type *Entry but is nil && this != nil") - } else if this == nil { - return fmt11.Errorf("that is type *Entrybut is not nil && this == nil") +func NewPopulatedOperation_Snapshot(r randyState, easy bool) *Operation_Snapshot { + this := &Operation_Snapshot{} + this.Entry = NewPopulatedEntry(r, easy) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedState(r, 2) } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt11.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) - } - } else if this.Name != nil { - return fmt11.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt11.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) + return this +} + +func NewPopulatedOperation_Diff(r randyState, easy bool) *Operation_Diff { + this := &Operation_Diff{} + this.Entry = NewPopulatedEntry(r, easy) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedState(r, 2) } - if !bytes2.Equal(this.Uuid, that1.Uuid) { - return fmt11.Errorf("Uuid this(%v) Not Equal that(%v)", this.Uuid, that1.Uuid) + return this +} + +func NewPopulatedOperation_Expunge(r randyState, easy bool) *Operation_Expunge { + this := &Operation_Expunge{} + v5 := randStringState(r) + this.Name = &v5 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedState(r, 2) } - if !bytes2.Equal(this.Value, that1.Value) { - return fmt11.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + return this +} + +type randyState interface { + Float32() float32 + Float64() float64 + Int63() int64 + Int31() int32 + Uint32() uint32 + Intn(n int) int +} + +func randUTF8RuneState(r randyState) rune { + ru := r.Intn(62) + if ru < 10 { + return rune(ru + 48) + } else if ru < 36 { + return rune(ru + 55) } - if !bytes2.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt11.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + return rune(ru + 61) +} +func randStringState(r randyState) string { + v6 := r.Intn(100) + tmps := make([]rune, v6) + for i := 0; i < v6; i++ { + tmps[i] = randUTF8RuneState(r) } - return nil + return string(tmps) } -func (this *Entry) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true +func randUnrecognizedState(r randyState, maxFieldNumber int) (data []byte) { + l := r.Intn(5) + for i := 0; i < l; i++ { + wire := r.Intn(4) + if wire == 3 { + wire = 5 } - return false + fieldNumber := maxFieldNumber + r.Intn(100) + data = randFieldState(data, r, fieldNumber, wire) } - - that1, ok := that.(*Entry) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false - } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false - } - if !bytes2.Equal(this.Uuid, that1.Uuid) { - return false - } - if !bytes2.Equal(this.Value, that1.Value) { - return false - } - if !bytes2.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true + return data } -func (this *Operation) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil +func randFieldState(data []byte, r randyState, fieldNumber int, wire int) []byte { + key := uint32(fieldNumber)<<3 | uint32(wire) + switch wire { + case 0: + data = encodeVarintPopulateState(data, uint64(key)) + v7 := r.Int63() + if r.Intn(2) == 0 { + v7 *= -1 } - return fmt11.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Operation) - if !ok { - return fmt11.Errorf("that is not of type *Operation") - } - if that1 == nil { - if this == nil { - return nil + data = encodeVarintPopulateState(data, uint64(v7)) + case 1: + data = encodeVarintPopulateState(data, uint64(key)) + data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) + case 2: + data = encodeVarintPopulateState(data, uint64(key)) + ll := r.Intn(100) + data = encodeVarintPopulateState(data, uint64(ll)) + for j := 0; j < ll; j++ { + data = append(data, byte(r.Intn(256))) } - return fmt11.Errorf("that is type *Operation but is nil && this != nil") - } else if this == nil { - return fmt11.Errorf("that is type *Operationbut is not nil && this == nil") + default: + data = encodeVarintPopulateState(data, uint64(key)) + data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt11.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) - } - } else if this.Type != nil { - return fmt11.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt11.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) + return data +} +func encodeVarintPopulateState(data []byte, v uint64) []byte { + for v >= 1<<7 { + data = append(data, uint8(uint64(v)&0x7f|0x80)) + v >>= 7 } - if !this.Snapshot.Equal(that1.Snapshot) { - return fmt11.Errorf("Snapshot this(%v) Not Equal that(%v)", this.Snapshot, that1.Snapshot) + data = append(data, uint8(v)) + return data +} +func (m *Entry) Size() (n int) { + var l int + _ = l + if m.Name != nil { + l = len(*m.Name) + n += 1 + l + sovState(uint64(l)) } - if !this.Diff.Equal(that1.Diff) { - return fmt11.Errorf("Diff this(%v) Not Equal that(%v)", this.Diff, that1.Diff) + if m.Uuid != nil { + l = len(m.Uuid) + n += 1 + l + sovState(uint64(l)) } - if !this.Expunge.Equal(that1.Expunge) { - return fmt11.Errorf("Expunge this(%v) Not Equal that(%v)", this.Expunge, that1.Expunge) + if m.Value != nil { + l = len(m.Value) + n += 1 + l + sovState(uint64(l)) } - if !bytes2.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt11.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return nil + return n } -func (this *Operation) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - that1, ok := that.(*Operation) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false - } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false +func (m *Operation) Size() (n int) { + var l int + _ = l + if m.Type != nil { + n += 1 + sovState(uint64(*m.Type)) } - if !this.Snapshot.Equal(that1.Snapshot) { - return false + if m.Snapshot != nil { + l = m.Snapshot.Size() + n += 1 + l + sovState(uint64(l)) } - if !this.Diff.Equal(that1.Diff) { - return false + if m.Expunge != nil { + l = m.Expunge.Size() + n += 1 + l + sovState(uint64(l)) } - if !this.Expunge.Equal(that1.Expunge) { - return false + if m.Diff != nil { + l = m.Diff.Size() + n += 1 + l + sovState(uint64(l)) } - if !bytes2.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return true + return n } -func (this *Operation_Snapshot) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt11.Errorf("that == nil && this != nil") - } - that1, ok := that.(*Operation_Snapshot) - if !ok { - return fmt11.Errorf("that is not of type *Operation_Snapshot") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt11.Errorf("that is type *Operation_Snapshot but is nil && this != nil") - } else if this == nil { - return fmt11.Errorf("that is type *Operation_Snapshotbut is not nil && this == nil") - } - if !this.Entry.Equal(that1.Entry) { - return fmt11.Errorf("Entry this(%v) Not Equal that(%v)", this.Entry, that1.Entry) +func (m *Operation_Snapshot) Size() (n int) { + var l int + _ = l + if m.Entry != nil { + l = m.Entry.Size() + n += 1 + l + sovState(uint64(l)) } - if !bytes2.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt11.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return nil + return n } -func (this *Operation_Snapshot) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - that1, ok := that.(*Operation_Snapshot) - if !ok { - return false +func (m *Operation_Diff) Size() (n int) { + var l int + _ = l + if m.Entry != nil { + l = m.Entry.Size() + n += 1 + l + sovState(uint64(l)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if !this.Entry.Equal(that1.Entry) { - return false + return n +} + +func (m *Operation_Expunge) Size() (n int) { + var l int + _ = l + if m.Name != nil { + l = len(*m.Name) + n += 1 + l + sovState(uint64(l)) } - if !bytes2.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return true + return n } -func (this *Operation_Diff) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt11.Errorf("that == nil && this != nil") - } - that1, ok := that.(*Operation_Diff) - if !ok { - return fmt11.Errorf("that is not of type *Operation_Diff") - } - if that1 == nil { - if this == nil { - return nil +func sovState(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break } - return fmt11.Errorf("that is type *Operation_Diff but is nil && this != nil") - } else if this == nil { - return fmt11.Errorf("that is type *Operation_Diffbut is not nil && this == nil") } - if !this.Entry.Equal(that1.Entry) { - return fmt11.Errorf("Entry this(%v) Not Equal that(%v)", this.Entry, that1.Entry) + return n +} +func sozState(x uint64) (n int) { + return sovState(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *Entry) String() string { + if this == nil { + return "nil" } - if !bytes2.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt11.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + s := strings.Join([]string{`&Entry{`, + `Name:` + valueToStringState(this.Name) + `,`, + `Uuid:` + valueToStringState(this.Uuid) + `,`, + `Value:` + valueToStringState(this.Value) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Operation) String() string { + if this == nil { + return "nil" } - return nil + s := strings.Join([]string{`&Operation{`, + `Type:` + valueToStringState(this.Type) + `,`, + `Snapshot:` + strings.Replace(fmt.Sprintf("%v", this.Snapshot), "Operation_Snapshot", "Operation_Snapshot", 1) + `,`, + `Expunge:` + strings.Replace(fmt.Sprintf("%v", this.Expunge), "Operation_Expunge", "Operation_Expunge", 1) + `,`, + `Diff:` + strings.Replace(fmt.Sprintf("%v", this.Diff), "Operation_Diff", "Operation_Diff", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s } -func (this *Operation_Diff) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false +func (this *Operation_Snapshot) String() string { + if this == nil { + return "nil" } - - that1, ok := that.(*Operation_Diff) - if !ok { - return false + s := strings.Join([]string{`&Operation_Snapshot{`, + `Entry:` + strings.Replace(fmt.Sprintf("%v", this.Entry), "Entry", "Entry", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Operation_Diff) String() string { + if this == nil { + return "nil" } - if that1 == nil { - if this == nil { - return true + s := strings.Join([]string{`&Operation_Diff{`, + `Entry:` + strings.Replace(fmt.Sprintf("%v", this.Entry), "Entry", "Entry", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Operation_Expunge) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Operation_Expunge{`, + `Name:` + valueToStringState(this.Name) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func valueToStringState(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *Entry) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Name = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Uuid", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Uuid = append([]byte{}, data[iNdEx:postIndex]...) + iNdEx = postIndex + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append([]byte{}, data[iNdEx:postIndex]...) + iNdEx = postIndex + hasFields[0] |= uint64(0x00000004) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipState(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthState + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false - } else if this == nil { - return false } - if !this.Entry.Equal(that1.Entry) { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") } - if !bytes2.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("uuid") } - return true + if hasFields[0]&uint64(0x00000004) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") + } + + return nil } -func (this *Operation_Expunge) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil +func (m *Operation) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var v Operation_Type + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (Operation_Type(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Type = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Snapshot", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Snapshot == nil { + m.Snapshot = &Operation_Snapshot{} + } + if err := m.Snapshot.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expunge", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Expunge == nil { + m.Expunge = &Operation_Expunge{} + } + if err := m.Expunge.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Diff", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Diff == nil { + m.Diff = &Operation_Diff{} + } + if err := m.Diff.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipState(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthState + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt11.Errorf("that == nil && this != nil") } - - that1, ok := that.(*Operation_Expunge) - if !ok { - return fmt11.Errorf("that is not of type *Operation_Expunge") + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") } - if that1 == nil { - if this == nil { - return nil + + return nil +} +func (m *Operation_Snapshot) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - return fmt11.Errorf("that is type *Operation_Expunge but is nil && this != nil") - } else if this == nil { - return fmt11.Errorf("that is type *Operation_Expungebut is not nil && this == nil") - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt11.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Entry", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Entry == nil { + m.Entry = &Entry{} + } + if err := m.Entry.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipState(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthState + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Name != nil { - return fmt11.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt11.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) } - if !bytes2.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt11.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("entry") } + return nil } -func (this *Operation_Expunge) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true +func (m *Operation_Diff) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Entry", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Entry == nil { + m.Entry = &Entry{} + } + if err := m.Entry.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipState(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthState + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false } - - that1, ok := that.(*Operation_Expunge) - if !ok { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("entry") } - if that1 == nil { - if this == nil { - return true + + return nil +} +func (m *Operation_Expunge) Unmarshal(data []byte) error { + var hasFields [1]uint64 + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - return false - } else if this == nil { - return false - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Name = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipState(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthState + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false } - if !bytes2.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") } - return true + + return nil +} +func skipState(data []byte) (n int, err error) { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for { + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if data[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + iNdEx += length + if length < 0 { + return 0, ErrInvalidLengthState + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipState(data[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") } + +var ( + ErrInvalidLengthState = fmt.Errorf("proto: negative length found during unmarshaling") +) diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/statepb_test.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/statepb_test.go index 56d626beaa518..89870c024c444 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/statepb_test.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/statepb_test.go @@ -4,60 +4,60 @@ package mesosproto -import testing14 "testing" -import math_rand14 "math/rand" -import time14 "time" -import github_com_gogo_protobuf_proto8 "github.com/gogo/protobuf/proto" -import testing15 "testing" -import math_rand15 "math/rand" -import time15 "time" -import encoding_json2 "encoding/json" -import testing16 "testing" -import math_rand16 "math/rand" -import time16 "time" -import github_com_gogo_protobuf_proto9 "github.com/gogo/protobuf/proto" -import math_rand17 "math/rand" -import time17 "time" -import testing17 "testing" -import fmt4 "fmt" -import math_rand18 "math/rand" -import time18 "time" -import testing18 "testing" -import github_com_gogo_protobuf_proto10 "github.com/gogo/protobuf/proto" -import math_rand19 "math/rand" -import time19 "time" -import testing19 "testing" -import fmt5 "fmt" -import go_parser2 "go/parser" -import math_rand20 "math/rand" -import time20 "time" -import testing20 "testing" -import github_com_gogo_protobuf_proto11 "github.com/gogo/protobuf/proto" +import testing "testing" +import math_rand "math/rand" +import time "time" +import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" +import github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb" +import fmt "fmt" +import go_parser "go/parser" +import proto "github.com/gogo/protobuf/proto" +import math "math" -func TestEntryProto(t *testing14.T) { - popr := math_rand14.New(math_rand14.NewSource(time14.Now().UnixNano())) +// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +func TestEntryProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedEntry(popr, false) - data, err := github_com_gogo_protobuf_proto8.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Entry{} - if err := github_com_gogo_protobuf_proto8.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestEntryMarshalTo(t *testing14.T) { - popr := math_rand14.New(math_rand14.NewSource(time14.Now().UnixNano())) +func TestEntryMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedEntry(popr, false) size := p.Size() data := make([]byte, size) @@ -66,25 +66,25 @@ func TestEntryMarshalTo(t *testing14.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Entry{} - if err := github_com_gogo_protobuf_proto8.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkEntryProtoMarshal(b *testing14.B) { - popr := math_rand14.New(math_rand14.NewSource(616)) +func BenchmarkEntryProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Entry, 10000) for i := 0; i < 10000; i++ { @@ -92,7 +92,7 @@ func BenchmarkEntryProtoMarshal(b *testing14.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto8.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -101,12 +101,12 @@ func BenchmarkEntryProtoMarshal(b *testing14.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkEntryProtoUnmarshal(b *testing14.B) { - popr := math_rand14.New(math_rand14.NewSource(616)) +func BenchmarkEntryProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto8.Marshal(NewPopulatedEntry(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedEntry(popr, false)) if err != nil { panic(err) } @@ -116,37 +116,50 @@ func BenchmarkEntryProtoUnmarshal(b *testing14.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto8.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestOperationProto(t *testing14.T) { - popr := math_rand14.New(math_rand14.NewSource(time14.Now().UnixNano())) +func TestOperationProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation(popr, false) - data, err := github_com_gogo_protobuf_proto8.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Operation{} - if err := github_com_gogo_protobuf_proto8.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestOperationMarshalTo(t *testing14.T) { - popr := math_rand14.New(math_rand14.NewSource(time14.Now().UnixNano())) +func TestOperationMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation(popr, false) size := p.Size() data := make([]byte, size) @@ -155,25 +168,25 @@ func TestOperationMarshalTo(t *testing14.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Operation{} - if err := github_com_gogo_protobuf_proto8.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkOperationProtoMarshal(b *testing14.B) { - popr := math_rand14.New(math_rand14.NewSource(616)) +func BenchmarkOperationProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Operation, 10000) for i := 0; i < 10000; i++ { @@ -181,7 +194,7 @@ func BenchmarkOperationProtoMarshal(b *testing14.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto8.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -190,12 +203,12 @@ func BenchmarkOperationProtoMarshal(b *testing14.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkOperationProtoUnmarshal(b *testing14.B) { - popr := math_rand14.New(math_rand14.NewSource(616)) +func BenchmarkOperationProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto8.Marshal(NewPopulatedOperation(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedOperation(popr, false)) if err != nil { panic(err) } @@ -205,37 +218,50 @@ func BenchmarkOperationProtoUnmarshal(b *testing14.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto8.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestOperation_SnapshotProto(t *testing14.T) { - popr := math_rand14.New(math_rand14.NewSource(time14.Now().UnixNano())) +func TestOperation_SnapshotProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Snapshot(popr, false) - data, err := github_com_gogo_protobuf_proto8.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Operation_Snapshot{} - if err := github_com_gogo_protobuf_proto8.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestOperation_SnapshotMarshalTo(t *testing14.T) { - popr := math_rand14.New(math_rand14.NewSource(time14.Now().UnixNano())) +func TestOperation_SnapshotMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Snapshot(popr, false) size := p.Size() data := make([]byte, size) @@ -244,25 +270,25 @@ func TestOperation_SnapshotMarshalTo(t *testing14.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Operation_Snapshot{} - if err := github_com_gogo_protobuf_proto8.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkOperation_SnapshotProtoMarshal(b *testing14.B) { - popr := math_rand14.New(math_rand14.NewSource(616)) +func BenchmarkOperation_SnapshotProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Operation_Snapshot, 10000) for i := 0; i < 10000; i++ { @@ -270,7 +296,7 @@ func BenchmarkOperation_SnapshotProtoMarshal(b *testing14.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto8.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -279,12 +305,12 @@ func BenchmarkOperation_SnapshotProtoMarshal(b *testing14.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkOperation_SnapshotProtoUnmarshal(b *testing14.B) { - popr := math_rand14.New(math_rand14.NewSource(616)) +func BenchmarkOperation_SnapshotProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto8.Marshal(NewPopulatedOperation_Snapshot(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedOperation_Snapshot(popr, false)) if err != nil { panic(err) } @@ -294,37 +320,50 @@ func BenchmarkOperation_SnapshotProtoUnmarshal(b *testing14.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto8.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestOperation_DiffProto(t *testing14.T) { - popr := math_rand14.New(math_rand14.NewSource(time14.Now().UnixNano())) +func TestOperation_DiffProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Diff(popr, false) - data, err := github_com_gogo_protobuf_proto8.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Operation_Diff{} - if err := github_com_gogo_protobuf_proto8.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestOperation_DiffMarshalTo(t *testing14.T) { - popr := math_rand14.New(math_rand14.NewSource(time14.Now().UnixNano())) +func TestOperation_DiffMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Diff(popr, false) size := p.Size() data := make([]byte, size) @@ -333,25 +372,25 @@ func TestOperation_DiffMarshalTo(t *testing14.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Operation_Diff{} - if err := github_com_gogo_protobuf_proto8.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkOperation_DiffProtoMarshal(b *testing14.B) { - popr := math_rand14.New(math_rand14.NewSource(616)) +func BenchmarkOperation_DiffProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Operation_Diff, 10000) for i := 0; i < 10000; i++ { @@ -359,7 +398,7 @@ func BenchmarkOperation_DiffProtoMarshal(b *testing14.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto8.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -368,12 +407,12 @@ func BenchmarkOperation_DiffProtoMarshal(b *testing14.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkOperation_DiffProtoUnmarshal(b *testing14.B) { - popr := math_rand14.New(math_rand14.NewSource(616)) +func BenchmarkOperation_DiffProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto8.Marshal(NewPopulatedOperation_Diff(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedOperation_Diff(popr, false)) if err != nil { panic(err) } @@ -383,37 +422,50 @@ func BenchmarkOperation_DiffProtoUnmarshal(b *testing14.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto8.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestOperation_ExpungeProto(t *testing14.T) { - popr := math_rand14.New(math_rand14.NewSource(time14.Now().UnixNano())) +func TestOperation_ExpungeProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Expunge(popr, false) - data, err := github_com_gogo_protobuf_proto8.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Operation_Expunge{} - if err := github_com_gogo_protobuf_proto8.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestOperation_ExpungeMarshalTo(t *testing14.T) { - popr := math_rand14.New(math_rand14.NewSource(time14.Now().UnixNano())) +func TestOperation_ExpungeMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Expunge(popr, false) size := p.Size() data := make([]byte, size) @@ -422,25 +474,25 @@ func TestOperation_ExpungeMarshalTo(t *testing14.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Operation_Expunge{} - if err := github_com_gogo_protobuf_proto8.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkOperation_ExpungeProtoMarshal(b *testing14.B) { - popr := math_rand14.New(math_rand14.NewSource(616)) +func BenchmarkOperation_ExpungeProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Operation_Expunge, 10000) for i := 0; i < 10000; i++ { @@ -448,7 +500,7 @@ func BenchmarkOperation_ExpungeProtoMarshal(b *testing14.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto8.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -457,12 +509,12 @@ func BenchmarkOperation_ExpungeProtoMarshal(b *testing14.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkOperation_ExpungeProtoUnmarshal(b *testing14.B) { - popr := math_rand14.New(math_rand14.NewSource(616)) +func BenchmarkOperation_ExpungeProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto8.Marshal(NewPopulatedOperation_Expunge(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedOperation_Expunge(popr, false)) if err != nil { panic(err) } @@ -472,336 +524,452 @@ func BenchmarkOperation_ExpungeProtoUnmarshal(b *testing14.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto8.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestEntryJSON(t *testing15.T) { - popr := math_rand15.New(math_rand15.NewSource(time15.Now().UnixNano())) +func TestEntryJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedEntry(popr, true) - jsondata, err := encoding_json2.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Entry{} - err = encoding_json2.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestOperationJSON(t *testing15.T) { - popr := math_rand15.New(math_rand15.NewSource(time15.Now().UnixNano())) +func TestOperationJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation(popr, true) - jsondata, err := encoding_json2.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Operation{} - err = encoding_json2.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestOperation_SnapshotJSON(t *testing15.T) { - popr := math_rand15.New(math_rand15.NewSource(time15.Now().UnixNano())) +func TestOperation_SnapshotJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Snapshot(popr, true) - jsondata, err := encoding_json2.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Operation_Snapshot{} - err = encoding_json2.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestOperation_DiffJSON(t *testing15.T) { - popr := math_rand15.New(math_rand15.NewSource(time15.Now().UnixNano())) +func TestOperation_DiffJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Diff(popr, true) - jsondata, err := encoding_json2.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Operation_Diff{} - err = encoding_json2.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestOperation_ExpungeJSON(t *testing15.T) { - popr := math_rand15.New(math_rand15.NewSource(time15.Now().UnixNano())) +func TestOperation_ExpungeJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Expunge(popr, true) - jsondata, err := encoding_json2.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Operation_Expunge{} - err = encoding_json2.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestEntryProtoText(t *testing16.T) { - popr := math_rand16.New(math_rand16.NewSource(time16.Now().UnixNano())) +func TestEntryProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedEntry(popr, true) - data := github_com_gogo_protobuf_proto9.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &Entry{} - if err := github_com_gogo_protobuf_proto9.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestEntryProtoCompactText(t *testing16.T) { - popr := math_rand16.New(math_rand16.NewSource(time16.Now().UnixNano())) +func TestEntryProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedEntry(popr, true) - data := github_com_gogo_protobuf_proto9.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &Entry{} - if err := github_com_gogo_protobuf_proto9.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestOperationProtoText(t *testing16.T) { - popr := math_rand16.New(math_rand16.NewSource(time16.Now().UnixNano())) +func TestOperationProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation(popr, true) - data := github_com_gogo_protobuf_proto9.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &Operation{} - if err := github_com_gogo_protobuf_proto9.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestOperationProtoCompactText(t *testing16.T) { - popr := math_rand16.New(math_rand16.NewSource(time16.Now().UnixNano())) +func TestOperationProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation(popr, true) - data := github_com_gogo_protobuf_proto9.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &Operation{} - if err := github_com_gogo_protobuf_proto9.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestOperation_SnapshotProtoText(t *testing16.T) { - popr := math_rand16.New(math_rand16.NewSource(time16.Now().UnixNano())) +func TestOperation_SnapshotProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Snapshot(popr, true) - data := github_com_gogo_protobuf_proto9.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &Operation_Snapshot{} - if err := github_com_gogo_protobuf_proto9.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestOperation_SnapshotProtoCompactText(t *testing16.T) { - popr := math_rand16.New(math_rand16.NewSource(time16.Now().UnixNano())) +func TestOperation_SnapshotProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Snapshot(popr, true) - data := github_com_gogo_protobuf_proto9.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &Operation_Snapshot{} - if err := github_com_gogo_protobuf_proto9.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestOperation_DiffProtoText(t *testing16.T) { - popr := math_rand16.New(math_rand16.NewSource(time16.Now().UnixNano())) +func TestOperation_DiffProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Diff(popr, true) - data := github_com_gogo_protobuf_proto9.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &Operation_Diff{} - if err := github_com_gogo_protobuf_proto9.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestOperation_DiffProtoCompactText(t *testing16.T) { - popr := math_rand16.New(math_rand16.NewSource(time16.Now().UnixNano())) +func TestOperation_DiffProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Diff(popr, true) - data := github_com_gogo_protobuf_proto9.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &Operation_Diff{} - if err := github_com_gogo_protobuf_proto9.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestOperation_ExpungeProtoText(t *testing16.T) { - popr := math_rand16.New(math_rand16.NewSource(time16.Now().UnixNano())) +func TestOperation_ExpungeProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Expunge(popr, true) - data := github_com_gogo_protobuf_proto9.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &Operation_Expunge{} - if err := github_com_gogo_protobuf_proto9.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestOperation_ExpungeProtoCompactText(t *testing16.T) { - popr := math_rand16.New(math_rand16.NewSource(time16.Now().UnixNano())) +func TestOperation_ExpungeProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Expunge(popr, true) - data := github_com_gogo_protobuf_proto9.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &Operation_Expunge{} - if err := github_com_gogo_protobuf_proto9.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestEntryStringer(t *testing17.T) { - popr := math_rand17.New(math_rand17.NewSource(time17.Now().UnixNano())) +func TestEntryVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedEntry(popr, false) - s1 := p.String() - s2 := fmt4.Sprintf("%v", p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Entry{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestOperationVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOperation(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Operation{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestOperation_SnapshotVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOperation_Snapshot(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Operation_Snapshot{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestOperation_DiffVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOperation_Diff(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Operation_Diff{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestOperation_ExpungeVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOperation_Expunge(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Operation_Expunge{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestEntryGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedEntry(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) } } -func TestOperationStringer(t *testing17.T) { - popr := math_rand17.New(math_rand17.NewSource(time17.Now().UnixNano())) +func TestOperationGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedOperation(popr, false) - s1 := p.String() - s2 := fmt4.Sprintf("%v", p) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) } } -func TestOperation_SnapshotStringer(t *testing17.T) { - popr := math_rand17.New(math_rand17.NewSource(time17.Now().UnixNano())) +func TestOperation_SnapshotGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedOperation_Snapshot(popr, false) - s1 := p.String() - s2 := fmt4.Sprintf("%v", p) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) } } -func TestOperation_DiffStringer(t *testing17.T) { - popr := math_rand17.New(math_rand17.NewSource(time17.Now().UnixNano())) +func TestOperation_DiffGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedOperation_Diff(popr, false) - s1 := p.String() - s2 := fmt4.Sprintf("%v", p) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) } } -func TestOperation_ExpungeStringer(t *testing17.T) { - popr := math_rand17.New(math_rand17.NewSource(time17.Now().UnixNano())) +func TestOperation_ExpungeGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedOperation_Expunge(popr, false) - s1 := p.String() - s2 := fmt4.Sprintf("%v", p) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) } } -func TestEntrySize(t *testing18.T) { - popr := math_rand18.New(math_rand18.NewSource(time18.Now().UnixNano())) +func TestEntrySize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedEntry(popr, true) - size2 := github_com_gogo_protobuf_proto10.Size(p) - data, err := github_com_gogo_protobuf_proto10.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto10.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkEntrySize(b *testing18.B) { - popr := math_rand18.New(math_rand18.NewSource(616)) +func BenchmarkEntrySize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Entry, 1000) for i := 0; i < 1000; i++ { @@ -814,29 +982,30 @@ func BenchmarkEntrySize(b *testing18.B) { b.SetBytes(int64(total / b.N)) } -func TestOperationSize(t *testing18.T) { - popr := math_rand18.New(math_rand18.NewSource(time18.Now().UnixNano())) +func TestOperationSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation(popr, true) - size2 := github_com_gogo_protobuf_proto10.Size(p) - data, err := github_com_gogo_protobuf_proto10.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto10.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkOperationSize(b *testing18.B) { - popr := math_rand18.New(math_rand18.NewSource(616)) +func BenchmarkOperationSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Operation, 1000) for i := 0; i < 1000; i++ { @@ -849,29 +1018,30 @@ func BenchmarkOperationSize(b *testing18.B) { b.SetBytes(int64(total / b.N)) } -func TestOperation_SnapshotSize(t *testing18.T) { - popr := math_rand18.New(math_rand18.NewSource(time18.Now().UnixNano())) +func TestOperation_SnapshotSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Snapshot(popr, true) - size2 := github_com_gogo_protobuf_proto10.Size(p) - data, err := github_com_gogo_protobuf_proto10.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto10.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkOperation_SnapshotSize(b *testing18.B) { - popr := math_rand18.New(math_rand18.NewSource(616)) +func BenchmarkOperation_SnapshotSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Operation_Snapshot, 1000) for i := 0; i < 1000; i++ { @@ -884,29 +1054,30 @@ func BenchmarkOperation_SnapshotSize(b *testing18.B) { b.SetBytes(int64(total / b.N)) } -func TestOperation_DiffSize(t *testing18.T) { - popr := math_rand18.New(math_rand18.NewSource(time18.Now().UnixNano())) +func TestOperation_DiffSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Diff(popr, true) - size2 := github_com_gogo_protobuf_proto10.Size(p) - data, err := github_com_gogo_protobuf_proto10.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto10.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkOperation_DiffSize(b *testing18.B) { - popr := math_rand18.New(math_rand18.NewSource(616)) +func BenchmarkOperation_DiffSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Operation_Diff, 1000) for i := 0; i < 1000; i++ { @@ -919,29 +1090,30 @@ func BenchmarkOperation_DiffSize(b *testing18.B) { b.SetBytes(int64(total / b.N)) } -func TestOperation_ExpungeSize(t *testing18.T) { - popr := math_rand18.New(math_rand18.NewSource(time18.Now().UnixNano())) +func TestOperation_ExpungeSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Expunge(popr, true) - size2 := github_com_gogo_protobuf_proto10.Size(p) - data, err := github_com_gogo_protobuf_proto10.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto10.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkOperation_ExpungeSize(b *testing18.B) { - popr := math_rand18.New(math_rand18.NewSource(616)) +func BenchmarkOperation_ExpungeSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Operation_Expunge, 1000) for i := 0; i < 1000; i++ { @@ -954,144 +1126,49 @@ func BenchmarkOperation_ExpungeSize(b *testing18.B) { b.SetBytes(int64(total / b.N)) } -func TestEntryGoString(t *testing19.T) { - popr := math_rand19.New(math_rand19.NewSource(time19.Now().UnixNano())) +func TestEntryStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedEntry(popr, false) - s1 := p.GoString() - s2 := fmt5.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser2.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestOperationGoString(t *testing19.T) { - popr := math_rand19.New(math_rand19.NewSource(time19.Now().UnixNano())) +func TestOperationStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedOperation(popr, false) - s1 := p.GoString() - s2 := fmt5.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser2.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestOperation_SnapshotGoString(t *testing19.T) { - popr := math_rand19.New(math_rand19.NewSource(time19.Now().UnixNano())) +func TestOperation_SnapshotStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedOperation_Snapshot(popr, false) - s1 := p.GoString() - s2 := fmt5.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser2.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestOperation_DiffGoString(t *testing19.T) { - popr := math_rand19.New(math_rand19.NewSource(time19.Now().UnixNano())) +func TestOperation_DiffStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedOperation_Diff(popr, false) - s1 := p.GoString() - s2 := fmt5.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser2.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestOperation_ExpungeGoString(t *testing19.T) { - popr := math_rand19.New(math_rand19.NewSource(time19.Now().UnixNano())) +func TestOperation_ExpungeStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedOperation_Expunge(popr, false) - s1 := p.GoString() - s2 := fmt5.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser2.ParseExpr(s1) - if err != nil { - panic(err) - } -} -func TestEntryVerboseEqual(t *testing20.T) { - popr := math_rand20.New(math_rand20.NewSource(time20.Now().UnixNano())) - p := NewPopulatedEntry(popr, false) - data, err := github_com_gogo_protobuf_proto11.Marshal(p) - if err != nil { - panic(err) - } - msg := &Entry{} - if err := github_com_gogo_protobuf_proto11.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestOperationVerboseEqual(t *testing20.T) { - popr := math_rand20.New(math_rand20.NewSource(time20.Now().UnixNano())) - p := NewPopulatedOperation(popr, false) - data, err := github_com_gogo_protobuf_proto11.Marshal(p) - if err != nil { - panic(err) - } - msg := &Operation{} - if err := github_com_gogo_protobuf_proto11.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestOperation_SnapshotVerboseEqual(t *testing20.T) { - popr := math_rand20.New(math_rand20.NewSource(time20.Now().UnixNano())) - p := NewPopulatedOperation_Snapshot(popr, false) - data, err := github_com_gogo_protobuf_proto11.Marshal(p) - if err != nil { - panic(err) - } - msg := &Operation_Snapshot{} - if err := github_com_gogo_protobuf_proto11.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestOperation_DiffVerboseEqual(t *testing20.T) { - popr := math_rand20.New(math_rand20.NewSource(time20.Now().UnixNano())) - p := NewPopulatedOperation_Diff(popr, false) - data, err := github_com_gogo_protobuf_proto11.Marshal(p) - if err != nil { - panic(err) - } - msg := &Operation_Diff{} - if err := github_com_gogo_protobuf_proto11.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestOperation_ExpungeVerboseEqual(t *testing20.T) { - popr := math_rand20.New(math_rand20.NewSource(time20.Now().UnixNano())) - p := NewPopulatedOperation_Expunge(popr, false) - data, err := github_com_gogo_protobuf_proto11.Marshal(p) - if err != nil { - panic(err) - } - msg := &Operation_Expunge{} - if err := github_com_gogo_protobuf_proto11.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + t.Fatalf("String want %v got %v", s1, s2) } } diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosutil/constants.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosutil/constants.go index 849c26baa00eb..a1a3085f8e31f 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosutil/constants.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosutil/constants.go @@ -2,5 +2,5 @@ package mesosutil const ( // MesosVersion indicates the supported mesos version. - MesosVersion = "0.20.0" + MesosVersion = "0.24.0" ) diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/messenger/decoder.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/messenger/decoder.go new file mode 100644 index 0000000000000..50c1f413e4a55 --- /dev/null +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/messenger/decoder.go @@ -0,0 +1,615 @@ +package messenger + +import ( + "bufio" + "bytes" + "errors" + "io" + "net" + "net/http" + "net/textproto" + "net/url" + "strconv" + "strings" + "sync" + "sync/atomic" + "syscall" + "time" + + log "github.com/golang/glog" +) + +const ( + DefaultReadTimeout = 5 * time.Second + DefaultWriteTimeout = 5 * time.Second +) + +type decoderID int32 + +func (did decoderID) String() string { + return "[" + strconv.Itoa(int(did)) + "]" +} + +func (did *decoderID) next() decoderID { + return decoderID(atomic.AddInt32((*int32)(did), 1)) +} + +var ( + errHijackFailed = errors.New("failed to hijack http connection") + did decoderID // decoder ID counter + closedChan = make(chan struct{}) +) + +func init() { + close(closedChan) +} + +type Decoder interface { + Requests() <-chan *Request + Err() <-chan error + Cancel(bool) +} + +type Request struct { + *http.Request + response chan<- Response // callers that are finished with a Request should ensure that response is *always* closed, regardless of whether a Response has been written. +} + +type Response struct { + code int + reason string +} + +type httpDecoder struct { + req *http.Request // original request + kalive bool // keepalive + chunked bool // chunked + msg chan *Request + con net.Conn + rw *bufio.ReadWriter + errCh chan error + buf *bytes.Buffer + lrc *io.LimitedReader + shouldQuit chan struct{} // signal chan, closes upon calls to Cancel(...) + forceQuit chan struct{} // signal chan, indicates that quit is NOT graceful; closes upon Cancel(false) + cancelGuard sync.Mutex + readTimeout time.Duration + writeTimeout time.Duration + idtag string // useful for debugging + sendError func(err error) // abstraction for error handling + outCh chan *bytes.Buffer +} + +// DecodeHTTP hijacks an HTTP server connection and generates mesos libprocess HTTP +// requests via the returned chan. Upon generation of an error in the error chan the +// decoder's internal goroutine will terminate. This func returns immediately. +// The caller should immediately *stop* using the ResponseWriter and Request that were +// passed as parameters; the decoder assumes full control of the HTTP transport. +func DecodeHTTP(w http.ResponseWriter, r *http.Request) Decoder { + id := did.next() + d := &httpDecoder{ + msg: make(chan *Request), + errCh: make(chan error, 1), + req: r, + shouldQuit: make(chan struct{}), + forceQuit: make(chan struct{}), + readTimeout: DefaultReadTimeout, + writeTimeout: DefaultWriteTimeout, + idtag: id.String(), + outCh: make(chan *bytes.Buffer), + } + d.sendError = d.defaultSendError + go d.run(w) + return d +} + +func (d *httpDecoder) Requests() <-chan *Request { + return d.msg +} + +func (d *httpDecoder) Err() <-chan error { + return d.errCh +} + +// Cancel the decoding process; if graceful then process pending responses before terminating +func (d *httpDecoder) Cancel(graceful bool) { + log.V(2).Infof("%scancel:%t", d.idtag, graceful) + d.cancelGuard.Lock() + defer d.cancelGuard.Unlock() + select { + case <-d.shouldQuit: + // already quitting, but perhaps gracefully? + default: + close(d.shouldQuit) + } + // allow caller to "upgrade" from a graceful cancel to a forced one + if !graceful { + select { + case <-d.forceQuit: + // already forcefully quitting + default: + close(d.forceQuit) // push it! + } + } +} + +func (d *httpDecoder) run(res http.ResponseWriter) { + defer func() { + close(d.outCh) + log.V(2).Infoln(d.idtag + "run: terminating") + }() + + go func() { + for buf := range d.outCh { + select { + case <-d.forceQuit: + return + default: + } + //TODO(jdef) I worry about this busy-looping + for buf.Len() > 0 { + d.tryFlushResponse(buf) + } + } + }() + + var next httpState + for state := d.bootstrapState(res); state != nil; state = next { + next = state(d) + } +} + +// tryFlushResponse flushes the response buffer (if not empty); returns true if flush succeeded +func (d *httpDecoder) tryFlushResponse(out *bytes.Buffer) { + log.V(2).Infof(d.idtag+"try-flush-responses: %d bytes to flush", out.Len()) + // set a write deadline here so that we don't block for very long. + err := d.setWriteTimeout() + if err != nil { + // this is a problem because if we can't set the timeout then we can't guarantee + // how long a write op might block for. Log the error and skip this response. + log.Errorln("failed to set write deadline, aborting response:", err.Error()) + } else { + _, err = out.WriteTo(d.rw.Writer) + if err != nil { + if neterr, ok := err.(net.Error); ok && neterr.Timeout() && out.Len() > 0 { + // we couldn't fully write before timing out, return rch and hope that + // we have better luck next time. + return + } + // we don't really know how to deal with other kinds of errors, so + // log it and skip the rest of the response. + log.Errorln("failed to write response buffer:", err.Error()) + } + err = d.rw.Flush() + if err != nil { + if neterr, ok := err.(net.Error); ok && neterr.Timeout() && out.Len() > 0 { + return + } + log.Errorln("failed to flush response buffer:", err.Error()) + } + } +} + +// TODO(jdef) make this a func on Response, to write its contents to a *bytes.Buffer +func (d *httpDecoder) buildResponseEntity(resp *Response) *bytes.Buffer { + log.V(2).Infoln(d.idtag + "build-response-entity") + + out := &bytes.Buffer{} + + // generate new response buffer content and continue; buffer should have + // at least a response status-line w/ Content-Length: 0 + out.WriteString("HTTP/1.1 ") + out.WriteString(strconv.Itoa(resp.code)) + out.WriteString(" ") + out.WriteString(resp.reason) + out.WriteString(crlf + "Content-Length: 0" + crlf) + + select { + case <-d.shouldQuit: + // this is the last request in the pipeline and we've been told to quit, so + // indicate that the server will close the connection. + out.WriteString("Connection: Close" + crlf) + default: + } + out.WriteString(crlf) // this ends the HTTP response entity + return out +} + +// updateForRequest updates the chunked and kalive fields of the decoder to align +// with the header values of the request +func (d *httpDecoder) updateForRequest() { + // check "Transfer-Encoding" for "chunked" + d.chunked = false + for _, v := range d.req.Header["Transfer-Encoding"] { + if v == "chunked" { + d.chunked = true + break + } + } + if !d.chunked && d.req.ContentLength < 0 { + // strongly suspect that Go's internal net/http lib is stripping + // the Transfer-Encoding header from the initial request, so this + // workaround makes a very mesos-specific assumption: an unknown + // Content-Length indicates a chunked stream. + d.chunked = true + } + + // check "Connection" for "Keep-Alive" + d.kalive = d.req.Header.Get("Connection") == "Keep-Alive" + + log.V(2).Infof(d.idtag+"update-for-request: chunked %v keep-alive %v", d.chunked, d.kalive) +} + +func (d *httpDecoder) readBodyContent() httpState { + log.V(2).Info(d.idtag + "read-body-content") + if d.chunked { + d.buf = &bytes.Buffer{} + return readChunkHeaderState + } else { + d.lrc = limit(d.rw.Reader, d.req.ContentLength) + d.buf = &bytes.Buffer{} + return readBodyState + } +} + +const http202response = "HTTP/1.1 202 OK\r\nContent-Length: 0\r\n\r\n" + +func (d *httpDecoder) generateRequest() httpState { + log.V(2).Infof(d.idtag + "generate-request") + // send a Request to msg + b := d.buf.Bytes() + rch := make(chan Response, 1) + r := &Request{ + Request: &http.Request{ + Method: d.req.Method, + URL: d.req.URL, + Proto: d.req.Proto, + ProtoMajor: d.req.ProtoMajor, + ProtoMinor: d.req.ProtoMinor, + Header: d.req.Header, + Close: !d.kalive, + Host: d.req.Host, + RequestURI: d.req.RequestURI, + Body: &body{bytes.NewBuffer(b)}, + ContentLength: int64(len(b)), + }, + response: rch, + } + + select { + case d.msg <- r: + case <-d.forceQuit: + return terminateState + } + + select { + case <-d.forceQuit: + return terminateState + case resp, ok := <-rch: + if ok { + // response required, so build it and ship it + out := d.buildResponseEntity(&resp) + select { + case <-d.forceQuit: + return terminateState + case d.outCh <- out: + } + } + } + + if d.kalive { + d.req = &http.Request{ + ContentLength: -1, + Header: make(http.Header), + } + return awaitRequestState + } else { + return gracefulTerminateState + } +} + +func (d *httpDecoder) defaultSendError(err error) { + d.errCh <- err +} + +type httpState func(d *httpDecoder) httpState + +// terminateState forcefully shuts down the state machine +func terminateState(d *httpDecoder) httpState { + log.V(2).Infoln(d.idtag + "terminate-state") + // closing these chans tells Decoder users that it's wrapping up + close(d.msg) + close(d.errCh) + + // attempt to forcefully close the connection and signal response handlers that + // no further responses should be written + d.Cancel(false) + + if d.con != nil { + d.con.Close() + } + + // there is no spoon + return nil +} + +func gracefulTerminateState(d *httpDecoder) httpState { + log.V(2).Infoln(d.idtag + "gracefully-terminate-state") + // closing these chans tells Decoder users that it's wrapping up + close(d.msg) + close(d.errCh) + + // gracefully terminate the connection; signal that we should flush pending + // responses before closing the connection. + d.Cancel(true) + + return nil +} + +func limit(r *bufio.Reader, limit int64) *io.LimitedReader { + return &io.LimitedReader{ + R: r, + N: limit, + } +} + +// bootstrapState expects to be called when the standard net/http lib has already +// read the initial request query line + headers from a connection. the request +// is ready to be hijacked at this point. +func (d *httpDecoder) bootstrapState(res http.ResponseWriter) httpState { + log.V(2).Infoln(d.idtag + "bootstrap-state") + d.updateForRequest() + + // hijack + hj, ok := res.(http.Hijacker) + if !ok { + http.Error(res, "server does not support hijack", http.StatusInternalServerError) + d.sendError(errHijackFailed) + return terminateState + } + c, rw, err := hj.Hijack() + if err != nil { + http.Error(res, "failed to hijack the connection", http.StatusInternalServerError) + d.sendError(errHijackFailed) + return terminateState + } + d.rw = rw + d.con = c + return d.readBodyContent() +} + +type body struct { + *bytes.Buffer +} + +func (b *body) Close() error { return nil } + +// checkTimeoutOrFail tests whether the given error is related to a timeout condition. +// returns true if the caller should advance to the returned state. +func (d *httpDecoder) checkTimeoutOrFail(err error, stateContinue httpState) (httpState, bool) { + if err != nil { + if neterr, ok := err.(net.Error); ok && neterr.Timeout() { + select { + case <-d.forceQuit: + return terminateState, true + case <-d.shouldQuit: + return gracefulTerminateState, true + default: + return stateContinue, true + } + } + d.sendError(err) + return terminateState, true + } + return nil, false +} + +func (d *httpDecoder) setReadTimeoutOrFail() bool { + if d.readTimeout > 0 { + err := d.con.SetReadDeadline(time.Now().Add(d.readTimeout)) + if err != nil { + d.sendError(err) + return false + } + } + return true +} + +func (d *httpDecoder) setWriteTimeout() error { + if d.writeTimeout > 0 { + return d.con.SetWriteDeadline(time.Now().Add(d.writeTimeout)) + } + return nil +} + +func readChunkHeaderState(d *httpDecoder) httpState { + log.V(2).Infoln(d.idtag + "read-chunk-header-state") + tr := textproto.NewReader(d.rw.Reader) + if !d.setReadTimeoutOrFail() { + return terminateState + } + hexlen, err := tr.ReadLine() + if next, ok := d.checkTimeoutOrFail(err, readChunkHeaderState); ok { + return next + } + + clen, err := strconv.ParseInt(hexlen, 16, 64) + if err != nil { + d.sendError(err) + return terminateState + } + + if clen == 0 { + return readEndOfChunkStreamState + } + + d.lrc = limit(d.rw.Reader, clen) + return readChunkState +} + +func readChunkState(d *httpDecoder) httpState { + log.V(2).Infoln(d.idtag+"read-chunk-state, bytes remaining:", d.lrc.N) + if !d.setReadTimeoutOrFail() { + return terminateState + } + _, err := d.buf.ReadFrom(d.lrc) + if next, ok := d.checkTimeoutOrFail(err, readChunkState); ok { + return next + } + return readEndOfChunkState +} + +const crlf = "\r\n" + +func readEndOfChunkState(d *httpDecoder) httpState { + log.V(2).Infoln(d.idtag + "read-end-of-chunk-state") + if !d.setReadTimeoutOrFail() { + return terminateState + } + b, err := d.rw.Reader.Peek(2) + if len(b) == 2 { + if string(b) == crlf { + d.rw.ReadByte() + d.rw.ReadByte() + return readChunkHeaderState + } + d.sendError(errors.New(d.idtag + "unexpected data at end-of-chunk marker")) + return terminateState + } + // less than two bytes avail + if next, ok := d.checkTimeoutOrFail(err, readEndOfChunkState); ok { + return next + } + panic("couldn't peek 2 bytes, but didn't get an error?!") +} + +func readEndOfChunkStreamState(d *httpDecoder) httpState { + log.V(2).Infoln(d.idtag + "read-end-of-chunk-stream-state") + if !d.setReadTimeoutOrFail() { + return terminateState + } + b, err := d.rw.Reader.Peek(2) + if len(b) == 2 { + if string(b) == crlf { + d.rw.ReadByte() + d.rw.ReadByte() + return d.generateRequest() + } + d.sendError(errors.New(d.idtag + "unexpected data at end-of-chunk marker")) + return terminateState + } + // less than 2 bytes avail + if next, ok := d.checkTimeoutOrFail(err, readEndOfChunkStreamState); ok { + return next + } + panic("couldn't peek 2 bytes, but didn't get an error?!") +} + +func readBodyState(d *httpDecoder) httpState { + log.V(2).Infof(d.idtag+"read-body-state: %d bytes remaining", d.lrc.N) + // read remaining bytes into the buffer + var err error + if d.lrc.N > 0 { + if !d.setReadTimeoutOrFail() { + return terminateState + } + _, err = d.buf.ReadFrom(d.lrc) + } + if d.lrc.N <= 0 { + return d.generateRequest() + } + if next, ok := d.checkTimeoutOrFail(err, readBodyState); ok { + return next + } + return readBodyState +} + +func isGracefulTermSignal(err error) bool { + if err == io.EOF { + return true + } + if operr, ok := err.(*net.OpError); ok { + return operr.Op == "read" && err == syscall.ECONNRESET + } + return false +} + +func awaitRequestState(d *httpDecoder) httpState { + log.V(2).Infoln(d.idtag + "await-request-state") + tr := textproto.NewReader(d.rw.Reader) + if !d.setReadTimeoutOrFail() { + return terminateState + } + requestLine, err := tr.ReadLine() + if requestLine == "" && isGracefulTermSignal(err) { + // we're actually expecting this at some point, so don't react poorly + return gracefulTerminateState + } + if next, ok := d.checkTimeoutOrFail(err, awaitRequestState); ok { + return next + } + ss := strings.SplitN(requestLine, " ", 3) + if len(ss) < 3 { + if err == io.EOF { + return gracefulTerminateState + } + d.sendError(errors.New(d.idtag + "illegal request line")) + return terminateState + } + r := d.req + r.Method = ss[0] + r.RequestURI = ss[1] + r.URL, err = url.ParseRequestURI(ss[1]) + if err != nil { + d.sendError(err) + return terminateState + } + major, minor, ok := http.ParseHTTPVersion(ss[2]) + if !ok { + d.sendError(errors.New(d.idtag + "malformed HTTP version")) + return terminateState + } + r.ProtoMajor = major + r.ProtoMinor = minor + r.Proto = ss[2] + return readHeaderState +} + +func readHeaderState(d *httpDecoder) httpState { + log.V(2).Infoln(d.idtag + "read-header-state") + if !d.setReadTimeoutOrFail() { + return terminateState + } + r := d.req + tr := textproto.NewReader(d.rw.Reader) + h, err := tr.ReadMIMEHeader() + // merge any headers that were read successfully (before a possible error) + for k, v := range h { + if rh, exists := r.Header[k]; exists { + r.Header[k] = append(rh, v...) + } else { + r.Header[k] = v + } + log.V(2).Infoln(d.idtag+"request header", k, v) + } + if next, ok := d.checkTimeoutOrFail(err, readHeaderState); ok { + return next + } + + // special headers: Host, Content-Length, Transfer-Encoding + r.Host = r.Header.Get("Host") + r.TransferEncoding = r.Header["Transfer-Encoding"] + if cl := r.Header.Get("Content-Length"); cl != "" { + l, err := strconv.ParseInt(cl, 10, 64) + if err != nil { + d.sendError(err) + return terminateState + } + if l > -1 { + r.ContentLength = l + log.V(2).Infoln(d.idtag+"set content length", r.ContentLength) + } + } + d.updateForRequest() + return d.readBodyContent() +} diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/messenger/http_transporter.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/messenger/http_transporter.go index cfd7f2583a977..b356bed531b9e 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/messenger/http_transporter.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/messenger/http_transporter.go @@ -20,14 +20,17 @@ package messenger import ( "bytes" + "encoding/hex" + "errors" "fmt" + "io" "io/ioutil" "net" "net/http" "net/url" + "os" "strings" "sync" - "sync/atomic" "syscall" "time" @@ -38,27 +41,89 @@ import ( var ( discardOnStopError = fmt.Errorf("discarding message because transport is shutting down") + errNotStarted = errors.New("HTTP transport has not been started") + errTerminal = errors.New("HTTP transport is terminated") + errAlreadyRunning = errors.New("HTTP transport is already running") ) +// httpTransporter is a subset of the Transporter interface +type httpTransporter interface { + Send(ctx context.Context, msg *Message) error + Recv() (*Message, error) + Inject(ctx context.Context, msg *Message) error + Install(messageName string) + Start() (upid.UPID, <-chan error) + Stop(graceful bool) error +} + +type notStartedState struct { + h *HTTPTransporter +} + +type stoppedState struct{} + +type runningState struct { + *notStartedState +} + +/* -- not-started state */ + +func (s *notStartedState) Send(ctx context.Context, msg *Message) error { return errNotStarted } +func (s *notStartedState) Recv() (*Message, error) { return nil, errNotStarted } +func (s *notStartedState) Inject(ctx context.Context, msg *Message) error { return errNotStarted } +func (s *notStartedState) Stop(graceful bool) error { return errNotStarted } +func (s *notStartedState) Install(messageName string) { s.h.install(messageName) } +func (s *notStartedState) Start() (upid.UPID, <-chan error) { + s.h.state = &runningState{s} + return s.h.start() +} + +/* -- stopped state */ + +func (s *stoppedState) Send(ctx context.Context, msg *Message) error { return errTerminal } +func (s *stoppedState) Recv() (*Message, error) { return nil, errTerminal } +func (s *stoppedState) Inject(ctx context.Context, msg *Message) error { return errTerminal } +func (s *stoppedState) Stop(graceful bool) error { return errTerminal } +func (s *stoppedState) Install(messageName string) {} +func (s *stoppedState) Start() (upid.UPID, <-chan error) { + ch := make(chan error, 1) + ch <- errTerminal + return upid.UPID{}, ch +} + +/* -- running state */ + +func (s *runningState) Send(ctx context.Context, msg *Message) error { return s.h.send(ctx, msg) } +func (s *runningState) Recv() (*Message, error) { return s.h.recv() } +func (s *runningState) Inject(ctx context.Context, msg *Message) error { return s.h.inject(ctx, msg) } +func (s *runningState) Stop(graceful bool) error { + s.h.state = &stoppedState{} + return s.h.stop(graceful) +} +func (s *runningState) Start() (upid.UPID, <-chan error) { + ch := make(chan error, 1) + ch <- errAlreadyRunning + return upid.UPID{}, ch +} + // HTTPTransporter implements the interfaces of the Transporter. type HTTPTransporter struct { // If the host is empty("") then it will listen on localhost. // If the port is empty("") then it will listen on random port. - upid *upid.UPID + upid upid.UPID listener net.Listener // TODO(yifan): Change to TCPListener. mux *http.ServeMux tr *http.Transport client *http.Client // TODO(yifan): Set read/write deadline. messageQueue chan *Message address net.IP // optional binding address - started chan struct{} - stopped chan struct{} - stopping int32 - lifeLock sync.Mutex // protect lifecycle (start/stop) funcs + shouldQuit chan struct{} + stateLock sync.RWMutex // protect lifecycle (start/stop) funcs + state httpTransporter } // NewHTTPTransporter creates a new http transporter with an optional binding address. -func NewHTTPTransporter(upid *upid.UPID, address net.IP) *HTTPTransporter { +func NewHTTPTransporter(upid upid.UPID, address net.IP) *HTTPTransporter { tr := &http.Transport{} result := &HTTPTransporter{ upid: upid, @@ -67,13 +132,18 @@ func NewHTTPTransporter(upid *upid.UPID, address net.IP) *HTTPTransporter { client: &http.Client{Transport: tr}, tr: tr, address: address, - started: make(chan struct{}), - stopped: make(chan struct{}), + shouldQuit: make(chan struct{}), } - close(result.stopped) + result.state = ¬StartedState{result} return result } +func (t *HTTPTransporter) getState() httpTransporter { + t.stateLock.RLock() + defer t.stateLock.RUnlock() + return t.state +} + // some network errors are probably recoverable, attempt to determine that here. func isRecoverableError(err error) bool { if urlErr, ok := err.(*url.Error); ok { @@ -85,6 +155,7 @@ func isRecoverableError(err error) bool { return true } //TODO(jdef) this is pretty hackish, there's probably a better way + //TODO(jdef) should also check for EHOSTDOWN and EHOSTUNREACH return (netErr.Op == "dial" && netErr.Net == "tcp" && netErr.Err == syscall.ECONNREFUSED) } log.V(2).Infof("unrecoverable error: %#v", err) @@ -104,6 +175,10 @@ func (e *recoverableError) Error() string { // Send sends the message to its specified upid. func (t *HTTPTransporter) Send(ctx context.Context, msg *Message) (sendError error) { + return t.getState().Send(ctx, msg) +} + +func (t *HTTPTransporter) send(ctx context.Context, msg *Message) (sendError error) { log.V(2).Infof("Sending message to %v via http\n", msg.UPID) req, err := t.makeLibprocessRequest(msg) if err != nil { @@ -120,7 +195,7 @@ func (t *HTTPTransporter) Send(ctx context.Context, msg *Message) (sendError err return ctx.Err() case <-time.After(duration): // ..retry request, continue - case <-t.stopped: + case <-t.shouldQuit: return discardOnStopError } } @@ -164,7 +239,7 @@ func (t *HTTPTransporter) httpDo(ctx context.Context, req *http.Request, f func( select { case <-ctx.Done(): return ctx.Err() - case <-t.stopped: + case <-t.shouldQuit: return discardOnStopError default: // continue } @@ -178,7 +253,7 @@ func (t *HTTPTransporter) httpDo(ctx context.Context, req *http.Request, f func( return ctx.Err() case err := <-c: return err - case <-t.stopped: + case <-t.shouldQuit: t.tr.CancelRequest(req) <-c // Wait for f to return. return discardOnStopError @@ -187,24 +262,32 @@ func (t *HTTPTransporter) httpDo(ctx context.Context, req *http.Request, f func( // Recv returns the message, one at a time. func (t *HTTPTransporter) Recv() (*Message, error) { + return t.getState().Recv() +} + +func (t *HTTPTransporter) recv() (*Message, error) { select { default: select { case msg := <-t.messageQueue: return msg, nil - case <-t.stopped: + case <-t.shouldQuit: } - case <-t.stopped: + case <-t.shouldQuit: } return nil, discardOnStopError } //Inject places a message into the incoming message queue. func (t *HTTPTransporter) Inject(ctx context.Context, msg *Message) error { + return t.getState().Inject(ctx, msg) +} + +func (t *HTTPTransporter) inject(ctx context.Context, msg *Message) error { select { case <-ctx.Done(): return ctx.Err() - case <-t.stopped: + case <-t.shouldQuit: return discardOnStopError default: // continue } @@ -214,15 +297,73 @@ func (t *HTTPTransporter) Inject(ctx context.Context, msg *Message) error { return nil case <-ctx.Done(): return ctx.Err() - case <-t.stopped: + case <-t.shouldQuit: return discardOnStopError } } // Install the request URI according to the message's name. func (t *HTTPTransporter) Install(msgName string) { + t.getState().Install(msgName) +} + +func (t *HTTPTransporter) install(msgName string) { requestURI := fmt.Sprintf("/%s/%s", t.upid.ID, msgName) - t.mux.HandleFunc(requestURI, t.messageHandler) + t.mux.HandleFunc(requestURI, t.messageDecoder) +} + +type loggedListener struct { + delegate net.Listener + done <-chan struct{} +} + +func (l *loggedListener) Accept() (c net.Conn, err error) { + c, err = l.delegate.Accept() + if c != nil { + log.Infoln("accepted connection from", c.RemoteAddr()) + c = logConnection(c) + } else if err != nil { + select { + case <-l.done: + default: + log.Errorln("failed to accept connection:", err.Error()) + } + } + return +} + +func (l *loggedListener) Close() (err error) { + err = l.delegate.Close() + if err != nil { + select { + case <-l.done: + default: + log.Errorln("error closing listener:", err.Error()) + } + } else { + log.Infoln("closed listener") + } + return +} + +func (l *loggedListener) Addr() net.Addr { return l.delegate.Addr() } + +func logConnection(c net.Conn) net.Conn { + w := hex.Dumper(os.Stdout) + r := io.TeeReader(c, w) + return &loggedConnection{ + Conn: c, + reader: r, + } +} + +type loggedConnection struct { + net.Conn + reader io.Reader +} + +func (c *loggedConnection) Read(b []byte) (int, error) { + return c.reader.Read(b) } // Listen starts listen on UPID. If UPID is empty, the transporter @@ -252,6 +393,7 @@ func (t *HTTPTransporter) listen() error { } // Save the host:port in case they are not specified in upid. host, port, _ = net.SplitHostPort(ln.Addr().String()) + log.Infoln("listening on", host, "port", port) if len(t.upid.Host) == 0 { t.upid.Host = host @@ -261,72 +403,81 @@ func (t *HTTPTransporter) listen() error { t.upid.Port = port } - t.listener = ln + if log.V(3) { + t.listener = &loggedListener{delegate: ln, done: t.shouldQuit} + } else { + t.listener = ln + } return nil } // Start starts the http transporter -func (t *HTTPTransporter) Start() <-chan error { - t.lifeLock.Lock() - defer t.lifeLock.Unlock() - - select { - case <-t.started: - // already started - return nil - case <-t.stopped: - defer close(t.started) - t.stopped = make(chan struct{}) - atomic.StoreInt32(&t.stopping, 0) - default: - panic("not started, not stopped, what am i? how can i start?") - } +func (t *HTTPTransporter) Start() (upid.UPID, <-chan error) { + t.stateLock.Lock() + defer t.stateLock.Unlock() + return t.state.Start() +} +// start expects to be guarded by stateLock +func (t *HTTPTransporter) start() (upid.UPID, <-chan error) { ch := make(chan error, 1) if err := t.listen(); err != nil { ch <- err - } else { - // TODO(yifan): Set read/write deadline. - log.Infof("http transport listening on %v", t.listener.Addr()) - go func() { - err := http.Serve(t.listener, t.mux) - if atomic.CompareAndSwapInt32(&t.stopping, 1, 0) { - ch <- nil + return upid.UPID{}, ch + } + + // TODO(yifan): Set read/write deadline. + go func() { + s := &http.Server{ + ReadTimeout: DefaultReadTimeout, + WriteTimeout: DefaultWriteTimeout, + Handler: t.mux, + } + err := s.Serve(t.listener) + select { + case <-t.shouldQuit: + log.V(1).Infof("HTTP server stopped because of shutdown") + ch <- nil + default: + if err != nil && log.V(1) { + log.Errorln("HTTP server stopped with error", err.Error()) } else { - ch <- err + log.V(1).Infof("HTTP server stopped") } - }() - } - return ch + ch <- err + t.Stop(false) + } + }() + return t.upid, ch } // Stop stops the http transporter by closing the listener. func (t *HTTPTransporter) Stop(graceful bool) error { - t.lifeLock.Lock() - defer t.lifeLock.Unlock() + t.stateLock.Lock() + defer t.stateLock.Unlock() + return t.state.Stop(graceful) +} + +// stop expects to be guarded by stateLock +func (t *HTTPTransporter) stop(graceful bool) error { + close(t.shouldQuit) + + log.Info("stopping HTTP transport") - select { - case <-t.stopped: - // already stopped - return nil - case <-t.started: - defer close(t.stopped) - t.started = make(chan struct{}) - default: - panic("not started, not stopped, what am i? how can i stop?") - } //TODO(jdef) if graceful, wait for pending requests to terminate - atomic.StoreInt32(&t.stopping, 1) + err := t.listener.Close() return err } // UPID returns the upid of the transporter. -func (t *HTTPTransporter) UPID() *upid.UPID { +func (t *HTTPTransporter) UPID() upid.UPID { + t.stateLock.Lock() + defer t.stateLock.Unlock() return t.upid } -func (t *HTTPTransporter) messageHandler(w http.ResponseWriter, r *http.Request) { +func (t *HTTPTransporter) messageDecoder(w http.ResponseWriter, r *http.Request) { // Verify it's a libprocess request. from, err := getLibprocessFrom(r) if err != nil { @@ -334,19 +485,86 @@ func (t *HTTPTransporter) messageHandler(w http.ResponseWriter, r *http.Request) w.WriteHeader(http.StatusBadRequest) return } - data, err := ioutil.ReadAll(r.Body) + decoder := DecodeHTTP(w, r) + defer decoder.Cancel(true) + + t.processRequests(from, decoder.Requests()) + + // log an error if there's one waiting, otherwise move on + select { + case err, ok := <-decoder.Err(): + if ok { + log.Errorf("failed to decode HTTP message: %v", err) + } + default: + } +} + +func (t *HTTPTransporter) processRequests(from *upid.UPID, incoming <-chan *Request) { + for { + select { + case r, ok := <-incoming: + if !ok || !t.processOneRequest(from, r) { + return + } + case <-t.shouldQuit: + return + } + } +} + +func (t *HTTPTransporter) processOneRequest(from *upid.UPID, request *Request) (keepGoing bool) { + // regardless of whether we write a Response we must close this chan + defer close(request.response) + keepGoing = true + + //TODO(jdef) this is probably inefficient given the current implementation of the + // decoder: no need to make another copy of data that's already competely buffered + data, err := ioutil.ReadAll(request.Body) if err != nil { - log.Errorf("Failed to read HTTP body: %v\n", err) - w.WriteHeader(http.StatusBadRequest) + // this is unlikely given the current implementation of the decoder: + // the body has been completely buffered in memory already + log.Errorf("failed to read HTTP body: %v", err) return } - log.V(2).Infof("Receiving message from %v, length %v\n", from, len(data)) - w.WriteHeader(http.StatusAccepted) - t.messageQueue <- &Message{ + log.V(2).Infof("Receiving %q %v from %v, length %v", request.Method, request.URL, from, len(data)) + m := &Message{ UPID: from, - Name: extractNameFromRequestURI(r.RequestURI), + Name: extractNameFromRequestURI(request.RequestURI), Bytes: data, } + + // deterministic behavior and output.. + select { + case <-t.shouldQuit: + keepGoing = false + select { + case t.messageQueue <- m: + default: + } + case t.messageQueue <- m: + select { + case <-t.shouldQuit: + keepGoing = false + default: + } + } + + // Only send back an HTTP response if this isn't from libprocess + // (which we determine by looking at the User-Agent). This is + // necessary because older versions of libprocess would try and + // recv the data and parse it as an HTTP request which would + // fail thus causing the socket to get closed (but now + // libprocess will ignore responses, see ignore_data). + // see https://github.com/apache/mesos/blob/adecbfa6a216815bd7dc7d26e721c4c87e465c30/3rdparty/libprocess/src/process.cpp#L2192 + if _, ok := parseLibprocessAgent(request.Header); !ok { + log.V(2).Infof("not libprocess agent, sending a 202") + request.response <- Response{ + code: 202, + reason: "Accepted", + } // should never block + } + return } func (t *HTTPTransporter) makeLibprocessRequest(msg *Message) (*http.Request, error) { @@ -372,10 +590,8 @@ func getLibprocessFrom(r *http.Request) (*upid.UPID, error) { if r.Method != "POST" { return nil, fmt.Errorf("Not a POST request") } - ua, ok := r.Header["User-Agent"] - if ok && strings.HasPrefix(ua[0], "libprocess/") { - // TODO(yifan): Just take the first field for now. - return upid.Parse(ua[0][len("libprocess/"):]) + if agent, ok := parseLibprocessAgent(r.Header); ok { + return upid.Parse(agent) } lf, ok := r.Header["Libprocess-From"] if ok { @@ -384,3 +600,15 @@ func getLibprocessFrom(r *http.Request) (*upid.UPID, error) { } return nil, fmt.Errorf("Cannot find 'User-Agent' or 'Libprocess-From'") } + +func parseLibprocessAgent(h http.Header) (string, bool) { + const prefix = "libprocess/" + if ua, ok := h["User-Agent"]; ok { + for _, agent := range ua { + if strings.HasPrefix(agent, prefix) { + return agent[len(prefix):], true + } + } + } + return "", false +} diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/messenger/http_transporter_test.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/messenger/http_transporter_test.go index f3dc1e56bf450..dfe241640ac9a 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/messenger/http_transporter_test.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/messenger/http_transporter_test.go @@ -1,7 +1,9 @@ package messenger import ( + "bytes" "fmt" + "io/ioutil" "net" "net/http" "net/http/httptest" @@ -17,11 +19,8 @@ import ( ) func TestTransporterNew(t *testing.T) { - id, err := upid.Parse(fmt.Sprintf("mesos1@localhost:%d", getNewPort())) - assert.NoError(t, err) - trans := NewHTTPTransporter(id, nil) + trans := NewHTTPTransporter(upid.UPID{ID: "mesos1", Host: "localhost"}, nil) assert.NotNil(t, trans) - assert.NotNil(t, trans.upid) assert.NotNil(t, trans.messageQueue) assert.NotNil(t, trans.client) } @@ -31,9 +30,6 @@ func TestTransporterSend(t *testing.T) { serverId := "testserver" // setup mesos client-side - fromUpid, err := upid.Parse(fmt.Sprintf("mesos1@localhost:%d", getNewPort())) - assert.NoError(t, err) - protoMsg := testmessage.GenerateSmallMessage() msgName := getMessageName(protoMsg) msg := &Message{ @@ -55,8 +51,8 @@ func TestTransporterSend(t *testing.T) { assert.NoError(t, err) // make transport call. - transport := NewHTTPTransporter(fromUpid, nil) - errch := transport.Start() + transport := NewHTTPTransporter(upid.UPID{ID: "mesos1", Host: "localhost"}, nil) + _, errch := transport.Start() defer transport.Stop(false) msg.UPID = toUpid @@ -78,9 +74,6 @@ func TestTransporter_DiscardedSend(t *testing.T) { serverId := "testserver" // setup mesos client-side - fromUpid, err := upid.Parse(fmt.Sprintf("mesos1@localhost:%d", getNewPort())) - assert.NoError(t, err) - protoMsg := testmessage.GenerateSmallMessage() msgName := getMessageName(protoMsg) msg := &Message{ @@ -100,8 +93,8 @@ func TestTransporter_DiscardedSend(t *testing.T) { assert.NoError(t, err) // make transport call. - transport := NewHTTPTransporter(fromUpid, nil) - errch := transport.Start() + transport := NewHTTPTransporter(upid.UPID{ID: "mesos1", Host: "localhost"}, nil) + _, errch := transport.Start() defer transport.Stop(false) msg.UPID = toUpid @@ -138,20 +131,18 @@ func TestTransporter_DiscardedSend(t *testing.T) { func TestTransporterStartAndRcvd(t *testing.T) { serverId := "testserver" - serverPort := getNewPort() - serverAddr := "127.0.0.1:" + strconv.Itoa(serverPort) + serverAddr := "127.0.0.1" protoMsg := testmessage.GenerateSmallMessage() msgName := getMessageName(protoMsg) ctrl := make(chan struct{}) // setup receiver (server) process - rcvPid, err := upid.Parse(fmt.Sprintf("%s@%s", serverId, serverAddr)) - assert.NoError(t, err) - receiver := NewHTTPTransporter(rcvPid, nil) + receiver := NewHTTPTransporter(upid.UPID{ID: serverId, Host: serverAddr}, nil) receiver.Install(msgName) go func() { defer close(ctrl) + t.Logf("received something...") msg, err := receiver.Recv() assert.Nil(t, err) assert.NotNil(t, msg) @@ -160,25 +151,23 @@ func TestTransporterStartAndRcvd(t *testing.T) { } }() - errch := receiver.Start() + rcvPid, errch := receiver.Start() defer receiver.Stop(false) assert.NotNil(t, errch) time.Sleep(time.Millisecond * 7) // time to catchup // setup sender (client) process - sndUpid, err := upid.Parse(fmt.Sprintf("mesos1@localhost:%d", getNewPort())) - assert.NoError(t, err) - - sender := NewHTTPTransporter(sndUpid, nil) + sender := NewHTTPTransporter(upid.UPID{ID: "mesos1", Host: "localhost"}, nil) msg := &Message{ - UPID: rcvPid, + UPID: &rcvPid, Name: msgName, ProtoMessage: protoMsg, } - errch2 := sender.Start() + _, errch2 := sender.Start() defer sender.Stop(false) + t.Logf("sending test message") sender.Send(context.TODO(), msg) select { @@ -198,22 +187,18 @@ func TestTransporterStartAndRcvd(t *testing.T) { func TestTransporterStartAndInject(t *testing.T) { serverId := "testserver" - serverPort := getNewPort() - serverAddr := "127.0.0.1:" + strconv.Itoa(serverPort) protoMsg := testmessage.GenerateSmallMessage() msgName := getMessageName(protoMsg) ctrl := make(chan struct{}) // setup receiver (server) process - rcvPid, err := upid.Parse(fmt.Sprintf("%s@%s", serverId, serverAddr)) - assert.NoError(t, err) - receiver := NewHTTPTransporter(rcvPid, nil) + receiver := NewHTTPTransporter(upid.UPID{ID: serverId, Host: "127.0.0.1"}, nil) receiver.Install(msgName) - errch := receiver.Start() + rcvPid, errch := receiver.Start() defer receiver.Stop(false) msg := &Message{ - UPID: rcvPid, + UPID: &rcvPid, Name: msgName, ProtoMessage: protoMsg, } @@ -243,15 +228,11 @@ func TestTransporterStartAndInject(t *testing.T) { func TestTransporterStartAndStop(t *testing.T) { serverId := "testserver" - serverPort := getNewPort() - serverAddr := "127.0.0.1:" + strconv.Itoa(serverPort) // setup receiver (server) process - rcvPid, err := upid.Parse(fmt.Sprintf("%s@%s", serverId, serverAddr)) - assert.NoError(t, err) - receiver := NewHTTPTransporter(rcvPid, nil) + receiver := NewHTTPTransporter(upid.UPID{ID: serverId, Host: "127.0.0.1"}, nil) - errch := receiver.Start() + _, errch := receiver.Start() assert.NotNil(t, errch) time.Sleep(1 * time.Second) @@ -269,17 +250,20 @@ func TestTransporterStartAndStop(t *testing.T) { func TestMutatedHostUPid(t *testing.T) { serverId := "testserver" - serverPort := getNewPort() + // NOTE(tsenart): This static port can cause conflicts if multiple instances + // of this test run concurrently or else if this port is already bound by + // another socket. + serverPort := 12345 serverHost := "127.0.0.1" serverAddr := serverHost + ":" + strconv.Itoa(serverPort) // override the upid.Host with this listener IP - addr := net.ParseIP("127.0.0.2") + addr := net.ParseIP("0.0.0.0") // setup receiver (server) process uPid, err := upid.Parse(fmt.Sprintf("%s@%s", serverId, serverAddr)) assert.NoError(t, err) - receiver := NewHTTPTransporter(uPid, addr) + receiver := NewHTTPTransporter(*uPid, addr) err = receiver.listen() assert.NoError(t, err) @@ -294,36 +278,22 @@ func TestMutatedHostUPid(t *testing.T) { } func TestEmptyHostPortUPid(t *testing.T) { - serverId := "testserver" - serverPort := getNewPort() - serverHost := "127.0.0.1" - serverAddr := serverHost + ":" + strconv.Itoa(serverPort) - - // setup receiver (server) process - uPid, err := upid.Parse(fmt.Sprintf("%s@%s", serverId, serverAddr)) - assert.NoError(t, err) - - // Unset upid host and port - uPid.Host = "" - uPid.Port = "" + uPid := upid.UPID{ID: "testserver"} // override the upid.Host with this listener IP - addr := net.ParseIP("127.0.0.2") - + addr := net.ParseIP("0.0.0.0") receiver := NewHTTPTransporter(uPid, addr) - err = receiver.listen() + err := receiver.listen() assert.NoError(t, err) // This should be the host that overrides as uPid.Host is empty - if receiver.upid.Host != "127.0.0.2" { - t.Fatalf("reciever.upid.Host was expected to return %s, got %s\n", serverHost, receiver.upid.Host) + if receiver.upid.Host != "0.0.0.0" { + t.Fatalf("reciever.upid.Host was expected to return 0.0.0.0, got %q", receiver.upid.Host) } - // This should end up being a random port, not the server port as uPid - // port is empty - if receiver.upid.Port == strconv.Itoa(serverPort) { - t.Fatalf("receiver.upid.Port was not expected to return %d, got %s\n", serverPort, receiver.upid.Port) + if receiver.upid.Port == "0" { + t.Fatalf("receiver.upid.Port was not expected to return 0, got %q", receiver.upid.Port) } } @@ -332,3 +302,49 @@ func makeMockServer(path string, handler func(rsp http.ResponseWriter, req *http mux.HandleFunc(path, handler) return httptest.NewServer(mux) } + +func TestProcessOneRequest(t *testing.T) { + ht := &HTTPTransporter{ + messageQueue: make(chan *Message, 1), + shouldQuit: make(chan struct{}), + } + testfunc := func(expectProceed bool) { + rchan := make(chan Response, 1) + proceed := ht.processOneRequest(&upid.UPID{ID: "james"}, &Request{ + response: rchan, + Request: &http.Request{ + Method: "foo", + RequestURI: "a/z/bar", + Body: ioutil.NopCloser(&bytes.Reader{}), + }, + }) + // expecting to get a 202 response since the request doesn't have libprocess headers + if proceed != expectProceed { + t.Fatalf("expected proceed signal %t instead of %t", expectProceed, proceed) + } + select { + case resp := <-rchan: + if resp.code != 202 { + t.Fatalf("expected a 202 response for all libprocess requests") + } + default: + t.Fatalf("expected a response since we're not a libprocess agent") + } + select { + case m := <-ht.messageQueue: + // From, Name, Data + assert.Equal(t, "james", m.UPID.ID) + assert.Equal(t, "bar", m.Name) + default: + t.Fatalf("expected a message for the request that was processed") + } + } + t.Log("testing w/o shouldQuit signal") + testfunc(true) + + t.Log("testing w/ shouldQuit signal") + close(ht.shouldQuit) + for i := 0; i < 100; i++ { + testfunc(false) // do this in a loop to test determinism + } +} diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/messenger/messenger.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/messenger/messenger.go index c81ad31853c89..279a6f92cf7ef 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/messenger/messenger.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/messenger/messenger.go @@ -19,12 +19,11 @@ package messenger import ( - "flag" "fmt" "net" "reflect" "strconv" - "time" + "sync" "github.com/gogo/protobuf/proto" log "github.com/golang/glog" @@ -36,21 +35,8 @@ import ( const ( defaultQueueSize = 1024 - preparePeriod = time.Second * 1 ) -var ( - sendRoutines int - encodeRoutines int - decodeRoutines int -) - -func init() { - flag.IntVar(&sendRoutines, "send-routines", 1, "Number of network sending routines") - flag.IntVar(&encodeRoutines, "encode-routines", 1, "Number of encoding routines") - flag.IntVar(&decodeRoutines, "decode-routines", 1, "Number of decoding routines") -} - // MessageHandler is the callback of the message. When the callback // is invoked, the sender's upid and the message is passed to the callback. type MessageHandler func(from *upid.UPID, pbMsg proto.Message) @@ -62,24 +48,25 @@ type Messenger interface { Route(ctx context.Context, from *upid.UPID, msg proto.Message) error Start() error Stop() error - UPID() *upid.UPID + UPID() upid.UPID } // MesosMessenger is an implementation of the Messenger interface. type MesosMessenger struct { - upid *upid.UPID + upid upid.UPID encodingQueue chan *Message sendingQueue chan *Message installedMessages map[string]reflect.Type installedHandlers map[string]MessageHandler stop chan struct{} + stopOnce sync.Once tr Transporter } // ForHostname creates a new default messenger (HTTP), using UPIDBindingAddress to // determine the binding-address used for both the UPID.Host and Transport binding address. -func ForHostname(proc *process.Process, hostname string, bindingAddress net.IP, port uint16) (Messenger, error) { - upid := &upid.UPID{ +func ForHostname(proc *process.Process, hostname string, bindingAddress net.IP, port uint16, publishedAddress net.IP) (Messenger, error) { + upid := upid.UPID{ ID: proc.Label(), Port: strconv.Itoa(int(port)), } @@ -87,7 +74,21 @@ func ForHostname(proc *process.Process, hostname string, bindingAddress net.IP, if err != nil { return nil, err } - upid.Host = host + + var publishedHost string + if publishedAddress != nil { + publishedHost, err = UPIDBindingAddress(hostname, publishedAddress) + if err != nil { + return nil, err + } + } + + if publishedHost != "" { + upid.Host = publishedHost + } else { + upid.Host = host + } + return NewHttpWithBindingAddress(upid, bindingAddress), nil } @@ -135,17 +136,16 @@ func UPIDBindingAddress(hostname string, bindingAddress net.IP) (string, error) } // NewMesosMessenger creates a new mesos messenger. -func NewHttp(upid *upid.UPID) *MesosMessenger { +func NewHttp(upid upid.UPID) *MesosMessenger { return NewHttpWithBindingAddress(upid, nil) } -func NewHttpWithBindingAddress(upid *upid.UPID, address net.IP) *MesosMessenger { +func NewHttpWithBindingAddress(upid upid.UPID, address net.IP) *MesosMessenger { return New(upid, NewHTTPTransporter(upid, address)) } -func New(upid *upid.UPID, t Transporter) *MesosMessenger { +func New(upid upid.UPID, t Transporter) *MesosMessenger { return &MesosMessenger{ - upid: upid, encodingQueue: make(chan *Message, defaultQueueSize), sendingQueue: make(chan *Message, defaultQueueSize), installedMessages: make(map[string]reflect.Type), @@ -180,7 +180,7 @@ func (m *MesosMessenger) Install(handler MessageHandler, msg proto.Message) erro func (m *MesosMessenger) Send(ctx context.Context, upid *upid.UPID, msg proto.Message) error { if upid == nil { panic("cannot sent a message to a nil pid") - } else if upid.Equal(m.upid) { + } else if *upid == m.upid { return fmt.Errorf("Send the message to self") } name := getMessageName(msg) @@ -198,11 +198,15 @@ func (m *MesosMessenger) Send(ctx context.Context, upid *upid.UPID, msg proto.Me // 1) routing internal error to callback handlers // 2) testing components without starting remote servers. func (m *MesosMessenger) Route(ctx context.Context, upid *upid.UPID, msg proto.Message) error { - // if destination is not self, send to outbound. - if !upid.Equal(m.upid) { + if upid == nil { + panic("cannot route a message to a nil pid") + } else if *upid != m.upid { + // if destination is not self, send to outbound. return m.Send(ctx, upid, msg) } + // TODO(jdef) this has an unfortunate performance impact for self-messaging. implement + // something more reasonable here. data, err := proto.Marshal(msg) if err != nil { return err @@ -211,30 +215,29 @@ func (m *MesosMessenger) Route(ctx context.Context, upid *upid.UPID, msg proto.M return m.tr.Inject(ctx, &Message{upid, name, msg, data}) } -// Start starts the messenger. +// Start starts the messenger; expects to be called once and only once. func (m *MesosMessenger) Start() error { m.stop = make(chan struct{}) - errChan := m.tr.Start() - select { - case err := <-errChan: - log.Errorf("failed to start messenger: %v", err) - return err - case <-time.After(preparePeriod): // continue + pid, errChan := m.tr.Start() + if pid == (upid.UPID{}) { + err := <-errChan + return fmt.Errorf("failed to start messenger: %v", err) } - m.upid = m.tr.UPID() + // the pid that we're actually bound as + m.upid = pid - for i := 0; i < sendRoutines; i++ { - go m.sendLoop() - } - for i := 0; i < encodeRoutines; i++ { - go m.encodeLoop() - } - for i := 0; i < decodeRoutines; i++ { - go m.decodeLoop() - } + go m.sendLoop() + go m.encodeLoop() + go m.decodeLoop() + + // wait for a listener error or a stop signal; either way stop the messenger + + // TODO(jdef) a better implementation would attempt to re-listen; need to coordinate + // access to m.upid in that case. probably better off with a state machine instead of + // what we have now. go func() { select { case err := <-errChan: @@ -242,7 +245,11 @@ func (m *MesosMessenger) Start() error { //TODO(jdef) should the driver abort in this case? probably //since this messenger will never attempt to re-establish the //transport - log.Error(err) + log.Errorln("transport stopped unexpectedly:", err.Error()) + } + err = m.Stop() + if err != nil && err != errTerminal { + log.Errorln("failed to stop messenger cleanly: ", err.Error()) } case <-m.stop: } @@ -251,18 +258,27 @@ func (m *MesosMessenger) Start() error { } // Stop stops the messenger and clean up all the goroutines. -func (m *MesosMessenger) Stop() error { - //TODO(jdef) don't hardcode the graceful flag here - if err := m.tr.Stop(true); err != nil { - log.Errorf("Failed to stop the transporter: %v\n", err) - return err - } - close(m.stop) - return nil +func (m *MesosMessenger) Stop() (err error) { + m.stopOnce.Do(func() { + select { + case <-m.stop: + default: + defer close(m.stop) + } + + log.Info("stopping messenger..") + + //TODO(jdef) don't hardcode the graceful flag here + if err2 := m.tr.Stop(true); err2 != nil && err2 != errTerminal { + log.Warningf("failed to stop the transporter: %v\n", err2) + err = err2 + } + }) + return } // UPID returns the upid of the messenger. -func (m *MesosMessenger) UPID() *upid.UPID { +func (m *MesosMessenger) UPID() upid.UPID { return m.upid } @@ -303,7 +319,8 @@ func (m *MesosMessenger) reportError(err error) { defer cancel() c := make(chan error, 1) - go func() { c <- m.Route(ctx, m.UPID(), &mesos.FrameworkErrorMessage{Message: proto.String(err.Error())}) }() + pid := m.upid + go func() { c <- m.Route(ctx, &pid, &mesos.FrameworkErrorMessage{Message: proto.String(err.Error())}) }() select { case <-ctx.Done(): <-c // wait for Route to return diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/messenger/messenger_test.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/messenger/messenger_test.go index 4a18953700499..bb6d9fc05329e 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/messenger/messenger_test.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/messenger/messenger_test.go @@ -6,7 +6,6 @@ import ( "net" "net/http" "net/http/httptest" - "strconv" "sync" "testing" "time" @@ -19,19 +18,13 @@ import ( ) var ( - startPort = 10000 + rand.Intn(30000) - globalWG = new(sync.WaitGroup) + globalWG = new(sync.WaitGroup) ) func noopHandler(*upid.UPID, proto.Message) { globalWG.Done() } -func getNewPort() int { - startPort++ - return startPort -} - func shuffleMessages(queue *[]proto.Message) { for i := range *queue { index := rand.Intn(i + 1) @@ -136,39 +129,25 @@ func runTestServer(b *testing.B, wg *sync.WaitGroup) *httptest.Server { } func TestMessengerFailToInstall(t *testing.T) { - m := NewHttp(&upid.UPID{ID: "mesos"}) + m := NewHttp(upid.UPID{ID: "mesos"}) handler := func(from *upid.UPID, pbMsg proto.Message) {} assert.NotNil(t, m) assert.NoError(t, m.Install(handler, &testmessage.SmallMessage{})) assert.Error(t, m.Install(handler, &testmessage.SmallMessage{})) } -func TestMessengerFailToStart(t *testing.T) { - port := strconv.Itoa(getNewPort()) - m1 := NewHttp(&upid.UPID{ID: "mesos", Host: "localhost", Port: port}) - m2 := NewHttp(&upid.UPID{ID: "mesos", Host: "localhost", Port: port}) - assert.NoError(t, m1.Start()) - assert.Error(t, m2.Start()) -} - func TestMessengerFailToSend(t *testing.T) { - upid, err := upid.Parse(fmt.Sprintf("mesos1@localhost:%d", getNewPort())) - assert.NoError(t, err) - m := NewHttp(upid) + m := NewHttp(upid.UPID{ID: "foo", Host: "localhost"}) assert.NoError(t, m.Start()) - assert.Error(t, m.Send(context.TODO(), upid, &testmessage.SmallMessage{})) + self := m.UPID() + assert.Error(t, m.Send(context.TODO(), &self, &testmessage.SmallMessage{})) } func TestMessenger(t *testing.T) { messages := generateMixedMessages(1000) - upid1, err := upid.Parse(fmt.Sprintf("mesos1@localhost:%d", getNewPort())) - assert.NoError(t, err) - upid2, err := upid.Parse(fmt.Sprintf("mesos2@localhost:%d", getNewPort())) - assert.NoError(t, err) - - m1 := NewHttp(upid1) - m2 := NewHttp(upid2) + m1 := NewHttp(upid.UPID{ID: "mesos1", Host: "localhost"}) + m2 := NewHttp(upid.UPID{ID: "mesos2", Host: "localhost"}) done := make(chan struct{}) counts := make([]int, 4) @@ -177,10 +156,11 @@ func TestMessenger(t *testing.T) { assert.NoError(t, m1.Start()) assert.NoError(t, m2.Start()) + upid2 := m2.UPID() go func() { for _, msg := range messages { - assert.NoError(t, m1.Send(context.TODO(), upid2, msg)) + assert.NoError(t, m1.Send(context.TODO(), &upid2, msg)) } }() @@ -204,20 +184,20 @@ func BenchmarkMessengerSendSmallMessage(b *testing.B) { srv := runTestServer(b, wg) defer srv.Close() - upid1, err := upid.Parse(fmt.Sprintf("mesos1@localhost:%d", getNewPort())) - assert.NoError(b, err) upid2, err := upid.Parse(fmt.Sprintf("testserver@%s", srv.Listener.Addr().String())) - assert.NoError(b, err) - m1 := NewHttp(upid1) + m1 := NewHttp(upid.UPID{ID: "mesos1", Host: "localhost"}) assert.NoError(b, m1.Start()) + defer m1.Stop() b.ResetTimer() for i := 0; i < b.N; i++ { m1.Send(context.TODO(), upid2, messages[i%1000]) } wg.Wait() + b.StopTimer() + time.Sleep(2 * time.Second) // allow time for connection cleanup } func BenchmarkMessengerSendMediumMessage(b *testing.B) { @@ -228,19 +208,20 @@ func BenchmarkMessengerSendMediumMessage(b *testing.B) { srv := runTestServer(b, wg) defer srv.Close() - upid1, err := upid.Parse(fmt.Sprintf("mesos1@localhost:%d", getNewPort())) - assert.NoError(b, err) upid2, err := upid.Parse(fmt.Sprintf("testserver@%s", srv.Listener.Addr().String())) assert.NoError(b, err) - m1 := NewHttp(upid1) + m1 := NewHttp(upid.UPID{ID: "mesos1", Host: "localhost"}) assert.NoError(b, m1.Start()) + defer m1.Stop() b.ResetTimer() for i := 0; i < b.N; i++ { m1.Send(context.TODO(), upid2, messages[i%1000]) } wg.Wait() + b.StopTimer() + time.Sleep(2 * time.Second) // allow time for connection cleanup } func BenchmarkMessengerSendBigMessage(b *testing.B) { @@ -251,19 +232,20 @@ func BenchmarkMessengerSendBigMessage(b *testing.B) { srv := runTestServer(b, wg) defer srv.Close() - upid1, err := upid.Parse(fmt.Sprintf("mesos1@localhost:%d", getNewPort())) - assert.NoError(b, err) upid2, err := upid.Parse(fmt.Sprintf("testserver@%s", srv.Listener.Addr().String())) assert.NoError(b, err) - m1 := NewHttp(upid1) + m1 := NewHttp(upid.UPID{ID: "mesos1", Host: "localhost"}) assert.NoError(b, m1.Start()) + defer m1.Stop() b.ResetTimer() for i := 0; i < b.N; i++ { m1.Send(context.TODO(), upid2, messages[i%1000]) } wg.Wait() + b.StopTimer() + time.Sleep(2 * time.Second) // allow time for connection cleanup } func BenchmarkMessengerSendLargeMessage(b *testing.B) { @@ -274,19 +256,20 @@ func BenchmarkMessengerSendLargeMessage(b *testing.B) { srv := runTestServer(b, wg) defer srv.Close() - upid1, err := upid.Parse(fmt.Sprintf("mesos1@localhost:%d", getNewPort())) - assert.NoError(b, err) upid2, err := upid.Parse(fmt.Sprintf("testserver@%s", srv.Listener.Addr().String())) assert.NoError(b, err) - m1 := NewHttp(upid1) + m1 := NewHttp(upid.UPID{ID: "mesos1", Host: "localhost"}) assert.NoError(b, m1.Start()) + defer m1.Stop() b.ResetTimer() for i := 0; i < b.N; i++ { m1.Send(context.TODO(), upid2, messages[i%1000]) } wg.Wait() + b.StopTimer() + time.Sleep(2 * time.Second) // allow time for connection cleanup } func BenchmarkMessengerSendMixedMessage(b *testing.B) { @@ -297,19 +280,20 @@ func BenchmarkMessengerSendMixedMessage(b *testing.B) { srv := runTestServer(b, wg) defer srv.Close() - upid1, err := upid.Parse(fmt.Sprintf("mesos1@localhost:%d", getNewPort())) - assert.NoError(b, err) upid2, err := upid.Parse(fmt.Sprintf("testserver@%s", srv.Listener.Addr().String())) assert.NoError(b, err) - m1 := NewHttp(upid1) + m1 := NewHttp(upid.UPID{ID: "mesos1", Host: "localhost"}) assert.NoError(b, m1.Start()) + defer m1.Stop() b.ResetTimer() for i := 0; i < b.N; i++ { m1.Send(context.TODO(), upid2, messages[i%1000]) } wg.Wait() + b.StopTimer() + time.Sleep(2 * time.Second) // allow time for connection cleanup } func BenchmarkMessengerSendRecvSmallMessage(b *testing.B) { @@ -317,23 +301,25 @@ func BenchmarkMessengerSendRecvSmallMessage(b *testing.B) { messages := generateSmallMessages(1000) - upid1, err := upid.Parse(fmt.Sprintf("mesos1@localhost:%d", getNewPort())) - assert.NoError(b, err) - upid2, err := upid.Parse(fmt.Sprintf("mesos2@localhost:%d", getNewPort())) - assert.NoError(b, err) - - m1 := NewHttp(upid1) - m2 := NewHttp(upid2) + m1 := NewHttp(upid.UPID{ID: "foo1", Host: "localhost"}) + m2 := NewHttp(upid.UPID{ID: "foo2", Host: "localhost"}) assert.NoError(b, m1.Start()) + defer m1.Stop() + assert.NoError(b, m2.Start()) + defer m2.Stop() + assert.NoError(b, m2.Install(noopHandler, &testmessage.SmallMessage{})) - time.Sleep(time.Second) // Avoid race on upid. + upid2 := m2.UPID() + b.ResetTimer() for i := 0; i < b.N; i++ { - m1.Send(context.TODO(), upid2, messages[i%1000]) + m1.Send(context.TODO(), &upid2, messages[i%1000]) } globalWG.Wait() + b.StopTimer() + time.Sleep(2 * time.Second) // allow time for connection cleanup } func BenchmarkMessengerSendRecvMediumMessage(b *testing.B) { @@ -341,23 +327,25 @@ func BenchmarkMessengerSendRecvMediumMessage(b *testing.B) { messages := generateMediumMessages(1000) - upid1, err := upid.Parse(fmt.Sprintf("mesos1@localhost:%d", getNewPort())) - assert.NoError(b, err) - upid2, err := upid.Parse(fmt.Sprintf("mesos2@localhost:%d", getNewPort())) - assert.NoError(b, err) - - m1 := NewHttp(upid1) - m2 := NewHttp(upid2) + m1 := NewHttp(upid.UPID{ID: "foo1", Host: "localhost"}) + m2 := NewHttp(upid.UPID{ID: "foo2", Host: "localhost"}) assert.NoError(b, m1.Start()) + defer m1.Stop() + assert.NoError(b, m2.Start()) + defer m2.Stop() + assert.NoError(b, m2.Install(noopHandler, &testmessage.MediumMessage{})) - time.Sleep(time.Second) // Avoid race on upid. + upid2 := m2.UPID() + b.ResetTimer() for i := 0; i < b.N; i++ { - m1.Send(context.TODO(), upid2, messages[i%1000]) + m1.Send(context.TODO(), &upid2, messages[i%1000]) } globalWG.Wait() + b.StopTimer() + time.Sleep(2 * time.Second) // allow time for connection cleanup } func BenchmarkMessengerSendRecvBigMessage(b *testing.B) { @@ -365,72 +353,78 @@ func BenchmarkMessengerSendRecvBigMessage(b *testing.B) { messages := generateBigMessages(1000) - upid1, err := upid.Parse(fmt.Sprintf("mesos1@localhost:%d", getNewPort())) - assert.NoError(b, err) - upid2, err := upid.Parse(fmt.Sprintf("mesos2@localhost:%d", getNewPort())) - assert.NoError(b, err) - - m1 := NewHttp(upid1) - m2 := NewHttp(upid2) + m1 := NewHttp(upid.UPID{ID: "foo1", Host: "localhost"}) + m2 := NewHttp(upid.UPID{ID: "foo2", Host: "localhost"}) assert.NoError(b, m1.Start()) + defer m1.Stop() + assert.NoError(b, m2.Start()) + defer m2.Stop() + assert.NoError(b, m2.Install(noopHandler, &testmessage.BigMessage{})) - time.Sleep(time.Second) // Avoid race on upid. + upid2 := m2.UPID() + b.ResetTimer() for i := 0; i < b.N; i++ { - m1.Send(context.TODO(), upid2, messages[i%1000]) + m1.Send(context.TODO(), &upid2, messages[i%1000]) } globalWG.Wait() + b.StopTimer() + time.Sleep(2 * time.Second) // allow time for connection cleanup } func BenchmarkMessengerSendRecvLargeMessage(b *testing.B) { globalWG.Add(b.N) messages := generateLargeMessages(1000) - upid1, err := upid.Parse(fmt.Sprintf("mesos1@localhost:%d", getNewPort())) - assert.NoError(b, err) - upid2, err := upid.Parse(fmt.Sprintf("mesos2@localhost:%d", getNewPort())) - assert.NoError(b, err) - - m1 := NewHttp(upid1) - m2 := NewHttp(upid2) + m1 := NewHttp(upid.UPID{ID: "foo1", Host: "localhost"}) + m2 := NewHttp(upid.UPID{ID: "foo2", Host: "localhost"}) assert.NoError(b, m1.Start()) + defer m1.Stop() + assert.NoError(b, m2.Start()) + defer m2.Stop() + assert.NoError(b, m2.Install(noopHandler, &testmessage.LargeMessage{})) - time.Sleep(time.Second) // Avoid race on upid. + upid2 := m2.UPID() + b.ResetTimer() for i := 0; i < b.N; i++ { - m1.Send(context.TODO(), upid2, messages[i%1000]) + m1.Send(context.TODO(), &upid2, messages[i%1000]) } globalWG.Wait() + b.StopTimer() + time.Sleep(2 * time.Second) // allow time for connection cleanup } func BenchmarkMessengerSendRecvMixedMessage(b *testing.B) { globalWG.Add(b.N) messages := generateMixedMessages(1000) - upid1, err := upid.Parse(fmt.Sprintf("mesos1@localhost:%d", getNewPort())) - assert.NoError(b, err) - upid2, err := upid.Parse(fmt.Sprintf("mesos2@localhost:%d", getNewPort())) - assert.NoError(b, err) - - m1 := NewHttp(upid1) - m2 := NewHttp(upid2) + m1 := NewHttp(upid.UPID{ID: "foo1", Host: "localhost"}) + m2 := NewHttp(upid.UPID{ID: "foo2", Host: "localhost"}) assert.NoError(b, m1.Start()) + defer m1.Stop() + assert.NoError(b, m2.Start()) + defer m2.Stop() + assert.NoError(b, m2.Install(noopHandler, &testmessage.SmallMessage{})) assert.NoError(b, m2.Install(noopHandler, &testmessage.MediumMessage{})) assert.NoError(b, m2.Install(noopHandler, &testmessage.BigMessage{})) assert.NoError(b, m2.Install(noopHandler, &testmessage.LargeMessage{})) - time.Sleep(time.Second) // Avoid race on upid. + upid2 := m2.UPID() + b.ResetTimer() for i := 0; i < b.N; i++ { - m1.Send(context.TODO(), upid2, messages[i%1000]) + m1.Send(context.TODO(), &upid2, messages[i%1000]) } globalWG.Wait() + b.StopTimer() + time.Sleep(2 * time.Second) // allow time for connection cleanup } func TestUPIDBindingAddress(t *testing.T) { diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/messenger/mocked_messenger.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/messenger/mocked_messenger.go index 34d53d0868f3f..3fb811ef16a47 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/messenger/mocked_messenger.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/messenger/mocked_messenger.go @@ -83,8 +83,8 @@ func (m *MockedMessenger) Stop() error { } // UPID is a mocked implementation. -func (m *MockedMessenger) UPID() *upid.UPID { - return m.Called().Get(0).(*upid.UPID) +func (m *MockedMessenger) UPID() upid.UPID { + return m.Called().Get(0).(upid.UPID) } func (m *MockedMessenger) recvLoop() { diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/messenger/transporter.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/messenger/transporter.go index 7d920c08b0213..cfe80ec21580f 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/messenger/transporter.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/messenger/transporter.go @@ -43,11 +43,11 @@ type Transporter interface { //Start starts the transporter and returns immediately. The error chan //is never nil. - Start() <-chan error + Start() (upid.UPID, <-chan error) //Stop kills the transporter. Stop(graceful bool) error //UPID returns the PID for transporter. - UPID() *upid.UPID + UPID() upid.UPID } diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/scheduler/scheduler.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/scheduler/scheduler.go index 117f4b2f3c1b1..c2070810e4e50 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/scheduler/scheduler.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/scheduler/scheduler.go @@ -26,6 +26,7 @@ import ( "net" "os/user" "sync" + "sync/atomic" "time" "github.com/gogo/protobuf/proto" @@ -51,6 +52,17 @@ var ( authenticationCanceledError = errors.New("authentication canceled") ) +type ErrDriverAborted struct { + Reason string +} + +func (err *ErrDriverAborted) Error() string { + if err.Reason != "" { + return err.Reason + } + return "driver-aborted" +} + // helper to track authentication progress and to prevent multiple close() ops // against a signalling chan. it's safe to invoke the func's of this struct // even if the receiver pointer is nil. @@ -86,7 +98,9 @@ type DriverConfig struct { HostnameOverride string // optional BindingAddress net.IP // optional BindingPort uint16 // optional + PublishedAddress net.IP // optional NewMessenger func() (messenger.Messenger, error) // optional + NewDetector func() (detector.Master, error) // optional } // Concrete implementation of a SchedulerDriver that connects a @@ -110,14 +124,10 @@ type DriverConfig struct { // See src/examples/test_framework.cpp for an example of using the // MesosSchedulerDriver. type MesosSchedulerDriver struct { - Scheduler Scheduler - MasterPid *upid.UPID - FrameworkInfo *mesos.FrameworkInfo - - lock sync.RWMutex + masterPid *upid.UPID + frameworkInfo *mesos.FrameworkInfo self *upid.UPID stopCh chan struct{} - stopped bool status mesos.Status messenger messenger.Messenger masterDetector detector.Master @@ -133,6 +143,11 @@ type MesosSchedulerDriver struct { authenticating *authenticationAttempt reauthenticate bool withAuthContext func(context.Context) context.Context + dispatch func(context.Context, *upid.UPID, proto.Message) error // send a message somewhere + started chan struct{} // signal chan that closes upon a successful call to Start() + eventLock sync.RWMutex // guard for all driver state + withScheduler func(f func(s Scheduler)) // execute some func with respect to the given scheduler + done chan struct{} // signal chan that closes when no more events will be processed } // Create a new mesos scheduler driver with the given @@ -152,7 +167,7 @@ func NewMesosSchedulerDriver(config DriverConfig) (initializedDriver *MesosSched return } - framework := cloneFrameworkInfo(config.Framework) + framework := proto.Clone(config.Framework).(*mesos.FrameworkInfo) // set default userid if framework.GetUser() == "" { @@ -176,32 +191,40 @@ func NewMesosSchedulerDriver(config DriverConfig) (initializedDriver *MesosSched } driver := &MesosSchedulerDriver{ - Scheduler: config.Scheduler, - FrameworkInfo: framework, + frameworkInfo: framework, stopCh: make(chan struct{}), status: mesos.Status_DRIVER_NOT_STARTED, - stopped: true, cache: newSchedCache(), credential: config.Credential, failover: framework.Id != nil && len(framework.Id.GetValue()) > 0, withAuthContext: config.WithAuthContext, + started: make(chan struct{}), + done: make(chan struct{}), } + driver.withScheduler = driver.makeWithScheduler(config.Scheduler) + if framework.FailoverTimeout != nil && *framework.FailoverTimeout > 0 { driver.failoverTimeout = *framework.FailoverTimeout * float64(time.Second) log.V(1).Infof("found failover_timeout = %v", time.Duration(driver.failoverTimeout)) } + newDetector := config.NewDetector + if newDetector == nil { + newDetector = func() (detector.Master, error) { + return detector.New(config.Master) + } + } newMessenger := config.NewMessenger if newMessenger == nil { newMessenger = func() (messenger.Messenger, error) { process := process.New("scheduler") - return messenger.ForHostname(process, hostname, config.BindingAddress, config.BindingPort) + return messenger.ForHostname(process, hostname, config.BindingAddress, config.BindingPort, config.PublishedAddress) } } // initialize new detector. - if driver.masterDetector, err = detector.New(config.Master); err != nil { + if driver.masterDetector, err = newDetector(); err != nil { return } else if driver.messenger, err = newMessenger(); err != nil { return @@ -213,46 +236,120 @@ func NewMesosSchedulerDriver(config DriverConfig) (initializedDriver *MesosSched return } -func cloneFrameworkInfo(framework *mesos.FrameworkInfo) *mesos.FrameworkInfo { - if framework == nil { - return nil - } +func (driver *MesosSchedulerDriver) makeWithScheduler(cs Scheduler) func(func(Scheduler)) { + // mechanism that allows us to asynchronously invoke scheduler callbacks, but in a manner + // such that the callback invocations are serialized. useful because this will decouple the + // goroutine executing a messenger callback from the goroutine executing a scheduler callback, + // while preserving the serialization semantics for each type of callback handling. + // we use a chan to maintain the order of callback invocations; this is important for maintaining + // the order in which status updates are processed. + schedQueue := make(chan func(s Scheduler)) + go func() { + defer func() { + close(driver.done) + log.V(1).Infoln("finished processing scheduler events") + }() + for f := range schedQueue { + f(cs) + } + }() + + var schedLock sync.Mutex // synchronize write access to schedQueue + abort := int32(0) + + // assume that when withScheduler is invoked eventLock is locked + return func(f func(s Scheduler)) { + const timeout = 1 * time.Second + t := time.NewTimer(timeout) + defer t.Stop() + + trySend := func() (done bool) { + // don't block while attempting to enqueue a scheduler op; this could + // take a while depending upon the external scheduler implementation. + // also, it allows for multiple go-routines to re-compete for the lock + // every so often - this avoids indefinitely blocking a call to Abort(). + driver.eventLock.Unlock() + schedLock.Lock() + defer func() { + schedLock.Unlock() + driver.eventLock.Lock() + }() + + if atomic.LoadInt32(&abort) == 1 { + // can't send anymore + return true + } - clonedInfo := *framework - if clonedInfo.Id != nil { - clonedId := *clonedInfo.Id - clonedInfo.Id = &clonedId - if framework.FailoverTimeout != nil { - clonedInfo.FailoverTimeout = proto.Float64(*framework.FailoverTimeout) + // try to write to event queue... + select { + case schedQueue <- f: + done = true + case <-driver.stopCh: + done = true + case <-t.C: + } + + // if stopping then close out the queue (keeping this check separate from + // the above on purpose! otherwise we could miss the close signal) + select { + case <-driver.stopCh: + if atomic.CompareAndSwapInt32(&abort, 0, 1) { + defer close(schedQueue) + log.V(1).Infoln("stopping scheduler event queue..") + + // one last attempt, before we run out of time + select { + case schedQueue <- f: + case <-t.C: + } + } + default: + } + return + } + for !trySend() { + t.Reset(timeout) // TODO(jdef) add jitter to this } - if framework.Checkpoint != nil { - clonedInfo.Checkpoint = proto.Bool(*framework.Checkpoint) + // have to do this outside trySend because here we're guarded by eventLock; it's ok + // if this happens more then once. + if atomic.LoadInt32(&abort) == 1 { + driver.withScheduler = func(f func(_ Scheduler)) {} } } - return &clonedInfo } // init initializes the driver. func (driver *MesosSchedulerDriver) init() error { log.Infof("Initializing mesos scheduler driver\n") + driver.dispatch = driver.messenger.Send + + // serialize all callbacks from the messenger + guarded := func(h messenger.MessageHandler) messenger.MessageHandler { + return messenger.MessageHandler(func(from *upid.UPID, msg proto.Message) { + driver.eventLock.Lock() + defer driver.eventLock.Unlock() + h(from, msg) + }) + } // Install handlers. - driver.messenger.Install(driver.frameworkRegistered, &mesos.FrameworkRegisteredMessage{}) - driver.messenger.Install(driver.frameworkReregistered, &mesos.FrameworkReregisteredMessage{}) - driver.messenger.Install(driver.resourcesOffered, &mesos.ResourceOffersMessage{}) - driver.messenger.Install(driver.resourceOfferRescinded, &mesos.RescindResourceOfferMessage{}) - driver.messenger.Install(driver.statusUpdated, &mesos.StatusUpdateMessage{}) - driver.messenger.Install(driver.slaveLost, &mesos.LostSlaveMessage{}) - driver.messenger.Install(driver.frameworkMessageRcvd, &mesos.ExecutorToFrameworkMessage{}) - driver.messenger.Install(driver.frameworkErrorRcvd, &mesos.FrameworkErrorMessage{}) - driver.messenger.Install(driver.handleMasterChanged, &mesos.InternalMasterChangeDetected{}) - driver.messenger.Install(driver.handleAuthenticationResult, &mesos.InternalAuthenticationResult{}) + driver.messenger.Install(guarded(driver.frameworkRegistered), &mesos.FrameworkRegisteredMessage{}) + driver.messenger.Install(guarded(driver.frameworkReregistered), &mesos.FrameworkReregisteredMessage{}) + driver.messenger.Install(guarded(driver.resourcesOffered), &mesos.ResourceOffersMessage{}) + driver.messenger.Install(guarded(driver.resourceOfferRescinded), &mesos.RescindResourceOfferMessage{}) + driver.messenger.Install(guarded(driver.statusUpdated), &mesos.StatusUpdateMessage{}) + driver.messenger.Install(guarded(driver.slaveLost), &mesos.LostSlaveMessage{}) + driver.messenger.Install(guarded(driver.frameworkMessageRcvd), &mesos.ExecutorToFrameworkMessage{}) + driver.messenger.Install(guarded(driver.frameworkErrorRcvd), &mesos.FrameworkErrorMessage{}) + driver.messenger.Install(guarded(driver.exitedExecutor), &mesos.ExitedExecutorMessage{}) + driver.messenger.Install(guarded(driver.handleMasterChanged), &mesos.InternalMasterChangeDetected{}) + driver.messenger.Install(guarded(driver.handleAuthenticationResult), &mesos.InternalAuthenticationResult{}) return nil } // lead master detection callback. func (driver *MesosSchedulerDriver) handleMasterChanged(from *upid.UPID, pbMsg proto.Message) { - if driver.Status() == mesos.Status_DRIVER_ABORTED { + if driver.status == mesos.Status_DRIVER_ABORTED { log.Info("Ignoring master change because the driver is aborted.") return } else if !from.Equal(driver.self) { @@ -260,17 +357,17 @@ func (driver *MesosSchedulerDriver) handleMasterChanged(from *upid.UPID, pbMsg p return } - // Reconnect every time a master is dected. - if driver.Connected() { + // Reconnect every time a master is detected. + if driver.connected { log.V(3).Info("Disconnecting scheduler.") - driver.MasterPid = nil - driver.Scheduler.Disconnected(driver) + driver.masterPid = nil + driver.withScheduler(func(s Scheduler) { s.Disconnected(driver) }) } msg := pbMsg.(*mesos.InternalMasterChangeDetected) master := msg.Master - driver.setConnected(false) + driver.connected = false driver.authenticated = false if master != nil { @@ -281,20 +378,21 @@ func (driver *MesosSchedulerDriver) handleMasterChanged(from *upid.UPID, pbMsg p panic("Unable to parse Master's PID value.") // this should not happen. } - driver.MasterPid = pid // save for downstream ops. + driver.masterPid = pid // save for downstream ops. driver.tryAuthentication() } else { log.Infoln("No master detected.") } } +// tryAuthentication expects to be guarded by eventLock func (driver *MesosSchedulerDriver) tryAuthentication() { if driver.authenticated { // programming error panic("already authenticated") } - masterPid := driver.MasterPid // save for referencing later in goroutine + masterPid := driver.masterPid // save for referencing later in goroutine if masterPid == nil { log.Info("skipping authentication attempt because we lost the master") return @@ -328,7 +426,8 @@ func (driver *MesosSchedulerDriver) tryAuthentication() { result.Completed = proto.Bool(true) result.Success = proto.Bool(true) } - driver.messenger.Route(context.TODO(), driver.messenger.UPID(), result) + pid := driver.messenger.UPID() + driver.messenger.Route(context.TODO(), &pid, result) }() driver.authenticating = authenticating } else { @@ -340,7 +439,7 @@ func (driver *MesosSchedulerDriver) tryAuthentication() { } func (driver *MesosSchedulerDriver) handleAuthenticationResult(from *upid.UPID, pbMsg proto.Message) { - if driver.Status() != mesos.Status_DRIVER_RUNNING { + if driver.status != mesos.Status_DRIVER_RUNNING { log.V(1).Info("ignoring authenticate because driver is not running") return } @@ -352,7 +451,7 @@ func (driver *MesosSchedulerDriver) handleAuthenticationResult(from *upid.UPID, // programming error panic("already authenticated") } - if driver.MasterPid == nil { + if driver.masterPid == nil { log.Infoln("ignoring authentication result because master is lost") driver.authenticating.cancel() // cancel any in-progress background attempt @@ -361,15 +460,15 @@ func (driver *MesosSchedulerDriver) handleAuthenticationResult(from *upid.UPID, return } msg := pbMsg.(*mesos.InternalAuthenticationResult) - if driver.reauthenticate || !msg.GetCompleted() || driver.MasterPid.String() != msg.GetPid() { - log.Infof("failed to authenticate with master %v: master changed", driver.MasterPid) + if driver.reauthenticate || !msg.GetCompleted() || driver.masterPid.String() != msg.GetPid() { + log.Infof("failed to authenticate with master %v: master changed", driver.masterPid) driver.authenticating.cancel() // cancel any in-progress background authentication driver.reauthenticate = false driver.tryAuthentication() return } if !msg.GetSuccess() { - log.Errorf("master %v refused authentication", driver.MasterPid) + log.Errorf("master %v refused authentication", driver.masterPid) return } driver.authenticated = true @@ -377,42 +476,32 @@ func (driver *MesosSchedulerDriver) handleAuthenticationResult(from *upid.UPID, } // ------------------------- Accessors ----------------------- // + +// Status returns the current driver status func (driver *MesosSchedulerDriver) Status() mesos.Status { - driver.lock.RLock() - defer driver.lock.RUnlock() + driver.eventLock.RLock() + defer driver.eventLock.RUnlock() return driver.status } -func (driver *MesosSchedulerDriver) setStatus(stat mesos.Status) { - driver.lock.Lock() - driver.status = stat - driver.lock.Unlock() -} - -func (driver *MesosSchedulerDriver) Stopped() bool { - driver.lock.RLock() - defer driver.lock.RUnlock() - return driver.stopped -} -func (driver *MesosSchedulerDriver) setStopped(val bool) { - driver.lock.Lock() - driver.stopped = val - driver.lock.Unlock() +// Running returns true if the driver is in the DRIVER_RUNNING state +func (driver *MesosSchedulerDriver) Running() bool { + driver.eventLock.RLock() + defer driver.eventLock.RUnlock() + return driver.status == mesos.Status_DRIVER_RUNNING } +// Connected returns true if the driver has a registered (and authenticated, if enabled) +// connection to the leading mesos master func (driver *MesosSchedulerDriver) Connected() bool { - driver.lock.RLock() - defer driver.lock.RUnlock() + driver.eventLock.RLock() + defer driver.eventLock.RUnlock() return driver.connected } -func (driver *MesosSchedulerDriver) setConnected(val bool) { - driver.lock.Lock() - driver.connected = val - if val { - driver.failover = false - } - driver.lock.Unlock() +// stopped returns true if the driver status != DRIVER_RUNNING; expects to be guarded by eventLock +func (driver *MesosSchedulerDriver) stopped() bool { + return driver.status != mesos.Status_DRIVER_RUNNING } // ---------------------- Handlers for Events from Master --------------- // @@ -424,7 +513,7 @@ func (driver *MesosSchedulerDriver) frameworkRegistered(from *upid.UPID, pbMsg p masterPid := masterInfo.GetPid() frameworkId := msg.GetFrameworkId() - if driver.Status() == mesos.Status_DRIVER_ABORTED { + if driver.status == mesos.Status_DRIVER_ABORTED { log.Infof("ignoring FrameworkRegisteredMessage from master %s, driver is aborted", masterPid) return } @@ -434,28 +523,29 @@ func (driver *MesosSchedulerDriver) frameworkRegistered(from *upid.UPID, pbMsg p return } - if driver.stopped { + if driver.stopped() { log.Infof("ignoring FrameworkRegisteredMessage from master %s, driver is stopped", masterPid) return } - if !driver.MasterPid.Equal(from) { - log.Warningf("ignoring framework registered message because it was sent from '%v' instead of leading master '%v'", from, driver.MasterPid) + if !driver.masterPid.Equal(from) { + log.Warningf("ignoring framework registered message because it was sent from '%v' instead of leading master '%v'", from, driver.masterPid) return } log.Infof("Framework registered with ID=%s\n", frameworkId.GetValue()) - driver.FrameworkInfo.Id = frameworkId // generated by master. + driver.frameworkInfo.Id = frameworkId // generated by master. - driver.setConnected(true) + driver.connected = true + driver.failover = false driver.connection = uuid.NewUUID() - driver.Scheduler.Registered(driver, frameworkId, masterInfo) + driver.withScheduler(func(s Scheduler) { s.Registered(driver, frameworkId, masterInfo) }) } func (driver *MesosSchedulerDriver) frameworkReregistered(from *upid.UPID, pbMsg proto.Message) { log.V(1).Infoln("Handling Scheduler re-registered event.") msg := pbMsg.(*mesos.FrameworkReregisteredMessage) - if driver.Status() == mesos.Status_DRIVER_ABORTED { + if driver.status == mesos.Status_DRIVER_ABORTED { log.Infoln("Ignoring FrameworkReregisteredMessage from master, driver is aborted!") return } @@ -463,17 +553,18 @@ func (driver *MesosSchedulerDriver) frameworkReregistered(from *upid.UPID, pbMsg log.Infoln("Ignoring FrameworkReregisteredMessage from master,driver is already connected!") return } - if !driver.MasterPid.Equal(from) { - log.Warningf("ignoring framework re-registered message because it was sent from '%v' instead of leading master '%v'", from, driver.MasterPid) + if !driver.masterPid.Equal(from) { + log.Warningf("ignoring framework re-registered message because it was sent from '%v' instead of leading master '%v'", from, driver.masterPid) return } // TODO(vv) detect if message was from leading-master (sched.cpp) log.Infof("Framework re-registered with ID [%s] ", msg.GetFrameworkId().GetValue()) - driver.setConnected(true) + driver.connected = true + driver.failover = false driver.connection = uuid.NewUUID() - driver.Scheduler.Reregistered(driver, msg.GetMasterInfo()) + driver.withScheduler(func(s Scheduler) { s.Reregistered(driver, msg.GetMasterInfo()) }) } @@ -481,7 +572,7 @@ func (driver *MesosSchedulerDriver) resourcesOffered(from *upid.UPID, pbMsg prot log.V(2).Infoln("Handling resource offers.") msg := pbMsg.(*mesos.ResourceOffersMessage) - if driver.Status() == mesos.Status_DRIVER_ABORTED { + if driver.status == mesos.Status_DRIVER_ABORTED { log.Infoln("Ignoring ResourceOffersMessage, the driver is aborted!") return } @@ -506,7 +597,7 @@ func (driver *MesosSchedulerDriver) resourcesOffered(from *upid.UPID, pbMsg prot } } - driver.Scheduler.ResourceOffers(driver, msg.Offers) + driver.withScheduler(func(s Scheduler) { s.ResourceOffers(driver, msg.Offers) }) } func (driver *MesosSchedulerDriver) resourceOfferRescinded(from *upid.UPID, pbMsg proto.Message) { @@ -514,7 +605,7 @@ func (driver *MesosSchedulerDriver) resourceOfferRescinded(from *upid.UPID, pbMs msg := pbMsg.(*mesos.RescindResourceOfferMessage) - if driver.Status() == mesos.Status_DRIVER_ABORTED { + if driver.status == mesos.Status_DRIVER_ABORTED { log.Infoln("Ignoring RescindResourceOfferMessage, the driver is aborted!") return } @@ -528,7 +619,7 @@ func (driver *MesosSchedulerDriver) resourceOfferRescinded(from *upid.UPID, pbMs log.V(1).Infoln("Rescinding offer ", msg.OfferId.GetValue()) driver.cache.removeOffer(msg.OfferId) - driver.Scheduler.OfferRescinded(driver, msg.OfferId) + driver.withScheduler(func(s Scheduler) { s.OfferRescinded(driver, msg.OfferId) }) } func (driver *MesosSchedulerDriver) send(upid *upid.UPID, msg proto.Message) error { @@ -537,7 +628,7 @@ func (driver *MesosSchedulerDriver) send(upid *upid.UPID, msg proto.Message) err defer cancel() c := make(chan error, 1) - go func() { c <- driver.messenger.Send(ctx, upid, msg) }() + go func() { c <- driver.dispatch(ctx, upid, msg) }() select { case <-ctx.Done(): @@ -548,49 +639,92 @@ func (driver *MesosSchedulerDriver) send(upid *upid.UPID, msg proto.Message) err } } +// statusUpdated expects to be guarded by eventLock func (driver *MesosSchedulerDriver) statusUpdated(from *upid.UPID, pbMsg proto.Message) { msg := pbMsg.(*mesos.StatusUpdateMessage) - if driver.Status() == mesos.Status_DRIVER_ABORTED { - log.V(1).Infoln("Ignoring StatusUpdate message, the driver is aborted!") - return - } - if !driver.connected { - log.V(1).Infoln("Ignoring StatusUpdate message, the driver is not connected!") + if driver.status != mesos.Status_DRIVER_RUNNING { + log.V(1).Infoln("Ignoring StatusUpdate message, the driver is not running!") return } - if !driver.MasterPid.Equal(from) { - log.Warningf("ignoring status message because it was sent from '%v' instead of leading master '%v'", from, driver.MasterPid) - return + if !from.Equal(driver.self) { + if !driver.connected { + log.V(1).Infoln("Ignoring StatusUpdate message, the driver is not connected!") + return + } + if !driver.masterPid.Equal(from) { + log.Warningf("ignoring status message because it was sent from '%v' instead of leading master '%v'", from, driver.masterPid) + return + } } - log.V(2).Infoln("Received status update from ", from.String(), " status source:", msg.GetPid()) + log.V(2).Infof("Received status update from %q status source %q", from.String(), msg.GetPid()) - driver.Scheduler.StatusUpdate(driver, msg.Update.GetStatus()) + status := msg.Update.GetStatus() - if driver.Status() == mesos.Status_DRIVER_ABORTED { + // see https://github.com/apache/mesos/blob/master/src/sched/sched.cpp#L887 + // If the update does not have a 'uuid', it does not need + // acknowledging. However, prior to 0.23.0, the update uuid + // was required and always set. We also don't want to ACK updates + // that were internally generated. In 0.24.0, we can rely on the + // update uuid check here, until then we must still check for + // this being sent from the driver (from == UPID()) or from + // the master (pid == UPID()). + // TODO(vinod): Get rid of this logic in 0.25.0 because master + // and slave correctly set task status in 0.24.0. + if clearUUID := len(msg.Update.Uuid) == 0 || from.Equal(driver.self) || msg.GetPid() == driver.self.String(); clearUUID { + status.Uuid = nil + } else { + status.Uuid = msg.Update.Uuid + } + + driver.withScheduler(func(s Scheduler) { s.StatusUpdate(driver, status) }) + + if driver.status == mesos.Status_DRIVER_ABORTED { log.V(1).Infoln("Not sending StatusUpdate ACK, the driver is aborted!") return } - // Send StatusUpdate Acknowledgement - // Only send ACK if udpate was not from this driver - if !from.Equal(driver.self) && msg.GetPid() != from.String() { + // Send StatusUpdate Acknowledgement; see above for the rules. + // Only send ACK if udpate was not from this driver and spec'd a UUID; this is compat w/ 0.23+ + ackRequired := len(msg.Update.Uuid) > 0 && !from.Equal(driver.self) && msg.GetPid() != driver.self.String() + if ackRequired { ackMsg := &mesos.StatusUpdateAcknowledgementMessage{ SlaveId: msg.Update.SlaveId, - FrameworkId: driver.FrameworkInfo.Id, + FrameworkId: driver.frameworkInfo.Id, TaskId: msg.Update.Status.TaskId, Uuid: msg.Update.Uuid, } - log.V(2).Infoln("Sending status update ACK to ", from.String()) - if err := driver.send(driver.MasterPid, ackMsg); err != nil { - log.Errorf("Failed to send StatusUpdate ACK message: %v\n", err) + log.V(2).Infof("Sending ACK for status update %+v to %q", *msg.Update, from.String()) + if err := driver.send(driver.masterPid, ackMsg); err != nil { + log.Errorf("Failed to send StatusUpdate ACK message: %v", err) return } } else { - log.V(1).Infoln("Not sending ACK, update is not from slave:", from.String()) + log.V(2).Infof("Not sending ACK, update is not from slave %q", from.String()) + } +} + +func (driver *MesosSchedulerDriver) exitedExecutor(from *upid.UPID, pbMsg proto.Message) { + log.V(1).Infoln("Handling ExitedExceutor event.") + msg := pbMsg.(*mesos.ExitedExecutorMessage) + + if driver.status == mesos.Status_DRIVER_ABORTED { + log.V(1).Infoln("Ignoring ExitedExecutor message, the driver is aborted!") + return } + if !driver.connected { + log.V(1).Infoln("Ignoring ExitedExecutor message, the driver is not connected!") + return + } + status := msg.GetStatus() + log.V(2).Infoln("Lost executor %q from slave %q for framework %q with status %d", + msg.GetExecutorId().GetValue(), + msg.GetSlaveId().GetValue(), + msg.GetFrameworkId().GetValue(), + status) + driver.withScheduler(func(s Scheduler) { s.ExecutorLost(driver, msg.GetExecutorId(), msg.GetSlaveId(), int(status)) }) } func (driver *MesosSchedulerDriver) slaveLost(from *upid.UPID, pbMsg proto.Message) { @@ -598,7 +732,7 @@ func (driver *MesosSchedulerDriver) slaveLost(from *upid.UPID, pbMsg proto.Messa msg := pbMsg.(*mesos.LostSlaveMessage) - if driver.Status() == mesos.Status_DRIVER_ABORTED { + if driver.status == mesos.Status_DRIVER_ABORTED { log.V(1).Infoln("Ignoring LostSlave message, the driver is aborted!") return } @@ -613,7 +747,7 @@ func (driver *MesosSchedulerDriver) slaveLost(from *upid.UPID, pbMsg proto.Messa log.V(2).Infoln("Lost slave ", msg.SlaveId.GetValue()) driver.cache.removeSlavePid(msg.SlaveId) - driver.Scheduler.SlaveLost(driver, msg.SlaveId) + driver.withScheduler(func(s Scheduler) { s.SlaveLost(driver, msg.SlaveId) }) } func (driver *MesosSchedulerDriver) frameworkMessageRcvd(from *upid.UPID, pbMsg proto.Message) { @@ -621,20 +755,20 @@ func (driver *MesosSchedulerDriver) frameworkMessageRcvd(from *upid.UPID, pbMsg msg := pbMsg.(*mesos.ExecutorToFrameworkMessage) - if driver.Status() == mesos.Status_DRIVER_ABORTED { + if driver.status == mesos.Status_DRIVER_ABORTED { log.V(1).Infoln("Ignoring framwork message, the driver is aborted!") return } log.V(1).Infoln("Received Framwork Message ", msg.String()) - driver.Scheduler.FrameworkMessage(driver, msg.ExecutorId, msg.SlaveId, string(msg.Data)) + driver.withScheduler(func(s Scheduler) { s.FrameworkMessage(driver, msg.ExecutorId, msg.SlaveId, string(msg.Data)) }) } func (driver *MesosSchedulerDriver) frameworkErrorRcvd(from *upid.UPID, pbMsg proto.Message) { log.V(1).Infoln("Handling framework error event.") msg := pbMsg.(*mesos.FrameworkErrorMessage) - driver.error(msg.GetMessage(), true) + driver.error(msg.GetMessage()) } // ---------------------- Interface Methods ---------------------- // @@ -642,24 +776,35 @@ func (driver *MesosSchedulerDriver) frameworkErrorRcvd(from *upid.UPID, pbMsg pr // Starts the scheduler driver. // Returns immediately if an error occurs within start sequence. func (driver *MesosSchedulerDriver) Start() (mesos.Status, error) { - log.Infoln("Starting the scheduler driver...") + driver.eventLock.Lock() + defer driver.eventLock.Unlock() + return driver.start() +} - if stat := driver.Status(); stat != mesos.Status_DRIVER_NOT_STARTED { - return stat, fmt.Errorf("Unable to Start, expecting driver status %s, but is %s:", mesos.Status_DRIVER_NOT_STARTED, stat) +// start expected to be guarded by eventLock +func (driver *MesosSchedulerDriver) start() (mesos.Status, error) { + select { + case <-driver.started: + return driver.status, errors.New("Unable to Start: driver has already been started once.") + default: // proceed } - driver.setStopped(true) - driver.setStatus(mesos.Status_DRIVER_NOT_STARTED) + log.Infoln("Starting the scheduler driver...") + + if driver.status != mesos.Status_DRIVER_NOT_STARTED { + return driver.status, fmt.Errorf("Unable to Start, expecting driver status %s, but is %s:", mesos.Status_DRIVER_NOT_STARTED, driver.status) + } // Start the messenger. if err := driver.messenger.Start(); err != nil { log.Errorf("Scheduler failed to start the messenger: %v\n", err) - return driver.Status(), err + return driver.status, err } - driver.self = driver.messenger.UPID() - driver.setStatus(mesos.Status_DRIVER_RUNNING) - driver.setStopped(false) + pid := driver.messenger.UPID() + driver.self = &pid + driver.status = mesos.Status_DRIVER_RUNNING + close(driver.started) log.Infof("Mesos scheduler driver started with PID=%v", driver.self) @@ -669,14 +814,15 @@ func (driver *MesosSchedulerDriver) Start() (mesos.Status, error) { }) }) - // register with Detect() AFTER we have a self pid from the messenger, otherwise things get ugly - // because our internal messaging depends on it. detector callbacks are routed over the messenger - // bus, maintaining serial (concurrency-safe) callback execution. - log.V(1).Infof("starting master detector %T: %+v", driver.masterDetector, driver.masterDetector) - driver.masterDetector.Detect(listener) - - log.V(2).Infoln("master detector started") - return driver.Status(), nil + if driver.masterDetector != nil { + // register with Detect() AFTER we have a self pid from the messenger, otherwise things get ugly + // because our internal messaging depends on it. detector callbacks are routed over the messenger + // bus, maintaining serial (concurrency-safe) callback execution. + log.V(1).Infof("starting master detector %T: %+v", driver.masterDetector, driver.masterDetector) + driver.masterDetector.Detect(listener) + log.V(2).Infoln("master detector started") + } + return driver.status, nil } // authenticate against the spec'd master pid using the configured authenticationProvider. @@ -729,53 +875,59 @@ func (driver *MesosSchedulerDriver) doReliableRegistration(maxBackoff float64) { } // Determine the delay for next attempt by picking a random - // duration between 0 and 'maxBackoff'. + // duration between 0 and 'maxBackoff' (jitter). delay := time.Duration(maxBackoff * rand.Float64()) log.V(1).Infof("will retry registration in %v if necessary", delay) + t := time.NewTimer(delay) + defer t.Stop() + select { case <-driver.stopCh: return - case <-time.After(delay): + case <-t.C: maxBackoff *= 2 } } } -// return true if we should attempt another registration later +// registerOnce returns true if we should attempt another registration later; it is *not* +// guarded by eventLock: all access to mutable members of MesosSchedulerDriver should be +// explicitly synchronized. func (driver *MesosSchedulerDriver) registerOnce() bool { - var ( failover bool pid *upid.UPID + info *mesos.FrameworkInfo ) if func() bool { - driver.lock.RLock() - defer driver.lock.RUnlock() + driver.eventLock.RLock() + defer driver.eventLock.RUnlock() - if driver.stopped || driver.connected || driver.MasterPid == nil || (driver.credential != nil && !driver.authenticated) { + if driver.stopped() || driver.connected || driver.masterPid == nil || (driver.credential != nil && !driver.authenticated) { log.V(1).Infof("skipping registration request: stopped=%v, connected=%v, authenticated=%v", - driver.stopped, driver.connected, driver.authenticated) + driver.stopped(), driver.connected, driver.authenticated) return false } failover = driver.failover - pid = driver.MasterPid + pid = driver.masterPid + info = proto.Clone(driver.frameworkInfo).(*mesos.FrameworkInfo) return true }() { // register framework var message proto.Message - if driver.FrameworkInfo.Id != nil && len(driver.FrameworkInfo.Id.GetValue()) > 0 { + if len(info.GetId().GetValue()) > 0 { // not the first time, or failing over log.V(1).Infof("Reregistering with master: %v", pid) message = &mesos.ReregisterFrameworkMessage{ - Framework: driver.FrameworkInfo, + Framework: info, Failover: proto.Bool(failover), } } else { log.V(1).Infof("Registering with master: %v", pid) message = &mesos.RegisterFrameworkMessage{ - Framework: driver.FrameworkInfo, + Framework: info, } } if err := driver.send(pid, message); err != nil { @@ -792,19 +944,52 @@ func (driver *MesosSchedulerDriver) registerOnce() bool { //Join blocks until the driver is stopped. //Should follow a call to Start() func (driver *MesosSchedulerDriver) Join() (mesos.Status, error) { - if stat := driver.Status(); stat != mesos.Status_DRIVER_RUNNING { - return stat, fmt.Errorf("Unable to Join, expecting driver status %s, but is %s", mesos.Status_DRIVER_RUNNING, stat) + driver.eventLock.Lock() + defer driver.eventLock.Unlock() + return driver.join() +} + +// join expects to be guarded by eventLock +func (driver *MesosSchedulerDriver) join() (stat mesos.Status, err error) { + if stat = driver.status; stat != mesos.Status_DRIVER_RUNNING { + err = fmt.Errorf("Unable to Join, expecting driver status %s, but is %s", mesos.Status_DRIVER_RUNNING, stat) + return + } + + timeout := 1 * time.Second + t := time.NewTimer(timeout) + defer t.Stop() + + driver.eventLock.Unlock() + defer func() { + driver.eventLock.Lock() + stat = driver.status + }() +waitForDeath: + for { + select { + case <-driver.done: + break waitForDeath + case <-t.C: + } + t.Reset(timeout) } - <-driver.stopCh // wait for stop signal - return driver.Status(), nil + return } //Run starts and joins driver process and waits to be stopped or aborted. func (driver *MesosSchedulerDriver) Run() (mesos.Status, error) { - stat, err := driver.Start() + driver.eventLock.Lock() + defer driver.eventLock.Unlock() + return driver.run() +} + +// run expected to be guarded by eventLock +func (driver *MesosSchedulerDriver) run() (mesos.Status, error) { + stat, err := driver.start() if err != nil { - return driver.Stop(false) + return driver.stop(err, false) } if stat != mesos.Status_DRIVER_RUNNING { @@ -812,13 +997,20 @@ func (driver *MesosSchedulerDriver) Run() (mesos.Status, error) { } log.Infoln("Scheduler driver running. Waiting to be stopped.") - return driver.Join() + return driver.join() } //Stop stops the driver. func (driver *MesosSchedulerDriver) Stop(failover bool) (mesos.Status, error) { + driver.eventLock.Lock() + defer driver.eventLock.Unlock() + return driver.stop(nil, failover) +} + +// stop expects to be guarded by eventLock +func (driver *MesosSchedulerDriver) stop(cause error, failover bool) (mesos.Status, error) { log.Infoln("Stopping the scheduler driver") - if stat := driver.Status(); stat != mesos.Status_DRIVER_RUNNING { + if stat := driver.status; stat != mesos.Status_DRIVER_RUNNING { return stat, fmt.Errorf("Unable to Stop, expected driver status %s, but is %s", mesos.Status_DRIVER_RUNNING, stat) } @@ -826,59 +1018,84 @@ func (driver *MesosSchedulerDriver) Stop(failover bool) (mesos.Status, error) { // unregister the framework log.Infoln("Unregistering the scheduler driver") message := &mesos.UnregisterFrameworkMessage{ - FrameworkId: driver.FrameworkInfo.Id, + FrameworkId: driver.frameworkInfo.Id, } //TODO(jdef) this is actually a little racy: we send an 'unregister' message but then - // immediately afterward the messenger is stopped in driver.stop(). so the unregister message + // immediately afterward the messenger is stopped in driver._stop(). so the unregister message // may not actually end up being sent out. - if err := driver.send(driver.MasterPid, message); err != nil { + if err := driver.send(driver.masterPid, message); err != nil { log.Errorf("Failed to send UnregisterFramework message while stopping driver: %v\n", err) - return driver.stop(mesos.Status_DRIVER_ABORTED) + if cause == nil { + cause = &ErrDriverAborted{} + } + return driver._stop(cause, mesos.Status_DRIVER_ABORTED) } + time.Sleep(2 * time.Second) } // stop messenger - return driver.stop(mesos.Status_DRIVER_STOPPED) + return driver._stop(cause, mesos.Status_DRIVER_STOPPED) } -func (driver *MesosSchedulerDriver) stop(stopStatus mesos.Status) (mesos.Status, error) { +// stop expects to be guarded by eventLock +func (driver *MesosSchedulerDriver) _stop(cause error, stopStatus mesos.Status) (mesos.Status, error) { // stop messenger - err := driver.messenger.Stop() defer func() { select { case <-driver.stopCh: - // already closed + return default: - close(driver.stopCh) + } + close(driver.stopCh) + if cause != nil { + log.V(1).Infof("Sending error via withScheduler: %v", cause) + driver.withScheduler(func(s Scheduler) { s.Error(driver, cause.Error()) }) + } else { + // send a noop func, withScheduler needs to see that stopCh is closed + log.V(1).Infof("Sending kill signal to withScheduler") + driver.withScheduler(func(_ Scheduler) {}) } }() - - driver.setStatus(stopStatus) - driver.setStopped(true) + driver.status = stopStatus driver.connected = false - if err != nil { - return stopStatus, err - } + log.Info("stopping messenger") + err := driver.messenger.Stop() - return stopStatus, nil + log.Infof("Stop() complete with status %v error %v", stopStatus, err) + return stopStatus, err } func (driver *MesosSchedulerDriver) Abort() (stat mesos.Status, err error) { - defer driver.masterDetector.Cancel() - log.Infof("Aborting framework [%+v]", driver.FrameworkInfo.Id) + driver.eventLock.Lock() + defer driver.eventLock.Unlock() + return driver.abort(nil) +} + +// abort expects to be guarded by eventLock +func (driver *MesosSchedulerDriver) abort(cause error) (stat mesos.Status, err error) { + if driver.masterDetector != nil { + defer driver.masterDetector.Cancel() + } + + log.Infof("Aborting framework [%+v]", driver.frameworkInfo.Id) + if driver.connected { - _, err = driver.Stop(true) + _, err = driver.stop(cause, true) } else { driver.messenger.Stop() } + stat = mesos.Status_DRIVER_ABORTED - driver.setStatus(stat) + driver.status = stat return } func (driver *MesosSchedulerDriver) LaunchTasks(offerIds []*mesos.OfferID, tasks []*mesos.TaskInfo, filters *mesos.Filters) (mesos.Status, error) { - if stat := driver.Status(); stat != mesos.Status_DRIVER_RUNNING { + driver.eventLock.Lock() + defer driver.eventLock.Unlock() + + if stat := driver.status; stat != mesos.Status_DRIVER_RUNNING { return stat, fmt.Errorf("Unable to LaunchTasks, expected driver status %s, but got %s", mesos.Status_DRIVER_RUNNING, stat) } @@ -890,7 +1107,7 @@ func (driver *MesosSchedulerDriver) LaunchTasks(offerIds []*mesos.OfferID, tasks for _, task := range tasks { driver.pushLostTask(task, "Master is disconnected") } - return driver.Status(), fmt.Errorf("Not connected to master. Tasks marked as lost.") + return driver.status, fmt.Errorf("Not connected to master. Tasks marked as lost.") } okTasks := make([]*mesos.TaskInfo, 0, len(tasks)) @@ -898,7 +1115,7 @@ func (driver *MesosSchedulerDriver) LaunchTasks(offerIds []*mesos.OfferID, tasks // Set TaskInfo.executor.framework_id, if it's missing. for _, task := range tasks { if task.Executor != nil && task.Executor.FrameworkId == nil { - task.Executor.FrameworkId = driver.FrameworkInfo.Id + task.Executor.FrameworkId = driver.frameworkInfo.Id } okTasks = append(okTasks, task) } @@ -925,37 +1142,40 @@ func (driver *MesosSchedulerDriver) LaunchTasks(offerIds []*mesos.OfferID, tasks // launch tasks message := &mesos.LaunchTasksMessage{ - FrameworkId: driver.FrameworkInfo.Id, + FrameworkId: driver.frameworkInfo.Id, OfferIds: offerIds, Tasks: okTasks, Filters: filters, } - if err := driver.send(driver.MasterPid, message); err != nil { + if err := driver.send(driver.masterPid, message); err != nil { for _, task := range tasks { driver.pushLostTask(task, "Unable to launch tasks: "+err.Error()) } log.Errorf("Failed to send LaunchTask message: %v\n", err) - return driver.Status(), err + return driver.status, err } - return driver.Status(), nil + return driver.status, nil } +// pushLostTask expects to be guarded by eventLock func (driver *MesosSchedulerDriver) pushLostTask(taskInfo *mesos.TaskInfo, why string) { msg := &mesos.StatusUpdateMessage{ Update: &mesos.StatusUpdate{ - FrameworkId: driver.FrameworkInfo.Id, + FrameworkId: driver.frameworkInfo.Id, Status: &mesos.TaskStatus{ TaskId: taskInfo.TaskId, State: mesos.TaskState_TASK_LOST.Enum(), + Source: mesos.TaskStatus_SOURCE_MASTER.Enum(), Message: proto.String(why), + Reason: mesos.TaskStatus_REASON_MASTER_DISCONNECTED.Enum(), }, SlaveId: taskInfo.SlaveId, ExecutorId: taskInfo.Executor.ExecutorId, Timestamp: proto.Float64(float64(time.Now().Unix())), - Uuid: []byte(uuid.NewUUID()), }, + Pid: proto.String(driver.self.String()), } // put it on internal chanel @@ -964,30 +1184,36 @@ func (driver *MesosSchedulerDriver) pushLostTask(taskInfo *mesos.TaskInfo, why s } func (driver *MesosSchedulerDriver) KillTask(taskId *mesos.TaskID) (mesos.Status, error) { - if stat := driver.Status(); stat != mesos.Status_DRIVER_RUNNING { + driver.eventLock.Lock() + defer driver.eventLock.Unlock() + + if stat := driver.status; stat != mesos.Status_DRIVER_RUNNING { return stat, fmt.Errorf("Unable to KillTask, expecting driver status %s, but got %s", mesos.Status_DRIVER_RUNNING, stat) } if !driver.connected { log.Infoln("Ignoring kill task message, disconnected from master.") - return driver.Status(), fmt.Errorf("Not connected to master") + return driver.status, fmt.Errorf("Not connected to master") } message := &mesos.KillTaskMessage{ - FrameworkId: driver.FrameworkInfo.Id, + FrameworkId: driver.frameworkInfo.Id, TaskId: taskId, } - if err := driver.send(driver.MasterPid, message); err != nil { + if err := driver.send(driver.masterPid, message); err != nil { log.Errorf("Failed to send KillTask message: %v\n", err) - return driver.Status(), err + return driver.status, err } - return driver.Status(), nil + return driver.status, nil } func (driver *MesosSchedulerDriver) RequestResources(requests []*mesos.Request) (mesos.Status, error) { - if stat := driver.Status(); stat != mesos.Status_DRIVER_RUNNING { + driver.eventLock.Lock() + defer driver.eventLock.Unlock() + + if stat := driver.status; stat != mesos.Status_DRIVER_RUNNING { return stat, fmt.Errorf("Unable to RequestResources, expecting driver status %s, but got %s", mesos.Status_DRIVER_RUNNING, stat) } @@ -997,11 +1223,11 @@ func (driver *MesosSchedulerDriver) RequestResources(requests []*mesos.Request) } message := &mesos.ResourceRequestMessage{ - FrameworkId: driver.FrameworkInfo.Id, + FrameworkId: driver.frameworkInfo.Id, Requests: requests, } - if err := driver.send(driver.MasterPid, message); err != nil { + if err := driver.send(driver.masterPid, message); err != nil { log.Errorf("Failed to send ResourceRequest message: %v\n", err) return driver.status, err } @@ -1010,42 +1236,49 @@ func (driver *MesosSchedulerDriver) RequestResources(requests []*mesos.Request) } func (driver *MesosSchedulerDriver) DeclineOffer(offerId *mesos.OfferID, filters *mesos.Filters) (mesos.Status, error) { + // NOTE: don't lock eventLock here because we're delegating to LaunchTasks() and that does it for us // launching an empty task list will decline the offer return driver.LaunchTasks([]*mesos.OfferID{offerId}, []*mesos.TaskInfo{}, filters) } func (driver *MesosSchedulerDriver) ReviveOffers() (mesos.Status, error) { - if stat := driver.Status(); stat != mesos.Status_DRIVER_RUNNING { + driver.eventLock.Lock() + defer driver.eventLock.Unlock() + + if stat := driver.status; stat != mesos.Status_DRIVER_RUNNING { return stat, fmt.Errorf("Unable to ReviveOffers, expecting driver status %s, but got %s", mesos.Status_DRIVER_RUNNING, stat) } if !driver.connected { log.Infoln("Ignoring revive offers message, disconnected from master.") - return driver.Status(), fmt.Errorf("Not connected to master.") + return driver.status, fmt.Errorf("Not connected to master.") } message := &mesos.ReviveOffersMessage{ - FrameworkId: driver.FrameworkInfo.Id, + FrameworkId: driver.frameworkInfo.Id, } - if err := driver.send(driver.MasterPid, message); err != nil { + if err := driver.send(driver.masterPid, message); err != nil { log.Errorf("Failed to send ReviveOffers message: %v\n", err) - return driver.Status(), err + return driver.status, err } - return driver.Status(), nil + return driver.status, nil } func (driver *MesosSchedulerDriver) SendFrameworkMessage(executorId *mesos.ExecutorID, slaveId *mesos.SlaveID, data string) (mesos.Status, error) { - if stat := driver.Status(); stat != mesos.Status_DRIVER_RUNNING { + driver.eventLock.Lock() + defer driver.eventLock.Unlock() + + if stat := driver.status; stat != mesos.Status_DRIVER_RUNNING { return stat, fmt.Errorf("Unable to SendFrameworkMessage, expecting driver status %s, but got %s", mesos.Status_DRIVER_RUNNING, stat) } if !driver.connected { log.Infoln("Ignoring send framework message, disconnected from master.") - return driver.Status(), fmt.Errorf("Not connected to master") + return driver.status, fmt.Errorf("Not connected to master") } message := &mesos.FrameworkToExecutorMessage{ SlaveId: slaveId, - FrameworkId: driver.FrameworkInfo.Id, + FrameworkId: driver.frameworkInfo.Id, ExecutorId: executorId, Data: []byte(data), } @@ -1054,56 +1287,52 @@ func (driver *MesosSchedulerDriver) SendFrameworkMessage(executorId *mesos.Execu if driver.cache.containsSlavePid(slaveId) { slavePid := driver.cache.getSlavePid(slaveId) if slavePid.Equal(driver.self) { - return driver.Status(), nil + return driver.status, nil } if err := driver.send(slavePid, message); err != nil { log.Errorf("Failed to send framework to executor message: %v\n", err) - return driver.Status(), err + return driver.status, err } } else { // slavePid not cached, send to master. - if err := driver.send(driver.MasterPid, message); err != nil { + if err := driver.send(driver.masterPid, message); err != nil { log.Errorf("Failed to send framework to executor message: %v\n", err) - return driver.Status(), err + return driver.status, err } } - return driver.Status(), nil + return driver.status, nil } func (driver *MesosSchedulerDriver) ReconcileTasks(statuses []*mesos.TaskStatus) (mesos.Status, error) { - if stat := driver.Status(); stat != mesos.Status_DRIVER_RUNNING { + driver.eventLock.Lock() + defer driver.eventLock.Unlock() + + if stat := driver.status; stat != mesos.Status_DRIVER_RUNNING { return stat, fmt.Errorf("Unable to ReconcileTasks, expecting driver status %s, but got %s", mesos.Status_DRIVER_RUNNING, stat) } if !driver.connected { log.Infoln("Ignoring send Reconcile Tasks message, disconnected from master.") - return driver.Status(), fmt.Errorf("Not connected to master.") + return driver.status, fmt.Errorf("Not connected to master.") } message := &mesos.ReconcileTasksMessage{ - FrameworkId: driver.FrameworkInfo.Id, + FrameworkId: driver.frameworkInfo.Id, Statuses: statuses, } - if err := driver.send(driver.MasterPid, message); err != nil { + if err := driver.send(driver.masterPid, message); err != nil { log.Errorf("Failed to send reconcile tasks message: %v\n", err) - return driver.Status(), err + return driver.status, err } - return driver.Status(), nil + return driver.status, nil } -func (driver *MesosSchedulerDriver) error(err string, abortDriver bool) { - if abortDriver { - if driver.Status() == mesos.Status_DRIVER_ABORTED { - log.V(3).Infoln("Ignoring error message, the driver is aborted!") - return - } - - log.Infoln("Aborting driver, got error '", err, "'") - - driver.Abort() +// error expects to be guarded by eventLock +func (driver *MesosSchedulerDriver) error(err string) { + if driver.status == mesos.Status_DRIVER_ABORTED { + log.V(3).Infoln("Ignoring error message, the driver is aborted!") + return } - - log.V(3).Infof("Sending error '%v'", err) - driver.Scheduler.Error(driver, err) + driver.abort(&ErrDriverAborted{Reason: err}) } diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/scheduler/scheduler_intgr_test.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/scheduler/scheduler_intgr_test.go index fc4137c2b9e89..7fbae11df1747 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/scheduler/scheduler_intgr_test.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/scheduler/scheduler_intgr_test.go @@ -37,9 +37,10 @@ import ( // testScuduler is used for testing Schduler callbacks. type testScheduler struct { - ch chan bool - wg *sync.WaitGroup - s *SchedulerIntegrationTestSuite + ch chan bool + wg *sync.WaitGroup + s *SchedulerIntegrationTestSuite + errors chan string // yields errors received by Scheduler.Error } // convenience @@ -83,7 +84,7 @@ func (sched *testScheduler) StatusUpdate(dr SchedulerDriver, stat *mesos.TaskSta sched.s.NotNil(stat) sched.s.Equal("test-task-001", stat.GetTaskId().GetValue()) sched.wg.Done() - log.Infof("Status update done with waitGroup %v \n", sched.wg) + log.Infof("Status update done with waitGroup") } func (sched *testScheduler) SlaveLost(dr SchedulerDriver, slaveId *mesos.SlaveID) { @@ -109,7 +110,7 @@ func (sched *testScheduler) ExecutorLost(SchedulerDriver, *mesos.ExecutorID, *me func (sched *testScheduler) Error(dr SchedulerDriver, err string) { log.Infoln("Sched.Error() called.") - sched.s.Equal("test-error-999", err) + sched.errors <- err sched.ch <- true } @@ -128,7 +129,7 @@ func (sched *testScheduler) waitForCallback(timeout time.Duration) bool { } func newTestScheduler(s *SchedulerIntegrationTestSuite) *testScheduler { - return &testScheduler{ch: make(chan bool), s: s} + return &testScheduler{ch: make(chan bool), s: s, errors: make(chan string, 2)} } type mockServerConfigurator func(frameworkId *mesos.FrameworkID, suite *SchedulerIntegrationTestSuite) @@ -168,8 +169,12 @@ func (suite *SchedulerIntegrationTestSuite) configure(frameworkId *mesos.Framewo suite.sched = newTestScheduler(suite) suite.sched.ch = make(chan bool, 10) // big enough that it doesn't block callback processing - suite.driver = newTestSchedulerDriver(suite.T(), suite.sched, suite.framework, suite.server.Addr, nil) - + cfg := DriverConfig{ + Scheduler: suite.sched, + Framework: suite.framework, + Master: suite.server.Addr, + } + suite.driver = newTestSchedulerDriver(suite.T(), cfg).MesosSchedulerDriver suite.config(frameworkId, suite) stat, err := suite.driver.Start() @@ -205,7 +210,9 @@ var defaultMockServerConfigurator = mockServerConfigurator(func(frameworkId *mes rsp.WriteHeader(http.StatusAccepted) } // this is what the mocked scheduler is expecting to receive - suite.driver.frameworkRegistered(suite.driver.MasterPid, &mesos.FrameworkRegisteredMessage{ + suite.driver.eventLock.Lock() + defer suite.driver.eventLock.Unlock() + suite.driver.frameworkRegistered(suite.driver.masterPid, &mesos.FrameworkRegisteredMessage{ FrameworkId: frameworkId, MasterInfo: masterInfo, }) @@ -219,7 +226,9 @@ var defaultMockServerConfigurator = mockServerConfigurator(func(frameworkId *mes rsp.WriteHeader(http.StatusAccepted) } // this is what the mocked scheduler is expecting to receive - suite.driver.frameworkReregistered(suite.driver.MasterPid, &mesos.FrameworkReregisteredMessage{ + suite.driver.eventLock.Lock() + defer suite.driver.eventLock.Unlock() + suite.driver.frameworkReregistered(suite.driver.masterPid, &mesos.FrameworkReregisteredMessage{ FrameworkId: frameworkId, MasterInfo: masterInfo, }) @@ -239,8 +248,12 @@ func (s *SchedulerIntegrationTestSuite) TearDownTest() { if s.server != nil { s.server.Close() } - if s.driver != nil && s.driver.Status() == mesos.Status_DRIVER_RUNNING { + if s.driver != nil { s.driver.Abort() + + // wait for all events to finish processing, otherwise we can get into a data + // race when the suite object is reused for the next test. + <-s.driver.done } } @@ -353,7 +366,7 @@ func (suite *SchedulerIntegrationTestSuite) TestSchedulerDriverStatusUpdatedEven defer req.Body.Close() assert.NotNil(t, data) wg.Done() - log.Infof("MockMaster - Done with wait group %v \n", wg) + log.Infof("MockMaster - Done with wait group") }) suite.sched.wg = &wg }) @@ -369,7 +382,8 @@ func (suite *SchedulerIntegrationTestSuite) TestSchedulerDriverStatusUpdatedEven float64(time.Now().Unix()), []byte("test-abcd-ef-3455-454-001"), ), - Pid: proto.String(suite.driver.self.String()), + // note: cannot use driver's pid here if we want an ACK + Pid: proto.String("test-slave-001(1)@foo.bar:1234"), } pbMsg.Update.SlaveId = &mesos.SlaveID{Value: proto.String("test-slave-001")} @@ -437,6 +451,8 @@ func (suite *SchedulerIntegrationTestSuite) TestSchedulerDriverFrameworkErrorEve c := suite.newMockClient() c.SendMessage(suite.driver.self, pbMsg) - suite.sched.waitForCallback(0) + message := <-suite.sched.errors + suite.Equal("test-error-999", message) + suite.sched.waitForCallback(10 * time.Second) suite.Equal(mesos.Status_DRIVER_ABORTED, suite.driver.Status()) } diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/scheduler/scheduler_unit_test.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/scheduler/scheduler_unit_test.go index add643262fa88..9f2c02faef7d4 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/scheduler/scheduler_unit_test.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/scheduler/scheduler_unit_test.go @@ -21,61 +21,22 @@ package scheduler import ( "fmt" "os/user" - "sync" "testing" "time" "github.com/gogo/protobuf/proto" log "github.com/golang/glog" "github.com/mesos/mesos-go/detector" - "github.com/mesos/mesos-go/detector/zoo" + _ "github.com/mesos/mesos-go/detector/zoo" mesos "github.com/mesos/mesos-go/mesosproto" util "github.com/mesos/mesos-go/mesosutil" "github.com/mesos/mesos-go/messenger" "github.com/mesos/mesos-go/upid" - "github.com/samuel/go-zookeeper/zk" "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" "golang.org/x/net/context" ) -var ( - registerMockDetectorOnce sync.Once -) - -func ensureMockDetectorRegistered() { - registerMockDetectorOnce.Do(func() { - var s *SchedulerTestSuite - err := s.registerMockDetector("testing://") - if err != nil { - log.Error(err) - } - }) -} - -type MockDetector struct { - mock.Mock - address string -} - -func (m *MockDetector) Detect(listener detector.MasterChanged) error { - if listener != nil { - if pid, err := upid.Parse("master(2)@" + m.address); err != nil { - return err - } else { - go listener.OnMasterChanged(detector.CreateMasterInfo(pid)) - } - } - return nil -} - -func (m *MockDetector) Done() <-chan struct{} { - return nil -} - -func (m *MockDetector) Cancel() {} - type SchedulerTestSuiteCore struct { master string masterUpid string @@ -89,18 +50,6 @@ type SchedulerTestSuite struct { SchedulerTestSuiteCore } -func (s *SchedulerTestSuite) registerMockDetector(prefix string) error { - address := "" - if s != nil { - address = s.master - } else { - address = "127.0.0.1:8080" - } - return detector.Register(prefix, detector.PluginFactory(func(spec string) (detector.Master, error) { - return &MockDetector{address: address}, nil - })) -} - func (s *SchedulerTestSuiteCore) SetupTest() { s.master = "127.0.0.1:8080" s.masterUpid = "master(2)@" + s.master @@ -118,93 +67,89 @@ func TestSchedulerSuite(t *testing.T) { suite.Run(t, new(SchedulerTestSuite)) } -func newTestSchedulerDriver(t *testing.T, sched Scheduler, framework *mesos.FrameworkInfo, master string, cred *mesos.Credential) *MesosSchedulerDriver { - dconfig := DriverConfig{ - Scheduler: sched, - Framework: framework, - Master: master, - Credential: cred, +func driverConfig(sched Scheduler, framework *mesos.FrameworkInfo, master string, cred *mesos.Credential) DriverConfig { + return driverConfigMessenger(sched, framework, master, cred, nil) +} + +func driverConfigMessenger(sched Scheduler, framework *mesos.FrameworkInfo, master string, cred *mesos.Credential, m messenger.Messenger) DriverConfig { + d := DriverConfig{ + Scheduler: sched, + Framework: framework, + Master: master, + Credential: cred, + NewDetector: func() (detector.Master, error) { return nil, nil }, // master detection not needed } - driver, err := NewMesosSchedulerDriver(dconfig) + if m != nil { + d.NewMessenger = func() (messenger.Messenger, error) { return m, nil } + } + return d +} + +func mockedMessenger() *messenger.MockedMessenger { + m := messenger.NewMockedMessenger() + m.On("Start").Return(nil) + m.On("UPID").Return(upid.UPID{}) + m.On("Send").Return(nil) + m.On("Stop").Return(nil) + m.On("Route").Return(nil) + m.On("Install").Return(nil) + return m +} + +type testSchedulerDriver struct { + *MesosSchedulerDriver +} + +func (t *testSchedulerDriver) setConnected(b bool) { + t.eventLock.Lock() + defer t.eventLock.Unlock() + t.connected = b +} + +func newTestSchedulerDriver(t *testing.T, cfg DriverConfig) *testSchedulerDriver { + driver, err := NewMesosSchedulerDriver(cfg) if err != nil { t.Fatal(err) } - return driver + return &testSchedulerDriver{driver} } func TestSchedulerDriverNew(t *testing.T) { masterAddr := "localhost:5050" - driver := newTestSchedulerDriver(t, NewMockScheduler(), &mesos.FrameworkInfo{}, masterAddr, nil) + driver := newTestSchedulerDriver(t, driverConfig(NewMockScheduler(), &mesos.FrameworkInfo{}, masterAddr, nil)) user, _ := user.Current() - assert.Equal(t, user.Username, driver.FrameworkInfo.GetUser()) + assert.Equal(t, user.Username, driver.frameworkInfo.GetUser()) host := util.GetHostname("") - assert.Equal(t, host, driver.FrameworkInfo.GetHostname()) + assert.Equal(t, host, driver.frameworkInfo.GetHostname()) } func TestSchedulerDriverNew_WithPid(t *testing.T) { masterAddr := "master@127.0.0.1:5050" mUpid, err := upid.Parse(masterAddr) assert.NoError(t, err) - driver := newTestSchedulerDriver(t, NewMockScheduler(), &mesos.FrameworkInfo{}, masterAddr, nil) + driver := newTestSchedulerDriver(t, driverConfig(NewMockScheduler(), &mesos.FrameworkInfo{}, masterAddr, nil)) driver.handleMasterChanged(driver.self, &mesos.InternalMasterChangeDetected{Master: &mesos.MasterInfo{Pid: proto.String(mUpid.String())}}) - assert.True(t, driver.MasterPid.Equal(mUpid), fmt.Sprintf("expected upid %+v instead of %+v", mUpid, driver.MasterPid)) + assert.True(t, driver.masterPid.Equal(mUpid), fmt.Sprintf("expected upid %+v instead of %+v", mUpid, driver.masterPid)) assert.NoError(t, err) } -func (suite *SchedulerTestSuite) TestSchedulerDriverNew_WithZkUrl() { - masterAddr := "zk://127.0.0.1:5050/mesos" - driver := newTestSchedulerDriver(suite.T(), NewMockScheduler(), suite.framework, masterAddr, nil) - md, err := zoo.NewMockMasterDetector(masterAddr) - suite.NoError(err) - suite.NotNil(md) - driver.masterDetector = md // override internal master detector - - md.ScheduleConnEvent(zk.StateConnected) - - done := make(chan struct{}) - driver.masterDetector.Detect(detector.OnMasterChanged(func(m *mesos.MasterInfo) { - suite.NotNil(m) - suite.NotEqual(m.GetPid, suite.masterUpid) - close(done) - })) - - //TODO(vlad) revisit, detector not responding. - - //NOTE(jdef) this works for me, I wonder if the timeouts are too short, or if - //GOMAXPROCS settings are affecting the result? - - // md.ScheduleSessEvent(zk.EventNodeChildrenChanged) - // select { - // case <-done: - // case <-time.After(time.Millisecond * 1000): - // suite.T().Errorf("Timed out waiting for children event.") - // } -} - func (suite *SchedulerTestSuite) TestSchedulerDriverNew_WithFrameworkInfo_Override() { suite.framework.Hostname = proto.String("local-host") - driver := newTestSchedulerDriver(suite.T(), NewMockScheduler(), suite.framework, "127.0.0.1:5050", nil) - suite.Equal(driver.FrameworkInfo.GetUser(), "test-user") - suite.Equal("local-host", driver.FrameworkInfo.GetHostname()) + driver := newTestSchedulerDriver(suite.T(), driverConfig(NewMockScheduler(), suite.framework, "127.0.0.1:5050", nil)) + suite.Equal(driver.frameworkInfo.GetUser(), "test-user") + suite.Equal("local-host", driver.frameworkInfo.GetHostname()) } func (suite *SchedulerTestSuite) TestSchedulerDriverStartOK() { sched := NewMockScheduler() - - messenger := messenger.NewMockedMessenger() - messenger.On("Start").Return(nil) - messenger.On("UPID").Return(&upid.UPID{}) - messenger.On("Send").Return(nil) - messenger.On("Stop").Return(nil) - - driver := newTestSchedulerDriver(suite.T(), sched, suite.framework, suite.master, nil) - driver.messenger = messenger - suite.True(driver.Stopped()) + driver := newTestSchedulerDriver(suite.T(), driverConfigMessenger(sched, suite.framework, suite.master, nil, mockedMessenger())) + suite.False(driver.Running()) stat, err := driver.Start() suite.NoError(err) suite.Equal(mesos.Status_DRIVER_RUNNING, stat) - suite.False(driver.Stopped()) + suite.True(driver.Running()) + driver.Stop(true) } func (suite *SchedulerTestSuite) TestSchedulerDriverStartWithMessengerFailure() { @@ -213,19 +158,18 @@ func (suite *SchedulerTestSuite) TestSchedulerDriverStartWithMessengerFailure() messenger := messenger.NewMockedMessenger() messenger.On("Start").Return(fmt.Errorf("Failed to start messenger")) - messenger.On("Stop").Return() + messenger.On("Stop").Return(nil) + messenger.On("Install").Return(nil) - driver := newTestSchedulerDriver(suite.T(), sched, suite.framework, suite.master, nil) - driver.messenger = messenger - suite.True(driver.Stopped()) + driver := newTestSchedulerDriver(suite.T(), driverConfigMessenger(sched, suite.framework, suite.master, nil, messenger)) + suite.False(driver.Running()) stat, err := driver.Start() suite.Error(err) - suite.True(driver.Stopped()) - suite.True(!driver.Connected()) + suite.False(driver.Running()) + suite.False(driver.Connected()) suite.Equal(mesos.Status_DRIVER_NOT_STARTED, driver.Status()) suite.Equal(mesos.Status_DRIVER_NOT_STARTED, stat) - } func (suite *SchedulerTestSuite) TestSchedulerDriverStartWithRegistrationFailure() { @@ -235,13 +179,11 @@ func (suite *SchedulerTestSuite) TestSchedulerDriverStartWithRegistrationFailure // Set expections and return values. messenger := messenger.NewMockedMessenger() messenger.On("Start").Return(nil) - messenger.On("UPID").Return(&upid.UPID{}) + messenger.On("UPID").Return(upid.UPID{}) messenger.On("Stop").Return(nil) + messenger.On("Install").Return(nil) - driver := newTestSchedulerDriver(suite.T(), sched, suite.framework, suite.master, nil) - - driver.messenger = messenger - suite.True(driver.Stopped()) + driver := newTestSchedulerDriver(suite.T(), driverConfigMessenger(sched, suite.framework, suite.master, nil, messenger)) // reliable registration loops until the driver is stopped, connected, etc.. stat, err := driver.Start() @@ -250,42 +192,36 @@ func (suite *SchedulerTestSuite) TestSchedulerDriverStartWithRegistrationFailure time.Sleep(5 * time.Second) // wait a bit, registration should be looping... - suite.False(driver.Stopped()) + suite.True(driver.Running()) suite.Equal(mesos.Status_DRIVER_RUNNING, driver.Status()) // stop the driver, should not panic! - driver.Stop(false) // not failing over - suite.True(driver.Stopped()) + driver.Stop(false) // intentionally not failing over + suite.False(driver.Running()) suite.Equal(mesos.Status_DRIVER_STOPPED, driver.Status()) messenger.AssertExpectations(suite.T()) } func (suite *SchedulerTestSuite) TestSchedulerDriverJoinUnstarted() { - driver := newTestSchedulerDriver(suite.T(), NewMockScheduler(), suite.framework, suite.master, nil) - suite.True(driver.Stopped()) + driver := newTestSchedulerDriver(suite.T(), driverConfig(NewMockScheduler(), suite.framework, suite.master, nil)) + suite.False(driver.Running()) stat, err := driver.Join() suite.Error(err) suite.Equal(mesos.Status_DRIVER_NOT_STARTED, stat) + suite.False(driver.Running()) } func (suite *SchedulerTestSuite) TestSchedulerDriverJoinOK() { // Set expections and return values. - messenger := messenger.NewMockedMessenger() - messenger.On("Start").Return(nil) - messenger.On("UPID").Return(&upid.UPID{}) - messenger.On("Send").Return(nil) - messenger.On("Stop").Return(nil) - - driver := newTestSchedulerDriver(suite.T(), NewMockScheduler(), suite.framework, suite.master, nil) - driver.messenger = messenger - suite.True(driver.Stopped()) + driver := newTestSchedulerDriver(suite.T(), driverConfigMessenger(NewMockScheduler(), suite.framework, suite.master, nil, mockedMessenger())) + suite.False(driver.Running()) stat, err := driver.Start() suite.NoError(err) suite.Equal(mesos.Status_DRIVER_RUNNING, stat) - suite.False(driver.Stopped()) + suite.True(driver.Running()) testCh := make(chan mesos.Status) go func() { @@ -293,45 +229,37 @@ func (suite *SchedulerTestSuite) TestSchedulerDriverJoinOK() { testCh <- stat }() - close(driver.stopCh) // manually stopping - stat = <-testCh // when Stop() is called, stat will be DRIVER_STOPPED. + driver.Stop(true) } func (suite *SchedulerTestSuite) TestSchedulerDriverRun() { // Set expections and return values. - messenger := messenger.NewMockedMessenger() - messenger.On("Start").Return(nil) - messenger.On("UPID").Return(&upid.UPID{}) - messenger.On("Send").Return(nil) - messenger.On("Stop").Return(nil) - - driver := newTestSchedulerDriver(suite.T(), NewMockScheduler(), suite.framework, suite.master, nil) - driver.messenger = messenger - suite.True(driver.Stopped()) + driver := newTestSchedulerDriver(suite.T(), driverConfigMessenger(NewMockScheduler(), suite.framework, suite.master, nil, mockedMessenger())) + suite.False(driver.Running()) + ch := make(chan struct{}) go func() { + defer close(ch) stat, err := driver.Run() suite.NoError(err) suite.Equal(mesos.Status_DRIVER_STOPPED, stat) }() - time.Sleep(time.Millisecond * 1) - - suite.False(driver.Stopped()) + <-driver.started + suite.True(driver.Running()) suite.Equal(mesos.Status_DRIVER_RUNNING, driver.Status()) // close it all. - driver.setStatus(mesos.Status_DRIVER_STOPPED) - close(driver.stopCh) - time.Sleep(time.Millisecond * 1) + driver.Stop(true) + <-ch } func (suite *SchedulerTestSuite) TestSchedulerDriverStopUnstarted() { - driver := newTestSchedulerDriver(suite.T(), NewMockScheduler(), suite.framework, suite.master, nil) - suite.True(driver.Stopped()) + driver := newTestSchedulerDriver(suite.T(), driverConfig(NewMockScheduler(), suite.framework, suite.master, nil)) + suite.False(driver.Running()) stat, err := driver.Stop(true) suite.NotNil(err) - suite.True(driver.Stopped()) + suite.False(driver.Running()) suite.Equal(mesos.Status_DRIVER_NOT_STARTED, stat) } @@ -347,25 +275,19 @@ func (m *msgTracker) Send(ctx context.Context, upid *upid.UPID, msg proto.Messag func (suite *SchedulerTestSuite) TestSchdulerDriverStop_WithoutFailover() { // Set expections and return values. - messenger := &msgTracker{MockedMessenger: messenger.NewMockedMessenger()} - messenger.On("Start").Return(nil) - messenger.On("UPID").Return(&upid.UPID{}) - messenger.On("Send").Return(nil) - messenger.On("Stop").Return(nil) - messenger.On("Route").Return(nil) - - driver := newTestSchedulerDriver(suite.T(), NewMockScheduler(), suite.framework, suite.master, nil) - driver.messenger = messenger - suite.True(driver.Stopped()) + messenger := &msgTracker{MockedMessenger: mockedMessenger()} + driver := newTestSchedulerDriver(suite.T(), driverConfigMessenger(NewMockScheduler(), suite.framework, suite.master, nil, messenger)) + suite.False(driver.Running()) + ch := make(chan struct{}) go func() { + defer close(ch) stat, err := driver.Run() suite.NoError(err) suite.Equal(mesos.Status_DRIVER_STOPPED, stat) }() - time.Sleep(time.Millisecond * 1) - - suite.False(driver.Stopped()) + <-driver.started + suite.True(driver.Running()) suite.Equal(mesos.Status_DRIVER_RUNNING, driver.Status()) driver.connected = true // pretend that we're already registered @@ -376,80 +298,73 @@ func (suite *SchedulerTestSuite) TestSchdulerDriverStop_WithoutFailover() { _, isUnregMsg := msg.(proto.Message) suite.True(isUnregMsg, "expected UnregisterFrameworkMessage instead of %+v", msg) - suite.True(driver.Stopped()) + suite.False(driver.Running()) suite.Equal(mesos.Status_DRIVER_STOPPED, driver.Status()) + <-ch } func (suite *SchedulerTestSuite) TestSchdulerDriverStop_WithFailover() { // Set expections and return values. - messenger := &msgTracker{MockedMessenger: messenger.NewMockedMessenger()} - messenger.On("Start").Return(nil) - messenger.On("UPID").Return(&upid.UPID{}) - messenger.On("Send").Return(nil) - messenger.On("Stop").Return(nil) - messenger.On("Route").Return(nil) - - driver := newTestSchedulerDriver(suite.T(), NewMockScheduler(), suite.framework, suite.master, nil) - driver.messenger = messenger - suite.True(driver.Stopped()) - - stat, err := driver.Start() - suite.NoError(err) - suite.Equal(mesos.Status_DRIVER_RUNNING, stat) - suite.False(driver.Stopped()) - driver.connected = true // pretend that we're already registered + mess := &msgTracker{MockedMessenger: mockedMessenger()} + d := DriverConfig{ + Scheduler: NewMockScheduler(), + Framework: suite.framework, + Master: suite.master, + NewMessenger: func() (messenger.Messenger, error) { return mess, nil }, + NewDetector: func() (detector.Master, error) { return nil, nil }, + } + driver := newTestSchedulerDriver(suite.T(), d) + suite.False(driver.Running()) + ch := make(chan struct{}) go func() { - // Run() blocks until the driver is stopped or aborted - stat, err := driver.Join() + defer close(ch) + stat, err := driver.Run() suite.NoError(err) suite.Equal(mesos.Status_DRIVER_STOPPED, stat) }() + <-driver.started + driver.setConnected(true) // simulated - // wait for Join() to begin blocking (so that it has already validated the driver state) - time.Sleep(200 * time.Millisecond) - + suite.True(driver.Running()) driver.Stop(true) // true = scheduler failover - msg := messenger.lastMessage + msg := mess.lastMessage // we're expecting that lastMessage is nil because when failing over there's no // 'unregister' message sent by the scheduler. suite.Nil(msg) - suite.True(driver.Stopped()) + suite.False(driver.Running()) suite.Equal(mesos.Status_DRIVER_STOPPED, driver.Status()) + <-ch } -func (suite *SchedulerTestSuite) TestSchdulerDriverAbort() { - // Set expections and return values. - messenger := messenger.NewMockedMessenger() - messenger.On("Start").Return(nil) - messenger.On("UPID").Return(&upid.UPID{}) - messenger.On("Send").Return(nil) - messenger.On("Stop").Return(nil) - messenger.On("Route").Return(nil) - - driver := newTestSchedulerDriver(suite.T(), NewMockScheduler(), suite.framework, suite.master, nil) - driver.messenger = messenger - suite.True(driver.Stopped()) +func (suite *SchedulerTestSuite) TestSchedulerDriverAbort() { + driver := newTestSchedulerDriver(suite.T(), driverConfigMessenger(NewMockScheduler(), suite.framework, suite.master, nil, mockedMessenger())) + suite.False(driver.Running()) + ch := make(chan struct{}) go func() { + defer close(ch) stat, err := driver.Run() suite.NoError(err) suite.Equal(mesos.Status_DRIVER_ABORTED, stat) }() - time.Sleep(time.Millisecond * 1) + <-driver.started driver.setConnected(true) // simulated - suite.False(driver.Stopped()) + suite.True(driver.Running()) suite.Equal(mesos.Status_DRIVER_RUNNING, driver.Status()) stat, err := driver.Abort() - time.Sleep(time.Millisecond * 1) suite.NoError(err) - suite.True(driver.Stopped()) + + <-driver.stopCh + suite.False(driver.Running()) suite.Equal(mesos.Status_DRIVER_ABORTED, stat) suite.Equal(mesos.Status_DRIVER_ABORTED, driver.Status()) + log.Info("waiting for driver to stop") + <-ch } func (suite *SchedulerTestSuite) TestSchdulerDriverLunchTasksUnstarted() { @@ -459,10 +374,9 @@ func (suite *SchedulerTestSuite) TestSchdulerDriverLunchTasksUnstarted() { // Set expections and return values. messenger := messenger.NewMockedMessenger() messenger.On("Route").Return(nil) + messenger.On("Install").Return(nil) - driver := newTestSchedulerDriver(suite.T(), sched, suite.framework, suite.master, nil) - driver.messenger = messenger - suite.True(driver.Stopped()) + driver := newTestSchedulerDriver(suite.T(), driverConfigMessenger(sched, suite.framework, suite.master, nil, messenger)) stat, err := driver.LaunchTasks( []*mesos.OfferID{{}}, @@ -478,33 +392,18 @@ func (suite *SchedulerTestSuite) TestSchdulerDriverLaunchTasksWithError() { sched.On("StatusUpdate").Return(nil) sched.On("Error").Return() - msgr := messenger.NewMockedMessenger() - msgr.On("Start").Return(nil) - msgr.On("Send").Return(nil) - msgr.On("UPID").Return(&upid.UPID{}) - msgr.On("Stop").Return(nil) - msgr.On("Route").Return(nil) - - driver := newTestSchedulerDriver(suite.T(), sched, suite.framework, suite.master, nil) - driver.messenger = msgr - suite.True(driver.Stopped()) + msgr := mockedMessenger() + driver := newTestSchedulerDriver(suite.T(), driverConfigMessenger(sched, suite.framework, suite.master, nil, msgr)) + driver.dispatch = func(_ context.Context, _ *upid.UPID, _ proto.Message) error { + return fmt.Errorf("Unable to send message") + } go func() { driver.Run() }() - time.Sleep(time.Millisecond * 1) + <-driver.started driver.setConnected(true) // simulated - suite.False(driver.Stopped()) - suite.Equal(mesos.Status_DRIVER_RUNNING, driver.Status()) - - // to trigger error - msgr2 := messenger.NewMockedMessenger() - msgr2.On("Start").Return(nil) - msgr2.On("UPID").Return(&upid.UPID{}) - msgr2.On("Send").Return(fmt.Errorf("Unable to send message")) - msgr2.On("Stop").Return(nil) - msgr.On("Route").Return(nil) - driver.messenger = msgr2 + suite.True(driver.Running()) // setup an offer offer := util.NewOffer( @@ -534,30 +433,19 @@ func (suite *SchedulerTestSuite) TestSchdulerDriverLaunchTasksWithError() { tasks, &mesos.Filters{}, ) - suite.Error(err) suite.Equal(mesos.Status_DRIVER_RUNNING, stat) - + suite.Error(err) } func (suite *SchedulerTestSuite) TestSchdulerDriverLaunchTasks() { - messenger := messenger.NewMockedMessenger() - messenger.On("Start").Return(nil) - messenger.On("UPID").Return(&upid.UPID{}) - messenger.On("Send").Return(nil) - messenger.On("Stop").Return(nil) - messenger.On("Route").Return(nil) - - driver := newTestSchedulerDriver(suite.T(), NewMockScheduler(), suite.framework, suite.master, nil) - driver.messenger = messenger - suite.True(driver.Stopped()) + driver := newTestSchedulerDriver(suite.T(), driverConfigMessenger(NewMockScheduler(), suite.framework, suite.master, nil, mockedMessenger())) go func() { driver.Run() }() - time.Sleep(time.Millisecond * 1) + <-driver.started driver.setConnected(true) // simulated - suite.False(driver.Stopped()) - suite.Equal(mesos.Status_DRIVER_RUNNING, driver.Status()) + suite.True(driver.Running()) task := util.NewTaskInfo( "simple-task", @@ -578,24 +466,14 @@ func (suite *SchedulerTestSuite) TestSchdulerDriverLaunchTasks() { } func (suite *SchedulerTestSuite) TestSchdulerDriverKillTask() { - messenger := messenger.NewMockedMessenger() - messenger.On("Start").Return(nil) - messenger.On("UPID").Return(&upid.UPID{}) - messenger.On("Send").Return(nil) - messenger.On("Stop").Return(nil) - messenger.On("Route").Return(nil) - - driver := newTestSchedulerDriver(suite.T(), NewMockScheduler(), suite.framework, suite.master, nil) - driver.messenger = messenger - suite.True(driver.Stopped()) + driver := newTestSchedulerDriver(suite.T(), driverConfigMessenger(NewMockScheduler(), suite.framework, suite.master, nil, mockedMessenger())) go func() { driver.Run() }() - time.Sleep(time.Millisecond * 1) + <-driver.started driver.setConnected(true) // simulated - suite.False(driver.Stopped()) - suite.Equal(mesos.Status_DRIVER_RUNNING, driver.Status()) + suite.True(driver.Running()) stat, err := driver.KillTask(util.NewTaskID("test-task-1")) suite.NoError(err) @@ -603,16 +481,7 @@ func (suite *SchedulerTestSuite) TestSchdulerDriverKillTask() { } func (suite *SchedulerTestSuite) TestSchdulerDriverRequestResources() { - messenger := messenger.NewMockedMessenger() - messenger.On("Start").Return(nil) - messenger.On("UPID").Return(&upid.UPID{}) - messenger.On("Send").Return(nil) - messenger.On("Stop").Return(nil) - messenger.On("Route").Return(nil) - - driver := newTestSchedulerDriver(suite.T(), NewMockScheduler(), suite.framework, suite.master, nil) - driver.messenger = messenger - suite.True(driver.Stopped()) + driver := newTestSchedulerDriver(suite.T(), driverConfigMessenger(NewMockScheduler(), suite.framework, suite.master, nil, mockedMessenger())) driver.Start() driver.setConnected(true) // simulated @@ -637,16 +506,7 @@ func (suite *SchedulerTestSuite) TestSchdulerDriverDeclineOffers() { } func (suite *SchedulerTestSuite) TestSchdulerDriverReviveOffers() { - messenger := messenger.NewMockedMessenger() - messenger.On("Start").Return(nil) - messenger.On("UPID").Return(&upid.UPID{}) - messenger.On("Send").Return(nil) - messenger.On("Stop").Return(nil) - messenger.On("Route").Return(nil) - - driver := newTestSchedulerDriver(suite.T(), NewMockScheduler(), suite.framework, suite.master, nil) - driver.messenger = messenger - suite.True(driver.Stopped()) + driver := newTestSchedulerDriver(suite.T(), driverConfigMessenger(NewMockScheduler(), suite.framework, suite.master, nil, mockedMessenger())) driver.Start() driver.setConnected(true) // simulated @@ -658,16 +518,7 @@ func (suite *SchedulerTestSuite) TestSchdulerDriverReviveOffers() { } func (suite *SchedulerTestSuite) TestSchdulerDriverSendFrameworkMessage() { - messenger := messenger.NewMockedMessenger() - messenger.On("Start").Return(nil) - messenger.On("UPID").Return(&upid.UPID{}) - messenger.On("Send").Return(nil) - messenger.On("Stop").Return(nil) - messenger.On("Route").Return(nil) - - driver := newTestSchedulerDriver(suite.T(), NewMockScheduler(), suite.framework, suite.master, nil) - driver.messenger = messenger - suite.True(driver.Stopped()) + driver := newTestSchedulerDriver(suite.T(), driverConfigMessenger(NewMockScheduler(), suite.framework, suite.master, nil, mockedMessenger())) driver.Start() driver.setConnected(true) // simulated @@ -683,16 +534,7 @@ func (suite *SchedulerTestSuite) TestSchdulerDriverSendFrameworkMessage() { } func (suite *SchedulerTestSuite) TestSchdulerDriverReconcileTasks() { - messenger := messenger.NewMockedMessenger() - messenger.On("Start").Return(nil) - messenger.On("UPID").Return(&upid.UPID{}) - messenger.On("Send").Return(nil) - messenger.On("Stop").Return(nil) - messenger.On("Route").Return(nil) - - driver := newTestSchedulerDriver(suite.T(), NewMockScheduler(), suite.framework, suite.master, nil) - driver.messenger = messenger - suite.True(driver.Stopped()) + driver := newTestSchedulerDriver(suite.T(), driverConfigMessenger(NewMockScheduler(), suite.framework, suite.master, nil, mockedMessenger())) driver.Start() driver.setConnected(true) // simulated diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/upid/upid.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/upid/upid.go index ca69106ef1895..74f9ebbd8065a 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/upid/upid.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/upid/upid.go @@ -49,10 +49,7 @@ func Parse(input string) (*UPID, error) { } // String returns the string representation. -func (u *UPID) String() string { - if u == nil { - return "" - } +func (u UPID) String() string { return fmt.Sprintf("%s@%s:%s", u.ID, u.Host, u.Port) } diff --git a/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/conn.go b/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/conn.go index 47d5534a89fc4..b46467025a7ff 100644 --- a/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/conn.go +++ b/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/conn.go @@ -1,3 +1,4 @@ +// Package zk is a native Go client library for the ZooKeeper orchestration service. package zk /* @@ -14,7 +15,6 @@ import ( "errors" "fmt" "io" - "log" "net" "strconv" "strings" @@ -23,8 +23,17 @@ import ( "time" ) +// ErrNoServer indicates that an operation cannot be completed +// because attempts to connect to all servers in the list failed. var ErrNoServer = errors.New("zk: could not connect to a server") +// ErrInvalidPath indicates that an operation was being attempted on +// an invalid path. (e.g. empty path) +var ErrInvalidPath = errors.New("zk: invalid path") + +// DefaultLogger uses the stdlib log package for logging. +var DefaultLogger Logger = defaultLogger{} + const ( bufferSize = 1536 * 1024 eventChanSize = 6 @@ -47,6 +56,11 @@ type watchPathType struct { type Dialer func(network, address string, timeout time.Duration) (net.Conn, error) +// Logger is an interface that can be implemented to provide custom log output. +type Logger interface { + Printf(string, ...interface{}) +} + type Conn struct { lastZxid int64 sessionID int64 @@ -74,6 +88,8 @@ type Conn struct { // Debug (used by unit tests) reconnectDelay time.Duration + + logger Logger } type request struct { @@ -160,6 +176,7 @@ func ConnectWithDialer(servers []string, sessionTimeout time.Duration, dialer Di watchers: make(map[watchPathType][]chan Event), passwd: emptyPassword, timeout: int32(sessionTimeout.Nanoseconds() / 1e6), + logger: DefaultLogger, // Debug reconnectDelay: 0, @@ -182,10 +199,17 @@ func (c *Conn) Close() { } } +// States returns the current state of the connection. func (c *Conn) State() State { return State(atomic.LoadInt32((*int32)(&c.state))) } +// SetLogger sets the logger to be used for printing errors. +// Logger is an interface provided by this package. +func (c *Conn) SetLogger(l Logger) { + c.logger = l +} + func (c *Conn) setState(state State) { atomic.StoreInt32((*int32)(&c.state), int32(state)) select { @@ -221,7 +245,7 @@ func (c *Conn) connect() error { return nil } - log.Printf("Failed to connect to %s: %+v", c.servers[c.serverIndex], err) + c.logger.Printf("Failed to connect to %s: %+v", c.servers[c.serverIndex], err) } } @@ -267,7 +291,7 @@ func (c *Conn) loop() { // Yeesh if err != io.EOF && err != ErrSessionExpired && !strings.Contains(err.Error(), "use of closed network connection") { - log.Println(err) + c.logger.Printf(err.Error()) } select { @@ -367,7 +391,7 @@ func (c *Conn) sendSetWatches() { res := &setWatchesResponse{} _, err := c.request(opSetWatches, req, res, nil) if err != nil { - log.Printf("Failed to set previous watches: %s", err.Error()) + c.logger.Printf("Failed to set previous watches: %s", err.Error()) } }() } @@ -439,9 +463,6 @@ func (c *Conn) authenticate() error { return ErrSessionExpired } - if c.sessionID != r.SessionID { - atomic.StoreUint32(&c.xid, 0) - } c.timeout = r.TimeOut c.sessionID = r.SessionID c.passwd = r.Passwd @@ -582,7 +603,7 @@ func (c *Conn) recvLoop(conn net.Conn) error { } else if res.Xid == -2 { // Ping response. Ignore. } else if res.Xid < 0 { - log.Printf("Xid < 0 (%d) but not ping or watcher event", res.Xid) + c.logger.Printf("Xid < 0 (%d) but not ping or watcher event", res.Xid) } else { if res.Zxid > 0 { c.lastZxid = res.Zxid @@ -596,7 +617,7 @@ func (c *Conn) recvLoop(conn net.Conn) error { c.requestsLock.Unlock() if !ok { - log.Printf("Response for unknown request with xid %d", res.Xid) + c.logger.Printf("Response for unknown request with xid %d", res.Xid) } else { if res.Err != 0 { err = res.Err.toError() @@ -694,6 +715,9 @@ func (c *Conn) GetW(path string) ([]byte, *Stat, <-chan Event, error) { } func (c *Conn) Set(path string, data []byte, version int32) (*Stat, error) { + if path == "" { + return nil, ErrInvalidPath + } res := &setDataResponse{} _, err := c.request(opSetData, &SetDataRequest{path, data, version}, res, nil) return &res.Stat, err diff --git a/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/constants.go b/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/constants.go index 0546af2efae4e..f9b39b904f744 100644 --- a/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/constants.go +++ b/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/constants.go @@ -57,7 +57,6 @@ const ( StateUnknown = State(-1) StateDisconnected = State(0) StateConnecting = State(1) - StateSyncConnected = State(3) StateAuthFailed = State(4) StateConnectedReadOnly = State(5) StateSaslAuthenticated = State(6) @@ -77,7 +76,6 @@ var ( stateNames = map[State]string{ StateUnknown: "StateUnknown", StateDisconnected: "StateDisconnected", - StateSyncConnected: "StateSyncConnected", StateConnectedReadOnly: "StateConnectedReadOnly", StateSaslAuthenticated: "StateSaslAuthenticated", StateExpired: "StateExpired", diff --git a/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/flw.go b/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/flw.go index c1225ffa25abe..1045c98cfdb35 100644 --- a/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/flw.go +++ b/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/flw.go @@ -49,15 +49,17 @@ func FLWSrvr(servers []string, timeout time.Duration) ([]*ServerStats, bool) { continue } - match := re.FindAllStringSubmatch(string(response), -1)[0][1:] + matches := re.FindAllStringSubmatch(string(response), -1) - if match == nil { + if matches == nil { err := fmt.Errorf("unable to parse fields from zookeeper response (no regex matches)") ss[i] = &ServerStats{Error: err} imOk = false continue } + match := matches[0][1:] + // determine current server var srvrMode Mode switch match[10] { diff --git a/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/lock.go b/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/lock.go index fb77e4a5383d5..f13a8b0ba6ea1 100644 --- a/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/lock.go +++ b/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/lock.go @@ -8,10 +8,13 @@ import ( ) var ( - ErrDeadlock = errors.New("zk: trying to acquire a lock twice") + // ErrDeadlock is returned by Lock when trying to lock twice without unlocking first + ErrDeadlock = errors.New("zk: trying to acquire a lock twice") + // ErrNotLocked is returned by Unlock when trying to release a lock that has not first be acquired. ErrNotLocked = errors.New("zk: not locked") ) +// Lock is a mutual exclusion lock. type Lock struct { c *Conn path string @@ -20,6 +23,9 @@ type Lock struct { seq int } +// NewLock creates a new lock instance using the provided connection, path, and acl. +// The path must be a node that is only used by this lock. A lock instances starts +// unlocked until Lock() is called. func NewLock(c *Conn, path string, acl []ACL) *Lock { return &Lock{ c: c, @@ -33,6 +39,9 @@ func parseSeq(path string) (int, error) { return strconv.Atoi(parts[len(parts)-1]) } +// Lock attempts to acquire the lock. It will wait to return until the lock +// is acquired or an error occurs. If this instance already has the lock +// then ErrDeadlock is returned. func (l *Lock) Lock() error { if l.lockPath != "" { return ErrDeadlock @@ -118,6 +127,8 @@ func (l *Lock) Lock() error { return nil } +// Unlock releases an acquired lock. If the lock is not currently acquired by +// this Lock instance than ErrNotLocked is returned. func (l *Lock) Unlock() error { if l.lockPath == "" { return ErrNotLocked diff --git a/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/structs.go b/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/structs.go index 3c9058adb7d75..8fbc069ee1f52 100644 --- a/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/structs.go +++ b/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/structs.go @@ -3,6 +3,7 @@ package zk import ( "encoding/binary" "errors" + "log" "reflect" "runtime" "time" @@ -14,6 +15,12 @@ var ( ErrShortBuffer = errors.New("zk: buffer too small") ) +type defaultLogger struct{} + +func (defaultLogger) Printf(format string, a ...interface{}) { + log.Printf(format, a...) +} + type ACL struct { Perms int32 Scheme string diff --git a/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/structs_test.go b/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/structs_test.go index 64f18e8d3efcb..cafbbd95c2611 100644 --- a/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/structs_test.go +++ b/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/structs_test.go @@ -58,3 +58,14 @@ func TestDecodeShortBuffer(t *testing.T) { return } } + +func BenchmarkEncode(b *testing.B) { + buf := make([]byte, 4096) + st := &connectRequest{Passwd: []byte("1234567890")} + b.ReportAllocs() + for i := 0; i < b.N; i++ { + if _, err := encodePacket(buf, st); err != nil { + b.Fatal(err) + } + } +}