github.com/m3db/m3@v1.5.0/src/query/generated/proto/admin/placement.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: github.com/m3db/m3/src/query/generated/proto/admin/placement.proto 3 4 // Copyright (c) 2021 Uber Technologies, Inc. 5 // 6 // Permission is hereby granted, free of charge, to any person obtaining a copy 7 // of this software and associated documentation files (the "Software"), to deal 8 // in the Software without restriction, including without limitation the rights 9 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 // copies of the Software, and to permit persons to whom the Software is 11 // furnished to do so, subject to the following conditions: 12 // 13 // The above copyright notice and this permission notice shall be included in 14 // all copies or substantial portions of the Software. 15 // 16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 // THE SOFTWARE. 23 24 package admin 25 26 import proto "github.com/gogo/protobuf/proto" 27 import fmt "fmt" 28 import math "math" 29 import placementpb "github.com/m3db/m3/src/cluster/generated/proto/placementpb" 30 31 import io "io" 32 33 // Reference imports to suppress errors if they are not otherwise used. 34 var _ = proto.Marshal 35 var _ = fmt.Errorf 36 var _ = math.Inf 37 38 type PlacementInitRequest struct { 39 Instances []*placementpb.Instance `protobuf:"bytes,1,rep,name=instances" json:"instances,omitempty"` 40 NumShards int32 `protobuf:"varint,2,opt,name=num_shards,json=numShards,proto3" json:"num_shards,omitempty"` 41 ReplicationFactor int32 `protobuf:"varint,3,opt,name=replication_factor,json=replicationFactor,proto3" json:"replication_factor,omitempty"` 42 OptionOverride *placementpb.Options `protobuf:"bytes,99,opt,name=option_override,json=optionOverride" json:"option_override,omitempty"` 43 } 44 45 func (m *PlacementInitRequest) Reset() { *m = PlacementInitRequest{} } 46 func (m *PlacementInitRequest) String() string { return proto.CompactTextString(m) } 47 func (*PlacementInitRequest) ProtoMessage() {} 48 func (*PlacementInitRequest) Descriptor() ([]byte, []int) { return fileDescriptorPlacement, []int{0} } 49 50 func (m *PlacementInitRequest) GetInstances() []*placementpb.Instance { 51 if m != nil { 52 return m.Instances 53 } 54 return nil 55 } 56 57 func (m *PlacementInitRequest) GetNumShards() int32 { 58 if m != nil { 59 return m.NumShards 60 } 61 return 0 62 } 63 64 func (m *PlacementInitRequest) GetReplicationFactor() int32 { 65 if m != nil { 66 return m.ReplicationFactor 67 } 68 return 0 69 } 70 71 func (m *PlacementInitRequest) GetOptionOverride() *placementpb.Options { 72 if m != nil { 73 return m.OptionOverride 74 } 75 return nil 76 } 77 78 type PlacementGetResponse struct { 79 Placement *placementpb.Placement `protobuf:"bytes,1,opt,name=placement" json:"placement,omitempty"` 80 Version int32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` 81 } 82 83 func (m *PlacementGetResponse) Reset() { *m = PlacementGetResponse{} } 84 func (m *PlacementGetResponse) String() string { return proto.CompactTextString(m) } 85 func (*PlacementGetResponse) ProtoMessage() {} 86 func (*PlacementGetResponse) Descriptor() ([]byte, []int) { return fileDescriptorPlacement, []int{1} } 87 88 func (m *PlacementGetResponse) GetPlacement() *placementpb.Placement { 89 if m != nil { 90 return m.Placement 91 } 92 return nil 93 } 94 95 func (m *PlacementGetResponse) GetVersion() int32 { 96 if m != nil { 97 return m.Version 98 } 99 return 0 100 } 101 102 type PlacementAddRequest struct { 103 Instances []*placementpb.Instance `protobuf:"bytes,1,rep,name=instances" json:"instances,omitempty"` 104 // By default add requests will only succeed if all instances in the placement 105 // are AVAILABLE for all their shards. force overrides that. 106 Force bool `protobuf:"varint,2,opt,name=force,proto3" json:"force,omitempty"` 107 OptionOverride *placementpb.Options `protobuf:"bytes,99,opt,name=option_override,json=optionOverride" json:"option_override,omitempty"` 108 } 109 110 func (m *PlacementAddRequest) Reset() { *m = PlacementAddRequest{} } 111 func (m *PlacementAddRequest) String() string { return proto.CompactTextString(m) } 112 func (*PlacementAddRequest) ProtoMessage() {} 113 func (*PlacementAddRequest) Descriptor() ([]byte, []int) { return fileDescriptorPlacement, []int{2} } 114 115 func (m *PlacementAddRequest) GetInstances() []*placementpb.Instance { 116 if m != nil { 117 return m.Instances 118 } 119 return nil 120 } 121 122 func (m *PlacementAddRequest) GetForce() bool { 123 if m != nil { 124 return m.Force 125 } 126 return false 127 } 128 129 func (m *PlacementAddRequest) GetOptionOverride() *placementpb.Options { 130 if m != nil { 131 return m.OptionOverride 132 } 133 return nil 134 } 135 136 type PlacementRemoveRequest struct { 137 InstanceIds []string `protobuf:"bytes,1,rep,name=instance_ids,json=instanceIds" json:"instance_ids,omitempty"` 138 Force bool `protobuf:"varint,2,opt,name=force,proto3" json:"force,omitempty"` 139 OptionOverride *placementpb.Options `protobuf:"bytes,99,opt,name=option_override,json=optionOverride" json:"option_override,omitempty"` 140 } 141 142 func (m *PlacementRemoveRequest) Reset() { *m = PlacementRemoveRequest{} } 143 func (m *PlacementRemoveRequest) String() string { return proto.CompactTextString(m) } 144 func (*PlacementRemoveRequest) ProtoMessage() {} 145 func (*PlacementRemoveRequest) Descriptor() ([]byte, []int) { return fileDescriptorPlacement, []int{3} } 146 147 func (m *PlacementRemoveRequest) GetInstanceIds() []string { 148 if m != nil { 149 return m.InstanceIds 150 } 151 return nil 152 } 153 154 func (m *PlacementRemoveRequest) GetForce() bool { 155 if m != nil { 156 return m.Force 157 } 158 return false 159 } 160 161 func (m *PlacementRemoveRequest) GetOptionOverride() *placementpb.Options { 162 if m != nil { 163 return m.OptionOverride 164 } 165 return nil 166 } 167 168 type PlacementReplaceRequest struct { 169 LeavingInstanceIDs []string `protobuf:"bytes,1,rep,name=leavingInstanceIDs" json:"leavingInstanceIDs,omitempty"` 170 Candidates []*placementpb.Instance `protobuf:"bytes,2,rep,name=candidates" json:"candidates,omitempty"` 171 Force bool `protobuf:"varint,3,opt,name=force,proto3" json:"force,omitempty"` 172 OptionOverride *placementpb.Options `protobuf:"bytes,99,opt,name=option_override,json=optionOverride" json:"option_override,omitempty"` 173 } 174 175 func (m *PlacementReplaceRequest) Reset() { *m = PlacementReplaceRequest{} } 176 func (m *PlacementReplaceRequest) String() string { return proto.CompactTextString(m) } 177 func (*PlacementReplaceRequest) ProtoMessage() {} 178 func (*PlacementReplaceRequest) Descriptor() ([]byte, []int) { return fileDescriptorPlacement, []int{4} } 179 180 func (m *PlacementReplaceRequest) GetLeavingInstanceIDs() []string { 181 if m != nil { 182 return m.LeavingInstanceIDs 183 } 184 return nil 185 } 186 187 func (m *PlacementReplaceRequest) GetCandidates() []*placementpb.Instance { 188 if m != nil { 189 return m.Candidates 190 } 191 return nil 192 } 193 194 func (m *PlacementReplaceRequest) GetForce() bool { 195 if m != nil { 196 return m.Force 197 } 198 return false 199 } 200 201 func (m *PlacementReplaceRequest) GetOptionOverride() *placementpb.Options { 202 if m != nil { 203 return m.OptionOverride 204 } 205 return nil 206 } 207 208 type PlacementSetRequest struct { 209 Placement *placementpb.Placement `protobuf:"bytes,1,opt,name=placement" json:"placement,omitempty"` 210 Version int32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` 211 // Confirm must be set, otherwise just a dry run is executed. 212 Confirm bool `protobuf:"varint,3,opt,name=confirm,proto3" json:"confirm,omitempty"` 213 // Force will skip validating the placement. 214 Force bool `protobuf:"varint,4,opt,name=force,proto3" json:"force,omitempty"` 215 } 216 217 func (m *PlacementSetRequest) Reset() { *m = PlacementSetRequest{} } 218 func (m *PlacementSetRequest) String() string { return proto.CompactTextString(m) } 219 func (*PlacementSetRequest) ProtoMessage() {} 220 func (*PlacementSetRequest) Descriptor() ([]byte, []int) { return fileDescriptorPlacement, []int{5} } 221 222 func (m *PlacementSetRequest) GetPlacement() *placementpb.Placement { 223 if m != nil { 224 return m.Placement 225 } 226 return nil 227 } 228 229 func (m *PlacementSetRequest) GetVersion() int32 { 230 if m != nil { 231 return m.Version 232 } 233 return 0 234 } 235 236 func (m *PlacementSetRequest) GetConfirm() bool { 237 if m != nil { 238 return m.Confirm 239 } 240 return false 241 } 242 243 func (m *PlacementSetRequest) GetForce() bool { 244 if m != nil { 245 return m.Force 246 } 247 return false 248 } 249 250 type PlacementSetResponse struct { 251 Placement *placementpb.Placement `protobuf:"bytes,1,opt,name=placement" json:"placement,omitempty"` 252 Version int32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` 253 DryRun bool `protobuf:"varint,3,opt,name=dryRun,proto3" json:"dryRun,omitempty"` 254 } 255 256 func (m *PlacementSetResponse) Reset() { *m = PlacementSetResponse{} } 257 func (m *PlacementSetResponse) String() string { return proto.CompactTextString(m) } 258 func (*PlacementSetResponse) ProtoMessage() {} 259 func (*PlacementSetResponse) Descriptor() ([]byte, []int) { return fileDescriptorPlacement, []int{6} } 260 261 func (m *PlacementSetResponse) GetPlacement() *placementpb.Placement { 262 if m != nil { 263 return m.Placement 264 } 265 return nil 266 } 267 268 func (m *PlacementSetResponse) GetVersion() int32 { 269 if m != nil { 270 return m.Version 271 } 272 return 0 273 } 274 275 func (m *PlacementSetResponse) GetDryRun() bool { 276 if m != nil { 277 return m.DryRun 278 } 279 return false 280 } 281 282 func init() { 283 proto.RegisterType((*PlacementInitRequest)(nil), "admin.PlacementInitRequest") 284 proto.RegisterType((*PlacementGetResponse)(nil), "admin.PlacementGetResponse") 285 proto.RegisterType((*PlacementAddRequest)(nil), "admin.PlacementAddRequest") 286 proto.RegisterType((*PlacementRemoveRequest)(nil), "admin.PlacementRemoveRequest") 287 proto.RegisterType((*PlacementReplaceRequest)(nil), "admin.PlacementReplaceRequest") 288 proto.RegisterType((*PlacementSetRequest)(nil), "admin.PlacementSetRequest") 289 proto.RegisterType((*PlacementSetResponse)(nil), "admin.PlacementSetResponse") 290 } 291 func (m *PlacementInitRequest) Marshal() (dAtA []byte, err error) { 292 size := m.Size() 293 dAtA = make([]byte, size) 294 n, err := m.MarshalTo(dAtA) 295 if err != nil { 296 return nil, err 297 } 298 return dAtA[:n], nil 299 } 300 301 func (m *PlacementInitRequest) MarshalTo(dAtA []byte) (int, error) { 302 var i int 303 _ = i 304 var l int 305 _ = l 306 if len(m.Instances) > 0 { 307 for _, msg := range m.Instances { 308 dAtA[i] = 0xa 309 i++ 310 i = encodeVarintPlacement(dAtA, i, uint64(msg.Size())) 311 n, err := msg.MarshalTo(dAtA[i:]) 312 if err != nil { 313 return 0, err 314 } 315 i += n 316 } 317 } 318 if m.NumShards != 0 { 319 dAtA[i] = 0x10 320 i++ 321 i = encodeVarintPlacement(dAtA, i, uint64(m.NumShards)) 322 } 323 if m.ReplicationFactor != 0 { 324 dAtA[i] = 0x18 325 i++ 326 i = encodeVarintPlacement(dAtA, i, uint64(m.ReplicationFactor)) 327 } 328 if m.OptionOverride != nil { 329 dAtA[i] = 0x9a 330 i++ 331 dAtA[i] = 0x6 332 i++ 333 i = encodeVarintPlacement(dAtA, i, uint64(m.OptionOverride.Size())) 334 n1, err := m.OptionOverride.MarshalTo(dAtA[i:]) 335 if err != nil { 336 return 0, err 337 } 338 i += n1 339 } 340 return i, nil 341 } 342 343 func (m *PlacementGetResponse) Marshal() (dAtA []byte, err error) { 344 size := m.Size() 345 dAtA = make([]byte, size) 346 n, err := m.MarshalTo(dAtA) 347 if err != nil { 348 return nil, err 349 } 350 return dAtA[:n], nil 351 } 352 353 func (m *PlacementGetResponse) MarshalTo(dAtA []byte) (int, error) { 354 var i int 355 _ = i 356 var l int 357 _ = l 358 if m.Placement != nil { 359 dAtA[i] = 0xa 360 i++ 361 i = encodeVarintPlacement(dAtA, i, uint64(m.Placement.Size())) 362 n2, err := m.Placement.MarshalTo(dAtA[i:]) 363 if err != nil { 364 return 0, err 365 } 366 i += n2 367 } 368 if m.Version != 0 { 369 dAtA[i] = 0x10 370 i++ 371 i = encodeVarintPlacement(dAtA, i, uint64(m.Version)) 372 } 373 return i, nil 374 } 375 376 func (m *PlacementAddRequest) Marshal() (dAtA []byte, err error) { 377 size := m.Size() 378 dAtA = make([]byte, size) 379 n, err := m.MarshalTo(dAtA) 380 if err != nil { 381 return nil, err 382 } 383 return dAtA[:n], nil 384 } 385 386 func (m *PlacementAddRequest) MarshalTo(dAtA []byte) (int, error) { 387 var i int 388 _ = i 389 var l int 390 _ = l 391 if len(m.Instances) > 0 { 392 for _, msg := range m.Instances { 393 dAtA[i] = 0xa 394 i++ 395 i = encodeVarintPlacement(dAtA, i, uint64(msg.Size())) 396 n, err := msg.MarshalTo(dAtA[i:]) 397 if err != nil { 398 return 0, err 399 } 400 i += n 401 } 402 } 403 if m.Force { 404 dAtA[i] = 0x10 405 i++ 406 if m.Force { 407 dAtA[i] = 1 408 } else { 409 dAtA[i] = 0 410 } 411 i++ 412 } 413 if m.OptionOverride != nil { 414 dAtA[i] = 0x9a 415 i++ 416 dAtA[i] = 0x6 417 i++ 418 i = encodeVarintPlacement(dAtA, i, uint64(m.OptionOverride.Size())) 419 n3, err := m.OptionOverride.MarshalTo(dAtA[i:]) 420 if err != nil { 421 return 0, err 422 } 423 i += n3 424 } 425 return i, nil 426 } 427 428 func (m *PlacementRemoveRequest) Marshal() (dAtA []byte, err error) { 429 size := m.Size() 430 dAtA = make([]byte, size) 431 n, err := m.MarshalTo(dAtA) 432 if err != nil { 433 return nil, err 434 } 435 return dAtA[:n], nil 436 } 437 438 func (m *PlacementRemoveRequest) MarshalTo(dAtA []byte) (int, error) { 439 var i int 440 _ = i 441 var l int 442 _ = l 443 if len(m.InstanceIds) > 0 { 444 for _, s := range m.InstanceIds { 445 dAtA[i] = 0xa 446 i++ 447 l = len(s) 448 for l >= 1<<7 { 449 dAtA[i] = uint8(uint64(l)&0x7f | 0x80) 450 l >>= 7 451 i++ 452 } 453 dAtA[i] = uint8(l) 454 i++ 455 i += copy(dAtA[i:], s) 456 } 457 } 458 if m.Force { 459 dAtA[i] = 0x10 460 i++ 461 if m.Force { 462 dAtA[i] = 1 463 } else { 464 dAtA[i] = 0 465 } 466 i++ 467 } 468 if m.OptionOverride != nil { 469 dAtA[i] = 0x9a 470 i++ 471 dAtA[i] = 0x6 472 i++ 473 i = encodeVarintPlacement(dAtA, i, uint64(m.OptionOverride.Size())) 474 n4, err := m.OptionOverride.MarshalTo(dAtA[i:]) 475 if err != nil { 476 return 0, err 477 } 478 i += n4 479 } 480 return i, nil 481 } 482 483 func (m *PlacementReplaceRequest) Marshal() (dAtA []byte, err error) { 484 size := m.Size() 485 dAtA = make([]byte, size) 486 n, err := m.MarshalTo(dAtA) 487 if err != nil { 488 return nil, err 489 } 490 return dAtA[:n], nil 491 } 492 493 func (m *PlacementReplaceRequest) MarshalTo(dAtA []byte) (int, error) { 494 var i int 495 _ = i 496 var l int 497 _ = l 498 if len(m.LeavingInstanceIDs) > 0 { 499 for _, s := range m.LeavingInstanceIDs { 500 dAtA[i] = 0xa 501 i++ 502 l = len(s) 503 for l >= 1<<7 { 504 dAtA[i] = uint8(uint64(l)&0x7f | 0x80) 505 l >>= 7 506 i++ 507 } 508 dAtA[i] = uint8(l) 509 i++ 510 i += copy(dAtA[i:], s) 511 } 512 } 513 if len(m.Candidates) > 0 { 514 for _, msg := range m.Candidates { 515 dAtA[i] = 0x12 516 i++ 517 i = encodeVarintPlacement(dAtA, i, uint64(msg.Size())) 518 n, err := msg.MarshalTo(dAtA[i:]) 519 if err != nil { 520 return 0, err 521 } 522 i += n 523 } 524 } 525 if m.Force { 526 dAtA[i] = 0x18 527 i++ 528 if m.Force { 529 dAtA[i] = 1 530 } else { 531 dAtA[i] = 0 532 } 533 i++ 534 } 535 if m.OptionOverride != nil { 536 dAtA[i] = 0x9a 537 i++ 538 dAtA[i] = 0x6 539 i++ 540 i = encodeVarintPlacement(dAtA, i, uint64(m.OptionOverride.Size())) 541 n5, err := m.OptionOverride.MarshalTo(dAtA[i:]) 542 if err != nil { 543 return 0, err 544 } 545 i += n5 546 } 547 return i, nil 548 } 549 550 func (m *PlacementSetRequest) Marshal() (dAtA []byte, err error) { 551 size := m.Size() 552 dAtA = make([]byte, size) 553 n, err := m.MarshalTo(dAtA) 554 if err != nil { 555 return nil, err 556 } 557 return dAtA[:n], nil 558 } 559 560 func (m *PlacementSetRequest) MarshalTo(dAtA []byte) (int, error) { 561 var i int 562 _ = i 563 var l int 564 _ = l 565 if m.Placement != nil { 566 dAtA[i] = 0xa 567 i++ 568 i = encodeVarintPlacement(dAtA, i, uint64(m.Placement.Size())) 569 n6, err := m.Placement.MarshalTo(dAtA[i:]) 570 if err != nil { 571 return 0, err 572 } 573 i += n6 574 } 575 if m.Version != 0 { 576 dAtA[i] = 0x10 577 i++ 578 i = encodeVarintPlacement(dAtA, i, uint64(m.Version)) 579 } 580 if m.Confirm { 581 dAtA[i] = 0x18 582 i++ 583 if m.Confirm { 584 dAtA[i] = 1 585 } else { 586 dAtA[i] = 0 587 } 588 i++ 589 } 590 if m.Force { 591 dAtA[i] = 0x20 592 i++ 593 if m.Force { 594 dAtA[i] = 1 595 } else { 596 dAtA[i] = 0 597 } 598 i++ 599 } 600 return i, nil 601 } 602 603 func (m *PlacementSetResponse) Marshal() (dAtA []byte, err error) { 604 size := m.Size() 605 dAtA = make([]byte, size) 606 n, err := m.MarshalTo(dAtA) 607 if err != nil { 608 return nil, err 609 } 610 return dAtA[:n], nil 611 } 612 613 func (m *PlacementSetResponse) MarshalTo(dAtA []byte) (int, error) { 614 var i int 615 _ = i 616 var l int 617 _ = l 618 if m.Placement != nil { 619 dAtA[i] = 0xa 620 i++ 621 i = encodeVarintPlacement(dAtA, i, uint64(m.Placement.Size())) 622 n7, err := m.Placement.MarshalTo(dAtA[i:]) 623 if err != nil { 624 return 0, err 625 } 626 i += n7 627 } 628 if m.Version != 0 { 629 dAtA[i] = 0x10 630 i++ 631 i = encodeVarintPlacement(dAtA, i, uint64(m.Version)) 632 } 633 if m.DryRun { 634 dAtA[i] = 0x18 635 i++ 636 if m.DryRun { 637 dAtA[i] = 1 638 } else { 639 dAtA[i] = 0 640 } 641 i++ 642 } 643 return i, nil 644 } 645 646 func encodeVarintPlacement(dAtA []byte, offset int, v uint64) int { 647 for v >= 1<<7 { 648 dAtA[offset] = uint8(v&0x7f | 0x80) 649 v >>= 7 650 offset++ 651 } 652 dAtA[offset] = uint8(v) 653 return offset + 1 654 } 655 func (m *PlacementInitRequest) Size() (n int) { 656 var l int 657 _ = l 658 if len(m.Instances) > 0 { 659 for _, e := range m.Instances { 660 l = e.Size() 661 n += 1 + l + sovPlacement(uint64(l)) 662 } 663 } 664 if m.NumShards != 0 { 665 n += 1 + sovPlacement(uint64(m.NumShards)) 666 } 667 if m.ReplicationFactor != 0 { 668 n += 1 + sovPlacement(uint64(m.ReplicationFactor)) 669 } 670 if m.OptionOverride != nil { 671 l = m.OptionOverride.Size() 672 n += 2 + l + sovPlacement(uint64(l)) 673 } 674 return n 675 } 676 677 func (m *PlacementGetResponse) Size() (n int) { 678 var l int 679 _ = l 680 if m.Placement != nil { 681 l = m.Placement.Size() 682 n += 1 + l + sovPlacement(uint64(l)) 683 } 684 if m.Version != 0 { 685 n += 1 + sovPlacement(uint64(m.Version)) 686 } 687 return n 688 } 689 690 func (m *PlacementAddRequest) Size() (n int) { 691 var l int 692 _ = l 693 if len(m.Instances) > 0 { 694 for _, e := range m.Instances { 695 l = e.Size() 696 n += 1 + l + sovPlacement(uint64(l)) 697 } 698 } 699 if m.Force { 700 n += 2 701 } 702 if m.OptionOverride != nil { 703 l = m.OptionOverride.Size() 704 n += 2 + l + sovPlacement(uint64(l)) 705 } 706 return n 707 } 708 709 func (m *PlacementRemoveRequest) Size() (n int) { 710 var l int 711 _ = l 712 if len(m.InstanceIds) > 0 { 713 for _, s := range m.InstanceIds { 714 l = len(s) 715 n += 1 + l + sovPlacement(uint64(l)) 716 } 717 } 718 if m.Force { 719 n += 2 720 } 721 if m.OptionOverride != nil { 722 l = m.OptionOverride.Size() 723 n += 2 + l + sovPlacement(uint64(l)) 724 } 725 return n 726 } 727 728 func (m *PlacementReplaceRequest) Size() (n int) { 729 var l int 730 _ = l 731 if len(m.LeavingInstanceIDs) > 0 { 732 for _, s := range m.LeavingInstanceIDs { 733 l = len(s) 734 n += 1 + l + sovPlacement(uint64(l)) 735 } 736 } 737 if len(m.Candidates) > 0 { 738 for _, e := range m.Candidates { 739 l = e.Size() 740 n += 1 + l + sovPlacement(uint64(l)) 741 } 742 } 743 if m.Force { 744 n += 2 745 } 746 if m.OptionOverride != nil { 747 l = m.OptionOverride.Size() 748 n += 2 + l + sovPlacement(uint64(l)) 749 } 750 return n 751 } 752 753 func (m *PlacementSetRequest) Size() (n int) { 754 var l int 755 _ = l 756 if m.Placement != nil { 757 l = m.Placement.Size() 758 n += 1 + l + sovPlacement(uint64(l)) 759 } 760 if m.Version != 0 { 761 n += 1 + sovPlacement(uint64(m.Version)) 762 } 763 if m.Confirm { 764 n += 2 765 } 766 if m.Force { 767 n += 2 768 } 769 return n 770 } 771 772 func (m *PlacementSetResponse) Size() (n int) { 773 var l int 774 _ = l 775 if m.Placement != nil { 776 l = m.Placement.Size() 777 n += 1 + l + sovPlacement(uint64(l)) 778 } 779 if m.Version != 0 { 780 n += 1 + sovPlacement(uint64(m.Version)) 781 } 782 if m.DryRun { 783 n += 2 784 } 785 return n 786 } 787 788 func sovPlacement(x uint64) (n int) { 789 for { 790 n++ 791 x >>= 7 792 if x == 0 { 793 break 794 } 795 } 796 return n 797 } 798 func sozPlacement(x uint64) (n int) { 799 return sovPlacement(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 800 } 801 func (m *PlacementInitRequest) Unmarshal(dAtA []byte) error { 802 l := len(dAtA) 803 iNdEx := 0 804 for iNdEx < l { 805 preIndex := iNdEx 806 var wire uint64 807 for shift := uint(0); ; shift += 7 { 808 if shift >= 64 { 809 return ErrIntOverflowPlacement 810 } 811 if iNdEx >= l { 812 return io.ErrUnexpectedEOF 813 } 814 b := dAtA[iNdEx] 815 iNdEx++ 816 wire |= (uint64(b) & 0x7F) << shift 817 if b < 0x80 { 818 break 819 } 820 } 821 fieldNum := int32(wire >> 3) 822 wireType := int(wire & 0x7) 823 if wireType == 4 { 824 return fmt.Errorf("proto: PlacementInitRequest: wiretype end group for non-group") 825 } 826 if fieldNum <= 0 { 827 return fmt.Errorf("proto: PlacementInitRequest: illegal tag %d (wire type %d)", fieldNum, wire) 828 } 829 switch fieldNum { 830 case 1: 831 if wireType != 2 { 832 return fmt.Errorf("proto: wrong wireType = %d for field Instances", wireType) 833 } 834 var msglen int 835 for shift := uint(0); ; shift += 7 { 836 if shift >= 64 { 837 return ErrIntOverflowPlacement 838 } 839 if iNdEx >= l { 840 return io.ErrUnexpectedEOF 841 } 842 b := dAtA[iNdEx] 843 iNdEx++ 844 msglen |= (int(b) & 0x7F) << shift 845 if b < 0x80 { 846 break 847 } 848 } 849 if msglen < 0 { 850 return ErrInvalidLengthPlacement 851 } 852 postIndex := iNdEx + msglen 853 if postIndex > l { 854 return io.ErrUnexpectedEOF 855 } 856 m.Instances = append(m.Instances, &placementpb.Instance{}) 857 if err := m.Instances[len(m.Instances)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 858 return err 859 } 860 iNdEx = postIndex 861 case 2: 862 if wireType != 0 { 863 return fmt.Errorf("proto: wrong wireType = %d for field NumShards", wireType) 864 } 865 m.NumShards = 0 866 for shift := uint(0); ; shift += 7 { 867 if shift >= 64 { 868 return ErrIntOverflowPlacement 869 } 870 if iNdEx >= l { 871 return io.ErrUnexpectedEOF 872 } 873 b := dAtA[iNdEx] 874 iNdEx++ 875 m.NumShards |= (int32(b) & 0x7F) << shift 876 if b < 0x80 { 877 break 878 } 879 } 880 case 3: 881 if wireType != 0 { 882 return fmt.Errorf("proto: wrong wireType = %d for field ReplicationFactor", wireType) 883 } 884 m.ReplicationFactor = 0 885 for shift := uint(0); ; shift += 7 { 886 if shift >= 64 { 887 return ErrIntOverflowPlacement 888 } 889 if iNdEx >= l { 890 return io.ErrUnexpectedEOF 891 } 892 b := dAtA[iNdEx] 893 iNdEx++ 894 m.ReplicationFactor |= (int32(b) & 0x7F) << shift 895 if b < 0x80 { 896 break 897 } 898 } 899 case 99: 900 if wireType != 2 { 901 return fmt.Errorf("proto: wrong wireType = %d for field OptionOverride", wireType) 902 } 903 var msglen int 904 for shift := uint(0); ; shift += 7 { 905 if shift >= 64 { 906 return ErrIntOverflowPlacement 907 } 908 if iNdEx >= l { 909 return io.ErrUnexpectedEOF 910 } 911 b := dAtA[iNdEx] 912 iNdEx++ 913 msglen |= (int(b) & 0x7F) << shift 914 if b < 0x80 { 915 break 916 } 917 } 918 if msglen < 0 { 919 return ErrInvalidLengthPlacement 920 } 921 postIndex := iNdEx + msglen 922 if postIndex > l { 923 return io.ErrUnexpectedEOF 924 } 925 if m.OptionOverride == nil { 926 m.OptionOverride = &placementpb.Options{} 927 } 928 if err := m.OptionOverride.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 929 return err 930 } 931 iNdEx = postIndex 932 default: 933 iNdEx = preIndex 934 skippy, err := skipPlacement(dAtA[iNdEx:]) 935 if err != nil { 936 return err 937 } 938 if skippy < 0 { 939 return ErrInvalidLengthPlacement 940 } 941 if (iNdEx + skippy) > l { 942 return io.ErrUnexpectedEOF 943 } 944 iNdEx += skippy 945 } 946 } 947 948 if iNdEx > l { 949 return io.ErrUnexpectedEOF 950 } 951 return nil 952 } 953 func (m *PlacementGetResponse) Unmarshal(dAtA []byte) error { 954 l := len(dAtA) 955 iNdEx := 0 956 for iNdEx < l { 957 preIndex := iNdEx 958 var wire uint64 959 for shift := uint(0); ; shift += 7 { 960 if shift >= 64 { 961 return ErrIntOverflowPlacement 962 } 963 if iNdEx >= l { 964 return io.ErrUnexpectedEOF 965 } 966 b := dAtA[iNdEx] 967 iNdEx++ 968 wire |= (uint64(b) & 0x7F) << shift 969 if b < 0x80 { 970 break 971 } 972 } 973 fieldNum := int32(wire >> 3) 974 wireType := int(wire & 0x7) 975 if wireType == 4 { 976 return fmt.Errorf("proto: PlacementGetResponse: wiretype end group for non-group") 977 } 978 if fieldNum <= 0 { 979 return fmt.Errorf("proto: PlacementGetResponse: illegal tag %d (wire type %d)", fieldNum, wire) 980 } 981 switch fieldNum { 982 case 1: 983 if wireType != 2 { 984 return fmt.Errorf("proto: wrong wireType = %d for field Placement", wireType) 985 } 986 var msglen int 987 for shift := uint(0); ; shift += 7 { 988 if shift >= 64 { 989 return ErrIntOverflowPlacement 990 } 991 if iNdEx >= l { 992 return io.ErrUnexpectedEOF 993 } 994 b := dAtA[iNdEx] 995 iNdEx++ 996 msglen |= (int(b) & 0x7F) << shift 997 if b < 0x80 { 998 break 999 } 1000 } 1001 if msglen < 0 { 1002 return ErrInvalidLengthPlacement 1003 } 1004 postIndex := iNdEx + msglen 1005 if postIndex > l { 1006 return io.ErrUnexpectedEOF 1007 } 1008 if m.Placement == nil { 1009 m.Placement = &placementpb.Placement{} 1010 } 1011 if err := m.Placement.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1012 return err 1013 } 1014 iNdEx = postIndex 1015 case 2: 1016 if wireType != 0 { 1017 return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) 1018 } 1019 m.Version = 0 1020 for shift := uint(0); ; shift += 7 { 1021 if shift >= 64 { 1022 return ErrIntOverflowPlacement 1023 } 1024 if iNdEx >= l { 1025 return io.ErrUnexpectedEOF 1026 } 1027 b := dAtA[iNdEx] 1028 iNdEx++ 1029 m.Version |= (int32(b) & 0x7F) << shift 1030 if b < 0x80 { 1031 break 1032 } 1033 } 1034 default: 1035 iNdEx = preIndex 1036 skippy, err := skipPlacement(dAtA[iNdEx:]) 1037 if err != nil { 1038 return err 1039 } 1040 if skippy < 0 { 1041 return ErrInvalidLengthPlacement 1042 } 1043 if (iNdEx + skippy) > l { 1044 return io.ErrUnexpectedEOF 1045 } 1046 iNdEx += skippy 1047 } 1048 } 1049 1050 if iNdEx > l { 1051 return io.ErrUnexpectedEOF 1052 } 1053 return nil 1054 } 1055 func (m *PlacementAddRequest) Unmarshal(dAtA []byte) error { 1056 l := len(dAtA) 1057 iNdEx := 0 1058 for iNdEx < l { 1059 preIndex := iNdEx 1060 var wire uint64 1061 for shift := uint(0); ; shift += 7 { 1062 if shift >= 64 { 1063 return ErrIntOverflowPlacement 1064 } 1065 if iNdEx >= l { 1066 return io.ErrUnexpectedEOF 1067 } 1068 b := dAtA[iNdEx] 1069 iNdEx++ 1070 wire |= (uint64(b) & 0x7F) << shift 1071 if b < 0x80 { 1072 break 1073 } 1074 } 1075 fieldNum := int32(wire >> 3) 1076 wireType := int(wire & 0x7) 1077 if wireType == 4 { 1078 return fmt.Errorf("proto: PlacementAddRequest: wiretype end group for non-group") 1079 } 1080 if fieldNum <= 0 { 1081 return fmt.Errorf("proto: PlacementAddRequest: illegal tag %d (wire type %d)", fieldNum, wire) 1082 } 1083 switch fieldNum { 1084 case 1: 1085 if wireType != 2 { 1086 return fmt.Errorf("proto: wrong wireType = %d for field Instances", wireType) 1087 } 1088 var msglen int 1089 for shift := uint(0); ; shift += 7 { 1090 if shift >= 64 { 1091 return ErrIntOverflowPlacement 1092 } 1093 if iNdEx >= l { 1094 return io.ErrUnexpectedEOF 1095 } 1096 b := dAtA[iNdEx] 1097 iNdEx++ 1098 msglen |= (int(b) & 0x7F) << shift 1099 if b < 0x80 { 1100 break 1101 } 1102 } 1103 if msglen < 0 { 1104 return ErrInvalidLengthPlacement 1105 } 1106 postIndex := iNdEx + msglen 1107 if postIndex > l { 1108 return io.ErrUnexpectedEOF 1109 } 1110 m.Instances = append(m.Instances, &placementpb.Instance{}) 1111 if err := m.Instances[len(m.Instances)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1112 return err 1113 } 1114 iNdEx = postIndex 1115 case 2: 1116 if wireType != 0 { 1117 return fmt.Errorf("proto: wrong wireType = %d for field Force", wireType) 1118 } 1119 var v int 1120 for shift := uint(0); ; shift += 7 { 1121 if shift >= 64 { 1122 return ErrIntOverflowPlacement 1123 } 1124 if iNdEx >= l { 1125 return io.ErrUnexpectedEOF 1126 } 1127 b := dAtA[iNdEx] 1128 iNdEx++ 1129 v |= (int(b) & 0x7F) << shift 1130 if b < 0x80 { 1131 break 1132 } 1133 } 1134 m.Force = bool(v != 0) 1135 case 99: 1136 if wireType != 2 { 1137 return fmt.Errorf("proto: wrong wireType = %d for field OptionOverride", wireType) 1138 } 1139 var msglen int 1140 for shift := uint(0); ; shift += 7 { 1141 if shift >= 64 { 1142 return ErrIntOverflowPlacement 1143 } 1144 if iNdEx >= l { 1145 return io.ErrUnexpectedEOF 1146 } 1147 b := dAtA[iNdEx] 1148 iNdEx++ 1149 msglen |= (int(b) & 0x7F) << shift 1150 if b < 0x80 { 1151 break 1152 } 1153 } 1154 if msglen < 0 { 1155 return ErrInvalidLengthPlacement 1156 } 1157 postIndex := iNdEx + msglen 1158 if postIndex > l { 1159 return io.ErrUnexpectedEOF 1160 } 1161 if m.OptionOverride == nil { 1162 m.OptionOverride = &placementpb.Options{} 1163 } 1164 if err := m.OptionOverride.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1165 return err 1166 } 1167 iNdEx = postIndex 1168 default: 1169 iNdEx = preIndex 1170 skippy, err := skipPlacement(dAtA[iNdEx:]) 1171 if err != nil { 1172 return err 1173 } 1174 if skippy < 0 { 1175 return ErrInvalidLengthPlacement 1176 } 1177 if (iNdEx + skippy) > l { 1178 return io.ErrUnexpectedEOF 1179 } 1180 iNdEx += skippy 1181 } 1182 } 1183 1184 if iNdEx > l { 1185 return io.ErrUnexpectedEOF 1186 } 1187 return nil 1188 } 1189 func (m *PlacementRemoveRequest) Unmarshal(dAtA []byte) error { 1190 l := len(dAtA) 1191 iNdEx := 0 1192 for iNdEx < l { 1193 preIndex := iNdEx 1194 var wire uint64 1195 for shift := uint(0); ; shift += 7 { 1196 if shift >= 64 { 1197 return ErrIntOverflowPlacement 1198 } 1199 if iNdEx >= l { 1200 return io.ErrUnexpectedEOF 1201 } 1202 b := dAtA[iNdEx] 1203 iNdEx++ 1204 wire |= (uint64(b) & 0x7F) << shift 1205 if b < 0x80 { 1206 break 1207 } 1208 } 1209 fieldNum := int32(wire >> 3) 1210 wireType := int(wire & 0x7) 1211 if wireType == 4 { 1212 return fmt.Errorf("proto: PlacementRemoveRequest: wiretype end group for non-group") 1213 } 1214 if fieldNum <= 0 { 1215 return fmt.Errorf("proto: PlacementRemoveRequest: illegal tag %d (wire type %d)", fieldNum, wire) 1216 } 1217 switch fieldNum { 1218 case 1: 1219 if wireType != 2 { 1220 return fmt.Errorf("proto: wrong wireType = %d for field InstanceIds", wireType) 1221 } 1222 var stringLen uint64 1223 for shift := uint(0); ; shift += 7 { 1224 if shift >= 64 { 1225 return ErrIntOverflowPlacement 1226 } 1227 if iNdEx >= l { 1228 return io.ErrUnexpectedEOF 1229 } 1230 b := dAtA[iNdEx] 1231 iNdEx++ 1232 stringLen |= (uint64(b) & 0x7F) << shift 1233 if b < 0x80 { 1234 break 1235 } 1236 } 1237 intStringLen := int(stringLen) 1238 if intStringLen < 0 { 1239 return ErrInvalidLengthPlacement 1240 } 1241 postIndex := iNdEx + intStringLen 1242 if postIndex > l { 1243 return io.ErrUnexpectedEOF 1244 } 1245 m.InstanceIds = append(m.InstanceIds, string(dAtA[iNdEx:postIndex])) 1246 iNdEx = postIndex 1247 case 2: 1248 if wireType != 0 { 1249 return fmt.Errorf("proto: wrong wireType = %d for field Force", wireType) 1250 } 1251 var v int 1252 for shift := uint(0); ; shift += 7 { 1253 if shift >= 64 { 1254 return ErrIntOverflowPlacement 1255 } 1256 if iNdEx >= l { 1257 return io.ErrUnexpectedEOF 1258 } 1259 b := dAtA[iNdEx] 1260 iNdEx++ 1261 v |= (int(b) & 0x7F) << shift 1262 if b < 0x80 { 1263 break 1264 } 1265 } 1266 m.Force = bool(v != 0) 1267 case 99: 1268 if wireType != 2 { 1269 return fmt.Errorf("proto: wrong wireType = %d for field OptionOverride", wireType) 1270 } 1271 var msglen int 1272 for shift := uint(0); ; shift += 7 { 1273 if shift >= 64 { 1274 return ErrIntOverflowPlacement 1275 } 1276 if iNdEx >= l { 1277 return io.ErrUnexpectedEOF 1278 } 1279 b := dAtA[iNdEx] 1280 iNdEx++ 1281 msglen |= (int(b) & 0x7F) << shift 1282 if b < 0x80 { 1283 break 1284 } 1285 } 1286 if msglen < 0 { 1287 return ErrInvalidLengthPlacement 1288 } 1289 postIndex := iNdEx + msglen 1290 if postIndex > l { 1291 return io.ErrUnexpectedEOF 1292 } 1293 if m.OptionOverride == nil { 1294 m.OptionOverride = &placementpb.Options{} 1295 } 1296 if err := m.OptionOverride.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1297 return err 1298 } 1299 iNdEx = postIndex 1300 default: 1301 iNdEx = preIndex 1302 skippy, err := skipPlacement(dAtA[iNdEx:]) 1303 if err != nil { 1304 return err 1305 } 1306 if skippy < 0 { 1307 return ErrInvalidLengthPlacement 1308 } 1309 if (iNdEx + skippy) > l { 1310 return io.ErrUnexpectedEOF 1311 } 1312 iNdEx += skippy 1313 } 1314 } 1315 1316 if iNdEx > l { 1317 return io.ErrUnexpectedEOF 1318 } 1319 return nil 1320 } 1321 func (m *PlacementReplaceRequest) Unmarshal(dAtA []byte) error { 1322 l := len(dAtA) 1323 iNdEx := 0 1324 for iNdEx < l { 1325 preIndex := iNdEx 1326 var wire uint64 1327 for shift := uint(0); ; shift += 7 { 1328 if shift >= 64 { 1329 return ErrIntOverflowPlacement 1330 } 1331 if iNdEx >= l { 1332 return io.ErrUnexpectedEOF 1333 } 1334 b := dAtA[iNdEx] 1335 iNdEx++ 1336 wire |= (uint64(b) & 0x7F) << shift 1337 if b < 0x80 { 1338 break 1339 } 1340 } 1341 fieldNum := int32(wire >> 3) 1342 wireType := int(wire & 0x7) 1343 if wireType == 4 { 1344 return fmt.Errorf("proto: PlacementReplaceRequest: wiretype end group for non-group") 1345 } 1346 if fieldNum <= 0 { 1347 return fmt.Errorf("proto: PlacementReplaceRequest: illegal tag %d (wire type %d)", fieldNum, wire) 1348 } 1349 switch fieldNum { 1350 case 1: 1351 if wireType != 2 { 1352 return fmt.Errorf("proto: wrong wireType = %d for field LeavingInstanceIDs", wireType) 1353 } 1354 var stringLen uint64 1355 for shift := uint(0); ; shift += 7 { 1356 if shift >= 64 { 1357 return ErrIntOverflowPlacement 1358 } 1359 if iNdEx >= l { 1360 return io.ErrUnexpectedEOF 1361 } 1362 b := dAtA[iNdEx] 1363 iNdEx++ 1364 stringLen |= (uint64(b) & 0x7F) << shift 1365 if b < 0x80 { 1366 break 1367 } 1368 } 1369 intStringLen := int(stringLen) 1370 if intStringLen < 0 { 1371 return ErrInvalidLengthPlacement 1372 } 1373 postIndex := iNdEx + intStringLen 1374 if postIndex > l { 1375 return io.ErrUnexpectedEOF 1376 } 1377 m.LeavingInstanceIDs = append(m.LeavingInstanceIDs, string(dAtA[iNdEx:postIndex])) 1378 iNdEx = postIndex 1379 case 2: 1380 if wireType != 2 { 1381 return fmt.Errorf("proto: wrong wireType = %d for field Candidates", wireType) 1382 } 1383 var msglen int 1384 for shift := uint(0); ; shift += 7 { 1385 if shift >= 64 { 1386 return ErrIntOverflowPlacement 1387 } 1388 if iNdEx >= l { 1389 return io.ErrUnexpectedEOF 1390 } 1391 b := dAtA[iNdEx] 1392 iNdEx++ 1393 msglen |= (int(b) & 0x7F) << shift 1394 if b < 0x80 { 1395 break 1396 } 1397 } 1398 if msglen < 0 { 1399 return ErrInvalidLengthPlacement 1400 } 1401 postIndex := iNdEx + msglen 1402 if postIndex > l { 1403 return io.ErrUnexpectedEOF 1404 } 1405 m.Candidates = append(m.Candidates, &placementpb.Instance{}) 1406 if err := m.Candidates[len(m.Candidates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1407 return err 1408 } 1409 iNdEx = postIndex 1410 case 3: 1411 if wireType != 0 { 1412 return fmt.Errorf("proto: wrong wireType = %d for field Force", wireType) 1413 } 1414 var v int 1415 for shift := uint(0); ; shift += 7 { 1416 if shift >= 64 { 1417 return ErrIntOverflowPlacement 1418 } 1419 if iNdEx >= l { 1420 return io.ErrUnexpectedEOF 1421 } 1422 b := dAtA[iNdEx] 1423 iNdEx++ 1424 v |= (int(b) & 0x7F) << shift 1425 if b < 0x80 { 1426 break 1427 } 1428 } 1429 m.Force = bool(v != 0) 1430 case 99: 1431 if wireType != 2 { 1432 return fmt.Errorf("proto: wrong wireType = %d for field OptionOverride", wireType) 1433 } 1434 var msglen int 1435 for shift := uint(0); ; shift += 7 { 1436 if shift >= 64 { 1437 return ErrIntOverflowPlacement 1438 } 1439 if iNdEx >= l { 1440 return io.ErrUnexpectedEOF 1441 } 1442 b := dAtA[iNdEx] 1443 iNdEx++ 1444 msglen |= (int(b) & 0x7F) << shift 1445 if b < 0x80 { 1446 break 1447 } 1448 } 1449 if msglen < 0 { 1450 return ErrInvalidLengthPlacement 1451 } 1452 postIndex := iNdEx + msglen 1453 if postIndex > l { 1454 return io.ErrUnexpectedEOF 1455 } 1456 if m.OptionOverride == nil { 1457 m.OptionOverride = &placementpb.Options{} 1458 } 1459 if err := m.OptionOverride.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1460 return err 1461 } 1462 iNdEx = postIndex 1463 default: 1464 iNdEx = preIndex 1465 skippy, err := skipPlacement(dAtA[iNdEx:]) 1466 if err != nil { 1467 return err 1468 } 1469 if skippy < 0 { 1470 return ErrInvalidLengthPlacement 1471 } 1472 if (iNdEx + skippy) > l { 1473 return io.ErrUnexpectedEOF 1474 } 1475 iNdEx += skippy 1476 } 1477 } 1478 1479 if iNdEx > l { 1480 return io.ErrUnexpectedEOF 1481 } 1482 return nil 1483 } 1484 func (m *PlacementSetRequest) Unmarshal(dAtA []byte) error { 1485 l := len(dAtA) 1486 iNdEx := 0 1487 for iNdEx < l { 1488 preIndex := iNdEx 1489 var wire uint64 1490 for shift := uint(0); ; shift += 7 { 1491 if shift >= 64 { 1492 return ErrIntOverflowPlacement 1493 } 1494 if iNdEx >= l { 1495 return io.ErrUnexpectedEOF 1496 } 1497 b := dAtA[iNdEx] 1498 iNdEx++ 1499 wire |= (uint64(b) & 0x7F) << shift 1500 if b < 0x80 { 1501 break 1502 } 1503 } 1504 fieldNum := int32(wire >> 3) 1505 wireType := int(wire & 0x7) 1506 if wireType == 4 { 1507 return fmt.Errorf("proto: PlacementSetRequest: wiretype end group for non-group") 1508 } 1509 if fieldNum <= 0 { 1510 return fmt.Errorf("proto: PlacementSetRequest: illegal tag %d (wire type %d)", fieldNum, wire) 1511 } 1512 switch fieldNum { 1513 case 1: 1514 if wireType != 2 { 1515 return fmt.Errorf("proto: wrong wireType = %d for field Placement", wireType) 1516 } 1517 var msglen int 1518 for shift := uint(0); ; shift += 7 { 1519 if shift >= 64 { 1520 return ErrIntOverflowPlacement 1521 } 1522 if iNdEx >= l { 1523 return io.ErrUnexpectedEOF 1524 } 1525 b := dAtA[iNdEx] 1526 iNdEx++ 1527 msglen |= (int(b) & 0x7F) << shift 1528 if b < 0x80 { 1529 break 1530 } 1531 } 1532 if msglen < 0 { 1533 return ErrInvalidLengthPlacement 1534 } 1535 postIndex := iNdEx + msglen 1536 if postIndex > l { 1537 return io.ErrUnexpectedEOF 1538 } 1539 if m.Placement == nil { 1540 m.Placement = &placementpb.Placement{} 1541 } 1542 if err := m.Placement.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1543 return err 1544 } 1545 iNdEx = postIndex 1546 case 2: 1547 if wireType != 0 { 1548 return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) 1549 } 1550 m.Version = 0 1551 for shift := uint(0); ; shift += 7 { 1552 if shift >= 64 { 1553 return ErrIntOverflowPlacement 1554 } 1555 if iNdEx >= l { 1556 return io.ErrUnexpectedEOF 1557 } 1558 b := dAtA[iNdEx] 1559 iNdEx++ 1560 m.Version |= (int32(b) & 0x7F) << shift 1561 if b < 0x80 { 1562 break 1563 } 1564 } 1565 case 3: 1566 if wireType != 0 { 1567 return fmt.Errorf("proto: wrong wireType = %d for field Confirm", wireType) 1568 } 1569 var v int 1570 for shift := uint(0); ; shift += 7 { 1571 if shift >= 64 { 1572 return ErrIntOverflowPlacement 1573 } 1574 if iNdEx >= l { 1575 return io.ErrUnexpectedEOF 1576 } 1577 b := dAtA[iNdEx] 1578 iNdEx++ 1579 v |= (int(b) & 0x7F) << shift 1580 if b < 0x80 { 1581 break 1582 } 1583 } 1584 m.Confirm = bool(v != 0) 1585 case 4: 1586 if wireType != 0 { 1587 return fmt.Errorf("proto: wrong wireType = %d for field Force", wireType) 1588 } 1589 var v int 1590 for shift := uint(0); ; shift += 7 { 1591 if shift >= 64 { 1592 return ErrIntOverflowPlacement 1593 } 1594 if iNdEx >= l { 1595 return io.ErrUnexpectedEOF 1596 } 1597 b := dAtA[iNdEx] 1598 iNdEx++ 1599 v |= (int(b) & 0x7F) << shift 1600 if b < 0x80 { 1601 break 1602 } 1603 } 1604 m.Force = bool(v != 0) 1605 default: 1606 iNdEx = preIndex 1607 skippy, err := skipPlacement(dAtA[iNdEx:]) 1608 if err != nil { 1609 return err 1610 } 1611 if skippy < 0 { 1612 return ErrInvalidLengthPlacement 1613 } 1614 if (iNdEx + skippy) > l { 1615 return io.ErrUnexpectedEOF 1616 } 1617 iNdEx += skippy 1618 } 1619 } 1620 1621 if iNdEx > l { 1622 return io.ErrUnexpectedEOF 1623 } 1624 return nil 1625 } 1626 func (m *PlacementSetResponse) Unmarshal(dAtA []byte) error { 1627 l := len(dAtA) 1628 iNdEx := 0 1629 for iNdEx < l { 1630 preIndex := iNdEx 1631 var wire uint64 1632 for shift := uint(0); ; shift += 7 { 1633 if shift >= 64 { 1634 return ErrIntOverflowPlacement 1635 } 1636 if iNdEx >= l { 1637 return io.ErrUnexpectedEOF 1638 } 1639 b := dAtA[iNdEx] 1640 iNdEx++ 1641 wire |= (uint64(b) & 0x7F) << shift 1642 if b < 0x80 { 1643 break 1644 } 1645 } 1646 fieldNum := int32(wire >> 3) 1647 wireType := int(wire & 0x7) 1648 if wireType == 4 { 1649 return fmt.Errorf("proto: PlacementSetResponse: wiretype end group for non-group") 1650 } 1651 if fieldNum <= 0 { 1652 return fmt.Errorf("proto: PlacementSetResponse: illegal tag %d (wire type %d)", fieldNum, wire) 1653 } 1654 switch fieldNum { 1655 case 1: 1656 if wireType != 2 { 1657 return fmt.Errorf("proto: wrong wireType = %d for field Placement", wireType) 1658 } 1659 var msglen int 1660 for shift := uint(0); ; shift += 7 { 1661 if shift >= 64 { 1662 return ErrIntOverflowPlacement 1663 } 1664 if iNdEx >= l { 1665 return io.ErrUnexpectedEOF 1666 } 1667 b := dAtA[iNdEx] 1668 iNdEx++ 1669 msglen |= (int(b) & 0x7F) << shift 1670 if b < 0x80 { 1671 break 1672 } 1673 } 1674 if msglen < 0 { 1675 return ErrInvalidLengthPlacement 1676 } 1677 postIndex := iNdEx + msglen 1678 if postIndex > l { 1679 return io.ErrUnexpectedEOF 1680 } 1681 if m.Placement == nil { 1682 m.Placement = &placementpb.Placement{} 1683 } 1684 if err := m.Placement.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1685 return err 1686 } 1687 iNdEx = postIndex 1688 case 2: 1689 if wireType != 0 { 1690 return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) 1691 } 1692 m.Version = 0 1693 for shift := uint(0); ; shift += 7 { 1694 if shift >= 64 { 1695 return ErrIntOverflowPlacement 1696 } 1697 if iNdEx >= l { 1698 return io.ErrUnexpectedEOF 1699 } 1700 b := dAtA[iNdEx] 1701 iNdEx++ 1702 m.Version |= (int32(b) & 0x7F) << shift 1703 if b < 0x80 { 1704 break 1705 } 1706 } 1707 case 3: 1708 if wireType != 0 { 1709 return fmt.Errorf("proto: wrong wireType = %d for field DryRun", wireType) 1710 } 1711 var v int 1712 for shift := uint(0); ; shift += 7 { 1713 if shift >= 64 { 1714 return ErrIntOverflowPlacement 1715 } 1716 if iNdEx >= l { 1717 return io.ErrUnexpectedEOF 1718 } 1719 b := dAtA[iNdEx] 1720 iNdEx++ 1721 v |= (int(b) & 0x7F) << shift 1722 if b < 0x80 { 1723 break 1724 } 1725 } 1726 m.DryRun = bool(v != 0) 1727 default: 1728 iNdEx = preIndex 1729 skippy, err := skipPlacement(dAtA[iNdEx:]) 1730 if err != nil { 1731 return err 1732 } 1733 if skippy < 0 { 1734 return ErrInvalidLengthPlacement 1735 } 1736 if (iNdEx + skippy) > l { 1737 return io.ErrUnexpectedEOF 1738 } 1739 iNdEx += skippy 1740 } 1741 } 1742 1743 if iNdEx > l { 1744 return io.ErrUnexpectedEOF 1745 } 1746 return nil 1747 } 1748 func skipPlacement(dAtA []byte) (n int, err error) { 1749 l := len(dAtA) 1750 iNdEx := 0 1751 for iNdEx < l { 1752 var wire uint64 1753 for shift := uint(0); ; shift += 7 { 1754 if shift >= 64 { 1755 return 0, ErrIntOverflowPlacement 1756 } 1757 if iNdEx >= l { 1758 return 0, io.ErrUnexpectedEOF 1759 } 1760 b := dAtA[iNdEx] 1761 iNdEx++ 1762 wire |= (uint64(b) & 0x7F) << shift 1763 if b < 0x80 { 1764 break 1765 } 1766 } 1767 wireType := int(wire & 0x7) 1768 switch wireType { 1769 case 0: 1770 for shift := uint(0); ; shift += 7 { 1771 if shift >= 64 { 1772 return 0, ErrIntOverflowPlacement 1773 } 1774 if iNdEx >= l { 1775 return 0, io.ErrUnexpectedEOF 1776 } 1777 iNdEx++ 1778 if dAtA[iNdEx-1] < 0x80 { 1779 break 1780 } 1781 } 1782 return iNdEx, nil 1783 case 1: 1784 iNdEx += 8 1785 return iNdEx, nil 1786 case 2: 1787 var length int 1788 for shift := uint(0); ; shift += 7 { 1789 if shift >= 64 { 1790 return 0, ErrIntOverflowPlacement 1791 } 1792 if iNdEx >= l { 1793 return 0, io.ErrUnexpectedEOF 1794 } 1795 b := dAtA[iNdEx] 1796 iNdEx++ 1797 length |= (int(b) & 0x7F) << shift 1798 if b < 0x80 { 1799 break 1800 } 1801 } 1802 iNdEx += length 1803 if length < 0 { 1804 return 0, ErrInvalidLengthPlacement 1805 } 1806 return iNdEx, nil 1807 case 3: 1808 for { 1809 var innerWire uint64 1810 var start int = iNdEx 1811 for shift := uint(0); ; shift += 7 { 1812 if shift >= 64 { 1813 return 0, ErrIntOverflowPlacement 1814 } 1815 if iNdEx >= l { 1816 return 0, io.ErrUnexpectedEOF 1817 } 1818 b := dAtA[iNdEx] 1819 iNdEx++ 1820 innerWire |= (uint64(b) & 0x7F) << shift 1821 if b < 0x80 { 1822 break 1823 } 1824 } 1825 innerWireType := int(innerWire & 0x7) 1826 if innerWireType == 4 { 1827 break 1828 } 1829 next, err := skipPlacement(dAtA[start:]) 1830 if err != nil { 1831 return 0, err 1832 } 1833 iNdEx = start + next 1834 } 1835 return iNdEx, nil 1836 case 4: 1837 return iNdEx, nil 1838 case 5: 1839 iNdEx += 4 1840 return iNdEx, nil 1841 default: 1842 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 1843 } 1844 } 1845 panic("unreachable") 1846 } 1847 1848 var ( 1849 ErrInvalidLengthPlacement = fmt.Errorf("proto: negative length found during unmarshaling") 1850 ErrIntOverflowPlacement = fmt.Errorf("proto: integer overflow") 1851 ) 1852 1853 func init() { 1854 proto.RegisterFile("github.com/m3db/m3/src/query/generated/proto/admin/placement.proto", fileDescriptorPlacement) 1855 } 1856 1857 var fileDescriptorPlacement = []byte{ 1858 // 475 bytes of a gzipped FileDescriptorProto 1859 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0xcd, 0x6e, 0x13, 0x31, 1860 0x10, 0xc6, 0x84, 0x14, 0x32, 0x41, 0xfc, 0x98, 0x10, 0x56, 0x48, 0x44, 0x21, 0xa7, 0x5c, 0xd8, 1861 0x95, 0x1a, 0x38, 0x72, 0xa0, 0x42, 0xa0, 0x70, 0x29, 0xda, 0x3c, 0x40, 0xe4, 0xd8, 0x93, 0xd4, 1862 0x52, 0xd6, 0xde, 0xda, 0xde, 0x48, 0xbd, 0xf0, 0x0c, 0xbd, 0x70, 0xe6, 0x75, 0x38, 0x72, 0x41, 1863 0xe2, 0x88, 0xc2, 0x8b, 0xa0, 0x3a, 0xeb, 0xdd, 0x2d, 0x3f, 0xbd, 0xb4, 0x3d, 0xce, 0xcc, 0x37, 1864 0x9f, 0xbf, 0x6f, 0x34, 0x63, 0x38, 0x58, 0x49, 0x77, 0x54, 0x2c, 0x62, 0xae, 0xb3, 0x24, 0x9b, 1865 0x88, 0x45, 0x92, 0x4d, 0x12, 0x6b, 0x78, 0x72, 0x5c, 0xa0, 0x39, 0x49, 0x56, 0xa8, 0xd0, 0x30, 1866 0x87, 0x22, 0xc9, 0x8d, 0x76, 0x3a, 0x61, 0x22, 0x93, 0x2a, 0xc9, 0xd7, 0x8c, 0x63, 0x86, 0xca, 1867 0xc5, 0x3e, 0x4b, 0xdb, 0x3e, 0xfd, 0xf4, 0xc3, 0x7f, 0xa8, 0xf8, 0xba, 0xb0, 0x0e, 0xcd, 0x5f, 1868 0x64, 0x15, 0x4d, 0xbe, 0xf8, 0x93, 0x72, 0xf4, 0x83, 0x40, 0xef, 0x63, 0xc8, 0x4d, 0x95, 0x74, 1869 0x29, 0x1e, 0x17, 0x68, 0x1d, 0x9d, 0x40, 0x47, 0x2a, 0xeb, 0x98, 0xe2, 0x68, 0x23, 0x32, 0x6c, 1870 0x8d, 0xbb, 0xfb, 0x8f, 0xe3, 0x06, 0x53, 0x3c, 0x2d, 0xab, 0x69, 0x8d, 0xa3, 0xcf, 0x00, 0x54, 1871 0x91, 0xcd, 0xed, 0x11, 0x33, 0xc2, 0x46, 0x37, 0x87, 0x64, 0xdc, 0x4e, 0x3b, 0xaa, 0xc8, 0x66, 1872 0x3e, 0x41, 0x5f, 0x00, 0x35, 0x98, 0xaf, 0x25, 0x67, 0x4e, 0x6a, 0x35, 0x5f, 0x32, 0xee, 0xb4, 1873 0x89, 0x5a, 0x1e, 0xf6, 0xb0, 0x51, 0x79, 0xe7, 0x0b, 0xf4, 0x35, 0xdc, 0xd7, 0xb9, 0x47, 0xea, 1874 0x0d, 0x1a, 0x23, 0x05, 0x46, 0x7c, 0x48, 0xc6, 0xdd, 0xfd, 0xde, 0x39, 0x21, 0x87, 0x1e, 0x63, 1875 0xd3, 0x7b, 0x3b, 0xf0, 0x61, 0x89, 0x1d, 0x2d, 0x1b, 0xce, 0xde, 0xa3, 0x4b, 0xd1, 0xe6, 0x5a, 1876 0x59, 0xa4, 0x2f, 0xa1, 0x53, 0xb5, 0x47, 0xc4, 0x13, 0xf6, 0xcf, 0x11, 0x56, 0x5d, 0x69, 0x0d, 1877 0xa4, 0x11, 0xdc, 0xde, 0xa0, 0xb1, 0x52, 0xab, 0xd2, 0x57, 0x08, 0x47, 0x5f, 0x08, 0x3c, 0xaa, 1878 0x5a, 0xde, 0x08, 0x71, 0xa9, 0x09, 0xf6, 0xa0, 0xbd, 0xd4, 0x86, 0xa3, 0x7f, 0xe4, 0x4e, 0xba, 1879 0x0b, 0x2e, 0x3b, 0x89, 0x53, 0x02, 0xfd, 0xda, 0x14, 0x66, 0x7a, 0x83, 0x41, 0xe4, 0x73, 0xb8, 1880 0x1b, 0x1e, 0x9f, 0x4b, 0xb1, 0xd3, 0xd9, 0x49, 0xbb, 0x21, 0x37, 0x15, 0xd7, 0x24, 0xe9, 0x3b, 1881 0x81, 0x27, 0x0d, 0x49, 0xbe, 0x25, 0x68, 0x8a, 0x81, 0xae, 0x91, 0x6d, 0xa4, 0x5a, 0x85, 0x09, 1882 0x4d, 0xdf, 0x06, 0x65, 0xff, 0xa8, 0xd0, 0x57, 0x00, 0x9c, 0x29, 0x21, 0x05, 0x73, 0x78, 0xb6, 1883 0x75, 0x17, 0x4c, 0xba, 0x01, 0xac, 0x7d, 0xb5, 0xae, 0xd0, 0xd7, 0xe7, 0xe6, 0x32, 0xcc, 0xb0, 1884 0x3a, 0xa7, 0x2b, 0x5e, 0xba, 0xb3, 0x0a, 0xd7, 0x6a, 0x29, 0x4d, 0x56, 0xca, 0x0f, 0x61, 0x6d, 1885 0xeb, 0x56, 0xc3, 0xd6, 0xe8, 0x53, 0xe3, 0x18, 0x66, 0xd7, 0x77, 0x0c, 0xb4, 0x0f, 0x7b, 0xc2, 1886 0x9c, 0xa4, 0x85, 0x2a, 0x65, 0x95, 0xd1, 0xc1, 0x83, 0xaf, 0xdb, 0x01, 0xf9, 0xb6, 0x1d, 0x90, 1887 0x9f, 0xdb, 0x01, 0x39, 0xfd, 0x35, 0xb8, 0xb1, 0xd8, 0xf3, 0x1f, 0xd0, 0xe4, 0x77, 0x00, 0x00, 1888 0x00, 0xff, 0xff, 0x8c, 0x7a, 0x08, 0x16, 0x19, 0x05, 0x00, 0x00, 1889 }