github.com/m3db/m3@v1.5.0/src/cluster/generated/proto/placementpb/placement.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: github.com/m3db/m3/src/cluster/generated/proto/placementpb/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  /*
    25  	Package placementpb is a generated protocol buffer package.
    26  
    27  	It is generated from these files:
    28  		github.com/m3db/m3/src/cluster/generated/proto/placementpb/placement.proto
    29  
    30  	It has these top-level messages:
    31  		Placement
    32  		Instance
    33  		InstanceMetadata
    34  		Shard
    35  		PlacementSnapshots
    36  		Options
    37  */
    38  package placementpb
    39  
    40  import proto "github.com/gogo/protobuf/proto"
    41  import fmt "fmt"
    42  import math "math"
    43  import google_protobuf "github.com/gogo/protobuf/types"
    44  
    45  import io "io"
    46  
    47  // Reference imports to suppress errors if they are not otherwise used.
    48  var _ = proto.Marshal
    49  var _ = fmt.Errorf
    50  var _ = math.Inf
    51  
    52  // This is a compile-time assertion to ensure that this generated file
    53  // is compatible with the proto package it is being compiled against.
    54  // A compilation error at this line likely means your copy of the
    55  // proto package needs to be updated.
    56  const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
    57  
    58  type ShardState int32
    59  
    60  const (
    61  	ShardState_INITIALIZING ShardState = 0
    62  	ShardState_AVAILABLE    ShardState = 1
    63  	ShardState_LEAVING      ShardState = 2
    64  )
    65  
    66  var ShardState_name = map[int32]string{
    67  	0: "INITIALIZING",
    68  	1: "AVAILABLE",
    69  	2: "LEAVING",
    70  }
    71  var ShardState_value = map[string]int32{
    72  	"INITIALIZING": 0,
    73  	"AVAILABLE":    1,
    74  	"LEAVING":      2,
    75  }
    76  
    77  func (x ShardState) String() string {
    78  	return proto.EnumName(ShardState_name, int32(x))
    79  }
    80  func (ShardState) EnumDescriptor() ([]byte, []int) { return fileDescriptorPlacement, []int{0} }
    81  
    82  type CompressMode int32
    83  
    84  const (
    85  	CompressMode_NONE CompressMode = 0
    86  	CompressMode_ZSTD CompressMode = 1
    87  )
    88  
    89  var CompressMode_name = map[int32]string{
    90  	0: "NONE",
    91  	1: "ZSTD",
    92  }
    93  var CompressMode_value = map[string]int32{
    94  	"NONE": 0,
    95  	"ZSTD": 1,
    96  }
    97  
    98  func (x CompressMode) String() string {
    99  	return proto.EnumName(CompressMode_name, int32(x))
   100  }
   101  func (CompressMode) EnumDescriptor() ([]byte, []int) { return fileDescriptorPlacement, []int{1} }
   102  
   103  type Placement struct {
   104  	Instances     map[string]*Instance `protobuf:"bytes,1,rep,name=instances" json:"instances,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value"`
   105  	ReplicaFactor uint32               `protobuf:"varint,2,opt,name=replica_factor,json=replicaFactor,proto3" json:"replica_factor,omitempty"`
   106  	NumShards     uint32               `protobuf:"varint,3,opt,name=num_shards,json=numShards,proto3" json:"num_shards,omitempty"`
   107  	IsSharded     bool                 `protobuf:"varint,4,opt,name=is_sharded,json=isSharded,proto3" json:"is_sharded,omitempty"`
   108  	// cutover_time is the placement-level cutover time and determines when the clients
   109  	// watching the placement deems the placement as "in effect" and can use it to determine
   110  	// shard placement.
   111  	CutoverTime int64 `protobuf:"varint,5,opt,name=cutover_time,json=cutoverTime,proto3" json:"cutover_time,omitempty"`
   112  	IsMirrored  bool  `protobuf:"varint,6,opt,name=is_mirrored,json=isMirrored,proto3" json:"is_mirrored,omitempty"`
   113  	// max_shard_set_id stores the maximum shard set id used to guarantee unique
   114  	// shard set id generations across placement changes.
   115  	MaxShardSetId uint32 `protobuf:"varint,7,opt,name=max_shard_set_id,json=maxShardSetId,proto3" json:"max_shard_set_id,omitempty"`
   116  }
   117  
   118  func (m *Placement) Reset()                    { *m = Placement{} }
   119  func (m *Placement) String() string            { return proto.CompactTextString(m) }
   120  func (*Placement) ProtoMessage()               {}
   121  func (*Placement) Descriptor() ([]byte, []int) { return fileDescriptorPlacement, []int{0} }
   122  
   123  func (m *Placement) GetInstances() map[string]*Instance {
   124  	if m != nil {
   125  		return m.Instances
   126  	}
   127  	return nil
   128  }
   129  
   130  func (m *Placement) GetReplicaFactor() uint32 {
   131  	if m != nil {
   132  		return m.ReplicaFactor
   133  	}
   134  	return 0
   135  }
   136  
   137  func (m *Placement) GetNumShards() uint32 {
   138  	if m != nil {
   139  		return m.NumShards
   140  	}
   141  	return 0
   142  }
   143  
   144  func (m *Placement) GetIsSharded() bool {
   145  	if m != nil {
   146  		return m.IsSharded
   147  	}
   148  	return false
   149  }
   150  
   151  func (m *Placement) GetCutoverTime() int64 {
   152  	if m != nil {
   153  		return m.CutoverTime
   154  	}
   155  	return 0
   156  }
   157  
   158  func (m *Placement) GetIsMirrored() bool {
   159  	if m != nil {
   160  		return m.IsMirrored
   161  	}
   162  	return false
   163  }
   164  
   165  func (m *Placement) GetMaxShardSetId() uint32 {
   166  	if m != nil {
   167  		return m.MaxShardSetId
   168  	}
   169  	return 0
   170  }
   171  
   172  type Instance struct {
   173  	Id             string            `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
   174  	IsolationGroup string            `protobuf:"bytes,2,opt,name=isolation_group,json=isolationGroup,proto3" json:"isolation_group,omitempty"`
   175  	Zone           string            `protobuf:"bytes,3,opt,name=zone,proto3" json:"zone,omitempty"`
   176  	Weight         uint32            `protobuf:"varint,4,opt,name=weight,proto3" json:"weight,omitempty"`
   177  	Endpoint       string            `protobuf:"bytes,5,opt,name=endpoint,proto3" json:"endpoint,omitempty"`
   178  	Shards         []*Shard          `protobuf:"bytes,6,rep,name=shards" json:"shards,omitempty"`
   179  	ShardSetId     uint32            `protobuf:"varint,7,opt,name=shard_set_id,json=shardSetId,proto3" json:"shard_set_id,omitempty"`
   180  	Hostname       string            `protobuf:"bytes,8,opt,name=hostname,proto3" json:"hostname,omitempty"`
   181  	Port           uint32            `protobuf:"varint,9,opt,name=port,proto3" json:"port,omitempty"`
   182  	Metadata       *InstanceMetadata `protobuf:"bytes,10,opt,name=metadata" json:"metadata,omitempty"`
   183  }
   184  
   185  func (m *Instance) Reset()                    { *m = Instance{} }
   186  func (m *Instance) String() string            { return proto.CompactTextString(m) }
   187  func (*Instance) ProtoMessage()               {}
   188  func (*Instance) Descriptor() ([]byte, []int) { return fileDescriptorPlacement, []int{1} }
   189  
   190  func (m *Instance) GetId() string {
   191  	if m != nil {
   192  		return m.Id
   193  	}
   194  	return ""
   195  }
   196  
   197  func (m *Instance) GetIsolationGroup() string {
   198  	if m != nil {
   199  		return m.IsolationGroup
   200  	}
   201  	return ""
   202  }
   203  
   204  func (m *Instance) GetZone() string {
   205  	if m != nil {
   206  		return m.Zone
   207  	}
   208  	return ""
   209  }
   210  
   211  func (m *Instance) GetWeight() uint32 {
   212  	if m != nil {
   213  		return m.Weight
   214  	}
   215  	return 0
   216  }
   217  
   218  func (m *Instance) GetEndpoint() string {
   219  	if m != nil {
   220  		return m.Endpoint
   221  	}
   222  	return ""
   223  }
   224  
   225  func (m *Instance) GetShards() []*Shard {
   226  	if m != nil {
   227  		return m.Shards
   228  	}
   229  	return nil
   230  }
   231  
   232  func (m *Instance) GetShardSetId() uint32 {
   233  	if m != nil {
   234  		return m.ShardSetId
   235  	}
   236  	return 0
   237  }
   238  
   239  func (m *Instance) GetHostname() string {
   240  	if m != nil {
   241  		return m.Hostname
   242  	}
   243  	return ""
   244  }
   245  
   246  func (m *Instance) GetPort() uint32 {
   247  	if m != nil {
   248  		return m.Port
   249  	}
   250  	return 0
   251  }
   252  
   253  func (m *Instance) GetMetadata() *InstanceMetadata {
   254  	if m != nil {
   255  		return m.Metadata
   256  	}
   257  	return nil
   258  }
   259  
   260  type InstanceMetadata struct {
   261  	DebugPort uint32 `protobuf:"varint,1,opt,name=debug_port,json=debugPort,proto3" json:"debug_port,omitempty"`
   262  }
   263  
   264  func (m *InstanceMetadata) Reset()                    { *m = InstanceMetadata{} }
   265  func (m *InstanceMetadata) String() string            { return proto.CompactTextString(m) }
   266  func (*InstanceMetadata) ProtoMessage()               {}
   267  func (*InstanceMetadata) Descriptor() ([]byte, []int) { return fileDescriptorPlacement, []int{2} }
   268  
   269  func (m *InstanceMetadata) GetDebugPort() uint32 {
   270  	if m != nil {
   271  		return m.DebugPort
   272  	}
   273  	return 0
   274  }
   275  
   276  type Shard struct {
   277  	Id       uint32     `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
   278  	State    ShardState `protobuf:"varint,2,opt,name=state,proto3,enum=placementpb.ShardState" json:"state,omitempty"`
   279  	SourceId string     `protobuf:"bytes,3,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"`
   280  	// Shard-level cutover and cutoff times determine when the shards have been cut over or
   281  	// cut off from the source instance to the destination instance. The placement-level
   282  	// cutover times are usually (but not required to be) earlier than shard-level cutover
   283  	// times if the clients watching the placement need to send traffic to the shards before
   284  	// they are ready to cut over or after they are ready to cut off (e.g., for warmup purposes).
   285  	CutoverNanos int64 `protobuf:"varint,4,opt,name=cutover_nanos,json=cutoverNanos,proto3" json:"cutover_nanos,omitempty"`
   286  	CutoffNanos  int64 `protobuf:"varint,5,opt,name=cutoff_nanos,json=cutoffNanos,proto3" json:"cutoff_nanos,omitempty"`
   287  	// redirect_to_shard_id is used during resharding process.
   288  	// If set, all the incoming writes will be redirected to the specified shard.
   289  	RedirectToShardId *google_protobuf.UInt32Value `protobuf:"bytes,6,opt,name=redirect_to_shard_id,json=redirectToShardId" json:"redirect_to_shard_id,omitempty"`
   290  }
   291  
   292  func (m *Shard) Reset()                    { *m = Shard{} }
   293  func (m *Shard) String() string            { return proto.CompactTextString(m) }
   294  func (*Shard) ProtoMessage()               {}
   295  func (*Shard) Descriptor() ([]byte, []int) { return fileDescriptorPlacement, []int{3} }
   296  
   297  func (m *Shard) GetId() uint32 {
   298  	if m != nil {
   299  		return m.Id
   300  	}
   301  	return 0
   302  }
   303  
   304  func (m *Shard) GetState() ShardState {
   305  	if m != nil {
   306  		return m.State
   307  	}
   308  	return ShardState_INITIALIZING
   309  }
   310  
   311  func (m *Shard) GetSourceId() string {
   312  	if m != nil {
   313  		return m.SourceId
   314  	}
   315  	return ""
   316  }
   317  
   318  func (m *Shard) GetCutoverNanos() int64 {
   319  	if m != nil {
   320  		return m.CutoverNanos
   321  	}
   322  	return 0
   323  }
   324  
   325  func (m *Shard) GetCutoffNanos() int64 {
   326  	if m != nil {
   327  		return m.CutoffNanos
   328  	}
   329  	return 0
   330  }
   331  
   332  func (m *Shard) GetRedirectToShardId() *google_protobuf.UInt32Value {
   333  	if m != nil {
   334  		return m.RedirectToShardId
   335  	}
   336  	return nil
   337  }
   338  
   339  type PlacementSnapshots struct {
   340  	// snapshots field is used only when compress_mode == NONE.
   341  	Snapshots           []*Placement `protobuf:"bytes,1,rep,name=snapshots" json:"snapshots,omitempty"`
   342  	CompressMode        CompressMode `protobuf:"varint,2,opt,name=compress_mode,json=compressMode,proto3,enum=placementpb.CompressMode" json:"compress_mode,omitempty"`
   343  	CompressedPlacement []byte       `protobuf:"bytes,3,opt,name=compressed_placement,json=compressedPlacement,proto3" json:"compressed_placement,omitempty"`
   344  }
   345  
   346  func (m *PlacementSnapshots) Reset()                    { *m = PlacementSnapshots{} }
   347  func (m *PlacementSnapshots) String() string            { return proto.CompactTextString(m) }
   348  func (*PlacementSnapshots) ProtoMessage()               {}
   349  func (*PlacementSnapshots) Descriptor() ([]byte, []int) { return fileDescriptorPlacement, []int{4} }
   350  
   351  func (m *PlacementSnapshots) GetSnapshots() []*Placement {
   352  	if m != nil {
   353  		return m.Snapshots
   354  	}
   355  	return nil
   356  }
   357  
   358  func (m *PlacementSnapshots) GetCompressMode() CompressMode {
   359  	if m != nil {
   360  		return m.CompressMode
   361  	}
   362  	return CompressMode_NONE
   363  }
   364  
   365  func (m *PlacementSnapshots) GetCompressedPlacement() []byte {
   366  	if m != nil {
   367  		return m.CompressedPlacement
   368  	}
   369  	return nil
   370  }
   371  
   372  type Options struct {
   373  	IsSharded         *google_protobuf.BoolValue `protobuf:"bytes,1,opt,name=is_sharded,json=isSharded" json:"is_sharded,omitempty"`
   374  	SkipPortMirroring *google_protobuf.BoolValue `protobuf:"bytes,2,opt,name=skip_port_mirroring,json=skipPortMirroring" json:"skip_port_mirroring,omitempty"`
   375  }
   376  
   377  func (m *Options) Reset()                    { *m = Options{} }
   378  func (m *Options) String() string            { return proto.CompactTextString(m) }
   379  func (*Options) ProtoMessage()               {}
   380  func (*Options) Descriptor() ([]byte, []int) { return fileDescriptorPlacement, []int{5} }
   381  
   382  func (m *Options) GetIsSharded() *google_protobuf.BoolValue {
   383  	if m != nil {
   384  		return m.IsSharded
   385  	}
   386  	return nil
   387  }
   388  
   389  func (m *Options) GetSkipPortMirroring() *google_protobuf.BoolValue {
   390  	if m != nil {
   391  		return m.SkipPortMirroring
   392  	}
   393  	return nil
   394  }
   395  
   396  func init() {
   397  	proto.RegisterType((*Placement)(nil), "placementpb.Placement")
   398  	proto.RegisterType((*Instance)(nil), "placementpb.Instance")
   399  	proto.RegisterType((*InstanceMetadata)(nil), "placementpb.InstanceMetadata")
   400  	proto.RegisterType((*Shard)(nil), "placementpb.Shard")
   401  	proto.RegisterType((*PlacementSnapshots)(nil), "placementpb.PlacementSnapshots")
   402  	proto.RegisterType((*Options)(nil), "placementpb.Options")
   403  	proto.RegisterEnum("placementpb.ShardState", ShardState_name, ShardState_value)
   404  	proto.RegisterEnum("placementpb.CompressMode", CompressMode_name, CompressMode_value)
   405  }
   406  func (m *Placement) Marshal() (dAtA []byte, err error) {
   407  	size := m.Size()
   408  	dAtA = make([]byte, size)
   409  	n, err := m.MarshalTo(dAtA)
   410  	if err != nil {
   411  		return nil, err
   412  	}
   413  	return dAtA[:n], nil
   414  }
   415  
   416  func (m *Placement) MarshalTo(dAtA []byte) (int, error) {
   417  	var i int
   418  	_ = i
   419  	var l int
   420  	_ = l
   421  	if len(m.Instances) > 0 {
   422  		for k, _ := range m.Instances {
   423  			dAtA[i] = 0xa
   424  			i++
   425  			v := m.Instances[k]
   426  			msgSize := 0
   427  			if v != nil {
   428  				msgSize = v.Size()
   429  				msgSize += 1 + sovPlacement(uint64(msgSize))
   430  			}
   431  			mapSize := 1 + len(k) + sovPlacement(uint64(len(k))) + msgSize
   432  			i = encodeVarintPlacement(dAtA, i, uint64(mapSize))
   433  			dAtA[i] = 0xa
   434  			i++
   435  			i = encodeVarintPlacement(dAtA, i, uint64(len(k)))
   436  			i += copy(dAtA[i:], k)
   437  			if v != nil {
   438  				dAtA[i] = 0x12
   439  				i++
   440  				i = encodeVarintPlacement(dAtA, i, uint64(v.Size()))
   441  				n1, err := v.MarshalTo(dAtA[i:])
   442  				if err != nil {
   443  					return 0, err
   444  				}
   445  				i += n1
   446  			}
   447  		}
   448  	}
   449  	if m.ReplicaFactor != 0 {
   450  		dAtA[i] = 0x10
   451  		i++
   452  		i = encodeVarintPlacement(dAtA, i, uint64(m.ReplicaFactor))
   453  	}
   454  	if m.NumShards != 0 {
   455  		dAtA[i] = 0x18
   456  		i++
   457  		i = encodeVarintPlacement(dAtA, i, uint64(m.NumShards))
   458  	}
   459  	if m.IsSharded {
   460  		dAtA[i] = 0x20
   461  		i++
   462  		if m.IsSharded {
   463  			dAtA[i] = 1
   464  		} else {
   465  			dAtA[i] = 0
   466  		}
   467  		i++
   468  	}
   469  	if m.CutoverTime != 0 {
   470  		dAtA[i] = 0x28
   471  		i++
   472  		i = encodeVarintPlacement(dAtA, i, uint64(m.CutoverTime))
   473  	}
   474  	if m.IsMirrored {
   475  		dAtA[i] = 0x30
   476  		i++
   477  		if m.IsMirrored {
   478  			dAtA[i] = 1
   479  		} else {
   480  			dAtA[i] = 0
   481  		}
   482  		i++
   483  	}
   484  	if m.MaxShardSetId != 0 {
   485  		dAtA[i] = 0x38
   486  		i++
   487  		i = encodeVarintPlacement(dAtA, i, uint64(m.MaxShardSetId))
   488  	}
   489  	return i, nil
   490  }
   491  
   492  func (m *Instance) Marshal() (dAtA []byte, err error) {
   493  	size := m.Size()
   494  	dAtA = make([]byte, size)
   495  	n, err := m.MarshalTo(dAtA)
   496  	if err != nil {
   497  		return nil, err
   498  	}
   499  	return dAtA[:n], nil
   500  }
   501  
   502  func (m *Instance) MarshalTo(dAtA []byte) (int, error) {
   503  	var i int
   504  	_ = i
   505  	var l int
   506  	_ = l
   507  	if len(m.Id) > 0 {
   508  		dAtA[i] = 0xa
   509  		i++
   510  		i = encodeVarintPlacement(dAtA, i, uint64(len(m.Id)))
   511  		i += copy(dAtA[i:], m.Id)
   512  	}
   513  	if len(m.IsolationGroup) > 0 {
   514  		dAtA[i] = 0x12
   515  		i++
   516  		i = encodeVarintPlacement(dAtA, i, uint64(len(m.IsolationGroup)))
   517  		i += copy(dAtA[i:], m.IsolationGroup)
   518  	}
   519  	if len(m.Zone) > 0 {
   520  		dAtA[i] = 0x1a
   521  		i++
   522  		i = encodeVarintPlacement(dAtA, i, uint64(len(m.Zone)))
   523  		i += copy(dAtA[i:], m.Zone)
   524  	}
   525  	if m.Weight != 0 {
   526  		dAtA[i] = 0x20
   527  		i++
   528  		i = encodeVarintPlacement(dAtA, i, uint64(m.Weight))
   529  	}
   530  	if len(m.Endpoint) > 0 {
   531  		dAtA[i] = 0x2a
   532  		i++
   533  		i = encodeVarintPlacement(dAtA, i, uint64(len(m.Endpoint)))
   534  		i += copy(dAtA[i:], m.Endpoint)
   535  	}
   536  	if len(m.Shards) > 0 {
   537  		for _, msg := range m.Shards {
   538  			dAtA[i] = 0x32
   539  			i++
   540  			i = encodeVarintPlacement(dAtA, i, uint64(msg.Size()))
   541  			n, err := msg.MarshalTo(dAtA[i:])
   542  			if err != nil {
   543  				return 0, err
   544  			}
   545  			i += n
   546  		}
   547  	}
   548  	if m.ShardSetId != 0 {
   549  		dAtA[i] = 0x38
   550  		i++
   551  		i = encodeVarintPlacement(dAtA, i, uint64(m.ShardSetId))
   552  	}
   553  	if len(m.Hostname) > 0 {
   554  		dAtA[i] = 0x42
   555  		i++
   556  		i = encodeVarintPlacement(dAtA, i, uint64(len(m.Hostname)))
   557  		i += copy(dAtA[i:], m.Hostname)
   558  	}
   559  	if m.Port != 0 {
   560  		dAtA[i] = 0x48
   561  		i++
   562  		i = encodeVarintPlacement(dAtA, i, uint64(m.Port))
   563  	}
   564  	if m.Metadata != nil {
   565  		dAtA[i] = 0x52
   566  		i++
   567  		i = encodeVarintPlacement(dAtA, i, uint64(m.Metadata.Size()))
   568  		n2, err := m.Metadata.MarshalTo(dAtA[i:])
   569  		if err != nil {
   570  			return 0, err
   571  		}
   572  		i += n2
   573  	}
   574  	return i, nil
   575  }
   576  
   577  func (m *InstanceMetadata) Marshal() (dAtA []byte, err error) {
   578  	size := m.Size()
   579  	dAtA = make([]byte, size)
   580  	n, err := m.MarshalTo(dAtA)
   581  	if err != nil {
   582  		return nil, err
   583  	}
   584  	return dAtA[:n], nil
   585  }
   586  
   587  func (m *InstanceMetadata) MarshalTo(dAtA []byte) (int, error) {
   588  	var i int
   589  	_ = i
   590  	var l int
   591  	_ = l
   592  	if m.DebugPort != 0 {
   593  		dAtA[i] = 0x8
   594  		i++
   595  		i = encodeVarintPlacement(dAtA, i, uint64(m.DebugPort))
   596  	}
   597  	return i, nil
   598  }
   599  
   600  func (m *Shard) Marshal() (dAtA []byte, err error) {
   601  	size := m.Size()
   602  	dAtA = make([]byte, size)
   603  	n, err := m.MarshalTo(dAtA)
   604  	if err != nil {
   605  		return nil, err
   606  	}
   607  	return dAtA[:n], nil
   608  }
   609  
   610  func (m *Shard) MarshalTo(dAtA []byte) (int, error) {
   611  	var i int
   612  	_ = i
   613  	var l int
   614  	_ = l
   615  	if m.Id != 0 {
   616  		dAtA[i] = 0x8
   617  		i++
   618  		i = encodeVarintPlacement(dAtA, i, uint64(m.Id))
   619  	}
   620  	if m.State != 0 {
   621  		dAtA[i] = 0x10
   622  		i++
   623  		i = encodeVarintPlacement(dAtA, i, uint64(m.State))
   624  	}
   625  	if len(m.SourceId) > 0 {
   626  		dAtA[i] = 0x1a
   627  		i++
   628  		i = encodeVarintPlacement(dAtA, i, uint64(len(m.SourceId)))
   629  		i += copy(dAtA[i:], m.SourceId)
   630  	}
   631  	if m.CutoverNanos != 0 {
   632  		dAtA[i] = 0x20
   633  		i++
   634  		i = encodeVarintPlacement(dAtA, i, uint64(m.CutoverNanos))
   635  	}
   636  	if m.CutoffNanos != 0 {
   637  		dAtA[i] = 0x28
   638  		i++
   639  		i = encodeVarintPlacement(dAtA, i, uint64(m.CutoffNanos))
   640  	}
   641  	if m.RedirectToShardId != nil {
   642  		dAtA[i] = 0x32
   643  		i++
   644  		i = encodeVarintPlacement(dAtA, i, uint64(m.RedirectToShardId.Size()))
   645  		n3, err := m.RedirectToShardId.MarshalTo(dAtA[i:])
   646  		if err != nil {
   647  			return 0, err
   648  		}
   649  		i += n3
   650  	}
   651  	return i, nil
   652  }
   653  
   654  func (m *PlacementSnapshots) Marshal() (dAtA []byte, err error) {
   655  	size := m.Size()
   656  	dAtA = make([]byte, size)
   657  	n, err := m.MarshalTo(dAtA)
   658  	if err != nil {
   659  		return nil, err
   660  	}
   661  	return dAtA[:n], nil
   662  }
   663  
   664  func (m *PlacementSnapshots) MarshalTo(dAtA []byte) (int, error) {
   665  	var i int
   666  	_ = i
   667  	var l int
   668  	_ = l
   669  	if len(m.Snapshots) > 0 {
   670  		for _, msg := range m.Snapshots {
   671  			dAtA[i] = 0xa
   672  			i++
   673  			i = encodeVarintPlacement(dAtA, i, uint64(msg.Size()))
   674  			n, err := msg.MarshalTo(dAtA[i:])
   675  			if err != nil {
   676  				return 0, err
   677  			}
   678  			i += n
   679  		}
   680  	}
   681  	if m.CompressMode != 0 {
   682  		dAtA[i] = 0x10
   683  		i++
   684  		i = encodeVarintPlacement(dAtA, i, uint64(m.CompressMode))
   685  	}
   686  	if len(m.CompressedPlacement) > 0 {
   687  		dAtA[i] = 0x1a
   688  		i++
   689  		i = encodeVarintPlacement(dAtA, i, uint64(len(m.CompressedPlacement)))
   690  		i += copy(dAtA[i:], m.CompressedPlacement)
   691  	}
   692  	return i, nil
   693  }
   694  
   695  func (m *Options) Marshal() (dAtA []byte, err error) {
   696  	size := m.Size()
   697  	dAtA = make([]byte, size)
   698  	n, err := m.MarshalTo(dAtA)
   699  	if err != nil {
   700  		return nil, err
   701  	}
   702  	return dAtA[:n], nil
   703  }
   704  
   705  func (m *Options) MarshalTo(dAtA []byte) (int, error) {
   706  	var i int
   707  	_ = i
   708  	var l int
   709  	_ = l
   710  	if m.IsSharded != nil {
   711  		dAtA[i] = 0xa
   712  		i++
   713  		i = encodeVarintPlacement(dAtA, i, uint64(m.IsSharded.Size()))
   714  		n4, err := m.IsSharded.MarshalTo(dAtA[i:])
   715  		if err != nil {
   716  			return 0, err
   717  		}
   718  		i += n4
   719  	}
   720  	if m.SkipPortMirroring != nil {
   721  		dAtA[i] = 0x12
   722  		i++
   723  		i = encodeVarintPlacement(dAtA, i, uint64(m.SkipPortMirroring.Size()))
   724  		n5, err := m.SkipPortMirroring.MarshalTo(dAtA[i:])
   725  		if err != nil {
   726  			return 0, err
   727  		}
   728  		i += n5
   729  	}
   730  	return i, nil
   731  }
   732  
   733  func encodeVarintPlacement(dAtA []byte, offset int, v uint64) int {
   734  	for v >= 1<<7 {
   735  		dAtA[offset] = uint8(v&0x7f | 0x80)
   736  		v >>= 7
   737  		offset++
   738  	}
   739  	dAtA[offset] = uint8(v)
   740  	return offset + 1
   741  }
   742  func (m *Placement) Size() (n int) {
   743  	var l int
   744  	_ = l
   745  	if len(m.Instances) > 0 {
   746  		for k, v := range m.Instances {
   747  			_ = k
   748  			_ = v
   749  			l = 0
   750  			if v != nil {
   751  				l = v.Size()
   752  				l += 1 + sovPlacement(uint64(l))
   753  			}
   754  			mapEntrySize := 1 + len(k) + sovPlacement(uint64(len(k))) + l
   755  			n += mapEntrySize + 1 + sovPlacement(uint64(mapEntrySize))
   756  		}
   757  	}
   758  	if m.ReplicaFactor != 0 {
   759  		n += 1 + sovPlacement(uint64(m.ReplicaFactor))
   760  	}
   761  	if m.NumShards != 0 {
   762  		n += 1 + sovPlacement(uint64(m.NumShards))
   763  	}
   764  	if m.IsSharded {
   765  		n += 2
   766  	}
   767  	if m.CutoverTime != 0 {
   768  		n += 1 + sovPlacement(uint64(m.CutoverTime))
   769  	}
   770  	if m.IsMirrored {
   771  		n += 2
   772  	}
   773  	if m.MaxShardSetId != 0 {
   774  		n += 1 + sovPlacement(uint64(m.MaxShardSetId))
   775  	}
   776  	return n
   777  }
   778  
   779  func (m *Instance) Size() (n int) {
   780  	var l int
   781  	_ = l
   782  	l = len(m.Id)
   783  	if l > 0 {
   784  		n += 1 + l + sovPlacement(uint64(l))
   785  	}
   786  	l = len(m.IsolationGroup)
   787  	if l > 0 {
   788  		n += 1 + l + sovPlacement(uint64(l))
   789  	}
   790  	l = len(m.Zone)
   791  	if l > 0 {
   792  		n += 1 + l + sovPlacement(uint64(l))
   793  	}
   794  	if m.Weight != 0 {
   795  		n += 1 + sovPlacement(uint64(m.Weight))
   796  	}
   797  	l = len(m.Endpoint)
   798  	if l > 0 {
   799  		n += 1 + l + sovPlacement(uint64(l))
   800  	}
   801  	if len(m.Shards) > 0 {
   802  		for _, e := range m.Shards {
   803  			l = e.Size()
   804  			n += 1 + l + sovPlacement(uint64(l))
   805  		}
   806  	}
   807  	if m.ShardSetId != 0 {
   808  		n += 1 + sovPlacement(uint64(m.ShardSetId))
   809  	}
   810  	l = len(m.Hostname)
   811  	if l > 0 {
   812  		n += 1 + l + sovPlacement(uint64(l))
   813  	}
   814  	if m.Port != 0 {
   815  		n += 1 + sovPlacement(uint64(m.Port))
   816  	}
   817  	if m.Metadata != nil {
   818  		l = m.Metadata.Size()
   819  		n += 1 + l + sovPlacement(uint64(l))
   820  	}
   821  	return n
   822  }
   823  
   824  func (m *InstanceMetadata) Size() (n int) {
   825  	var l int
   826  	_ = l
   827  	if m.DebugPort != 0 {
   828  		n += 1 + sovPlacement(uint64(m.DebugPort))
   829  	}
   830  	return n
   831  }
   832  
   833  func (m *Shard) Size() (n int) {
   834  	var l int
   835  	_ = l
   836  	if m.Id != 0 {
   837  		n += 1 + sovPlacement(uint64(m.Id))
   838  	}
   839  	if m.State != 0 {
   840  		n += 1 + sovPlacement(uint64(m.State))
   841  	}
   842  	l = len(m.SourceId)
   843  	if l > 0 {
   844  		n += 1 + l + sovPlacement(uint64(l))
   845  	}
   846  	if m.CutoverNanos != 0 {
   847  		n += 1 + sovPlacement(uint64(m.CutoverNanos))
   848  	}
   849  	if m.CutoffNanos != 0 {
   850  		n += 1 + sovPlacement(uint64(m.CutoffNanos))
   851  	}
   852  	if m.RedirectToShardId != nil {
   853  		l = m.RedirectToShardId.Size()
   854  		n += 1 + l + sovPlacement(uint64(l))
   855  	}
   856  	return n
   857  }
   858  
   859  func (m *PlacementSnapshots) Size() (n int) {
   860  	var l int
   861  	_ = l
   862  	if len(m.Snapshots) > 0 {
   863  		for _, e := range m.Snapshots {
   864  			l = e.Size()
   865  			n += 1 + l + sovPlacement(uint64(l))
   866  		}
   867  	}
   868  	if m.CompressMode != 0 {
   869  		n += 1 + sovPlacement(uint64(m.CompressMode))
   870  	}
   871  	l = len(m.CompressedPlacement)
   872  	if l > 0 {
   873  		n += 1 + l + sovPlacement(uint64(l))
   874  	}
   875  	return n
   876  }
   877  
   878  func (m *Options) Size() (n int) {
   879  	var l int
   880  	_ = l
   881  	if m.IsSharded != nil {
   882  		l = m.IsSharded.Size()
   883  		n += 1 + l + sovPlacement(uint64(l))
   884  	}
   885  	if m.SkipPortMirroring != nil {
   886  		l = m.SkipPortMirroring.Size()
   887  		n += 1 + l + sovPlacement(uint64(l))
   888  	}
   889  	return n
   890  }
   891  
   892  func sovPlacement(x uint64) (n int) {
   893  	for {
   894  		n++
   895  		x >>= 7
   896  		if x == 0 {
   897  			break
   898  		}
   899  	}
   900  	return n
   901  }
   902  func sozPlacement(x uint64) (n int) {
   903  	return sovPlacement(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   904  }
   905  func (m *Placement) Unmarshal(dAtA []byte) error {
   906  	l := len(dAtA)
   907  	iNdEx := 0
   908  	for iNdEx < l {
   909  		preIndex := iNdEx
   910  		var wire uint64
   911  		for shift := uint(0); ; shift += 7 {
   912  			if shift >= 64 {
   913  				return ErrIntOverflowPlacement
   914  			}
   915  			if iNdEx >= l {
   916  				return io.ErrUnexpectedEOF
   917  			}
   918  			b := dAtA[iNdEx]
   919  			iNdEx++
   920  			wire |= (uint64(b) & 0x7F) << shift
   921  			if b < 0x80 {
   922  				break
   923  			}
   924  		}
   925  		fieldNum := int32(wire >> 3)
   926  		wireType := int(wire & 0x7)
   927  		if wireType == 4 {
   928  			return fmt.Errorf("proto: Placement: wiretype end group for non-group")
   929  		}
   930  		if fieldNum <= 0 {
   931  			return fmt.Errorf("proto: Placement: illegal tag %d (wire type %d)", fieldNum, wire)
   932  		}
   933  		switch fieldNum {
   934  		case 1:
   935  			if wireType != 2 {
   936  				return fmt.Errorf("proto: wrong wireType = %d for field Instances", wireType)
   937  			}
   938  			var msglen int
   939  			for shift := uint(0); ; shift += 7 {
   940  				if shift >= 64 {
   941  					return ErrIntOverflowPlacement
   942  				}
   943  				if iNdEx >= l {
   944  					return io.ErrUnexpectedEOF
   945  				}
   946  				b := dAtA[iNdEx]
   947  				iNdEx++
   948  				msglen |= (int(b) & 0x7F) << shift
   949  				if b < 0x80 {
   950  					break
   951  				}
   952  			}
   953  			if msglen < 0 {
   954  				return ErrInvalidLengthPlacement
   955  			}
   956  			postIndex := iNdEx + msglen
   957  			if postIndex > l {
   958  				return io.ErrUnexpectedEOF
   959  			}
   960  			if m.Instances == nil {
   961  				m.Instances = make(map[string]*Instance)
   962  			}
   963  			var mapkey string
   964  			var mapvalue *Instance
   965  			for iNdEx < postIndex {
   966  				entryPreIndex := iNdEx
   967  				var wire uint64
   968  				for shift := uint(0); ; shift += 7 {
   969  					if shift >= 64 {
   970  						return ErrIntOverflowPlacement
   971  					}
   972  					if iNdEx >= l {
   973  						return io.ErrUnexpectedEOF
   974  					}
   975  					b := dAtA[iNdEx]
   976  					iNdEx++
   977  					wire |= (uint64(b) & 0x7F) << shift
   978  					if b < 0x80 {
   979  						break
   980  					}
   981  				}
   982  				fieldNum := int32(wire >> 3)
   983  				if fieldNum == 1 {
   984  					var stringLenmapkey uint64
   985  					for shift := uint(0); ; shift += 7 {
   986  						if shift >= 64 {
   987  							return ErrIntOverflowPlacement
   988  						}
   989  						if iNdEx >= l {
   990  							return io.ErrUnexpectedEOF
   991  						}
   992  						b := dAtA[iNdEx]
   993  						iNdEx++
   994  						stringLenmapkey |= (uint64(b) & 0x7F) << shift
   995  						if b < 0x80 {
   996  							break
   997  						}
   998  					}
   999  					intStringLenmapkey := int(stringLenmapkey)
  1000  					if intStringLenmapkey < 0 {
  1001  						return ErrInvalidLengthPlacement
  1002  					}
  1003  					postStringIndexmapkey := iNdEx + intStringLenmapkey
  1004  					if postStringIndexmapkey > l {
  1005  						return io.ErrUnexpectedEOF
  1006  					}
  1007  					mapkey = string(dAtA[iNdEx:postStringIndexmapkey])
  1008  					iNdEx = postStringIndexmapkey
  1009  				} else if fieldNum == 2 {
  1010  					var mapmsglen int
  1011  					for shift := uint(0); ; shift += 7 {
  1012  						if shift >= 64 {
  1013  							return ErrIntOverflowPlacement
  1014  						}
  1015  						if iNdEx >= l {
  1016  							return io.ErrUnexpectedEOF
  1017  						}
  1018  						b := dAtA[iNdEx]
  1019  						iNdEx++
  1020  						mapmsglen |= (int(b) & 0x7F) << shift
  1021  						if b < 0x80 {
  1022  							break
  1023  						}
  1024  					}
  1025  					if mapmsglen < 0 {
  1026  						return ErrInvalidLengthPlacement
  1027  					}
  1028  					postmsgIndex := iNdEx + mapmsglen
  1029  					if mapmsglen < 0 {
  1030  						return ErrInvalidLengthPlacement
  1031  					}
  1032  					if postmsgIndex > l {
  1033  						return io.ErrUnexpectedEOF
  1034  					}
  1035  					mapvalue = &Instance{}
  1036  					if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil {
  1037  						return err
  1038  					}
  1039  					iNdEx = postmsgIndex
  1040  				} else {
  1041  					iNdEx = entryPreIndex
  1042  					skippy, err := skipPlacement(dAtA[iNdEx:])
  1043  					if err != nil {
  1044  						return err
  1045  					}
  1046  					if skippy < 0 {
  1047  						return ErrInvalidLengthPlacement
  1048  					}
  1049  					if (iNdEx + skippy) > postIndex {
  1050  						return io.ErrUnexpectedEOF
  1051  					}
  1052  					iNdEx += skippy
  1053  				}
  1054  			}
  1055  			m.Instances[mapkey] = mapvalue
  1056  			iNdEx = postIndex
  1057  		case 2:
  1058  			if wireType != 0 {
  1059  				return fmt.Errorf("proto: wrong wireType = %d for field ReplicaFactor", wireType)
  1060  			}
  1061  			m.ReplicaFactor = 0
  1062  			for shift := uint(0); ; shift += 7 {
  1063  				if shift >= 64 {
  1064  					return ErrIntOverflowPlacement
  1065  				}
  1066  				if iNdEx >= l {
  1067  					return io.ErrUnexpectedEOF
  1068  				}
  1069  				b := dAtA[iNdEx]
  1070  				iNdEx++
  1071  				m.ReplicaFactor |= (uint32(b) & 0x7F) << shift
  1072  				if b < 0x80 {
  1073  					break
  1074  				}
  1075  			}
  1076  		case 3:
  1077  			if wireType != 0 {
  1078  				return fmt.Errorf("proto: wrong wireType = %d for field NumShards", wireType)
  1079  			}
  1080  			m.NumShards = 0
  1081  			for shift := uint(0); ; shift += 7 {
  1082  				if shift >= 64 {
  1083  					return ErrIntOverflowPlacement
  1084  				}
  1085  				if iNdEx >= l {
  1086  					return io.ErrUnexpectedEOF
  1087  				}
  1088  				b := dAtA[iNdEx]
  1089  				iNdEx++
  1090  				m.NumShards |= (uint32(b) & 0x7F) << shift
  1091  				if b < 0x80 {
  1092  					break
  1093  				}
  1094  			}
  1095  		case 4:
  1096  			if wireType != 0 {
  1097  				return fmt.Errorf("proto: wrong wireType = %d for field IsSharded", wireType)
  1098  			}
  1099  			var v int
  1100  			for shift := uint(0); ; shift += 7 {
  1101  				if shift >= 64 {
  1102  					return ErrIntOverflowPlacement
  1103  				}
  1104  				if iNdEx >= l {
  1105  					return io.ErrUnexpectedEOF
  1106  				}
  1107  				b := dAtA[iNdEx]
  1108  				iNdEx++
  1109  				v |= (int(b) & 0x7F) << shift
  1110  				if b < 0x80 {
  1111  					break
  1112  				}
  1113  			}
  1114  			m.IsSharded = bool(v != 0)
  1115  		case 5:
  1116  			if wireType != 0 {
  1117  				return fmt.Errorf("proto: wrong wireType = %d for field CutoverTime", wireType)
  1118  			}
  1119  			m.CutoverTime = 0
  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  				m.CutoverTime |= (int64(b) & 0x7F) << shift
  1130  				if b < 0x80 {
  1131  					break
  1132  				}
  1133  			}
  1134  		case 6:
  1135  			if wireType != 0 {
  1136  				return fmt.Errorf("proto: wrong wireType = %d for field IsMirrored", wireType)
  1137  			}
  1138  			var v int
  1139  			for shift := uint(0); ; shift += 7 {
  1140  				if shift >= 64 {
  1141  					return ErrIntOverflowPlacement
  1142  				}
  1143  				if iNdEx >= l {
  1144  					return io.ErrUnexpectedEOF
  1145  				}
  1146  				b := dAtA[iNdEx]
  1147  				iNdEx++
  1148  				v |= (int(b) & 0x7F) << shift
  1149  				if b < 0x80 {
  1150  					break
  1151  				}
  1152  			}
  1153  			m.IsMirrored = bool(v != 0)
  1154  		case 7:
  1155  			if wireType != 0 {
  1156  				return fmt.Errorf("proto: wrong wireType = %d for field MaxShardSetId", wireType)
  1157  			}
  1158  			m.MaxShardSetId = 0
  1159  			for shift := uint(0); ; shift += 7 {
  1160  				if shift >= 64 {
  1161  					return ErrIntOverflowPlacement
  1162  				}
  1163  				if iNdEx >= l {
  1164  					return io.ErrUnexpectedEOF
  1165  				}
  1166  				b := dAtA[iNdEx]
  1167  				iNdEx++
  1168  				m.MaxShardSetId |= (uint32(b) & 0x7F) << shift
  1169  				if b < 0x80 {
  1170  					break
  1171  				}
  1172  			}
  1173  		default:
  1174  			iNdEx = preIndex
  1175  			skippy, err := skipPlacement(dAtA[iNdEx:])
  1176  			if err != nil {
  1177  				return err
  1178  			}
  1179  			if skippy < 0 {
  1180  				return ErrInvalidLengthPlacement
  1181  			}
  1182  			if (iNdEx + skippy) > l {
  1183  				return io.ErrUnexpectedEOF
  1184  			}
  1185  			iNdEx += skippy
  1186  		}
  1187  	}
  1188  
  1189  	if iNdEx > l {
  1190  		return io.ErrUnexpectedEOF
  1191  	}
  1192  	return nil
  1193  }
  1194  func (m *Instance) Unmarshal(dAtA []byte) error {
  1195  	l := len(dAtA)
  1196  	iNdEx := 0
  1197  	for iNdEx < l {
  1198  		preIndex := iNdEx
  1199  		var wire uint64
  1200  		for shift := uint(0); ; shift += 7 {
  1201  			if shift >= 64 {
  1202  				return ErrIntOverflowPlacement
  1203  			}
  1204  			if iNdEx >= l {
  1205  				return io.ErrUnexpectedEOF
  1206  			}
  1207  			b := dAtA[iNdEx]
  1208  			iNdEx++
  1209  			wire |= (uint64(b) & 0x7F) << shift
  1210  			if b < 0x80 {
  1211  				break
  1212  			}
  1213  		}
  1214  		fieldNum := int32(wire >> 3)
  1215  		wireType := int(wire & 0x7)
  1216  		if wireType == 4 {
  1217  			return fmt.Errorf("proto: Instance: wiretype end group for non-group")
  1218  		}
  1219  		if fieldNum <= 0 {
  1220  			return fmt.Errorf("proto: Instance: illegal tag %d (wire type %d)", fieldNum, wire)
  1221  		}
  1222  		switch fieldNum {
  1223  		case 1:
  1224  			if wireType != 2 {
  1225  				return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
  1226  			}
  1227  			var stringLen uint64
  1228  			for shift := uint(0); ; shift += 7 {
  1229  				if shift >= 64 {
  1230  					return ErrIntOverflowPlacement
  1231  				}
  1232  				if iNdEx >= l {
  1233  					return io.ErrUnexpectedEOF
  1234  				}
  1235  				b := dAtA[iNdEx]
  1236  				iNdEx++
  1237  				stringLen |= (uint64(b) & 0x7F) << shift
  1238  				if b < 0x80 {
  1239  					break
  1240  				}
  1241  			}
  1242  			intStringLen := int(stringLen)
  1243  			if intStringLen < 0 {
  1244  				return ErrInvalidLengthPlacement
  1245  			}
  1246  			postIndex := iNdEx + intStringLen
  1247  			if postIndex > l {
  1248  				return io.ErrUnexpectedEOF
  1249  			}
  1250  			m.Id = string(dAtA[iNdEx:postIndex])
  1251  			iNdEx = postIndex
  1252  		case 2:
  1253  			if wireType != 2 {
  1254  				return fmt.Errorf("proto: wrong wireType = %d for field IsolationGroup", wireType)
  1255  			}
  1256  			var stringLen uint64
  1257  			for shift := uint(0); ; shift += 7 {
  1258  				if shift >= 64 {
  1259  					return ErrIntOverflowPlacement
  1260  				}
  1261  				if iNdEx >= l {
  1262  					return io.ErrUnexpectedEOF
  1263  				}
  1264  				b := dAtA[iNdEx]
  1265  				iNdEx++
  1266  				stringLen |= (uint64(b) & 0x7F) << shift
  1267  				if b < 0x80 {
  1268  					break
  1269  				}
  1270  			}
  1271  			intStringLen := int(stringLen)
  1272  			if intStringLen < 0 {
  1273  				return ErrInvalidLengthPlacement
  1274  			}
  1275  			postIndex := iNdEx + intStringLen
  1276  			if postIndex > l {
  1277  				return io.ErrUnexpectedEOF
  1278  			}
  1279  			m.IsolationGroup = string(dAtA[iNdEx:postIndex])
  1280  			iNdEx = postIndex
  1281  		case 3:
  1282  			if wireType != 2 {
  1283  				return fmt.Errorf("proto: wrong wireType = %d for field Zone", wireType)
  1284  			}
  1285  			var stringLen uint64
  1286  			for shift := uint(0); ; shift += 7 {
  1287  				if shift >= 64 {
  1288  					return ErrIntOverflowPlacement
  1289  				}
  1290  				if iNdEx >= l {
  1291  					return io.ErrUnexpectedEOF
  1292  				}
  1293  				b := dAtA[iNdEx]
  1294  				iNdEx++
  1295  				stringLen |= (uint64(b) & 0x7F) << shift
  1296  				if b < 0x80 {
  1297  					break
  1298  				}
  1299  			}
  1300  			intStringLen := int(stringLen)
  1301  			if intStringLen < 0 {
  1302  				return ErrInvalidLengthPlacement
  1303  			}
  1304  			postIndex := iNdEx + intStringLen
  1305  			if postIndex > l {
  1306  				return io.ErrUnexpectedEOF
  1307  			}
  1308  			m.Zone = string(dAtA[iNdEx:postIndex])
  1309  			iNdEx = postIndex
  1310  		case 4:
  1311  			if wireType != 0 {
  1312  				return fmt.Errorf("proto: wrong wireType = %d for field Weight", wireType)
  1313  			}
  1314  			m.Weight = 0
  1315  			for shift := uint(0); ; shift += 7 {
  1316  				if shift >= 64 {
  1317  					return ErrIntOverflowPlacement
  1318  				}
  1319  				if iNdEx >= l {
  1320  					return io.ErrUnexpectedEOF
  1321  				}
  1322  				b := dAtA[iNdEx]
  1323  				iNdEx++
  1324  				m.Weight |= (uint32(b) & 0x7F) << shift
  1325  				if b < 0x80 {
  1326  					break
  1327  				}
  1328  			}
  1329  		case 5:
  1330  			if wireType != 2 {
  1331  				return fmt.Errorf("proto: wrong wireType = %d for field Endpoint", wireType)
  1332  			}
  1333  			var stringLen uint64
  1334  			for shift := uint(0); ; shift += 7 {
  1335  				if shift >= 64 {
  1336  					return ErrIntOverflowPlacement
  1337  				}
  1338  				if iNdEx >= l {
  1339  					return io.ErrUnexpectedEOF
  1340  				}
  1341  				b := dAtA[iNdEx]
  1342  				iNdEx++
  1343  				stringLen |= (uint64(b) & 0x7F) << shift
  1344  				if b < 0x80 {
  1345  					break
  1346  				}
  1347  			}
  1348  			intStringLen := int(stringLen)
  1349  			if intStringLen < 0 {
  1350  				return ErrInvalidLengthPlacement
  1351  			}
  1352  			postIndex := iNdEx + intStringLen
  1353  			if postIndex > l {
  1354  				return io.ErrUnexpectedEOF
  1355  			}
  1356  			m.Endpoint = string(dAtA[iNdEx:postIndex])
  1357  			iNdEx = postIndex
  1358  		case 6:
  1359  			if wireType != 2 {
  1360  				return fmt.Errorf("proto: wrong wireType = %d for field Shards", wireType)
  1361  			}
  1362  			var msglen int
  1363  			for shift := uint(0); ; shift += 7 {
  1364  				if shift >= 64 {
  1365  					return ErrIntOverflowPlacement
  1366  				}
  1367  				if iNdEx >= l {
  1368  					return io.ErrUnexpectedEOF
  1369  				}
  1370  				b := dAtA[iNdEx]
  1371  				iNdEx++
  1372  				msglen |= (int(b) & 0x7F) << shift
  1373  				if b < 0x80 {
  1374  					break
  1375  				}
  1376  			}
  1377  			if msglen < 0 {
  1378  				return ErrInvalidLengthPlacement
  1379  			}
  1380  			postIndex := iNdEx + msglen
  1381  			if postIndex > l {
  1382  				return io.ErrUnexpectedEOF
  1383  			}
  1384  			m.Shards = append(m.Shards, &Shard{})
  1385  			if err := m.Shards[len(m.Shards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1386  				return err
  1387  			}
  1388  			iNdEx = postIndex
  1389  		case 7:
  1390  			if wireType != 0 {
  1391  				return fmt.Errorf("proto: wrong wireType = %d for field ShardSetId", wireType)
  1392  			}
  1393  			m.ShardSetId = 0
  1394  			for shift := uint(0); ; shift += 7 {
  1395  				if shift >= 64 {
  1396  					return ErrIntOverflowPlacement
  1397  				}
  1398  				if iNdEx >= l {
  1399  					return io.ErrUnexpectedEOF
  1400  				}
  1401  				b := dAtA[iNdEx]
  1402  				iNdEx++
  1403  				m.ShardSetId |= (uint32(b) & 0x7F) << shift
  1404  				if b < 0x80 {
  1405  					break
  1406  				}
  1407  			}
  1408  		case 8:
  1409  			if wireType != 2 {
  1410  				return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType)
  1411  			}
  1412  			var stringLen uint64
  1413  			for shift := uint(0); ; shift += 7 {
  1414  				if shift >= 64 {
  1415  					return ErrIntOverflowPlacement
  1416  				}
  1417  				if iNdEx >= l {
  1418  					return io.ErrUnexpectedEOF
  1419  				}
  1420  				b := dAtA[iNdEx]
  1421  				iNdEx++
  1422  				stringLen |= (uint64(b) & 0x7F) << shift
  1423  				if b < 0x80 {
  1424  					break
  1425  				}
  1426  			}
  1427  			intStringLen := int(stringLen)
  1428  			if intStringLen < 0 {
  1429  				return ErrInvalidLengthPlacement
  1430  			}
  1431  			postIndex := iNdEx + intStringLen
  1432  			if postIndex > l {
  1433  				return io.ErrUnexpectedEOF
  1434  			}
  1435  			m.Hostname = string(dAtA[iNdEx:postIndex])
  1436  			iNdEx = postIndex
  1437  		case 9:
  1438  			if wireType != 0 {
  1439  				return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType)
  1440  			}
  1441  			m.Port = 0
  1442  			for shift := uint(0); ; shift += 7 {
  1443  				if shift >= 64 {
  1444  					return ErrIntOverflowPlacement
  1445  				}
  1446  				if iNdEx >= l {
  1447  					return io.ErrUnexpectedEOF
  1448  				}
  1449  				b := dAtA[iNdEx]
  1450  				iNdEx++
  1451  				m.Port |= (uint32(b) & 0x7F) << shift
  1452  				if b < 0x80 {
  1453  					break
  1454  				}
  1455  			}
  1456  		case 10:
  1457  			if wireType != 2 {
  1458  				return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType)
  1459  			}
  1460  			var msglen int
  1461  			for shift := uint(0); ; shift += 7 {
  1462  				if shift >= 64 {
  1463  					return ErrIntOverflowPlacement
  1464  				}
  1465  				if iNdEx >= l {
  1466  					return io.ErrUnexpectedEOF
  1467  				}
  1468  				b := dAtA[iNdEx]
  1469  				iNdEx++
  1470  				msglen |= (int(b) & 0x7F) << shift
  1471  				if b < 0x80 {
  1472  					break
  1473  				}
  1474  			}
  1475  			if msglen < 0 {
  1476  				return ErrInvalidLengthPlacement
  1477  			}
  1478  			postIndex := iNdEx + msglen
  1479  			if postIndex > l {
  1480  				return io.ErrUnexpectedEOF
  1481  			}
  1482  			if m.Metadata == nil {
  1483  				m.Metadata = &InstanceMetadata{}
  1484  			}
  1485  			if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1486  				return err
  1487  			}
  1488  			iNdEx = postIndex
  1489  		default:
  1490  			iNdEx = preIndex
  1491  			skippy, err := skipPlacement(dAtA[iNdEx:])
  1492  			if err != nil {
  1493  				return err
  1494  			}
  1495  			if skippy < 0 {
  1496  				return ErrInvalidLengthPlacement
  1497  			}
  1498  			if (iNdEx + skippy) > l {
  1499  				return io.ErrUnexpectedEOF
  1500  			}
  1501  			iNdEx += skippy
  1502  		}
  1503  	}
  1504  
  1505  	if iNdEx > l {
  1506  		return io.ErrUnexpectedEOF
  1507  	}
  1508  	return nil
  1509  }
  1510  func (m *InstanceMetadata) Unmarshal(dAtA []byte) error {
  1511  	l := len(dAtA)
  1512  	iNdEx := 0
  1513  	for iNdEx < l {
  1514  		preIndex := iNdEx
  1515  		var wire uint64
  1516  		for shift := uint(0); ; shift += 7 {
  1517  			if shift >= 64 {
  1518  				return ErrIntOverflowPlacement
  1519  			}
  1520  			if iNdEx >= l {
  1521  				return io.ErrUnexpectedEOF
  1522  			}
  1523  			b := dAtA[iNdEx]
  1524  			iNdEx++
  1525  			wire |= (uint64(b) & 0x7F) << shift
  1526  			if b < 0x80 {
  1527  				break
  1528  			}
  1529  		}
  1530  		fieldNum := int32(wire >> 3)
  1531  		wireType := int(wire & 0x7)
  1532  		if wireType == 4 {
  1533  			return fmt.Errorf("proto: InstanceMetadata: wiretype end group for non-group")
  1534  		}
  1535  		if fieldNum <= 0 {
  1536  			return fmt.Errorf("proto: InstanceMetadata: illegal tag %d (wire type %d)", fieldNum, wire)
  1537  		}
  1538  		switch fieldNum {
  1539  		case 1:
  1540  			if wireType != 0 {
  1541  				return fmt.Errorf("proto: wrong wireType = %d for field DebugPort", wireType)
  1542  			}
  1543  			m.DebugPort = 0
  1544  			for shift := uint(0); ; shift += 7 {
  1545  				if shift >= 64 {
  1546  					return ErrIntOverflowPlacement
  1547  				}
  1548  				if iNdEx >= l {
  1549  					return io.ErrUnexpectedEOF
  1550  				}
  1551  				b := dAtA[iNdEx]
  1552  				iNdEx++
  1553  				m.DebugPort |= (uint32(b) & 0x7F) << shift
  1554  				if b < 0x80 {
  1555  					break
  1556  				}
  1557  			}
  1558  		default:
  1559  			iNdEx = preIndex
  1560  			skippy, err := skipPlacement(dAtA[iNdEx:])
  1561  			if err != nil {
  1562  				return err
  1563  			}
  1564  			if skippy < 0 {
  1565  				return ErrInvalidLengthPlacement
  1566  			}
  1567  			if (iNdEx + skippy) > l {
  1568  				return io.ErrUnexpectedEOF
  1569  			}
  1570  			iNdEx += skippy
  1571  		}
  1572  	}
  1573  
  1574  	if iNdEx > l {
  1575  		return io.ErrUnexpectedEOF
  1576  	}
  1577  	return nil
  1578  }
  1579  func (m *Shard) Unmarshal(dAtA []byte) error {
  1580  	l := len(dAtA)
  1581  	iNdEx := 0
  1582  	for iNdEx < l {
  1583  		preIndex := iNdEx
  1584  		var wire uint64
  1585  		for shift := uint(0); ; shift += 7 {
  1586  			if shift >= 64 {
  1587  				return ErrIntOverflowPlacement
  1588  			}
  1589  			if iNdEx >= l {
  1590  				return io.ErrUnexpectedEOF
  1591  			}
  1592  			b := dAtA[iNdEx]
  1593  			iNdEx++
  1594  			wire |= (uint64(b) & 0x7F) << shift
  1595  			if b < 0x80 {
  1596  				break
  1597  			}
  1598  		}
  1599  		fieldNum := int32(wire >> 3)
  1600  		wireType := int(wire & 0x7)
  1601  		if wireType == 4 {
  1602  			return fmt.Errorf("proto: Shard: wiretype end group for non-group")
  1603  		}
  1604  		if fieldNum <= 0 {
  1605  			return fmt.Errorf("proto: Shard: illegal tag %d (wire type %d)", fieldNum, wire)
  1606  		}
  1607  		switch fieldNum {
  1608  		case 1:
  1609  			if wireType != 0 {
  1610  				return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
  1611  			}
  1612  			m.Id = 0
  1613  			for shift := uint(0); ; shift += 7 {
  1614  				if shift >= 64 {
  1615  					return ErrIntOverflowPlacement
  1616  				}
  1617  				if iNdEx >= l {
  1618  					return io.ErrUnexpectedEOF
  1619  				}
  1620  				b := dAtA[iNdEx]
  1621  				iNdEx++
  1622  				m.Id |= (uint32(b) & 0x7F) << shift
  1623  				if b < 0x80 {
  1624  					break
  1625  				}
  1626  			}
  1627  		case 2:
  1628  			if wireType != 0 {
  1629  				return fmt.Errorf("proto: wrong wireType = %d for field State", wireType)
  1630  			}
  1631  			m.State = 0
  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  				m.State |= (ShardState(b) & 0x7F) << shift
  1642  				if b < 0x80 {
  1643  					break
  1644  				}
  1645  			}
  1646  		case 3:
  1647  			if wireType != 2 {
  1648  				return fmt.Errorf("proto: wrong wireType = %d for field SourceId", wireType)
  1649  			}
  1650  			var stringLen uint64
  1651  			for shift := uint(0); ; shift += 7 {
  1652  				if shift >= 64 {
  1653  					return ErrIntOverflowPlacement
  1654  				}
  1655  				if iNdEx >= l {
  1656  					return io.ErrUnexpectedEOF
  1657  				}
  1658  				b := dAtA[iNdEx]
  1659  				iNdEx++
  1660  				stringLen |= (uint64(b) & 0x7F) << shift
  1661  				if b < 0x80 {
  1662  					break
  1663  				}
  1664  			}
  1665  			intStringLen := int(stringLen)
  1666  			if intStringLen < 0 {
  1667  				return ErrInvalidLengthPlacement
  1668  			}
  1669  			postIndex := iNdEx + intStringLen
  1670  			if postIndex > l {
  1671  				return io.ErrUnexpectedEOF
  1672  			}
  1673  			m.SourceId = string(dAtA[iNdEx:postIndex])
  1674  			iNdEx = postIndex
  1675  		case 4:
  1676  			if wireType != 0 {
  1677  				return fmt.Errorf("proto: wrong wireType = %d for field CutoverNanos", wireType)
  1678  			}
  1679  			m.CutoverNanos = 0
  1680  			for shift := uint(0); ; shift += 7 {
  1681  				if shift >= 64 {
  1682  					return ErrIntOverflowPlacement
  1683  				}
  1684  				if iNdEx >= l {
  1685  					return io.ErrUnexpectedEOF
  1686  				}
  1687  				b := dAtA[iNdEx]
  1688  				iNdEx++
  1689  				m.CutoverNanos |= (int64(b) & 0x7F) << shift
  1690  				if b < 0x80 {
  1691  					break
  1692  				}
  1693  			}
  1694  		case 5:
  1695  			if wireType != 0 {
  1696  				return fmt.Errorf("proto: wrong wireType = %d for field CutoffNanos", wireType)
  1697  			}
  1698  			m.CutoffNanos = 0
  1699  			for shift := uint(0); ; shift += 7 {
  1700  				if shift >= 64 {
  1701  					return ErrIntOverflowPlacement
  1702  				}
  1703  				if iNdEx >= l {
  1704  					return io.ErrUnexpectedEOF
  1705  				}
  1706  				b := dAtA[iNdEx]
  1707  				iNdEx++
  1708  				m.CutoffNanos |= (int64(b) & 0x7F) << shift
  1709  				if b < 0x80 {
  1710  					break
  1711  				}
  1712  			}
  1713  		case 6:
  1714  			if wireType != 2 {
  1715  				return fmt.Errorf("proto: wrong wireType = %d for field RedirectToShardId", wireType)
  1716  			}
  1717  			var msglen int
  1718  			for shift := uint(0); ; shift += 7 {
  1719  				if shift >= 64 {
  1720  					return ErrIntOverflowPlacement
  1721  				}
  1722  				if iNdEx >= l {
  1723  					return io.ErrUnexpectedEOF
  1724  				}
  1725  				b := dAtA[iNdEx]
  1726  				iNdEx++
  1727  				msglen |= (int(b) & 0x7F) << shift
  1728  				if b < 0x80 {
  1729  					break
  1730  				}
  1731  			}
  1732  			if msglen < 0 {
  1733  				return ErrInvalidLengthPlacement
  1734  			}
  1735  			postIndex := iNdEx + msglen
  1736  			if postIndex > l {
  1737  				return io.ErrUnexpectedEOF
  1738  			}
  1739  			if m.RedirectToShardId == nil {
  1740  				m.RedirectToShardId = &google_protobuf.UInt32Value{}
  1741  			}
  1742  			if err := m.RedirectToShardId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1743  				return err
  1744  			}
  1745  			iNdEx = postIndex
  1746  		default:
  1747  			iNdEx = preIndex
  1748  			skippy, err := skipPlacement(dAtA[iNdEx:])
  1749  			if err != nil {
  1750  				return err
  1751  			}
  1752  			if skippy < 0 {
  1753  				return ErrInvalidLengthPlacement
  1754  			}
  1755  			if (iNdEx + skippy) > l {
  1756  				return io.ErrUnexpectedEOF
  1757  			}
  1758  			iNdEx += skippy
  1759  		}
  1760  	}
  1761  
  1762  	if iNdEx > l {
  1763  		return io.ErrUnexpectedEOF
  1764  	}
  1765  	return nil
  1766  }
  1767  func (m *PlacementSnapshots) Unmarshal(dAtA []byte) error {
  1768  	l := len(dAtA)
  1769  	iNdEx := 0
  1770  	for iNdEx < l {
  1771  		preIndex := iNdEx
  1772  		var wire uint64
  1773  		for shift := uint(0); ; shift += 7 {
  1774  			if shift >= 64 {
  1775  				return ErrIntOverflowPlacement
  1776  			}
  1777  			if iNdEx >= l {
  1778  				return io.ErrUnexpectedEOF
  1779  			}
  1780  			b := dAtA[iNdEx]
  1781  			iNdEx++
  1782  			wire |= (uint64(b) & 0x7F) << shift
  1783  			if b < 0x80 {
  1784  				break
  1785  			}
  1786  		}
  1787  		fieldNum := int32(wire >> 3)
  1788  		wireType := int(wire & 0x7)
  1789  		if wireType == 4 {
  1790  			return fmt.Errorf("proto: PlacementSnapshots: wiretype end group for non-group")
  1791  		}
  1792  		if fieldNum <= 0 {
  1793  			return fmt.Errorf("proto: PlacementSnapshots: illegal tag %d (wire type %d)", fieldNum, wire)
  1794  		}
  1795  		switch fieldNum {
  1796  		case 1:
  1797  			if wireType != 2 {
  1798  				return fmt.Errorf("proto: wrong wireType = %d for field Snapshots", wireType)
  1799  			}
  1800  			var msglen int
  1801  			for shift := uint(0); ; shift += 7 {
  1802  				if shift >= 64 {
  1803  					return ErrIntOverflowPlacement
  1804  				}
  1805  				if iNdEx >= l {
  1806  					return io.ErrUnexpectedEOF
  1807  				}
  1808  				b := dAtA[iNdEx]
  1809  				iNdEx++
  1810  				msglen |= (int(b) & 0x7F) << shift
  1811  				if b < 0x80 {
  1812  					break
  1813  				}
  1814  			}
  1815  			if msglen < 0 {
  1816  				return ErrInvalidLengthPlacement
  1817  			}
  1818  			postIndex := iNdEx + msglen
  1819  			if postIndex > l {
  1820  				return io.ErrUnexpectedEOF
  1821  			}
  1822  			m.Snapshots = append(m.Snapshots, &Placement{})
  1823  			if err := m.Snapshots[len(m.Snapshots)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1824  				return err
  1825  			}
  1826  			iNdEx = postIndex
  1827  		case 2:
  1828  			if wireType != 0 {
  1829  				return fmt.Errorf("proto: wrong wireType = %d for field CompressMode", wireType)
  1830  			}
  1831  			m.CompressMode = 0
  1832  			for shift := uint(0); ; shift += 7 {
  1833  				if shift >= 64 {
  1834  					return ErrIntOverflowPlacement
  1835  				}
  1836  				if iNdEx >= l {
  1837  					return io.ErrUnexpectedEOF
  1838  				}
  1839  				b := dAtA[iNdEx]
  1840  				iNdEx++
  1841  				m.CompressMode |= (CompressMode(b) & 0x7F) << shift
  1842  				if b < 0x80 {
  1843  					break
  1844  				}
  1845  			}
  1846  		case 3:
  1847  			if wireType != 2 {
  1848  				return fmt.Errorf("proto: wrong wireType = %d for field CompressedPlacement", wireType)
  1849  			}
  1850  			var byteLen int
  1851  			for shift := uint(0); ; shift += 7 {
  1852  				if shift >= 64 {
  1853  					return ErrIntOverflowPlacement
  1854  				}
  1855  				if iNdEx >= l {
  1856  					return io.ErrUnexpectedEOF
  1857  				}
  1858  				b := dAtA[iNdEx]
  1859  				iNdEx++
  1860  				byteLen |= (int(b) & 0x7F) << shift
  1861  				if b < 0x80 {
  1862  					break
  1863  				}
  1864  			}
  1865  			if byteLen < 0 {
  1866  				return ErrInvalidLengthPlacement
  1867  			}
  1868  			postIndex := iNdEx + byteLen
  1869  			if postIndex > l {
  1870  				return io.ErrUnexpectedEOF
  1871  			}
  1872  			m.CompressedPlacement = append(m.CompressedPlacement[:0], dAtA[iNdEx:postIndex]...)
  1873  			if m.CompressedPlacement == nil {
  1874  				m.CompressedPlacement = []byte{}
  1875  			}
  1876  			iNdEx = postIndex
  1877  		default:
  1878  			iNdEx = preIndex
  1879  			skippy, err := skipPlacement(dAtA[iNdEx:])
  1880  			if err != nil {
  1881  				return err
  1882  			}
  1883  			if skippy < 0 {
  1884  				return ErrInvalidLengthPlacement
  1885  			}
  1886  			if (iNdEx + skippy) > l {
  1887  				return io.ErrUnexpectedEOF
  1888  			}
  1889  			iNdEx += skippy
  1890  		}
  1891  	}
  1892  
  1893  	if iNdEx > l {
  1894  		return io.ErrUnexpectedEOF
  1895  	}
  1896  	return nil
  1897  }
  1898  func (m *Options) Unmarshal(dAtA []byte) error {
  1899  	l := len(dAtA)
  1900  	iNdEx := 0
  1901  	for iNdEx < l {
  1902  		preIndex := iNdEx
  1903  		var wire uint64
  1904  		for shift := uint(0); ; shift += 7 {
  1905  			if shift >= 64 {
  1906  				return ErrIntOverflowPlacement
  1907  			}
  1908  			if iNdEx >= l {
  1909  				return io.ErrUnexpectedEOF
  1910  			}
  1911  			b := dAtA[iNdEx]
  1912  			iNdEx++
  1913  			wire |= (uint64(b) & 0x7F) << shift
  1914  			if b < 0x80 {
  1915  				break
  1916  			}
  1917  		}
  1918  		fieldNum := int32(wire >> 3)
  1919  		wireType := int(wire & 0x7)
  1920  		if wireType == 4 {
  1921  			return fmt.Errorf("proto: Options: wiretype end group for non-group")
  1922  		}
  1923  		if fieldNum <= 0 {
  1924  			return fmt.Errorf("proto: Options: illegal tag %d (wire type %d)", fieldNum, wire)
  1925  		}
  1926  		switch fieldNum {
  1927  		case 1:
  1928  			if wireType != 2 {
  1929  				return fmt.Errorf("proto: wrong wireType = %d for field IsSharded", wireType)
  1930  			}
  1931  			var msglen int
  1932  			for shift := uint(0); ; shift += 7 {
  1933  				if shift >= 64 {
  1934  					return ErrIntOverflowPlacement
  1935  				}
  1936  				if iNdEx >= l {
  1937  					return io.ErrUnexpectedEOF
  1938  				}
  1939  				b := dAtA[iNdEx]
  1940  				iNdEx++
  1941  				msglen |= (int(b) & 0x7F) << shift
  1942  				if b < 0x80 {
  1943  					break
  1944  				}
  1945  			}
  1946  			if msglen < 0 {
  1947  				return ErrInvalidLengthPlacement
  1948  			}
  1949  			postIndex := iNdEx + msglen
  1950  			if postIndex > l {
  1951  				return io.ErrUnexpectedEOF
  1952  			}
  1953  			if m.IsSharded == nil {
  1954  				m.IsSharded = &google_protobuf.BoolValue{}
  1955  			}
  1956  			if err := m.IsSharded.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1957  				return err
  1958  			}
  1959  			iNdEx = postIndex
  1960  		case 2:
  1961  			if wireType != 2 {
  1962  				return fmt.Errorf("proto: wrong wireType = %d for field SkipPortMirroring", wireType)
  1963  			}
  1964  			var msglen int
  1965  			for shift := uint(0); ; shift += 7 {
  1966  				if shift >= 64 {
  1967  					return ErrIntOverflowPlacement
  1968  				}
  1969  				if iNdEx >= l {
  1970  					return io.ErrUnexpectedEOF
  1971  				}
  1972  				b := dAtA[iNdEx]
  1973  				iNdEx++
  1974  				msglen |= (int(b) & 0x7F) << shift
  1975  				if b < 0x80 {
  1976  					break
  1977  				}
  1978  			}
  1979  			if msglen < 0 {
  1980  				return ErrInvalidLengthPlacement
  1981  			}
  1982  			postIndex := iNdEx + msglen
  1983  			if postIndex > l {
  1984  				return io.ErrUnexpectedEOF
  1985  			}
  1986  			if m.SkipPortMirroring == nil {
  1987  				m.SkipPortMirroring = &google_protobuf.BoolValue{}
  1988  			}
  1989  			if err := m.SkipPortMirroring.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1990  				return err
  1991  			}
  1992  			iNdEx = postIndex
  1993  		default:
  1994  			iNdEx = preIndex
  1995  			skippy, err := skipPlacement(dAtA[iNdEx:])
  1996  			if err != nil {
  1997  				return err
  1998  			}
  1999  			if skippy < 0 {
  2000  				return ErrInvalidLengthPlacement
  2001  			}
  2002  			if (iNdEx + skippy) > l {
  2003  				return io.ErrUnexpectedEOF
  2004  			}
  2005  			iNdEx += skippy
  2006  		}
  2007  	}
  2008  
  2009  	if iNdEx > l {
  2010  		return io.ErrUnexpectedEOF
  2011  	}
  2012  	return nil
  2013  }
  2014  func skipPlacement(dAtA []byte) (n int, err error) {
  2015  	l := len(dAtA)
  2016  	iNdEx := 0
  2017  	for iNdEx < l {
  2018  		var wire uint64
  2019  		for shift := uint(0); ; shift += 7 {
  2020  			if shift >= 64 {
  2021  				return 0, ErrIntOverflowPlacement
  2022  			}
  2023  			if iNdEx >= l {
  2024  				return 0, io.ErrUnexpectedEOF
  2025  			}
  2026  			b := dAtA[iNdEx]
  2027  			iNdEx++
  2028  			wire |= (uint64(b) & 0x7F) << shift
  2029  			if b < 0x80 {
  2030  				break
  2031  			}
  2032  		}
  2033  		wireType := int(wire & 0x7)
  2034  		switch wireType {
  2035  		case 0:
  2036  			for shift := uint(0); ; shift += 7 {
  2037  				if shift >= 64 {
  2038  					return 0, ErrIntOverflowPlacement
  2039  				}
  2040  				if iNdEx >= l {
  2041  					return 0, io.ErrUnexpectedEOF
  2042  				}
  2043  				iNdEx++
  2044  				if dAtA[iNdEx-1] < 0x80 {
  2045  					break
  2046  				}
  2047  			}
  2048  			return iNdEx, nil
  2049  		case 1:
  2050  			iNdEx += 8
  2051  			return iNdEx, nil
  2052  		case 2:
  2053  			var length int
  2054  			for shift := uint(0); ; shift += 7 {
  2055  				if shift >= 64 {
  2056  					return 0, ErrIntOverflowPlacement
  2057  				}
  2058  				if iNdEx >= l {
  2059  					return 0, io.ErrUnexpectedEOF
  2060  				}
  2061  				b := dAtA[iNdEx]
  2062  				iNdEx++
  2063  				length |= (int(b) & 0x7F) << shift
  2064  				if b < 0x80 {
  2065  					break
  2066  				}
  2067  			}
  2068  			iNdEx += length
  2069  			if length < 0 {
  2070  				return 0, ErrInvalidLengthPlacement
  2071  			}
  2072  			return iNdEx, nil
  2073  		case 3:
  2074  			for {
  2075  				var innerWire uint64
  2076  				var start int = iNdEx
  2077  				for shift := uint(0); ; shift += 7 {
  2078  					if shift >= 64 {
  2079  						return 0, ErrIntOverflowPlacement
  2080  					}
  2081  					if iNdEx >= l {
  2082  						return 0, io.ErrUnexpectedEOF
  2083  					}
  2084  					b := dAtA[iNdEx]
  2085  					iNdEx++
  2086  					innerWire |= (uint64(b) & 0x7F) << shift
  2087  					if b < 0x80 {
  2088  						break
  2089  					}
  2090  				}
  2091  				innerWireType := int(innerWire & 0x7)
  2092  				if innerWireType == 4 {
  2093  					break
  2094  				}
  2095  				next, err := skipPlacement(dAtA[start:])
  2096  				if err != nil {
  2097  					return 0, err
  2098  				}
  2099  				iNdEx = start + next
  2100  			}
  2101  			return iNdEx, nil
  2102  		case 4:
  2103  			return iNdEx, nil
  2104  		case 5:
  2105  			iNdEx += 4
  2106  			return iNdEx, nil
  2107  		default:
  2108  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  2109  		}
  2110  	}
  2111  	panic("unreachable")
  2112  }
  2113  
  2114  var (
  2115  	ErrInvalidLengthPlacement = fmt.Errorf("proto: negative length found during unmarshaling")
  2116  	ErrIntOverflowPlacement   = fmt.Errorf("proto: integer overflow")
  2117  )
  2118  
  2119  func init() {
  2120  	proto.RegisterFile("github.com/m3db/m3/src/cluster/generated/proto/placementpb/placement.proto", fileDescriptorPlacement)
  2121  }
  2122  
  2123  var fileDescriptorPlacement = []byte{
  2124  	// 861 bytes of a gzipped FileDescriptorProto
  2125  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x54, 0xcb, 0x8e, 0xdb, 0x36,
  2126  	0x14, 0x0d, 0xed, 0x19, 0x8f, 0x75, 0xfd, 0xa8, 0xc2, 0xa4, 0xa9, 0x3a, 0x6d, 0x5c, 0xd7, 0x45,
  2127  	0x50, 0x63, 0x8a, 0xda, 0x88, 0x67, 0x93, 0x64, 0x51, 0xc0, 0x93, 0x4e, 0x03, 0x05, 0x63, 0x27,
  2128  	0xa0, 0xa7, 0xb3, 0xc8, 0x46, 0xa0, 0x25, 0xda, 0x26, 0x62, 0x89, 0x02, 0x49, 0xe5, 0xd1, 0xaf,
  2129  	0xc8, 0x2f, 0x15, 0xe8, 0xa2, 0xcb, 0x7e, 0x42, 0x31, 0xfd, 0x88, 0x02, 0x5d, 0x15, 0x22, 0x25,
  2130  	0x3f, 0x9a, 0x41, 0x77, 0xbc, 0xe7, 0x9e, 0x4b, 0x5e, 0x1e, 0x9e, 0x4b, 0x78, 0xbe, 0xe4, 0x7a,
  2131  	0x95, 0xcd, 0x07, 0xa1, 0x88, 0x87, 0xf1, 0x69, 0x34, 0x1f, 0xc6, 0xa7, 0x43, 0x25, 0xc3, 0x61,
  2132  	0xb8, 0xce, 0x94, 0x66, 0x72, 0xb8, 0x64, 0x09, 0x93, 0x54, 0xb3, 0x68, 0x98, 0x4a, 0xa1, 0xc5,
  2133  	0x30, 0x5d, 0xd3, 0x90, 0xc5, 0x2c, 0xd1, 0xe9, 0x7c, 0xbb, 0x1e, 0x98, 0x1c, 0x6e, 0xec, 0x24,
  2134  	0x8f, 0x3b, 0x4b, 0x21, 0x96, 0x6b, 0x66, 0xcb, 0xe6, 0xd9, 0x62, 0xf8, 0x56, 0xd2, 0x34, 0x65,
  2135  	0x52, 0x59, 0x72, 0xef, 0xef, 0x0a, 0x38, 0x2f, 0x4b, 0x3e, 0x7e, 0x0a, 0x0e, 0x4f, 0x94, 0xa6,
  2136  	0x49, 0xc8, 0x94, 0x87, 0xba, 0xd5, 0x7e, 0x63, 0xf4, 0x60, 0xb0, 0xb3, 0xdd, 0x60, 0x43, 0x1d,
  2137  	0xf8, 0x25, 0xef, 0x3c, 0xd1, 0xf2, 0x3d, 0xd9, 0xd6, 0xe1, 0x07, 0xd0, 0x96, 0x2c, 0x5d, 0xf3,
  2138  	0x90, 0x06, 0x0b, 0x1a, 0x6a, 0x21, 0xbd, 0x4a, 0x17, 0xf5, 0x5b, 0xa4, 0x55, 0xa0, 0x3f, 0x19,
  2139  	0x10, 0xdf, 0x07, 0x48, 0xb2, 0x38, 0x50, 0x2b, 0x2a, 0x23, 0xe5, 0x55, 0x0d, 0xc5, 0x49, 0xb2,
  2140  	0x78, 0x66, 0x80, 0x3c, 0xcd, 0x95, 0xcd, 0xb2, 0xc8, 0x3b, 0xe8, 0xa2, 0x7e, 0x9d, 0x38, 0x5c,
  2141  	0xcd, 0x2c, 0x80, 0xbf, 0x86, 0x66, 0x98, 0x69, 0xf1, 0x86, 0xc9, 0x40, 0xf3, 0x98, 0x79, 0x87,
  2142  	0x5d, 0xd4, 0xaf, 0x92, 0x46, 0x81, 0x5d, 0xf2, 0x98, 0xe1, 0xaf, 0xa0, 0xc1, 0x55, 0x10, 0x73,
  2143  	0x29, 0x85, 0x64, 0x91, 0x57, 0x33, 0x5b, 0x00, 0x57, 0x93, 0x02, 0xc1, 0xdf, 0x82, 0x1b, 0xd3,
  2144  	0x77, 0xf6, 0x8c, 0x40, 0x31, 0x1d, 0xf0, 0xc8, 0x3b, 0xb2, 0xad, 0xc6, 0xf4, 0x9d, 0x39, 0x69,
  2145  	0xc6, 0xb4, 0x1f, 0x1d, 0xcf, 0xa0, 0xbd, 0x7f, 0x5d, 0xec, 0x42, 0xf5, 0x35, 0x7b, 0xef, 0xa1,
  2146  	0x2e, 0xea, 0x3b, 0x24, 0x5f, 0xe2, 0xef, 0xe0, 0xf0, 0x0d, 0x5d, 0x67, 0xcc, 0x5c, 0xb6, 0x31,
  2147  	0xfa, 0x74, 0x4f, 0xb6, 0xb2, 0x9a, 0x58, 0xce, 0x93, 0xca, 0x23, 0xd4, 0xfb, 0xad, 0x02, 0xf5,
  2148  	0x12, 0xc7, 0x6d, 0xa8, 0xf0, 0xa8, 0xd8, 0xae, 0xc2, 0xf3, 0xd6, 0x3e, 0xe1, 0x4a, 0xac, 0xa9,
  2149  	0xe6, 0x22, 0x09, 0x96, 0x52, 0x64, 0xa9, 0xd9, 0xd7, 0x21, 0xed, 0x0d, 0xfc, 0x2c, 0x47, 0x31,
  2150  	0x86, 0x83, 0x5f, 0x44, 0xc2, 0x8c, 0x7e, 0x0e, 0x31, 0x6b, 0x7c, 0x0f, 0x6a, 0x6f, 0x19, 0x5f,
  2151  	0xae, 0xb4, 0x91, 0xad, 0x45, 0x8a, 0x08, 0x1f, 0x43, 0x9d, 0x25, 0x51, 0x2a, 0x78, 0xa2, 0x8d,
  2152  	0x5e, 0x0e, 0xd9, 0xc4, 0xf8, 0x04, 0x6a, 0xc5, 0x4b, 0xd4, 0xcc, 0xb3, 0xe3, 0xbd, 0xfe, 0x8d,
  2153  	0x16, 0xa4, 0x60, 0xe0, 0x2e, 0x34, 0x6f, 0xd0, 0x0c, 0xd4, 0x46, 0xb0, 0xfc, 0xa4, 0x95, 0x50,
  2154  	0x3a, 0xa1, 0x31, 0xf3, 0xea, 0xf6, 0xa4, 0x32, 0xce, 0x3b, 0x4e, 0x85, 0xd4, 0x9e, 0x63, 0xaa,
  2155  	0xcc, 0x1a, 0x3f, 0x86, 0x7a, 0xcc, 0x34, 0x8d, 0xa8, 0xa6, 0x1e, 0x18, 0xfd, 0xee, 0xdf, 0xa8,
  2156  	0xdf, 0xa4, 0x20, 0x91, 0x0d, 0xbd, 0xf7, 0x10, 0xdc, 0xff, 0x66, 0x73, 0xef, 0x44, 0x6c, 0x9e,
  2157  	0x2d, 0x03, 0x73, 0x10, 0xb2, 0xd6, 0x32, 0xc8, 0x4b, 0x21, 0x75, 0xef, 0x1f, 0x04, 0x87, 0xe6,
  2158  	0x46, 0x3b, 0xb2, 0xb7, 0x8c, 0xec, 0xdf, 0xc3, 0xa1, 0xd2, 0x54, 0xdb, 0x47, 0x6c, 0x8f, 0x3e,
  2159  	0xfb, 0x58, 0x84, 0x59, 0x9e, 0x26, 0x96, 0x85, 0xbf, 0x00, 0x47, 0x89, 0x4c, 0x86, 0x2c, 0x57,
  2160  	0xc1, 0xbe, 0x40, 0xdd, 0x02, 0x7e, 0x84, 0xbf, 0x81, 0x56, 0xe9, 0xd0, 0x84, 0x26, 0x42, 0x99,
  2161  	0xc7, 0xa8, 0x92, 0xd2, 0xb6, 0xd3, 0x1c, 0x2b, 0x6d, 0xbc, 0x58, 0x14, 0x9c, 0x1d, 0x1b, 0x2f,
  2162  	0x16, 0x96, 0x32, 0x81, 0xbb, 0x92, 0x45, 0x5c, 0xb2, 0x50, 0x07, 0x5a, 0x14, 0x6e, 0xe5, 0xd6,
  2163  	0xcf, 0x8d, 0xd1, 0x97, 0x03, 0x3b, 0xe0, 0x83, 0x72, 0xc0, 0x07, 0x3f, 0xfb, 0x89, 0x3e, 0x1d,
  2164  	0x5d, 0xe5, 0x3e, 0x23, 0xb7, 0xcb, 0xca, 0x4b, 0x61, 0xba, 0xf7, 0xa3, 0xde, 0xaf, 0x08, 0xf0,
  2165  	0x66, 0x8a, 0x67, 0x09, 0x4d, 0xd5, 0x4a, 0x68, 0x85, 0x1f, 0x81, 0xa3, 0xca, 0xa0, 0x98, 0xfc,
  2166  	0x7b, 0x37, 0x4f, 0xfe, 0x59, 0xc5, 0x43, 0x64, 0x4b, 0xc6, 0x3f, 0x40, 0x2b, 0x14, 0x71, 0x2a,
  2167  	0x99, 0x52, 0x41, 0x2c, 0xa2, 0x52, 0xbb, 0xcf, 0xf7, 0xaa, 0x9f, 0x16, 0x8c, 0x89, 0x88, 0x18,
  2168  	0x69, 0x86, 0x3b, 0x11, 0x7e, 0x08, 0x77, 0xcb, 0x98, 0x45, 0xc1, 0xa6, 0xc8, 0xe8, 0xd9, 0x24,
  2169  	0x77, 0xb6, 0xb9, 0x4d, 0x07, 0xbd, 0x0f, 0x08, 0x8e, 0x5e, 0xa4, 0xf9, 0x10, 0x28, 0xfc, 0x78,
  2170  	0xef, 0x9f, 0x40, 0x46, 0x94, 0xe3, 0x8f, 0x44, 0x39, 0x13, 0x62, 0x6d, 0x25, 0xd9, 0xf9, 0x43,
  2171  	0x9e, 0xc3, 0x1d, 0xf5, 0x9a, 0xa7, 0xc6, 0x25, 0xc5, 0x3f, 0xc1, 0x93, 0x65, 0x31, 0xc0, 0xff,
  2172  	0xb7, 0xc7, 0xed, 0xbc, 0x2c, 0xb7, 0xd2, 0xa4, 0x2c, 0x3a, 0x79, 0x02, 0xb0, 0xf5, 0x07, 0x76,
  2173  	0xa1, 0xe9, 0x4f, 0xfd, 0x4b, 0x7f, 0x7c, 0xe1, 0xbf, 0xf2, 0xa7, 0xcf, 0xdc, 0x5b, 0xb8, 0x05,
  2174  	0xce, 0xf8, 0x6a, 0xec, 0x5f, 0x8c, 0xcf, 0x2e, 0xce, 0x5d, 0x84, 0x1b, 0x70, 0x74, 0x71, 0x3e,
  2175  	0xbe, 0xca, 0x73, 0x95, 0x93, 0x1e, 0x34, 0x77, 0xf5, 0xc1, 0x75, 0x38, 0x98, 0xbe, 0x98, 0x9e,
  2176  	0xbb, 0xb7, 0xf2, 0xd5, 0xab, 0xd9, 0xe5, 0x8f, 0x2e, 0x3a, 0x73, 0x7f, 0xbf, 0xee, 0xa0, 0x3f,
  2177  	0xae, 0x3b, 0xe8, 0xcf, 0xeb, 0x0e, 0xfa, 0xf0, 0x57, 0xe7, 0xd6, 0xbc, 0x66, 0x1a, 0x3b, 0xfd,
  2178  	0x37, 0x00, 0x00, 0xff, 0xff, 0x38, 0x0a, 0x4d, 0xba, 0x3b, 0x06, 0x00, 0x00,
  2179  }