diff --git a/cluster/cluster.go b/cluster/cluster.go index cecbfcd47..81aa2e742 100644 --- a/cluster/cluster.go +++ b/cluster/cluster.go @@ -16,7 +16,7 @@ type Cluster struct { ActorSystem *actor.ActorSystem Config *Config remote *remote.Remote - pidCache *pidCacheValue + PidCache *pidCacheValue MemberList *MemberList partitionValue *partitionValue partitionManager *PartitionManager @@ -58,7 +58,7 @@ func (c *Cluster) Start() { // for each known kind, spin up a partition-kind actor to handle all requests for that kind c.partitionValue = setupPartition(c, kinds) - c.pidCache = setupPidCache(c.ActorSystem) + c.PidCache = setupPidCache(c.ActorSystem) c.MemberList = setupMemberList(c) c.partitionManager = newPartitionManager(c) c.partitionManager.Start() @@ -81,7 +81,7 @@ func (c *Cluster) StartClient() { // for each known kind, spin up a partition-kind actor to handle all requests for that kind c.partitionValue = setupPartition(c, kinds) - c.pidCache = setupPidCache(c.ActorSystem) + c.PidCache = setupPidCache(c.ActorSystem) c.MemberList = setupMemberList(c) c.partitionManager = newPartitionManager(c) c.partitionManager.Start() @@ -97,7 +97,7 @@ func (c *Cluster) Shutdown(graceful bool) { // This is to wait ownership transferring complete. time.Sleep(time.Millisecond * 2000) c.MemberList.stopMemberList() - c.pidCache.stopPidCache() + c.PidCache.stopPidCache() c.partitionValue.stopPartition() c.partitionManager.Stop() } @@ -111,8 +111,7 @@ func (c *Cluster) Shutdown(graceful bool) { // Get a PID to a virtual actor func (c *Cluster) GetV1(name string, kind string) (*actor.PID, remote.ResponseStatusCode) { // Check Cache - clusterActorId := kind + "/" + name - if pid, ok := c.pidCache.getCache(clusterActorId); ok { + if pid, ok := c.PidCache.getCache(name); ok { return pid, remote.ResponseStatusCodeOK } @@ -150,7 +149,7 @@ func (c *Cluster) GetV1(name string, kind string) (*actor.PID, remote.ResponseSt switch statusCode { case remote.ResponseStatusCodeOK: // save cache - c.pidCache.addCache(clusterActorId, response.Pid) + c.PidCache.addCache(name, response.Pid) // tell the original requester that we have a response return response.Pid, statusCode default: @@ -226,6 +225,11 @@ func (c *Cluster) GetClusterKinds() []string { return c.remote.GetKnownKinds() } +// ToShortString Get kind & identity +func (ci *ClusterIdentity) ToShortString() string { + return ci.Kind + "/" + ci.Identity +} + // Call is a wrap of context.RequestFuture with retries. func (c *Cluster) Call(name string, kind string, msg interface{}, callopts ...*GrainCallOptions) (interface{}, error) { var _callopts *GrainCallOptions = nil diff --git a/cluster/identity/identity_lookup.go b/cluster/identity/identity_lookup.go new file mode 100644 index 000000000..935c9dc98 --- /dev/null +++ b/cluster/identity/identity_lookup.go @@ -0,0 +1,88 @@ +package identity + +import ( + "github.com/AsynkronIT/protoactor-go/actor" + "github.com/AsynkronIT/protoactor-go/cluster" +) + +// Lookup contains +type Lookup interface { + Get(clusterIdentity *cluster.ClusterIdentity) *actor.PID + + RemovePid(pid *actor.PID) + + Setup(cluster *cluster.Cluster, kinds []string, isClient bool) + + Shutdown() +} + +// StorageLookup contains +type StorageLookup interface { + TryGetExistingActivation(clusterIdentity *cluster.ClusterIdentity) *StoredActivation + + TryAcquireLock(clusterIdentity *cluster.ClusterIdentity) *SpawnLock + + WaitForActivation(clusterIdentity *cluster.ClusterIdentity) *StoredActivation + + RemoveLock(spawnLock SpawnLock) + + StoreActivation(memberID string, spawnLock *SpawnLock, pid *actor.PID) + + RemoveActivation(pid *SpawnLock) + + RemoveMemberId(memberID string) +} + +// SpawnLock contains +type SpawnLock struct { + LockID string + ClusterIdentity *cluster.ClusterIdentity +} + +func newSpawnLock(lockID string, clusterIdentity *cluster.ClusterIdentity) *SpawnLock { + this := &SpawnLock{ + LockID: lockID, + ClusterIdentity: clusterIdentity, + } + + return this +} + +// StoredActivation contains +type StoredActivation struct { + Pid string + MemberID string +} + +func newStoredActivation(pid string, memberID string) *StoredActivation { + this := &StoredActivation{ + Pid: pid, + MemberID: memberID, + } + + return this +} + +// GetPid contains +type GetPid struct { + ClusterIdentity *cluster.ClusterIdentity +} + +func newGetPid(clusterIdentity *cluster.ClusterIdentity) *GetPid { + this := &GetPid{ + ClusterIdentity: clusterIdentity, + } + return this +} + +// PidResult contains +type PidResult struct { + Pid *actor.PID +} + +func newPidResult(p *actor.PID) *PidResult { + this := &PidResult{ + Pid: p, + } + return this +} diff --git a/cluster/identity/identity_storage_lookup.go b/cluster/identity/identity_storage_lookup.go new file mode 100644 index 000000000..8943dd288 --- /dev/null +++ b/cluster/identity/identity_storage_lookup.go @@ -0,0 +1,67 @@ +package identity + +import ( + "time" + + "github.com/AsynkronIT/protoactor-go/actor" + "github.com/AsynkronIT/protoactor-go/cluster" +) + +const ( + placementActorName = "placement-activator" + pidClusterIdentityStartIndex = len(placementActorName) + 1 +) + +// IdentityStorageLookup contains +type IdentityStorageLookup struct { + Storage StorageLookup + cluster *cluster.Cluster + isClient bool + placementActor *actor.PID + system *actor.ActorSystem + router *actor.PID + memberID string +} + +func newIdentityStorageLookup(storage StorageLookup) *IdentityStorageLookup { + this := &IdentityStorageLookup{ + Storage: storage, + } + return this +} + +// RemoveMember +func (i *IdentityStorageLookup) RemoveMember(memberID string) { + i.Storage.RemoveMemberId(memberID) +} + +// RemotePlacementActor +func RemotePlacementActor(address string) *actor.PID { + return actor.NewPID(address, placementActorName) +} + +// +// Interface: Lookup +// + +// Get +func (id *IdentityStorageLookup) Get(clusterIdentity *cluster.ClusterIdentity) *actor.PID { + msg := newGetPid(clusterIdentity) + timeout := 5 * time.Second + + res, _ := id.system.Root.RequestFuture(id.router, msg, timeout).Result() + response := res.(*actor.Future) + + return response.PID() +} + +func (id *IdentityStorageLookup) Setup(cluster *cluster.Cluster, kinds []string, isClient bool) { + id.cluster = cluster + id.system = cluster.ActorSystem + id.memberID = string(cluster.Id()) + + //workerProps := actor.PropsFromProducer(func() actor.Actor { return newIdentityStorageWorker(id) }) + + //routerProps := id.system.Root.(workerProps, 50); + +} diff --git a/cluster/identity/identity_storage_worker.go b/cluster/identity/identity_storage_worker.go new file mode 100644 index 000000000..a9919a63f --- /dev/null +++ b/cluster/identity/identity_storage_worker.go @@ -0,0 +1,50 @@ +package identity + +import ( + "log" + + "github.com/AsynkronIT/protoactor-go/actor" + "github.com/AsynkronIT/protoactor-go/cluster" +) + +type IdentityStorageWorker struct { + cluster *cluster.Cluster + lookup *IdentityStorageLookup + storage StorageLookup +} + +func newIdentityStorageWorker(storageLookup *IdentityStorageLookup) *IdentityStorageWorker { + this := &IdentityStorageWorker{ + cluster: storageLookup.cluster, + lookup: storageLookup, + storage: storageLookup.Storage, + } + return this +} + +// Receive func +func (ids *IdentityStorageWorker) Receive(c actor.Context) { + m := c.Message() + _, ok := m.(GetPid) + + if !ok { + return + } + + if c.Sender() == nil { + log.Println("No sender in GetPid request") + return + } + + cid := m.(GetPid).ClusterIdentity.Identity + "." + m.(GetPid).ClusterIdentity.Kind + + existing, _ := ids.cluster.PidCache.GetCache(cid) + + if existing != nil { + log.Printf("Found %s in pidcache", m.(GetPid).ClusterIdentity.ToShortString()) + c.Respond(newPidResult(existing)) + } + + return + // continue +} diff --git a/cluster/pid_cache.go b/cluster/pid_cache.go index 6e902933a..469e6f041 100644 --- a/cluster/pid_cache.go +++ b/cluster/pid_cache.go @@ -50,7 +50,7 @@ func (c *pidCacheValue) onMemberStatusEvent(evn interface{}) { } } -func (c *pidCacheValue) getCache(name string) (*actor.PID, bool) { +func (c *pidCacheValue) GetCache(name string) (*actor.PID, bool) { v, ok := c.cache.Get(name) if !ok { return nil, false diff --git a/cluster/protos.pb.go b/cluster/protos.pb.go index 33700fead..946811182 100644 --- a/cluster/protos.pb.go +++ b/cluster/protos.pb.go @@ -1,4228 +1 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: protos.proto - -package cluster - -import ( - bytes "bytes" - fmt "fmt" - actor "github.com/AsynkronIT/protoactor-go/actor" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - reflect "reflect" - strings "strings" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package - -type TakeOwnership struct { - Pid *actor.PID `protobuf:"bytes,1,opt,name=pid,proto3" json:"pid,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (m *TakeOwnership) Reset() { *m = TakeOwnership{} } -func (*TakeOwnership) ProtoMessage() {} -func (*TakeOwnership) Descriptor() ([]byte, []int) { - return fileDescriptor_5da3cbeb884d181c, []int{0} -} -func (m *TakeOwnership) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TakeOwnership) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TakeOwnership.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TakeOwnership) XXX_Merge(src proto.Message) { - xxx_messageInfo_TakeOwnership.Merge(m, src) -} -func (m *TakeOwnership) XXX_Size() int { - return m.Size() -} -func (m *TakeOwnership) XXX_DiscardUnknown() { - xxx_messageInfo_TakeOwnership.DiscardUnknown(m) -} - -var xxx_messageInfo_TakeOwnership proto.InternalMessageInfo - -func (m *TakeOwnership) GetPid() *actor.PID { - if m != nil { - return m.Pid - } - return nil -} - -func (m *TakeOwnership) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -//request response call from Identity actor sent to each member -//asking what activations they hold that belong to the requester -type IdentityHandoverRequest struct { - EventId uint64 `protobuf:"varint,1,opt,name=event_id,json=eventId,proto3" json:"event_id,omitempty"` - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` - Members []*Member `protobuf:"bytes,3,rep,name=members,proto3" json:"members,omitempty"` -} - -func (m *IdentityHandoverRequest) Reset() { *m = IdentityHandoverRequest{} } -func (*IdentityHandoverRequest) ProtoMessage() {} -func (*IdentityHandoverRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5da3cbeb884d181c, []int{1} -} -func (m *IdentityHandoverRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *IdentityHandoverRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_IdentityHandoverRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *IdentityHandoverRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_IdentityHandoverRequest.Merge(m, src) -} -func (m *IdentityHandoverRequest) XXX_Size() int { - return m.Size() -} -func (m *IdentityHandoverRequest) XXX_DiscardUnknown() { - xxx_messageInfo_IdentityHandoverRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_IdentityHandoverRequest proto.InternalMessageInfo - -func (m *IdentityHandoverRequest) GetEventId() uint64 { - if m != nil { - return m.EventId - } - return 0 -} - -func (m *IdentityHandoverRequest) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -func (m *IdentityHandoverRequest) GetMembers() []*Member { - if m != nil { - return m.Members - } - return nil -} - -//response message to the above -type IdentityHandoverResponse struct { - Actors []*Activation `protobuf:"bytes,1,rep,name=actors,proto3" json:"actors,omitempty"` -} - -func (m *IdentityHandoverResponse) Reset() { *m = IdentityHandoverResponse{} } -func (*IdentityHandoverResponse) ProtoMessage() {} -func (*IdentityHandoverResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5da3cbeb884d181c, []int{2} -} -func (m *IdentityHandoverResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *IdentityHandoverResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_IdentityHandoverResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *IdentityHandoverResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_IdentityHandoverResponse.Merge(m, src) -} -func (m *IdentityHandoverResponse) XXX_Size() int { - return m.Size() -} -func (m *IdentityHandoverResponse) XXX_DiscardUnknown() { - xxx_messageInfo_IdentityHandoverResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_IdentityHandoverResponse proto.InternalMessageInfo - -func (m *IdentityHandoverResponse) GetActors() []*Activation { - if m != nil { - return m.Actors - } - return nil -} - -type ClusterIdentity struct { - Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` - Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` -} - -func (m *ClusterIdentity) Reset() { *m = ClusterIdentity{} } -func (*ClusterIdentity) ProtoMessage() {} -func (*ClusterIdentity) Descriptor() ([]byte, []int) { - return fileDescriptor_5da3cbeb884d181c, []int{3} -} -func (m *ClusterIdentity) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ClusterIdentity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ClusterIdentity.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ClusterIdentity) XXX_Merge(src proto.Message) { - xxx_messageInfo_ClusterIdentity.Merge(m, src) -} -func (m *ClusterIdentity) XXX_Size() int { - return m.Size() -} -func (m *ClusterIdentity) XXX_DiscardUnknown() { - xxx_messageInfo_ClusterIdentity.DiscardUnknown(m) -} - -var xxx_messageInfo_ClusterIdentity proto.InternalMessageInfo - -func (m *ClusterIdentity) GetIdentity() string { - if m != nil { - return m.Identity - } - return "" -} - -func (m *ClusterIdentity) GetKind() string { - if m != nil { - return m.Kind - } - return "" -} - -type Activation struct { - Pid *actor.PID `protobuf:"bytes,1,opt,name=pid,proto3" json:"pid,omitempty"` - ClusterIdentity *ClusterIdentity `protobuf:"bytes,2,opt,name=cluster_identity,json=clusterIdentity,proto3" json:"cluster_identity,omitempty"` - EventId uint64 `protobuf:"varint,3,opt,name=eventId,proto3" json:"eventId,omitempty"` -} - -func (m *Activation) Reset() { *m = Activation{} } -func (*Activation) ProtoMessage() {} -func (*Activation) Descriptor() ([]byte, []int) { - return fileDescriptor_5da3cbeb884d181c, []int{4} -} -func (m *Activation) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Activation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Activation.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Activation) XXX_Merge(src proto.Message) { - xxx_messageInfo_Activation.Merge(m, src) -} -func (m *Activation) XXX_Size() int { - return m.Size() -} -func (m *Activation) XXX_DiscardUnknown() { - xxx_messageInfo_Activation.DiscardUnknown(m) -} - -var xxx_messageInfo_Activation proto.InternalMessageInfo - -func (m *Activation) GetPid() *actor.PID { - if m != nil { - return m.Pid - } - return nil -} - -func (m *Activation) GetClusterIdentity() *ClusterIdentity { - if m != nil { - return m.ClusterIdentity - } - return nil -} - -func (m *Activation) GetEventId() uint64 { - if m != nil { - return m.EventId - } - return 0 -} - -type ActivationTerminated struct { - Pid *actor.PID `protobuf:"bytes,1,opt,name=pid,proto3" json:"pid,omitempty"` - ClusterIdentity *ClusterIdentity `protobuf:"bytes,2,opt,name=cluster_identity,json=clusterIdentity,proto3" json:"cluster_identity,omitempty"` - EventId uint64 `protobuf:"varint,3,opt,name=eventId,proto3" json:"eventId,omitempty"` -} - -func (m *ActivationTerminated) Reset() { *m = ActivationTerminated{} } -func (*ActivationTerminated) ProtoMessage() {} -func (*ActivationTerminated) Descriptor() ([]byte, []int) { - return fileDescriptor_5da3cbeb884d181c, []int{5} -} -func (m *ActivationTerminated) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ActivationTerminated) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ActivationTerminated.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ActivationTerminated) XXX_Merge(src proto.Message) { - xxx_messageInfo_ActivationTerminated.Merge(m, src) -} -func (m *ActivationTerminated) XXX_Size() int { - return m.Size() -} -func (m *ActivationTerminated) XXX_DiscardUnknown() { - xxx_messageInfo_ActivationTerminated.DiscardUnknown(m) -} - -var xxx_messageInfo_ActivationTerminated proto.InternalMessageInfo - -func (m *ActivationTerminated) GetPid() *actor.PID { - if m != nil { - return m.Pid - } - return nil -} - -func (m *ActivationTerminated) GetClusterIdentity() *ClusterIdentity { - if m != nil { - return m.ClusterIdentity - } - return nil -} - -func (m *ActivationTerminated) GetEventId() uint64 { - if m != nil { - return m.EventId - } - return 0 -} - -type ActivationRequest struct { - ClusterIdentity *ClusterIdentity `protobuf:"bytes,1,opt,name=cluster_identity,json=clusterIdentity,proto3" json:"cluster_identity,omitempty"` - RequestId string `protobuf:"bytes,2,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` -} - -func (m *ActivationRequest) Reset() { *m = ActivationRequest{} } -func (*ActivationRequest) ProtoMessage() {} -func (*ActivationRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5da3cbeb884d181c, []int{6} -} -func (m *ActivationRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ActivationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ActivationRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ActivationRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ActivationRequest.Merge(m, src) -} -func (m *ActivationRequest) XXX_Size() int { - return m.Size() -} -func (m *ActivationRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ActivationRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ActivationRequest proto.InternalMessageInfo - -func (m *ActivationRequest) GetClusterIdentity() *ClusterIdentity { - if m != nil { - return m.ClusterIdentity - } - return nil -} - -func (m *ActivationRequest) GetRequestId() string { - if m != nil { - return m.RequestId - } - return "" -} - -type ActivationResponse struct { - Pid *actor.PID `protobuf:"bytes,1,opt,name=pid,proto3" json:"pid,omitempty"` - StatusCode uint32 `protobuf:"varint,2,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"` -} - -func (m *ActivationResponse) Reset() { *m = ActivationResponse{} } -func (*ActivationResponse) ProtoMessage() {} -func (*ActivationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5da3cbeb884d181c, []int{7} -} -func (m *ActivationResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ActivationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ActivationResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ActivationResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ActivationResponse.Merge(m, src) -} -func (m *ActivationResponse) XXX_Size() int { - return m.Size() -} -func (m *ActivationResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ActivationResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ActivationResponse proto.InternalMessageInfo - -func (m *ActivationResponse) GetPid() *actor.PID { - if m != nil { - return m.Pid - } - return nil -} - -func (m *ActivationResponse) GetStatusCode() uint32 { - if m != nil { - return m.StatusCode - } - return 0 -} - -type GrainRequest struct { - MethodIndex int32 `protobuf:"varint,1,opt,name=method_index,json=methodIndex,proto3" json:"method_index,omitempty"` - MessageData []byte `protobuf:"bytes,2,opt,name=message_data,json=messageData,proto3" json:"message_data,omitempty"` -} - -func (m *GrainRequest) Reset() { *m = GrainRequest{} } -func (*GrainRequest) ProtoMessage() {} -func (*GrainRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5da3cbeb884d181c, []int{8} -} -func (m *GrainRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GrainRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GrainRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GrainRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GrainRequest.Merge(m, src) -} -func (m *GrainRequest) XXX_Size() int { - return m.Size() -} -func (m *GrainRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GrainRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GrainRequest proto.InternalMessageInfo - -func (m *GrainRequest) GetMethodIndex() int32 { - if m != nil { - return m.MethodIndex - } - return 0 -} - -func (m *GrainRequest) GetMessageData() []byte { - if m != nil { - return m.MessageData - } - return nil -} - -type GrainResponse struct { - MessageData []byte `protobuf:"bytes,1,opt,name=message_data,json=messageData,proto3" json:"message_data,omitempty"` -} - -func (m *GrainResponse) Reset() { *m = GrainResponse{} } -func (*GrainResponse) ProtoMessage() {} -func (*GrainResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5da3cbeb884d181c, []int{9} -} -func (m *GrainResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GrainResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GrainResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GrainResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GrainResponse.Merge(m, src) -} -func (m *GrainResponse) XXX_Size() int { - return m.Size() -} -func (m *GrainResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GrainResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GrainResponse proto.InternalMessageInfo - -func (m *GrainResponse) GetMessageData() []byte { - if m != nil { - return m.MessageData - } - return nil -} - -type GrainErrorResponse struct { - Err string `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"` - Code int32 `protobuf:"varint,2,opt,name=code,proto3" json:"code,omitempty"` -} - -func (m *GrainErrorResponse) Reset() { *m = GrainErrorResponse{} } -func (*GrainErrorResponse) ProtoMessage() {} -func (*GrainErrorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5da3cbeb884d181c, []int{10} -} -func (m *GrainErrorResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GrainErrorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GrainErrorResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GrainErrorResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GrainErrorResponse.Merge(m, src) -} -func (m *GrainErrorResponse) XXX_Size() int { - return m.Size() -} -func (m *GrainErrorResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GrainErrorResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GrainErrorResponse proto.InternalMessageInfo - -func (m *GrainErrorResponse) GetErr() string { - if m != nil { - return m.Err - } - return "" -} - -func (m *GrainErrorResponse) GetCode() int32 { - if m != nil { - return m.Code - } - return 0 -} - -type Member struct { - Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` - Port int32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` - Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` - Kinds []string `protobuf:"bytes,4,rep,name=kinds,proto3" json:"kinds,omitempty"` -} - -func (m *Member) Reset() { *m = Member{} } -func (*Member) ProtoMessage() {} -func (*Member) Descriptor() ([]byte, []int) { - return fileDescriptor_5da3cbeb884d181c, []int{11} -} -func (m *Member) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Member) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Member.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Member) XXX_Merge(src proto.Message) { - xxx_messageInfo_Member.Merge(m, src) -} -func (m *Member) XXX_Size() int { - return m.Size() -} -func (m *Member) XXX_DiscardUnknown() { - xxx_messageInfo_Member.DiscardUnknown(m) -} - -var xxx_messageInfo_Member proto.InternalMessageInfo - -func (m *Member) GetHost() string { - if m != nil { - return m.Host - } - return "" -} - -func (m *Member) GetPort() int32 { - if m != nil { - return m.Port - } - return 0 -} - -func (m *Member) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -func (m *Member) GetKinds() []string { - if m != nil { - return m.Kinds - } - return nil -} - -type ClusterTopology struct { - EventId uint64 `protobuf:"varint,1,opt,name=event_id,json=eventId,proto3" json:"event_id,omitempty"` - Members []*Member `protobuf:"bytes,2,rep,name=members,proto3" json:"members,omitempty"` - Joined []*Member `protobuf:"bytes,3,rep,name=joined,proto3" json:"joined,omitempty"` - Left []*Member `protobuf:"bytes,4,rep,name=left,proto3" json:"left,omitempty"` - Banned []*Member `protobuf:"bytes,5,rep,name=banned,proto3" json:"banned,omitempty"` -} - -func (m *ClusterTopology) Reset() { *m = ClusterTopology{} } -func (*ClusterTopology) ProtoMessage() {} -func (*ClusterTopology) Descriptor() ([]byte, []int) { - return fileDescriptor_5da3cbeb884d181c, []int{12} -} -func (m *ClusterTopology) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ClusterTopology) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ClusterTopology.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ClusterTopology) XXX_Merge(src proto.Message) { - xxx_messageInfo_ClusterTopology.Merge(m, src) -} -func (m *ClusterTopology) XXX_Size() int { - return m.Size() -} -func (m *ClusterTopology) XXX_DiscardUnknown() { - xxx_messageInfo_ClusterTopology.DiscardUnknown(m) -} - -var xxx_messageInfo_ClusterTopology proto.InternalMessageInfo - -func (m *ClusterTopology) GetEventId() uint64 { - if m != nil { - return m.EventId - } - return 0 -} - -func (m *ClusterTopology) GetMembers() []*Member { - if m != nil { - return m.Members - } - return nil -} - -func (m *ClusterTopology) GetJoined() []*Member { - if m != nil { - return m.Joined - } - return nil -} - -func (m *ClusterTopology) GetLeft() []*Member { - if m != nil { - return m.Left - } - return nil -} - -func (m *ClusterTopology) GetBanned() []*Member { - if m != nil { - return m.Banned - } - return nil -} - -type HeartbeatRequest struct { -} - -func (m *HeartbeatRequest) Reset() { *m = HeartbeatRequest{} } -func (*HeartbeatRequest) ProtoMessage() {} -func (*HeartbeatRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5da3cbeb884d181c, []int{13} -} -func (m *HeartbeatRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *HeartbeatRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_HeartbeatRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *HeartbeatRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_HeartbeatRequest.Merge(m, src) -} -func (m *HeartbeatRequest) XXX_Size() int { - return m.Size() -} -func (m *HeartbeatRequest) XXX_DiscardUnknown() { - xxx_messageInfo_HeartbeatRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_HeartbeatRequest proto.InternalMessageInfo - -type HeartbeatResponse struct { - ActorCount uint32 `protobuf:"varint,1,opt,name=actor_count,json=actorCount,proto3" json:"actor_count,omitempty"` -} - -func (m *HeartbeatResponse) Reset() { *m = HeartbeatResponse{} } -func (*HeartbeatResponse) ProtoMessage() {} -func (*HeartbeatResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5da3cbeb884d181c, []int{14} -} -func (m *HeartbeatResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *HeartbeatResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_HeartbeatResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *HeartbeatResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_HeartbeatResponse.Merge(m, src) -} -func (m *HeartbeatResponse) XXX_Size() int { - return m.Size() -} -func (m *HeartbeatResponse) XXX_DiscardUnknown() { - xxx_messageInfo_HeartbeatResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_HeartbeatResponse proto.InternalMessageInfo - -func (m *HeartbeatResponse) GetActorCount() uint32 { - if m != nil { - return m.ActorCount - } - return 0 -} - -func init() { - proto.RegisterType((*TakeOwnership)(nil), "cluster.TakeOwnership") - proto.RegisterType((*IdentityHandoverRequest)(nil), "cluster.IdentityHandoverRequest") - proto.RegisterType((*IdentityHandoverResponse)(nil), "cluster.IdentityHandoverResponse") - proto.RegisterType((*ClusterIdentity)(nil), "cluster.ClusterIdentity") - proto.RegisterType((*Activation)(nil), "cluster.Activation") - proto.RegisterType((*ActivationTerminated)(nil), "cluster.ActivationTerminated") - proto.RegisterType((*ActivationRequest)(nil), "cluster.ActivationRequest") - proto.RegisterType((*ActivationResponse)(nil), "cluster.ActivationResponse") - proto.RegisterType((*GrainRequest)(nil), "cluster.GrainRequest") - proto.RegisterType((*GrainResponse)(nil), "cluster.GrainResponse") - proto.RegisterType((*GrainErrorResponse)(nil), "cluster.GrainErrorResponse") - proto.RegisterType((*Member)(nil), "cluster.Member") - proto.RegisterType((*ClusterTopology)(nil), "cluster.ClusterTopology") - proto.RegisterType((*HeartbeatRequest)(nil), "cluster.HeartbeatRequest") - proto.RegisterType((*HeartbeatResponse)(nil), "cluster.HeartbeatResponse") -} - -func init() { proto.RegisterFile("protos.proto", fileDescriptor_5da3cbeb884d181c) } - -var fileDescriptor_5da3cbeb884d181c = []byte{ - // 709 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x54, 0xcd, 0x6e, 0x13, 0x31, - 0x10, 0x8e, 0xf3, 0xdb, 0x4c, 0x12, 0xda, 0x9a, 0x4a, 0x2c, 0x15, 0x6c, 0xc3, 0x72, 0x20, 0x08, - 0x35, 0x91, 0x4a, 0xc5, 0x81, 0x5b, 0x48, 0x51, 0x9b, 0x03, 0x02, 0x2d, 0x11, 0xd7, 0xc8, 0x89, - 0xdd, 0x64, 0x69, 0x63, 0x07, 0xdb, 0x69, 0xc9, 0x8d, 0x2b, 0x37, 0x24, 0x5e, 0x82, 0x47, 0xe1, - 0x84, 0x7a, 0xec, 0x91, 0xa6, 0x17, 0x8e, 0x7d, 0x04, 0x64, 0xaf, 0x93, 0x86, 0xfe, 0x21, 0x4e, - 0x9c, 0x76, 0xe6, 0x9b, 0x99, 0x6f, 0x66, 0x3f, 0x8f, 0x0d, 0xc5, 0xa1, 0x14, 0x5a, 0xa8, 0xaa, - 0xfd, 0xe0, 0x5c, 0x77, 0x7f, 0xa4, 0x34, 0x93, 0xab, 0xeb, 0xbd, 0x48, 0xf7, 0x47, 0x9d, 0x6a, - 0x57, 0x0c, 0x6a, 0x3d, 0xd1, 0x13, 0x35, 0x1b, 0xef, 0x8c, 0x76, 0xad, 0x67, 0x1d, 0x6b, 0xc5, - 0x75, 0xab, 0xcf, 0xe6, 0xd2, 0xeb, 0x6a, 0xcc, 0xf7, 0xa4, 0xe0, 0xcd, 0x56, 0x5c, 0x44, 0xba, - 0x5a, 0xc8, 0xf5, 0x9e, 0xa8, 0x59, 0xa3, 0x36, 0xdf, 0x2f, 0xa8, 0x43, 0xa9, 0x45, 0xf6, 0xd8, - 0xeb, 0x43, 0xce, 0xa4, 0xea, 0x47, 0x43, 0x7c, 0x0f, 0x52, 0xc3, 0x88, 0x7a, 0xa8, 0x8c, 0x2a, - 0x85, 0x0d, 0xa8, 0xda, 0x92, 0xea, 0x9b, 0xe6, 0x56, 0x68, 0x60, 0x8c, 0x21, 0xcd, 0xc9, 0x80, - 0x79, 0xc9, 0x32, 0xaa, 0xe4, 0x43, 0x6b, 0x07, 0x63, 0xb8, 0xd3, 0xa4, 0x8c, 0xeb, 0x48, 0x8f, - 0x77, 0x08, 0xa7, 0xe2, 0x80, 0xc9, 0x90, 0x7d, 0x18, 0x31, 0xa5, 0xf1, 0x5d, 0x58, 0x60, 0x07, - 0x8c, 0xeb, 0xb6, 0x63, 0x4c, 0x87, 0x39, 0xeb, 0x37, 0x29, 0xf6, 0x20, 0x47, 0x28, 0x95, 0x4c, - 0x29, 0x47, 0x36, 0x75, 0xf1, 0x63, 0xc8, 0x0d, 0xd8, 0xa0, 0xc3, 0xa4, 0xf2, 0x52, 0xe5, 0x54, - 0xa5, 0xb0, 0xb1, 0x58, 0x75, 0xa2, 0x54, 0x5f, 0x59, 0x3c, 0x9c, 0xc6, 0x83, 0x6d, 0xf0, 0x2e, - 0xb7, 0x56, 0x43, 0xc1, 0x15, 0xc3, 0x4f, 0x20, 0x6b, 0x87, 0x57, 0x1e, 0xb2, 0x2c, 0xb7, 0x67, - 0x2c, 0xf5, 0xae, 0x8e, 0x0e, 0x88, 0x8e, 0x04, 0x0f, 0x5d, 0x4a, 0x50, 0x87, 0xc5, 0x46, 0x1c, - 0x9d, 0xf2, 0xe1, 0x55, 0x58, 0x88, 0x9c, 0x6d, 0x67, 0xcf, 0x87, 0x33, 0xdf, 0xc8, 0xb0, 0x17, - 0x71, 0x3a, 0x95, 0xc1, 0xd8, 0xc1, 0x67, 0x04, 0x70, 0xce, 0xfc, 0x17, 0x1d, 0x1b, 0xb0, 0xe4, - 0xa6, 0x69, 0xcf, 0x9a, 0x24, 0x6d, 0xaa, 0x37, 0x1b, 0xf3, 0xc2, 0x40, 0xe1, 0x62, 0xf7, 0xc2, - 0x84, 0x1e, 0x4c, 0xd5, 0xf4, 0x52, 0x7f, 0x88, 0x1b, 0x7c, 0x45, 0xb0, 0x72, 0x3e, 0x4b, 0x8b, - 0xc9, 0x41, 0xc4, 0x89, 0x66, 0xf4, 0xff, 0x4e, 0x75, 0x08, 0xcb, 0x73, 0xd2, 0xbb, 0x15, 0xb9, - 0xaa, 0x27, 0xfa, 0xd7, 0x9e, 0xf7, 0x01, 0x64, 0xcc, 0x67, 0x36, 0x2d, 0x3e, 0x95, 0xbc, 0x43, - 0x9a, 0x34, 0x78, 0x0b, 0x78, 0xbe, 0xb1, 0x5b, 0x90, 0x9b, 0xb5, 0x58, 0x83, 0x82, 0xd2, 0x44, - 0x8f, 0x54, 0xbb, 0x2b, 0x68, 0xbc, 0xf0, 0xa5, 0x10, 0x62, 0xa8, 0x21, 0x28, 0x0b, 0x5a, 0x50, - 0xdc, 0x96, 0x24, 0x9a, 0xfd, 0xc8, 0x03, 0x28, 0x0e, 0x98, 0xee, 0x0b, 0xda, 0x8e, 0x38, 0x65, - 0x1f, 0x2d, 0x6f, 0x26, 0x2c, 0xc4, 0x58, 0xd3, 0x40, 0x71, 0x8a, 0x52, 0xa4, 0xc7, 0xda, 0x94, - 0x68, 0x62, 0x49, 0x8b, 0x26, 0xc5, 0x62, 0x5b, 0x44, 0x93, 0x60, 0x03, 0x4a, 0x8e, 0xd5, 0x4d, - 0x79, 0xb1, 0x06, 0x5d, 0xae, 0x79, 0x0e, 0xd8, 0xd6, 0xbc, 0x94, 0x52, 0x9c, 0xef, 0xff, 0x12, - 0xa4, 0x98, 0x94, 0x6e, 0x75, 0x8d, 0x69, 0xb6, 0x76, 0xf6, 0x2f, 0x99, 0xd0, 0xda, 0xc1, 0x3b, - 0xc8, 0xc6, 0x97, 0xca, 0x44, 0xfb, 0x42, 0x69, 0x57, 0x60, 0x6d, 0x83, 0x0d, 0x85, 0xd4, 0xd3, - 0x0a, 0x63, 0xe3, 0x5b, 0x90, 0x8c, 0xe2, 0xa3, 0xcd, 0x87, 0xc9, 0x88, 0xe2, 0x15, 0xc8, 0x98, - 0xfd, 0x57, 0x5e, 0xba, 0x9c, 0xaa, 0xe4, 0xc3, 0xd8, 0x09, 0x7e, 0xa0, 0xd9, 0x8d, 0x6a, 0x89, - 0xa1, 0xd8, 0x17, 0xbd, 0xf1, 0x4d, 0xaf, 0xc1, 0xdc, 0x9d, 0x4f, 0xde, 0x7c, 0xe7, 0xf1, 0x23, - 0xc8, 0xbe, 0x17, 0x11, 0x67, 0xf4, 0xba, 0xd7, 0xc1, 0x85, 0xf1, 0x43, 0x48, 0xef, 0xb3, 0x5d, - 0x6d, 0xe7, 0xba, 0x22, 0xcd, 0x06, 0x0d, 0x5b, 0x87, 0x70, 0xc3, 0x96, 0xb9, 0x86, 0x2d, 0x0e, - 0x07, 0x18, 0x96, 0x76, 0x18, 0x91, 0xba, 0xc3, 0x88, 0x76, 0x47, 0x1e, 0x6c, 0xc2, 0xf2, 0x1c, - 0xe6, 0x74, 0x5f, 0x83, 0x82, 0x5d, 0xa5, 0x76, 0x57, 0x8c, 0x78, 0x2c, 0x67, 0x29, 0x04, 0x0b, - 0x35, 0x0c, 0xf2, 0x62, 0xf3, 0xe8, 0xc4, 0x4f, 0x1c, 0x9f, 0xf8, 0x89, 0xb3, 0x13, 0x3f, 0xf1, - 0x69, 0xe2, 0xa3, 0x6f, 0x13, 0x1f, 0x7d, 0x9f, 0xf8, 0xe8, 0x68, 0xe2, 0xa3, 0x9f, 0x13, 0x1f, - 0xfd, 0x9a, 0xf8, 0x89, 0xb3, 0x89, 0x8f, 0xbe, 0x9c, 0xfa, 0x89, 0xa3, 0x53, 0x3f, 0x71, 0x7c, - 0xea, 0x27, 0x3a, 0x59, 0xfb, 0x5e, 0x3f, 0xfd, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xe1, 0x1a, 0xfe, - 0x72, 0x2f, 0x06, 0x00, 0x00, -} - -func (this *TakeOwnership) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*TakeOwnership) - if !ok { - that2, ok := that.(TakeOwnership) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Pid.Equal(that1.Pid) { - return false - } - if this.Name != that1.Name { - return false - } - return true -} -func (this *IdentityHandoverRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*IdentityHandoverRequest) - if !ok { - that2, ok := that.(IdentityHandoverRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.EventId != that1.EventId { - return false - } - if this.Address != that1.Address { - return false - } - if len(this.Members) != len(that1.Members) { - return false - } - for i := range this.Members { - if !this.Members[i].Equal(that1.Members[i]) { - return false - } - } - return true -} -func (this *IdentityHandoverResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*IdentityHandoverResponse) - if !ok { - that2, ok := that.(IdentityHandoverResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Actors) != len(that1.Actors) { - return false - } - for i := range this.Actors { - if !this.Actors[i].Equal(that1.Actors[i]) { - return false - } - } - return true -} -func (this *ClusterIdentity) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ClusterIdentity) - if !ok { - that2, ok := that.(ClusterIdentity) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Identity != that1.Identity { - return false - } - if this.Kind != that1.Kind { - return false - } - return true -} -func (this *Activation) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Activation) - if !ok { - that2, ok := that.(Activation) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Pid.Equal(that1.Pid) { - return false - } - if !this.ClusterIdentity.Equal(that1.ClusterIdentity) { - return false - } - if this.EventId != that1.EventId { - return false - } - return true -} -func (this *ActivationTerminated) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ActivationTerminated) - if !ok { - that2, ok := that.(ActivationTerminated) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Pid.Equal(that1.Pid) { - return false - } - if !this.ClusterIdentity.Equal(that1.ClusterIdentity) { - return false - } - if this.EventId != that1.EventId { - return false - } - return true -} -func (this *ActivationRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ActivationRequest) - if !ok { - that2, ok := that.(ActivationRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.ClusterIdentity.Equal(that1.ClusterIdentity) { - return false - } - if this.RequestId != that1.RequestId { - return false - } - return true -} -func (this *ActivationResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ActivationResponse) - if !ok { - that2, ok := that.(ActivationResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Pid.Equal(that1.Pid) { - return false - } - if this.StatusCode != that1.StatusCode { - return false - } - return true -} -func (this *GrainRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*GrainRequest) - if !ok { - that2, ok := that.(GrainRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.MethodIndex != that1.MethodIndex { - return false - } - if !bytes.Equal(this.MessageData, that1.MessageData) { - return false - } - return true -} -func (this *GrainResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*GrainResponse) - if !ok { - that2, ok := that.(GrainResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !bytes.Equal(this.MessageData, that1.MessageData) { - return false - } - return true -} -func (this *GrainErrorResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*GrainErrorResponse) - if !ok { - that2, ok := that.(GrainErrorResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Err != that1.Err { - return false - } - if this.Code != that1.Code { - return false - } - return true -} -func (this *Member) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Member) - if !ok { - that2, ok := that.(Member) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Host != that1.Host { - return false - } - if this.Port != that1.Port { - return false - } - if this.Id != that1.Id { - return false - } - if len(this.Kinds) != len(that1.Kinds) { - return false - } - for i := range this.Kinds { - if this.Kinds[i] != that1.Kinds[i] { - return false - } - } - return true -} -func (this *ClusterTopology) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ClusterTopology) - if !ok { - that2, ok := that.(ClusterTopology) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.EventId != that1.EventId { - return false - } - if len(this.Members) != len(that1.Members) { - return false - } - for i := range this.Members { - if !this.Members[i].Equal(that1.Members[i]) { - return false - } - } - if len(this.Joined) != len(that1.Joined) { - return false - } - for i := range this.Joined { - if !this.Joined[i].Equal(that1.Joined[i]) { - return false - } - } - if len(this.Left) != len(that1.Left) { - return false - } - for i := range this.Left { - if !this.Left[i].Equal(that1.Left[i]) { - return false - } - } - if len(this.Banned) != len(that1.Banned) { - return false - } - for i := range this.Banned { - if !this.Banned[i].Equal(that1.Banned[i]) { - return false - } - } - return true -} -func (this *HeartbeatRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*HeartbeatRequest) - if !ok { - that2, ok := that.(HeartbeatRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - return true -} -func (this *HeartbeatResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*HeartbeatResponse) - if !ok { - that2, ok := that.(HeartbeatResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.ActorCount != that1.ActorCount { - return false - } - return true -} -func (m *TakeOwnership) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TakeOwnership) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Pid != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintProtos(dAtA, i, uint64(m.Pid.Size())) - n1, err := m.Pid.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 - } - if len(m.Name) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintProtos(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - return i, nil -} - -func (m *IdentityHandoverRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *IdentityHandoverRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.EventId != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintProtos(dAtA, i, uint64(m.EventId)) - } - if len(m.Address) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintProtos(dAtA, i, uint64(len(m.Address))) - i += copy(dAtA[i:], m.Address) - } - if len(m.Members) > 0 { - for _, msg := range m.Members { - dAtA[i] = 0x1a - i++ - i = encodeVarintProtos(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - return i, nil -} - -func (m *IdentityHandoverResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *IdentityHandoverResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Actors) > 0 { - for _, msg := range m.Actors { - dAtA[i] = 0xa - i++ - i = encodeVarintProtos(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - return i, nil -} - -func (m *ClusterIdentity) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ClusterIdentity) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Identity) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintProtos(dAtA, i, uint64(len(m.Identity))) - i += copy(dAtA[i:], m.Identity) - } - if len(m.Kind) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintProtos(dAtA, i, uint64(len(m.Kind))) - i += copy(dAtA[i:], m.Kind) - } - return i, nil -} - -func (m *Activation) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Activation) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Pid != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintProtos(dAtA, i, uint64(m.Pid.Size())) - n2, err := m.Pid.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 - } - if m.ClusterIdentity != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintProtos(dAtA, i, uint64(m.ClusterIdentity.Size())) - n3, err := m.ClusterIdentity.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n3 - } - if m.EventId != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintProtos(dAtA, i, uint64(m.EventId)) - } - return i, nil -} - -func (m *ActivationTerminated) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ActivationTerminated) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Pid != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintProtos(dAtA, i, uint64(m.Pid.Size())) - n4, err := m.Pid.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n4 - } - if m.ClusterIdentity != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintProtos(dAtA, i, uint64(m.ClusterIdentity.Size())) - n5, err := m.ClusterIdentity.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n5 - } - if m.EventId != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintProtos(dAtA, i, uint64(m.EventId)) - } - return i, nil -} - -func (m *ActivationRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ActivationRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.ClusterIdentity != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintProtos(dAtA, i, uint64(m.ClusterIdentity.Size())) - n6, err := m.ClusterIdentity.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n6 - } - if len(m.RequestId) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintProtos(dAtA, i, uint64(len(m.RequestId))) - i += copy(dAtA[i:], m.RequestId) - } - return i, nil -} - -func (m *ActivationResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ActivationResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Pid != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintProtos(dAtA, i, uint64(m.Pid.Size())) - n7, err := m.Pid.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n7 - } - if m.StatusCode != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintProtos(dAtA, i, uint64(m.StatusCode)) - } - return i, nil -} - -func (m *GrainRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GrainRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.MethodIndex != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintProtos(dAtA, i, uint64(m.MethodIndex)) - } - if len(m.MessageData) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintProtos(dAtA, i, uint64(len(m.MessageData))) - i += copy(dAtA[i:], m.MessageData) - } - return i, nil -} - -func (m *GrainResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GrainResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.MessageData) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintProtos(dAtA, i, uint64(len(m.MessageData))) - i += copy(dAtA[i:], m.MessageData) - } - return i, nil -} - -func (m *GrainErrorResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GrainErrorResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Err) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintProtos(dAtA, i, uint64(len(m.Err))) - i += copy(dAtA[i:], m.Err) - } - if m.Code != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintProtos(dAtA, i, uint64(m.Code)) - } - return i, nil -} - -func (m *Member) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Member) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Host) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintProtos(dAtA, i, uint64(len(m.Host))) - i += copy(dAtA[i:], m.Host) - } - if m.Port != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintProtos(dAtA, i, uint64(m.Port)) - } - if len(m.Id) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintProtos(dAtA, i, uint64(len(m.Id))) - i += copy(dAtA[i:], m.Id) - } - if len(m.Kinds) > 0 { - for _, s := range m.Kinds { - dAtA[i] = 0x22 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - return i, nil -} - -func (m *ClusterTopology) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ClusterTopology) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.EventId != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintProtos(dAtA, i, uint64(m.EventId)) - } - if len(m.Members) > 0 { - for _, msg := range m.Members { - dAtA[i] = 0x12 - i++ - i = encodeVarintProtos(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.Joined) > 0 { - for _, msg := range m.Joined { - dAtA[i] = 0x1a - i++ - i = encodeVarintProtos(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.Left) > 0 { - for _, msg := range m.Left { - dAtA[i] = 0x22 - i++ - i = encodeVarintProtos(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.Banned) > 0 { - for _, msg := range m.Banned { - dAtA[i] = 0x2a - i++ - i = encodeVarintProtos(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - return i, nil -} - -func (m *HeartbeatRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *HeartbeatRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - return i, nil -} - -func (m *HeartbeatResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *HeartbeatResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.ActorCount != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintProtos(dAtA, i, uint64(m.ActorCount)) - } - return i, nil -} - -func encodeVarintProtos(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *TakeOwnership) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pid != nil { - l = m.Pid.Size() - n += 1 + l + sovProtos(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovProtos(uint64(l)) - } - return n -} - -func (m *IdentityHandoverRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.EventId != 0 { - n += 1 + sovProtos(uint64(m.EventId)) - } - l = len(m.Address) - if l > 0 { - n += 1 + l + sovProtos(uint64(l)) - } - if len(m.Members) > 0 { - for _, e := range m.Members { - l = e.Size() - n += 1 + l + sovProtos(uint64(l)) - } - } - return n -} - -func (m *IdentityHandoverResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Actors) > 0 { - for _, e := range m.Actors { - l = e.Size() - n += 1 + l + sovProtos(uint64(l)) - } - } - return n -} - -func (m *ClusterIdentity) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Identity) - if l > 0 { - n += 1 + l + sovProtos(uint64(l)) - } - l = len(m.Kind) - if l > 0 { - n += 1 + l + sovProtos(uint64(l)) - } - return n -} - -func (m *Activation) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pid != nil { - l = m.Pid.Size() - n += 1 + l + sovProtos(uint64(l)) - } - if m.ClusterIdentity != nil { - l = m.ClusterIdentity.Size() - n += 1 + l + sovProtos(uint64(l)) - } - if m.EventId != 0 { - n += 1 + sovProtos(uint64(m.EventId)) - } - return n -} - -func (m *ActivationTerminated) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pid != nil { - l = m.Pid.Size() - n += 1 + l + sovProtos(uint64(l)) - } - if m.ClusterIdentity != nil { - l = m.ClusterIdentity.Size() - n += 1 + l + sovProtos(uint64(l)) - } - if m.EventId != 0 { - n += 1 + sovProtos(uint64(m.EventId)) - } - return n -} - -func (m *ActivationRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ClusterIdentity != nil { - l = m.ClusterIdentity.Size() - n += 1 + l + sovProtos(uint64(l)) - } - l = len(m.RequestId) - if l > 0 { - n += 1 + l + sovProtos(uint64(l)) - } - return n -} - -func (m *ActivationResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pid != nil { - l = m.Pid.Size() - n += 1 + l + sovProtos(uint64(l)) - } - if m.StatusCode != 0 { - n += 1 + sovProtos(uint64(m.StatusCode)) - } - return n -} - -func (m *GrainRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MethodIndex != 0 { - n += 1 + sovProtos(uint64(m.MethodIndex)) - } - l = len(m.MessageData) - if l > 0 { - n += 1 + l + sovProtos(uint64(l)) - } - return n -} - -func (m *GrainResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.MessageData) - if l > 0 { - n += 1 + l + sovProtos(uint64(l)) - } - return n -} - -func (m *GrainErrorResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Err) - if l > 0 { - n += 1 + l + sovProtos(uint64(l)) - } - if m.Code != 0 { - n += 1 + sovProtos(uint64(m.Code)) - } - return n -} - -func (m *Member) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Host) - if l > 0 { - n += 1 + l + sovProtos(uint64(l)) - } - if m.Port != 0 { - n += 1 + sovProtos(uint64(m.Port)) - } - l = len(m.Id) - if l > 0 { - n += 1 + l + sovProtos(uint64(l)) - } - if len(m.Kinds) > 0 { - for _, s := range m.Kinds { - l = len(s) - n += 1 + l + sovProtos(uint64(l)) - } - } - return n -} - -func (m *ClusterTopology) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.EventId != 0 { - n += 1 + sovProtos(uint64(m.EventId)) - } - if len(m.Members) > 0 { - for _, e := range m.Members { - l = e.Size() - n += 1 + l + sovProtos(uint64(l)) - } - } - if len(m.Joined) > 0 { - for _, e := range m.Joined { - l = e.Size() - n += 1 + l + sovProtos(uint64(l)) - } - } - if len(m.Left) > 0 { - for _, e := range m.Left { - l = e.Size() - n += 1 + l + sovProtos(uint64(l)) - } - } - if len(m.Banned) > 0 { - for _, e := range m.Banned { - l = e.Size() - n += 1 + l + sovProtos(uint64(l)) - } - } - return n -} - -func (m *HeartbeatRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *HeartbeatResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ActorCount != 0 { - n += 1 + sovProtos(uint64(m.ActorCount)) - } - return n -} - -func sovProtos(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozProtos(x uint64) (n int) { - return sovProtos(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *TakeOwnership) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TakeOwnership{`, - `Pid:` + strings.Replace(fmt.Sprintf("%v", this.Pid), "PID", "actor.PID", 1) + `,`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `}`, - }, "") - return s -} -func (this *IdentityHandoverRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&IdentityHandoverRequest{`, - `EventId:` + fmt.Sprintf("%v", this.EventId) + `,`, - `Address:` + fmt.Sprintf("%v", this.Address) + `,`, - `Members:` + strings.Replace(fmt.Sprintf("%v", this.Members), "Member", "Member", 1) + `,`, - `}`, - }, "") - return s -} -func (this *IdentityHandoverResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&IdentityHandoverResponse{`, - `Actors:` + strings.Replace(fmt.Sprintf("%v", this.Actors), "Activation", "Activation", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ClusterIdentity) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ClusterIdentity{`, - `Identity:` + fmt.Sprintf("%v", this.Identity) + `,`, - `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, - `}`, - }, "") - return s -} -func (this *Activation) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Activation{`, - `Pid:` + strings.Replace(fmt.Sprintf("%v", this.Pid), "PID", "actor.PID", 1) + `,`, - `ClusterIdentity:` + strings.Replace(fmt.Sprintf("%v", this.ClusterIdentity), "ClusterIdentity", "ClusterIdentity", 1) + `,`, - `EventId:` + fmt.Sprintf("%v", this.EventId) + `,`, - `}`, - }, "") - return s -} -func (this *ActivationTerminated) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ActivationTerminated{`, - `Pid:` + strings.Replace(fmt.Sprintf("%v", this.Pid), "PID", "actor.PID", 1) + `,`, - `ClusterIdentity:` + strings.Replace(fmt.Sprintf("%v", this.ClusterIdentity), "ClusterIdentity", "ClusterIdentity", 1) + `,`, - `EventId:` + fmt.Sprintf("%v", this.EventId) + `,`, - `}`, - }, "") - return s -} -func (this *ActivationRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ActivationRequest{`, - `ClusterIdentity:` + strings.Replace(fmt.Sprintf("%v", this.ClusterIdentity), "ClusterIdentity", "ClusterIdentity", 1) + `,`, - `RequestId:` + fmt.Sprintf("%v", this.RequestId) + `,`, - `}`, - }, "") - return s -} -func (this *ActivationResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ActivationResponse{`, - `Pid:` + strings.Replace(fmt.Sprintf("%v", this.Pid), "PID", "actor.PID", 1) + `,`, - `StatusCode:` + fmt.Sprintf("%v", this.StatusCode) + `,`, - `}`, - }, "") - return s -} -func (this *GrainRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GrainRequest{`, - `MethodIndex:` + fmt.Sprintf("%v", this.MethodIndex) + `,`, - `MessageData:` + fmt.Sprintf("%v", this.MessageData) + `,`, - `}`, - }, "") - return s -} -func (this *GrainResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GrainResponse{`, - `MessageData:` + fmt.Sprintf("%v", this.MessageData) + `,`, - `}`, - }, "") - return s -} -func (this *GrainErrorResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GrainErrorResponse{`, - `Err:` + fmt.Sprintf("%v", this.Err) + `,`, - `Code:` + fmt.Sprintf("%v", this.Code) + `,`, - `}`, - }, "") - return s -} -func (this *Member) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Member{`, - `Host:` + fmt.Sprintf("%v", this.Host) + `,`, - `Port:` + fmt.Sprintf("%v", this.Port) + `,`, - `Id:` + fmt.Sprintf("%v", this.Id) + `,`, - `Kinds:` + fmt.Sprintf("%v", this.Kinds) + `,`, - `}`, - }, "") - return s -} -func (this *ClusterTopology) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ClusterTopology{`, - `EventId:` + fmt.Sprintf("%v", this.EventId) + `,`, - `Members:` + strings.Replace(fmt.Sprintf("%v", this.Members), "Member", "Member", 1) + `,`, - `Joined:` + strings.Replace(fmt.Sprintf("%v", this.Joined), "Member", "Member", 1) + `,`, - `Left:` + strings.Replace(fmt.Sprintf("%v", this.Left), "Member", "Member", 1) + `,`, - `Banned:` + strings.Replace(fmt.Sprintf("%v", this.Banned), "Member", "Member", 1) + `,`, - `}`, - }, "") - return s -} -func (this *HeartbeatRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&HeartbeatRequest{`, - `}`, - }, "") - return s -} -func (this *HeartbeatResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&HeartbeatResponse{`, - `ActorCount:` + fmt.Sprintf("%v", this.ActorCount) + `,`, - `}`, - }, "") - return s -} -func valueToStringProtos(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *TakeOwnership) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TakeOwnership: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TakeOwnership: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pid", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProtos - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProtos - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pid == nil { - m.Pid = &actor.PID{} - } - if err := m.Pid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProtos - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProtos - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProtos(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProtos - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProtos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *IdentityHandoverRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: IdentityHandoverRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: IdentityHandoverRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EventId", wireType) - } - m.EventId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EventId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProtos - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProtos - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProtos - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProtos - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Members = append(m.Members, &Member{}) - if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProtos(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProtos - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProtos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *IdentityHandoverResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: IdentityHandoverResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: IdentityHandoverResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Actors", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProtos - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProtos - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Actors = append(m.Actors, &Activation{}) - if err := m.Actors[len(m.Actors)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProtos(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProtos - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProtos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ClusterIdentity) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ClusterIdentity: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ClusterIdentity: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Identity", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProtos - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProtos - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Identity = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProtos - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProtos - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Kind = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProtos(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProtos - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProtos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Activation) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Activation: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Activation: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pid", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProtos - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProtos - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pid == nil { - m.Pid = &actor.PID{} - } - if err := m.Pid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClusterIdentity", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProtos - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProtos - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ClusterIdentity == nil { - m.ClusterIdentity = &ClusterIdentity{} - } - if err := m.ClusterIdentity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EventId", wireType) - } - m.EventId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EventId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipProtos(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProtos - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProtos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ActivationTerminated) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActivationTerminated: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActivationTerminated: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pid", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProtos - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProtos - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pid == nil { - m.Pid = &actor.PID{} - } - if err := m.Pid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClusterIdentity", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProtos - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProtos - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ClusterIdentity == nil { - m.ClusterIdentity = &ClusterIdentity{} - } - if err := m.ClusterIdentity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EventId", wireType) - } - m.EventId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EventId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipProtos(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProtos - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProtos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ActivationRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActivationRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActivationRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClusterIdentity", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProtos - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProtos - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ClusterIdentity == nil { - m.ClusterIdentity = &ClusterIdentity{} - } - if err := m.ClusterIdentity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RequestId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProtos - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProtos - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RequestId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProtos(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProtos - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProtos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ActivationResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActivationResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActivationResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pid", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProtos - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProtos - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pid == nil { - m.Pid = &actor.PID{} - } - if err := m.Pid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StatusCode", wireType) - } - m.StatusCode = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StatusCode |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipProtos(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProtos - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProtos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GrainRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GrainRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GrainRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MethodIndex", wireType) - } - m.MethodIndex = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MethodIndex |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MessageData", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProtos - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProtos - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MessageData = append(m.MessageData[:0], dAtA[iNdEx:postIndex]...) - if m.MessageData == nil { - m.MessageData = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProtos(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProtos - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProtos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GrainResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GrainResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GrainResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MessageData", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProtos - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProtos - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MessageData = append(m.MessageData[:0], dAtA[iNdEx:postIndex]...) - if m.MessageData == nil { - m.MessageData = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProtos(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProtos - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProtos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GrainErrorResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GrainErrorResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GrainErrorResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Err", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProtos - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProtos - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Err = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) - } - m.Code = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Code |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipProtos(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProtos - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProtos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Member) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Member: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Member: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Host", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProtos - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProtos - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Host = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) - } - m.Port = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Port |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProtos - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProtos - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Id = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kinds", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProtos - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProtos - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Kinds = append(m.Kinds, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProtos(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProtos - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProtos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ClusterTopology) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ClusterTopology: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ClusterTopology: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EventId", wireType) - } - m.EventId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EventId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProtos - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProtos - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Members = append(m.Members, &Member{}) - if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Joined", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProtos - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProtos - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Joined = append(m.Joined, &Member{}) - if err := m.Joined[len(m.Joined)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Left", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProtos - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProtos - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Left = append(m.Left, &Member{}) - if err := m.Left[len(m.Left)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Banned", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProtos - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProtos - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Banned = append(m.Banned, &Member{}) - if err := m.Banned[len(m.Banned)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProtos(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProtos - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProtos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HeartbeatRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: HeartbeatRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HeartbeatRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipProtos(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProtos - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProtos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HeartbeatResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: HeartbeatResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HeartbeatResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ActorCount", wireType) - } - m.ActorCount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtos - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ActorCount |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipProtos(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProtos - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProtos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipProtos(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProtos - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProtos - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProtos - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthProtos - } - iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthProtos - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProtos - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipProtos(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthProtos - } - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthProtos = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowProtos = fmt.Errorf("proto: integer overflow") -) +.... \ No newline at end of file diff --git a/cluster/protos.proto b/cluster/protos.proto index 9ed93be5e..ed7d6d553 100644 --- a/cluster/protos.proto +++ b/cluster/protos.proto @@ -6,13 +6,6 @@ import "github.com/AsynkronIT/protoactor-go/actor/protos.proto"; option (gogoproto.gostring_all) = false; -message TakeOwnership { - actor.PID pid = 1; - string name = 2; -} - -// Copy from: -// https://github.com/AsynkronIT/protoactor-dotnet/blob/dev/src/Proto.Cluster/Protos.proto //request response call from Identity actor sent to each member //asking what activations they hold that belong to the requester @@ -35,13 +28,11 @@ message ClusterIdentity{ message Activation { actor.PID pid = 1; ClusterIdentity cluster_identity = 2; - uint64 eventId = 3; } message ActivationTerminated { actor.PID pid = 1; ClusterIdentity cluster_identity = 2; - uint64 eventId = 3; } message ActivationRequest { @@ -49,24 +40,28 @@ message ActivationRequest { string request_id = 2; } +message ProxyActivationRequest { + ClusterIdentity cluster_identity = 1; + actor.PID replaced_activation = 2; +} + message ActivationResponse { actor.PID pid = 1; - uint32 status_code = 2; } - message GrainRequest { int32 method_index = 1; bytes message_data = 2; + string message_type_name = 3; } message GrainResponse { - bytes message_data = 1; + bytes message_data = 1; + string message_type_name = 2; } message GrainErrorResponse { string err = 1; - int32 code = 2; } message Member { @@ -88,5 +83,86 @@ message HeartbeatRequest { } message HeartbeatResponse { - uint32 actor_count = 1; -} \ No newline at end of file + uint32 actor_count = 1; + string member_id = 2; + uint32 membership_hash_code = 3; +} + +message ClusterTopologyNotification { + string member_id = 1; + uint32 membership_hash_code = 2; + string leader_id = 3; +} + +message GracefulShutdown { + string member_id = 3; +} + + + +message SubscriberIdentity { + oneof Identity { + actor.PID pid = 1; + ClusterIdentity cluster_identity = 2; + } +} + +message Subscribers { + repeated SubscriberIdentity subscribers = 1; +} + +message SubscribeRequest { + SubscriberIdentity subscriber = 1; +} + +message SubscribeResponse { + +} + +message UnsubscribeRequest { + SubscriberIdentity subscriber = 1; +} + +message UnsubscribeResponse { + +} + +message PublishRequest { + bytes data = 1; +} + +message PublishResponse {} + +//this goes out to the delivery actors +message DeliveryBatch { + Subscribers subscribers = 1; + ProducerBatch batch = 2; +} + +//messages going into the topic actors +message ProducerBatch { + repeated string type_names = 1; + repeated ProducerEnvelope envelopes = 2; +} + +message ProducerEnvelope { + int32 type_id = 1; + bytes message_data = 2; + int32 serializer_id = 3; +} + +//messages going out of the topic actors +message TopicBatchRequest { + repeated string type_names = 1; + repeated TopicEnvelope envelopes = 2; +} + +message TopicBatchResponse { + +} + +message TopicEnvelope { + int32 type_id = 1; + bytes message_data = 2; + int32 serializer_id = 3; +}