From e6e232ebeda59b5bef47454efa689393a4748de6 Mon Sep 17 00:00:00 2001 From: Dongcheol Choe <40932237+dc7303@users.noreply.github.com> Date: Wed, 9 Jun 2021 09:51:33 +0900 Subject: [PATCH] Add document change event broadcast using members list (#189) Co-authored-by: Hackerwins --- api/converter/from_pb.go | 34 +- api/converter/to_pb.go | 29 +- api/yorkie.pb.go | 1854 ++++++++++++++------- api/yorkie.proto | 31 +- client/client.go | 10 +- pkg/types/event.go | 12 +- test/integration/cluster_mode_test.go | 6 +- yorkie/backend/sync/coordinator.go | 9 - yorkie/backend/sync/etcd/client.go | 19 +- yorkie/backend/sync/etcd/membermap.go | 5 +- yorkie/backend/sync/etcd/pubsub.go | 108 +- yorkie/backend/sync/memory/coordinator.go | 20 +- yorkie/backend/sync/memory/pubsub.go | 84 +- yorkie/backend/sync/memory/pubsub_test.go | 31 +- yorkie/backend/sync/pubsub.go | 21 +- yorkie/packs/pack_service.go | 9 +- yorkie/rpc/cluster.go | 36 + yorkie/rpc/server.go | 74 +- 18 files changed, 1613 insertions(+), 779 deletions(-) create mode 100644 yorkie/rpc/cluster.go diff --git a/api/converter/from_pb.go b/api/converter/from_pb.go index 2a2830734..863771795 100644 --- a/api/converter/from_pb.go +++ b/api/converter/from_pb.go @@ -27,6 +27,7 @@ import ( "github.com/yorkie-team/yorkie/pkg/document/operation" "github.com/yorkie-team/yorkie/pkg/document/time" "github.com/yorkie-team/yorkie/pkg/types" + "github.com/yorkie-team/yorkie/yorkie/backend/sync" ) // FromClient converts the given Protobuf format to model format. @@ -127,16 +128,35 @@ func FromDocumentKeys(pbKeys []*api.DocumentKey) []*key.Key { } // FromEventType converts the given Protobuf format to model format. -func FromEventType(pbEventType api.EventType) (types.EventType, error) { - switch pbEventType { - case api.EventType_DOCUMENTS_CHANGED: - return types.DocumentsChangeEvent, nil - case api.EventType_DOCUMENTS_WATCHED: +func FromEventType(pbDocEventType api.DocEventType) (types.DocEventType, error) { + switch pbDocEventType { + case api.DocEventType_DOCUMENTS_CHANGED: + return types.DocumentsChangedEvent, nil + case api.DocEventType_DOCUMENTS_WATCHED: return types.DocumentsWatchedEvent, nil - case api.EventType_DOCUMENTS_UNWATCHED: + case api.DocEventType_DOCUMENTS_UNWATCHED: return types.DocumentsUnwatchedEvent, nil } - return "", fmt.Errorf("%v: %w", pbEventType, ErrUnsupportedEventType) + return "", fmt.Errorf("%v: %w", pbDocEventType, ErrUnsupportedEventType) +} + +// FromDocEvent converts the given Protobuf format to model format. +func FromDocEvent(docEvent *api.DocEvent) (*sync.DocEvent, error) { + client, err := FromClient(docEvent.Publisher) + if err != nil { + return nil, err + } + + eventType, err := FromEventType(docEvent.Type) + if err != nil { + return nil, err + } + + return &sync.DocEvent{ + Type: eventType, + Publisher: *client, + DocumentKeys: FromDocumentKeys(docEvent.DocumentKeys), + }, nil } // FromOperations converts the given Protobuf format to model format. diff --git a/api/converter/to_pb.go b/api/converter/to_pb.go index 1d0e25a10..1212cbe74 100644 --- a/api/converter/to_pb.go +++ b/api/converter/to_pb.go @@ -28,6 +28,7 @@ import ( "github.com/yorkie-team/yorkie/pkg/document/operation" "github.com/yorkie-team/yorkie/pkg/document/time" "github.com/yorkie-team/yorkie/pkg/types" + "github.com/yorkie-team/yorkie/yorkie/backend/sync" ) // ToClient converts the given model to Protobuf format. @@ -96,7 +97,7 @@ func toChangeID(id *change.ID) *api.ChangeID { } // ToDocumentKeys converts the given model format to Protobuf format. -func ToDocumentKeys(keys ...*key.Key) []*api.DocumentKey { +func ToDocumentKeys(keys []*key.Key) []*api.DocumentKey { var pbKeys []*api.DocumentKey for _, k := range keys { pbKeys = append(pbKeys, toDocumentKey(k)) @@ -122,20 +123,34 @@ func ToClientsMap(clientsMap map[string][]types.Client) map[string]*api.Clients return pbClientsMap } -// ToEventType converts the given model format to Protobuf format. -func ToEventType(eventType types.EventType) (api.EventType, error) { +// ToDocEventType converts the given model format to Protobuf format. +func ToDocEventType(eventType types.DocEventType) (api.DocEventType, error) { switch eventType { - case types.DocumentsChangeEvent: - return api.EventType_DOCUMENTS_CHANGED, nil + case types.DocumentsChangedEvent: + return api.DocEventType_DOCUMENTS_CHANGED, nil case types.DocumentsWatchedEvent: - return api.EventType_DOCUMENTS_WATCHED, nil + return api.DocEventType_DOCUMENTS_WATCHED, nil case types.DocumentsUnwatchedEvent: - return api.EventType_DOCUMENTS_UNWATCHED, nil + return api.DocEventType_DOCUMENTS_UNWATCHED, nil default: return 0, fmt.Errorf("%s: %w", eventType, ErrUnsupportedEventType) } } +// ToDocEvent converts the given model to Protobuf format. +func ToDocEvent(docEvent sync.DocEvent) (*api.DocEvent, error) { + eventType, err := ToDocEventType(docEvent.Type) + if err != nil { + return nil, err + } + + return &api.DocEvent{ + Type: eventType, + Publisher: ToClient(docEvent.Publisher), + DocumentKeys: ToDocumentKeys(docEvent.DocumentKeys), + }, nil +} + // ToOperations converts the given model format to Protobuf format. func ToOperations(operations []operation.Operation) ([]*api.Operation, error) { var pbOperations []*api.Operation diff --git a/api/yorkie.pb.go b/api/yorkie.pb.go index cd76a7a37..4e74951f9 100644 --- a/api/yorkie.pb.go +++ b/api/yorkie.pb.go @@ -90,34 +90,128 @@ func (ValueType) EnumDescriptor() ([]byte, []int) { return fileDescriptor_9df40050e88fbc16, []int{0} } -type EventType int32 +type DocEventType int32 const ( - EventType_DOCUMENTS_CHANGED EventType = 0 - EventType_DOCUMENTS_WATCHED EventType = 1 - EventType_DOCUMENTS_UNWATCHED EventType = 2 + DocEventType_DOCUMENTS_CHANGED DocEventType = 0 + DocEventType_DOCUMENTS_WATCHED DocEventType = 1 + DocEventType_DOCUMENTS_UNWATCHED DocEventType = 2 ) -var EventType_name = map[int32]string{ +var DocEventType_name = map[int32]string{ 0: "DOCUMENTS_CHANGED", 1: "DOCUMENTS_WATCHED", 2: "DOCUMENTS_UNWATCHED", } -var EventType_value = map[string]int32{ +var DocEventType_value = map[string]int32{ "DOCUMENTS_CHANGED": 0, "DOCUMENTS_WATCHED": 1, "DOCUMENTS_UNWATCHED": 2, } -func (x EventType) String() string { - return proto.EnumName(EventType_name, int32(x)) +func (x DocEventType) String() string { + return proto.EnumName(DocEventType_name, int32(x)) } -func (EventType) EnumDescriptor() ([]byte, []int) { +func (DocEventType) EnumDescriptor() ([]byte, []int) { return fileDescriptor_9df40050e88fbc16, []int{1} } +type BroadcastEventRequest struct { + PublisherId []byte `protobuf:"bytes,1,opt,name=publisher_id,json=publisherId,proto3" json:"publisher_id,omitempty"` + Event *DocEvent `protobuf:"bytes,2,opt,name=event,proto3" json:"event,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BroadcastEventRequest) Reset() { *m = BroadcastEventRequest{} } +func (m *BroadcastEventRequest) String() string { return proto.CompactTextString(m) } +func (*BroadcastEventRequest) ProtoMessage() {} +func (*BroadcastEventRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9df40050e88fbc16, []int{0} +} +func (m *BroadcastEventRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BroadcastEventRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BroadcastEventRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BroadcastEventRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_BroadcastEventRequest.Merge(m, src) +} +func (m *BroadcastEventRequest) XXX_Size() int { + return m.Size() +} +func (m *BroadcastEventRequest) XXX_DiscardUnknown() { + xxx_messageInfo_BroadcastEventRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_BroadcastEventRequest proto.InternalMessageInfo + +func (m *BroadcastEventRequest) GetPublisherId() []byte { + if m != nil { + return m.PublisherId + } + return nil +} + +func (m *BroadcastEventRequest) GetEvent() *DocEvent { + if m != nil { + return m.Event + } + return nil +} + +type BroadcastEventResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BroadcastEventResponse) Reset() { *m = BroadcastEventResponse{} } +func (m *BroadcastEventResponse) String() string { return proto.CompactTextString(m) } +func (*BroadcastEventResponse) ProtoMessage() {} +func (*BroadcastEventResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9df40050e88fbc16, []int{1} +} +func (m *BroadcastEventResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BroadcastEventResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BroadcastEventResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BroadcastEventResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_BroadcastEventResponse.Merge(m, src) +} +func (m *BroadcastEventResponse) XXX_Size() int { + return m.Size() +} +func (m *BroadcastEventResponse) XXX_DiscardUnknown() { + xxx_messageInfo_BroadcastEventResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_BroadcastEventResponse proto.InternalMessageInfo + type ActivateClientRequest struct { ClientKey string `protobuf:"bytes,1,opt,name=client_key,json=clientKey,proto3" json:"client_key,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -129,7 +223,7 @@ func (m *ActivateClientRequest) Reset() { *m = ActivateClientRequest{} } func (m *ActivateClientRequest) String() string { return proto.CompactTextString(m) } func (*ActivateClientRequest) ProtoMessage() {} func (*ActivateClientRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{0} + return fileDescriptor_9df40050e88fbc16, []int{2} } func (m *ActivateClientRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -177,7 +271,7 @@ func (m *ActivateClientResponse) Reset() { *m = ActivateClientResponse{} func (m *ActivateClientResponse) String() string { return proto.CompactTextString(m) } func (*ActivateClientResponse) ProtoMessage() {} func (*ActivateClientResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{1} + return fileDescriptor_9df40050e88fbc16, []int{3} } func (m *ActivateClientResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -231,7 +325,7 @@ func (m *DeactivateClientRequest) Reset() { *m = DeactivateClientRequest func (m *DeactivateClientRequest) String() string { return proto.CompactTextString(m) } func (*DeactivateClientRequest) ProtoMessage() {} func (*DeactivateClientRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{2} + return fileDescriptor_9df40050e88fbc16, []int{4} } func (m *DeactivateClientRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -278,7 +372,7 @@ func (m *DeactivateClientResponse) Reset() { *m = DeactivateClientRespon func (m *DeactivateClientResponse) String() string { return proto.CompactTextString(m) } func (*DeactivateClientResponse) ProtoMessage() {} func (*DeactivateClientResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{3} + return fileDescriptor_9df40050e88fbc16, []int{5} } func (m *DeactivateClientResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -326,7 +420,7 @@ func (m *AttachDocumentRequest) Reset() { *m = AttachDocumentRequest{} } func (m *AttachDocumentRequest) String() string { return proto.CompactTextString(m) } func (*AttachDocumentRequest) ProtoMessage() {} func (*AttachDocumentRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{4} + return fileDescriptor_9df40050e88fbc16, []int{6} } func (m *AttachDocumentRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -381,7 +475,7 @@ func (m *AttachDocumentResponse) Reset() { *m = AttachDocumentResponse{} func (m *AttachDocumentResponse) String() string { return proto.CompactTextString(m) } func (*AttachDocumentResponse) ProtoMessage() {} func (*AttachDocumentResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{5} + return fileDescriptor_9df40050e88fbc16, []int{7} } func (m *AttachDocumentResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -436,7 +530,7 @@ func (m *DetachDocumentRequest) Reset() { *m = DetachDocumentRequest{} } func (m *DetachDocumentRequest) String() string { return proto.CompactTextString(m) } func (*DetachDocumentRequest) ProtoMessage() {} func (*DetachDocumentRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{6} + return fileDescriptor_9df40050e88fbc16, []int{8} } func (m *DetachDocumentRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -491,7 +585,7 @@ func (m *DetachDocumentResponse) Reset() { *m = DetachDocumentResponse{} func (m *DetachDocumentResponse) String() string { return proto.CompactTextString(m) } func (*DetachDocumentResponse) ProtoMessage() {} func (*DetachDocumentResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{7} + return fileDescriptor_9df40050e88fbc16, []int{9} } func (m *DetachDocumentResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -546,7 +640,7 @@ func (m *WatchDocumentsRequest) Reset() { *m = WatchDocumentsRequest{} } func (m *WatchDocumentsRequest) String() string { return proto.CompactTextString(m) } func (*WatchDocumentsRequest) ProtoMessage() {} func (*WatchDocumentsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{8} + return fileDescriptor_9df40050e88fbc16, []int{10} } func (m *WatchDocumentsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -592,7 +686,7 @@ func (m *WatchDocumentsRequest) GetDocumentKeys() []*DocumentKey { type WatchDocumentsResponse struct { // Types that are valid to be assigned to Body: // *WatchDocumentsResponse_Initialization_ - // *WatchDocumentsResponse_Event_ + // *WatchDocumentsResponse_Event Body isWatchDocumentsResponse_Body `protobuf_oneof:"body"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -603,7 +697,7 @@ func (m *WatchDocumentsResponse) Reset() { *m = WatchDocumentsResponse{} func (m *WatchDocumentsResponse) String() string { return proto.CompactTextString(m) } func (*WatchDocumentsResponse) ProtoMessage() {} func (*WatchDocumentsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{9} + return fileDescriptor_9df40050e88fbc16, []int{11} } func (m *WatchDocumentsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -641,12 +735,12 @@ type isWatchDocumentsResponse_Body interface { type WatchDocumentsResponse_Initialization_ struct { Initialization *WatchDocumentsResponse_Initialization `protobuf:"bytes,1,opt,name=initialization,proto3,oneof" json:"initialization,omitempty"` } -type WatchDocumentsResponse_Event_ struct { - Event *WatchDocumentsResponse_Event `protobuf:"bytes,2,opt,name=event,proto3,oneof" json:"event,omitempty"` +type WatchDocumentsResponse_Event struct { + Event *DocEvent `protobuf:"bytes,2,opt,name=event,proto3,oneof" json:"event,omitempty"` } func (*WatchDocumentsResponse_Initialization_) isWatchDocumentsResponse_Body() {} -func (*WatchDocumentsResponse_Event_) isWatchDocumentsResponse_Body() {} +func (*WatchDocumentsResponse_Event) isWatchDocumentsResponse_Body() {} func (m *WatchDocumentsResponse) GetBody() isWatchDocumentsResponse_Body { if m != nil { @@ -662,8 +756,8 @@ func (m *WatchDocumentsResponse) GetInitialization() *WatchDocumentsResponse_Ini return nil } -func (m *WatchDocumentsResponse) GetEvent() *WatchDocumentsResponse_Event { - if x, ok := m.GetBody().(*WatchDocumentsResponse_Event_); ok { +func (m *WatchDocumentsResponse) GetEvent() *DocEvent { + if x, ok := m.GetBody().(*WatchDocumentsResponse_Event); ok { return x.Event } return nil @@ -673,7 +767,7 @@ func (m *WatchDocumentsResponse) GetEvent() *WatchDocumentsResponse_Event { func (*WatchDocumentsResponse) XXX_OneofWrappers() []interface{} { return []interface{}{ (*WatchDocumentsResponse_Initialization_)(nil), - (*WatchDocumentsResponse_Event_)(nil), + (*WatchDocumentsResponse_Event)(nil), } } @@ -688,7 +782,7 @@ func (m *WatchDocumentsResponse_Initialization) Reset() { *m = WatchDocu func (m *WatchDocumentsResponse_Initialization) String() string { return proto.CompactTextString(m) } func (*WatchDocumentsResponse_Initialization) ProtoMessage() {} func (*WatchDocumentsResponse_Initialization) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{9, 0} + return fileDescriptor_9df40050e88fbc16, []int{11, 0} } func (m *WatchDocumentsResponse_Initialization) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -724,69 +818,6 @@ func (m *WatchDocumentsResponse_Initialization) GetPeersMapByDoc() map[string]*C return nil } -type WatchDocumentsResponse_Event struct { - Client *Client `protobuf:"bytes,1,opt,name=client,proto3" json:"client,omitempty"` - EventType EventType `protobuf:"varint,2,opt,name=event_type,json=eventType,proto3,enum=api.EventType" json:"event_type,omitempty"` - DocumentKeys []*DocumentKey `protobuf:"bytes,3,rep,name=document_keys,json=documentKeys,proto3" json:"document_keys,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *WatchDocumentsResponse_Event) Reset() { *m = WatchDocumentsResponse_Event{} } -func (m *WatchDocumentsResponse_Event) String() string { return proto.CompactTextString(m) } -func (*WatchDocumentsResponse_Event) ProtoMessage() {} -func (*WatchDocumentsResponse_Event) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{9, 1} -} -func (m *WatchDocumentsResponse_Event) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WatchDocumentsResponse_Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WatchDocumentsResponse_Event.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *WatchDocumentsResponse_Event) XXX_Merge(src proto.Message) { - xxx_messageInfo_WatchDocumentsResponse_Event.Merge(m, src) -} -func (m *WatchDocumentsResponse_Event) XXX_Size() int { - return m.Size() -} -func (m *WatchDocumentsResponse_Event) XXX_DiscardUnknown() { - xxx_messageInfo_WatchDocumentsResponse_Event.DiscardUnknown(m) -} - -var xxx_messageInfo_WatchDocumentsResponse_Event proto.InternalMessageInfo - -func (m *WatchDocumentsResponse_Event) GetClient() *Client { - if m != nil { - return m.Client - } - return nil -} - -func (m *WatchDocumentsResponse_Event) GetEventType() EventType { - if m != nil { - return m.EventType - } - return EventType_DOCUMENTS_CHANGED -} - -func (m *WatchDocumentsResponse_Event) GetDocumentKeys() []*DocumentKey { - if m != nil { - return m.DocumentKeys - } - return nil -} - type PushPullRequest struct { ClientId []byte `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` ChangePack *ChangePack `protobuf:"bytes,2,opt,name=change_pack,json=changePack,proto3" json:"change_pack,omitempty"` @@ -799,7 +830,7 @@ func (m *PushPullRequest) Reset() { *m = PushPullRequest{} } func (m *PushPullRequest) String() string { return proto.CompactTextString(m) } func (*PushPullRequest) ProtoMessage() {} func (*PushPullRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{10} + return fileDescriptor_9df40050e88fbc16, []int{12} } func (m *PushPullRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -854,7 +885,7 @@ func (m *PushPullResponse) Reset() { *m = PushPullResponse{} } func (m *PushPullResponse) String() string { return proto.CompactTextString(m) } func (*PushPullResponse) ProtoMessage() {} func (*PushPullResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{11} + return fileDescriptor_9df40050e88fbc16, []int{13} } func (m *PushPullResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -912,7 +943,7 @@ func (m *ChangePack) Reset() { *m = ChangePack{} } func (m *ChangePack) String() string { return proto.CompactTextString(m) } func (*ChangePack) ProtoMessage() {} func (*ChangePack) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{12} + return fileDescriptor_9df40050e88fbc16, []int{14} } func (m *ChangePack) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -989,7 +1020,7 @@ func (m *Change) Reset() { *m = Change{} } func (m *Change) String() string { return proto.CompactTextString(m) } func (*Change) ProtoMessage() {} func (*Change) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{13} + return fileDescriptor_9df40050e88fbc16, []int{15} } func (m *Change) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1052,7 +1083,7 @@ func (m *ChangeID) Reset() { *m = ChangeID{} } func (m *ChangeID) String() string { return proto.CompactTextString(m) } func (*ChangeID) ProtoMessage() {} func (*ChangeID) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{14} + return fileDescriptor_9df40050e88fbc16, []int{16} } func (m *ChangeID) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1123,7 +1154,7 @@ func (m *Operation) Reset() { *m = Operation{} } func (m *Operation) String() string { return proto.CompactTextString(m) } func (*Operation) ProtoMessage() {} func (*Operation) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{15} + return fileDescriptor_9df40050e88fbc16, []int{17} } func (m *Operation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1295,7 +1326,7 @@ func (m *Operation_Set) Reset() { *m = Operation_Set{} } func (m *Operation_Set) String() string { return proto.CompactTextString(m) } func (*Operation_Set) ProtoMessage() {} func (*Operation_Set) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{15, 0} + return fileDescriptor_9df40050e88fbc16, []int{17, 0} } func (m *Operation_Set) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1366,7 +1397,7 @@ func (m *Operation_Add) Reset() { *m = Operation_Add{} } func (m *Operation_Add) String() string { return proto.CompactTextString(m) } func (*Operation_Add) ProtoMessage() {} func (*Operation_Add) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{15, 1} + return fileDescriptor_9df40050e88fbc16, []int{17, 1} } func (m *Operation_Add) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1437,7 +1468,7 @@ func (m *Operation_Move) Reset() { *m = Operation_Move{} } func (m *Operation_Move) String() string { return proto.CompactTextString(m) } func (*Operation_Move) ProtoMessage() {} func (*Operation_Move) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{15, 2} + return fileDescriptor_9df40050e88fbc16, []int{17, 2} } func (m *Operation_Move) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1507,7 +1538,7 @@ func (m *Operation_Remove) Reset() { *m = Operation_Remove{} } func (m *Operation_Remove) String() string { return proto.CompactTextString(m) } func (*Operation_Remove) ProtoMessage() {} func (*Operation_Remove) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{15, 3} + return fileDescriptor_9df40050e88fbc16, []int{17, 3} } func (m *Operation_Remove) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1573,7 +1604,7 @@ func (m *Operation_Edit) Reset() { *m = Operation_Edit{} } func (m *Operation_Edit) String() string { return proto.CompactTextString(m) } func (*Operation_Edit) ProtoMessage() {} func (*Operation_Edit) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{15, 4} + return fileDescriptor_9df40050e88fbc16, []int{17, 4} } func (m *Operation_Edit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1658,7 +1689,7 @@ func (m *Operation_Select) Reset() { *m = Operation_Select{} } func (m *Operation_Select) String() string { return proto.CompactTextString(m) } func (*Operation_Select) ProtoMessage() {} func (*Operation_Select) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{15, 5} + return fileDescriptor_9df40050e88fbc16, []int{17, 5} } func (m *Operation_Select) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1732,7 +1763,7 @@ func (m *Operation_RichEdit) Reset() { *m = Operation_RichEdit{} } func (m *Operation_RichEdit) String() string { return proto.CompactTextString(m) } func (*Operation_RichEdit) ProtoMessage() {} func (*Operation_RichEdit) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{15, 6} + return fileDescriptor_9df40050e88fbc16, []int{17, 6} } func (m *Operation_RichEdit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1825,7 +1856,7 @@ func (m *Operation_Style) Reset() { *m = Operation_Style{} } func (m *Operation_Style) String() string { return proto.CompactTextString(m) } func (*Operation_Style) ProtoMessage() {} func (*Operation_Style) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{15, 7} + return fileDescriptor_9df40050e88fbc16, []int{17, 7} } func (m *Operation_Style) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1902,7 +1933,7 @@ func (m *Operation_Increase) Reset() { *m = Operation_Increase{} } func (m *Operation_Increase) String() string { return proto.CompactTextString(m) } func (*Operation_Increase) ProtoMessage() {} func (*Operation_Increase) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{15, 8} + return fileDescriptor_9df40050e88fbc16, []int{17, 8} } func (m *Operation_Increase) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1967,7 +1998,7 @@ func (m *JSONElementSimple) Reset() { *m = JSONElementSimple{} } func (m *JSONElementSimple) String() string { return proto.CompactTextString(m) } func (*JSONElementSimple) ProtoMessage() {} func (*JSONElementSimple) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{16} + return fileDescriptor_9df40050e88fbc16, []int{18} } func (m *JSONElementSimple) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2049,7 +2080,7 @@ func (m *JSONElement) Reset() { *m = JSONElement{} } func (m *JSONElement) String() string { return proto.CompactTextString(m) } func (*JSONElement) ProtoMessage() {} func (*JSONElement) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{17} + return fileDescriptor_9df40050e88fbc16, []int{19} } func (m *JSONElement) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2185,7 +2216,7 @@ func (m *JSONElement_JSONObject) Reset() { *m = JSONElement_JSONObject{} func (m *JSONElement_JSONObject) String() string { return proto.CompactTextString(m) } func (*JSONElement_JSONObject) ProtoMessage() {} func (*JSONElement_JSONObject) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{17, 0} + return fileDescriptor_9df40050e88fbc16, []int{19, 0} } func (m *JSONElement_JSONObject) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2256,7 +2287,7 @@ func (m *JSONElement_JSONArray) Reset() { *m = JSONElement_JSONArray{} } func (m *JSONElement_JSONArray) String() string { return proto.CompactTextString(m) } func (*JSONElement_JSONArray) ProtoMessage() {} func (*JSONElement_JSONArray) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{17, 1} + return fileDescriptor_9df40050e88fbc16, []int{19, 1} } func (m *JSONElement_JSONArray) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2328,7 +2359,7 @@ func (m *JSONElement_Primitive) Reset() { *m = JSONElement_Primitive{} } func (m *JSONElement_Primitive) String() string { return proto.CompactTextString(m) } func (*JSONElement_Primitive) ProtoMessage() {} func (*JSONElement_Primitive) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{17, 2} + return fileDescriptor_9df40050e88fbc16, []int{19, 2} } func (m *JSONElement_Primitive) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2406,7 +2437,7 @@ func (m *JSONElement_Text) Reset() { *m = JSONElement_Text{} } func (m *JSONElement_Text) String() string { return proto.CompactTextString(m) } func (*JSONElement_Text) ProtoMessage() {} func (*JSONElement_Text) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{17, 3} + return fileDescriptor_9df40050e88fbc16, []int{19, 3} } func (m *JSONElement_Text) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2477,7 +2508,7 @@ func (m *JSONElement_RichText) Reset() { *m = JSONElement_RichText{} } func (m *JSONElement_RichText) String() string { return proto.CompactTextString(m) } func (*JSONElement_RichText) ProtoMessage() {} func (*JSONElement_RichText) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{17, 4} + return fileDescriptor_9df40050e88fbc16, []int{19, 4} } func (m *JSONElement_RichText) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2549,7 +2580,7 @@ func (m *JSONElement_Counter) Reset() { *m = JSONElement_Counter{} } func (m *JSONElement_Counter) String() string { return proto.CompactTextString(m) } func (*JSONElement_Counter) ProtoMessage() {} func (*JSONElement_Counter) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{17, 5} + return fileDescriptor_9df40050e88fbc16, []int{19, 5} } func (m *JSONElement_Counter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2625,7 +2656,7 @@ func (m *RHTNode) Reset() { *m = RHTNode{} } func (m *RHTNode) String() string { return proto.CompactTextString(m) } func (*RHTNode) ProtoMessage() {} func (*RHTNode) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{18} + return fileDescriptor_9df40050e88fbc16, []int{20} } func (m *RHTNode) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2680,7 +2711,7 @@ func (m *RGANode) Reset() { *m = RGANode{} } func (m *RGANode) String() string { return proto.CompactTextString(m) } func (*RGANode) ProtoMessage() {} func (*RGANode) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{19} + return fileDescriptor_9df40050e88fbc16, []int{21} } func (m *RGANode) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2737,7 +2768,7 @@ func (m *TextNode) Reset() { *m = TextNode{} } func (m *TextNode) String() string { return proto.CompactTextString(m) } func (*TextNode) ProtoMessage() {} func (*TextNode) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{20} + return fileDescriptor_9df40050e88fbc16, []int{22} } func (m *TextNode) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2807,7 +2838,7 @@ func (m *RichTextNodeAttr) Reset() { *m = RichTextNodeAttr{} } func (m *RichTextNodeAttr) String() string { return proto.CompactTextString(m) } func (*RichTextNodeAttr) ProtoMessage() {} func (*RichTextNodeAttr) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{21} + return fileDescriptor_9df40050e88fbc16, []int{23} } func (m *RichTextNodeAttr) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2872,7 +2903,7 @@ func (m *RichTextNode) Reset() { *m = RichTextNode{} } func (m *RichTextNode) String() string { return proto.CompactTextString(m) } func (*RichTextNode) ProtoMessage() {} func (*RichTextNode) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{22} + return fileDescriptor_9df40050e88fbc16, []int{24} } func (m *RichTextNode) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2948,7 +2979,7 @@ func (m *TextNodeID) Reset() { *m = TextNodeID{} } func (m *TextNodeID) String() string { return proto.CompactTextString(m) } func (*TextNodeID) ProtoMessage() {} func (*TextNodeID) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{23} + return fileDescriptor_9df40050e88fbc16, []int{25} } func (m *TextNodeID) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3003,7 +3034,7 @@ func (m *Client) Reset() { *m = Client{} } func (m *Client) String() string { return proto.CompactTextString(m) } func (*Client) ProtoMessage() {} func (*Client) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{24} + return fileDescriptor_9df40050e88fbc16, []int{26} } func (m *Client) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3057,7 +3088,7 @@ func (m *Clients) Reset() { *m = Clients{} } func (m *Clients) String() string { return proto.CompactTextString(m) } func (*Clients) ProtoMessage() {} func (*Clients) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{25} + return fileDescriptor_9df40050e88fbc16, []int{27} } func (m *Clients) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3105,7 +3136,7 @@ func (m *DocumentKey) Reset() { *m = DocumentKey{} } func (m *DocumentKey) String() string { return proto.CompactTextString(m) } func (*DocumentKey) ProtoMessage() {} func (*DocumentKey) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{26} + return fileDescriptor_9df40050e88fbc16, []int{28} } func (m *DocumentKey) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3160,7 +3191,7 @@ func (m *Checkpoint) Reset() { *m = Checkpoint{} } func (m *Checkpoint) String() string { return proto.CompactTextString(m) } func (*Checkpoint) ProtoMessage() {} func (*Checkpoint) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{27} + return fileDescriptor_9df40050e88fbc16, []int{29} } func (m *Checkpoint) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3216,7 +3247,7 @@ func (m *TextNodePos) Reset() { *m = TextNodePos{} } func (m *TextNodePos) String() string { return proto.CompactTextString(m) } func (*TextNodePos) ProtoMessage() {} func (*TextNodePos) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{28} + return fileDescriptor_9df40050e88fbc16, []int{30} } func (m *TextNodePos) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3279,7 +3310,7 @@ func (m *TimeTicket) Reset() { *m = TimeTicket{} } func (m *TimeTicket) String() string { return proto.CompactTextString(m) } func (*TimeTicket) ProtoMessage() {} func (*TimeTicket) Descriptor() ([]byte, []int) { - return fileDescriptor_9df40050e88fbc16, []int{29} + return fileDescriptor_9df40050e88fbc16, []int{31} } func (m *TimeTicket) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3329,9 +3360,74 @@ func (m *TimeTicket) GetActorId() []byte { return nil } +type DocEvent struct { + Type DocEventType `protobuf:"varint,1,opt,name=type,proto3,enum=api.DocEventType" json:"type,omitempty"` + Publisher *Client `protobuf:"bytes,2,opt,name=publisher,proto3" json:"publisher,omitempty"` + DocumentKeys []*DocumentKey `protobuf:"bytes,3,rep,name=document_keys,json=documentKeys,proto3" json:"document_keys,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DocEvent) Reset() { *m = DocEvent{} } +func (m *DocEvent) String() string { return proto.CompactTextString(m) } +func (*DocEvent) ProtoMessage() {} +func (*DocEvent) Descriptor() ([]byte, []int) { + return fileDescriptor_9df40050e88fbc16, []int{32} +} +func (m *DocEvent) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DocEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DocEvent.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DocEvent) XXX_Merge(src proto.Message) { + xxx_messageInfo_DocEvent.Merge(m, src) +} +func (m *DocEvent) XXX_Size() int { + return m.Size() +} +func (m *DocEvent) XXX_DiscardUnknown() { + xxx_messageInfo_DocEvent.DiscardUnknown(m) +} + +var xxx_messageInfo_DocEvent proto.InternalMessageInfo + +func (m *DocEvent) GetType() DocEventType { + if m != nil { + return m.Type + } + return DocEventType_DOCUMENTS_CHANGED +} + +func (m *DocEvent) GetPublisher() *Client { + if m != nil { + return m.Publisher + } + return nil +} + +func (m *DocEvent) GetDocumentKeys() []*DocumentKey { + if m != nil { + return m.DocumentKeys + } + return nil +} + func init() { proto.RegisterEnum("api.ValueType", ValueType_name, ValueType_value) - proto.RegisterEnum("api.EventType", EventType_name, EventType_value) + proto.RegisterEnum("api.DocEventType", DocEventType_name, DocEventType_value) + proto.RegisterType((*BroadcastEventRequest)(nil), "api.BroadcastEventRequest") + proto.RegisterType((*BroadcastEventResponse)(nil), "api.BroadcastEventResponse") proto.RegisterType((*ActivateClientRequest)(nil), "api.ActivateClientRequest") proto.RegisterType((*ActivateClientResponse)(nil), "api.ActivateClientResponse") proto.RegisterType((*DeactivateClientRequest)(nil), "api.DeactivateClientRequest") @@ -3344,7 +3440,6 @@ func init() { proto.RegisterType((*WatchDocumentsResponse)(nil), "api.WatchDocumentsResponse") proto.RegisterType((*WatchDocumentsResponse_Initialization)(nil), "api.WatchDocumentsResponse.Initialization") proto.RegisterMapType((map[string]*Clients)(nil), "api.WatchDocumentsResponse.Initialization.PeersMapByDocEntry") - proto.RegisterType((*WatchDocumentsResponse_Event)(nil), "api.WatchDocumentsResponse.Event") proto.RegisterType((*PushPullRequest)(nil), "api.PushPullRequest") proto.RegisterType((*PushPullResponse)(nil), "api.PushPullResponse") proto.RegisterType((*ChangePack)(nil), "api.ChangePack") @@ -3386,155 +3481,160 @@ func init() { proto.RegisterType((*Checkpoint)(nil), "api.Checkpoint") proto.RegisterType((*TextNodePos)(nil), "api.TextNodePos") proto.RegisterType((*TimeTicket)(nil), "api.TimeTicket") + proto.RegisterType((*DocEvent)(nil), "api.DocEvent") } func init() { proto.RegisterFile("api/yorkie.proto", fileDescriptor_9df40050e88fbc16) } var fileDescriptor_9df40050e88fbc16 = []byte{ - // 2281 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x5a, 0xcb, 0x6f, 0xdb, 0xc8, - 0x19, 0x17, 0x25, 0xea, 0xc1, 0x4f, 0x7e, 0x30, 0x93, 0xd8, 0x51, 0x94, 0x47, 0x13, 0xee, 0x6e, - 0x93, 0x66, 0x53, 0x25, 0xf0, 0x36, 0xd9, 0x47, 0xb0, 0x05, 0x64, 0x49, 0xb0, 0xb4, 0x49, 0x24, - 0x97, 0x52, 0x9a, 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da, - 0x48, 0x77, 0xb4, 0x9d, 0x89, 0x66, 0xda, 0x46, 0x45, 0xa0, 0x86, 0x7f, 0x7e, 0x72, 0x2d, 0x6b, - 0xdb, 0x84, 0xc5, 0x23, 0xdd, 0xd9, 0x9c, 0x34, 0x6d, 0xa3, 0x35, 0xf6, 0xdd, 0x89, 0xba, 0xec, - 0x44, 0xfb, 0xaa, 0x5d, 0x40, 0xb3, 0x20, 0x24, 0x43, 0x6e, 0xea, 0x7b, 0xf2, 0x89, 0x14, 0xc8, - 0x1f, 0xea, 0xc3, 0x03, 0xcc, 0xad, 0x5b, 0x8a, 0x78, 0xca, 0x53, 0xd9, 0xd0, 0x67, 0xd9, 0x4f, - 0x84, 0xea, 0x2f, 0x05, 0xc8, 0x53, 0xeb, 0x4e, 0xe6, 0xdc, 0xef, 0x02, 0xd0, 0x29, 0xd0, 0xfc, - 0x89, 0xc3, 0x78, 0xaf, 0x6c, 0xac, 0x50, 0x20, 0x65, 0x32, 0x98, 0x38, 0x58, 0x95, 0x70, 0xf0, - 0x39, 0x1b, 0x0b, 0xb9, 0x93, 0xc4, 0xc2, 0x66, 0x01, 0xc4, 0x1d, 0xdb, 0x9c, 0x28, 0x3f, 0x86, - 0xd5, 0xed, 0x03, 0x6f, 0x6f, 0xfb, 0x60, 0x38, 0x7c, 0x47, 0xab, 0x4a, 0x07, 0x79, 0x2a, 0xe1, - 0xdd, 0x24, 0x88, 0x7f, 0x0b, 0x00, 0xd3, 0x21, 0xf4, 0x11, 0x2c, 0x45, 0xa7, 0x84, 0x4f, 0xf6, - 0xec, 0x8c, 0x94, 0x23, 0x33, 0x82, 0x6e, 0x03, 0x18, 0x7b, 0xd8, 0xd8, 0x77, 0x6c, 0x2b, 0x0c, - 0xd8, 0x40, 0x68, 0xd0, 0xad, 0x46, 0x20, 0xa8, 0x0a, 0x25, 0x6f, 0xac, 0x3b, 0xde, 0x9e, 0xed, - 0x57, 0x72, 0xcc, 0x84, 0xa0, 0x8d, 0x3e, 0x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d3, 0x83, - 0x02, 0x6b, 0x28, 0x3f, 0x5b, 0x82, 0x72, 0xc4, 0x36, 0xf4, 0x7d, 0x28, 0x3f, 0xf7, 0xec, 0xb1, - 0x66, 0xef, 0x3c, 0x27, 0x65, 0x35, 0x33, 0xeb, 0x62, 0x72, 0x66, 0xe9, 0x77, 0x8f, 0x42, 0xda, - 0x19, 0x15, 0x08, 0x05, 0x6b, 0xa1, 0xfb, 0x40, 0x5b, 0x9a, 0xee, 0xba, 0xfa, 0x84, 0xdb, 0x59, - 0x4d, 0x25, 0xaf, 0x13, 0x44, 0x3b, 0xa3, 0x4a, 0x04, 0x4f, 0x1b, 0xe8, 0x33, 0x90, 0x1c, 0xd7, - 0x1a, 0x59, 0xbe, 0x15, 0x1e, 0x2d, 0x66, 0x69, 0xb7, 0x03, 0x04, 0xa1, 0x0d, 0xe1, 0xe8, 0x43, - 0x10, 0x7d, 0xfc, 0xd2, 0x8f, 0x1d, 0x32, 0xa2, 0x64, 0x64, 0xf5, 0x90, 0x73, 0x03, 0x01, 0xa1, - 0x4f, 0xf8, 0x31, 0x80, 0x52, 0xb0, 0x90, 0xbf, 0x30, 0x43, 0x41, 0xb2, 0x1b, 0xa7, 0xa2, 0x07, - 0x01, 0xf2, 0x8d, 0xbe, 0x47, 0x12, 0xe6, 0xc1, 0xd8, 0xc7, 0x2e, 0xdf, 0x73, 0x2b, 0x33, 0x74, - 0x0d, 0x36, 0xde, 0xce, 0xa8, 0x01, 0xb4, 0xfa, 0x47, 0x01, 0x60, 0x3a, 0x65, 0x48, 0x81, 0xfc, - 0xd8, 0x36, 0xb1, 0xc7, 0xaf, 0x5d, 0xd8, 0x8d, 0x87, 0xda, 0x1e, 0x90, 0xd5, 0xad, 0xb2, 0xa1, - 0x85, 0xcb, 0xa9, 0x68, 0x78, 0xe5, 0x16, 0x0a, 0x2f, 0x71, 0x5e, 0x78, 0x55, 0xff, 0x20, 0x80, - 0x14, 0xba, 0xec, 0x08, 0xed, 0xb7, 0xea,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 0x37, - 0x20, 0xde, 0x94, 0x5f, 0xbf, 0xb9, 0x22, 0xfc, 0xe5, 0xcd, 0x15, 0xe1, 0x9f, 0x6f, 0xae, 0x08, - 0xbf, 0xfe, 0xd7, 0x95, 0xcc, 0x4e, 0x81, 0xfe, 0x8f, 0xf2, 0xd1, 0x7f, 0x02, 0x00, 0x00, 0xff, - 0xff, 0x7e, 0x9a, 0x06, 0x08, 0xa3, 0x22, 0x00, 0x00, + // 2350 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x1a, 0x4d, 0x6f, 0xdb, 0xc8, + 0x55, 0xd4, 0x37, 0x9f, 0x64, 0x99, 0x99, 0xc4, 0x8e, 0xa2, 0x7c, 0x34, 0x61, 0x36, 0x4d, 0x36, + 0x1b, 0x38, 0x81, 0xb7, 0xc9, 0x6e, 0x37, 0xd8, 0x02, 0xb2, 0x25, 0x58, 0xda, 0x24, 0x92, 0x4b, + 0x29, 0x9b, 0xe6, 0xc4, 0xd2, 0xe4, 0x38, 0x66, 0x2c, 0x89, 0x0c, 0x49, 0x19, 0x51, 0x0f, 0xfd, + 0x01, 0x45, 0x6f, 0xed, 0xa1, 0xe7, 0xa2, 0xc0, 0xfe, 0x81, 0x02, 0x3d, 0xb4, 0x40, 0x0e, 0xbd, + 0xe4, 0x50, 0x60, 0xdb, 0x63, 0x51, 0xa0, 0x28, 0xd2, 0x4b, 0xcf, 0xfd, 0x05, 0xc5, 0x7c, 0x90, + 0x22, 0x29, 0xda, 0xb2, 0xea, 0x4d, 0xd7, 0xe8, 0x8d, 0x33, 0xef, 0x7b, 0xde, 0x9b, 0xf7, 0xde, + 0xcc, 0x10, 0x24, 0xcd, 0x36, 0xef, 0x4e, 0x2c, 0x67, 0xdf, 0xc4, 0x6b, 0xb6, 0x63, 0x79, 0x16, + 0xca, 0x68, 0xb6, 0x29, 0xab, 0xb0, 0xb2, 0xe1, 0x58, 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93, + 0xff, 0x31, 0x0d, 0x39, 0x5a, 0xe9, 0x4f, 0x47, 0x8c, 0x34, 0x22, 0x1e, 0x62, 0x61, 0xf1, 0x41, + 0x52, 0x63, 0xb2, 0x88, 0x7b, 0x72, 0xf3, 0xdd, 0x73, 0xc2, 0x55, 0xfc, 0x4a, 0x80, 0xa2, 0xdf, + 0xfe, 0x9c, 0x6c, 0x21, 0xef, 0x44, 0x3d, 0xbf, 0x58, 0xe9, 0x9f, 0x5f, 0x6f, 0x82, 0xb3, 0xdd, + 0x5f, 0x05, 0x38, 0x33, 0xc3, 0x36, 0x56, 0xef, 0x84, 0xb9, 0xf5, 0xee, 0x36, 0x14, 0x49, 0x91, + 0x3d, 0xaa, 0x3a, 0x16, 0x28, 0x02, 0xab, 0xa5, 0xac, 0x19, 0x3e, 0xb2, 0xea, 0x73, 0x94, 0xba, + 0x87, 0x64, 0xc8, 0x7a, 0x13, 0x9b, 0x75, 0xd8, 0x15, 0x7e, 0xf4, 0xf8, 0x92, 0x58, 0xdd, 0x9f, + 0xd8, 0x58, 0xa1, 0xb0, 0xa9, 0x47, 0x72, 0xf4, 0xa0, 0xc0, 0x06, 0xf2, 0xcf, 0xca, 0x50, 0x0a, + 0xd9, 0x86, 0x7e, 0x00, 0xa5, 0x97, 0xae, 0x35, 0x52, 0xad, 0x9d, 0x97, 0xa4, 0xad, 0x66, 0x66, + 0x5d, 0x8c, 0xaf, 0x2c, 0xfd, 0xee, 0x52, 0x94, 0x56, 0x4a, 0x01, 0x42, 0xc1, 0x46, 0xe8, 0x21, + 0xd0, 0x91, 0xaa, 0x39, 0x8e, 0x36, 0xe1, 0x76, 0xd6, 0x12, 0xc9, 0xeb, 0x04, 0xa3, 0x95, 0x52, + 0x44, 0x82, 0x4f, 0x07, 0xe8, 0x33, 0x10, 0x6d, 0xc7, 0x1c, 0x9a, 0x9e, 0x19, 0x1c, 0x2d, 0x66, + 0x69, 0xb7, 0x7d, 0x0c, 0x42, 0x1b, 0xa0, 0xa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, 0xf3, 0x4a, 0x6a, 0x27, 0x4f, 0x7f, 0xa9, 0xf9, 0xf8, + 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x64, 0xf2, 0x30, 0x44, 0x66, 0x23, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -3825,56 +3925,201 @@ var _Yorkie_serviceDesc = grpc.ServiceDesc{ Metadata: "api/yorkie.proto", } -func (m *ActivateClientRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +// ClusterClient is the client API for Cluster service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ClusterClient interface { + BroadcastEvent(ctx context.Context, in *BroadcastEventRequest, opts ...grpc.CallOption) (*BroadcastEventResponse, error) } -func (m *ActivateClientRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type clusterClient struct { + cc *grpc.ClientConn } -func (m *ActivateClientRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.ClientKey) > 0 { - i -= len(m.ClientKey) - copy(dAtA[i:], m.ClientKey) - i = encodeVarintYorkie(dAtA, i, uint64(len(m.ClientKey))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil +func NewClusterClient(cc *grpc.ClientConn) ClusterClient { + return &clusterClient{cc} } -func (m *ActivateClientResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) +func (c *clusterClient) BroadcastEvent(ctx context.Context, in *BroadcastEventRequest, opts ...grpc.CallOption) (*BroadcastEventResponse, error) { + out := new(BroadcastEventResponse) + err := c.cc.Invoke(ctx, "/api.Cluster/BroadcastEvent", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil + return out, nil } -func (m *ActivateClientResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// ClusterServer is the server API for Cluster service. +type ClusterServer interface { + BroadcastEvent(context.Context, *BroadcastEventRequest) (*BroadcastEventResponse, error) } -func (m *ActivateClientResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +// UnimplementedClusterServer can be embedded to have forward compatible implementations. +type UnimplementedClusterServer struct { +} + +func (*UnimplementedClusterServer) BroadcastEvent(ctx context.Context, req *BroadcastEventRequest) (*BroadcastEventResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BroadcastEvent not implemented") +} + +func RegisterClusterServer(s *grpc.Server, srv ClusterServer) { + s.RegisterService(&_Cluster_serviceDesc, srv) +} + +func _Cluster_BroadcastEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BroadcastEventRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterServer).BroadcastEvent(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.Cluster/BroadcastEvent", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterServer).BroadcastEvent(ctx, req.(*BroadcastEventRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Cluster_serviceDesc = grpc.ServiceDesc{ + ServiceName: "api.Cluster", + HandlerType: (*ClusterServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "BroadcastEvent", + Handler: _Cluster_BroadcastEvent_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api/yorkie.proto", +} + +func (m *BroadcastEventRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BroadcastEventRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BroadcastEventRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Event != nil { + { + size, err := m.Event.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintYorkie(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.PublisherId) > 0 { + i -= len(m.PublisherId) + copy(dAtA[i:], m.PublisherId) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.PublisherId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BroadcastEventResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BroadcastEventResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BroadcastEventResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + return len(dAtA) - i, nil +} + +func (m *ActivateClientRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ActivateClientRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActivateClientRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.ClientKey) > 0 { + i -= len(m.ClientKey) + copy(dAtA[i:], m.ClientKey) + i = encodeVarintYorkie(dAtA, i, uint64(len(m.ClientKey))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ActivateClientResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ActivateClientResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActivateClientResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -4262,12 +4507,12 @@ func (m *WatchDocumentsResponse_Initialization_) MarshalToSizedBuffer(dAtA []byt } return len(dAtA) - i, nil } -func (m *WatchDocumentsResponse_Event_) MarshalTo(dAtA []byte) (int, error) { +func (m *WatchDocumentsResponse_Event) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *WatchDocumentsResponse_Event_) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *WatchDocumentsResponse_Event) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.Event != nil { { @@ -4336,64 +4581,6 @@ func (m *WatchDocumentsResponse_Initialization) MarshalToSizedBuffer(dAtA []byte return len(dAtA) - i, nil } -func (m *WatchDocumentsResponse_Event) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WatchDocumentsResponse_Event) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WatchDocumentsResponse_Event) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.DocumentKeys) > 0 { - for iNdEx := len(m.DocumentKeys) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.DocumentKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.EventType != 0 { - i = encodeVarintYorkie(dAtA, i, uint64(m.EventType)) - i-- - dAtA[i] = 0x10 - } - if m.Client != nil { - { - size, err := m.Client.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintYorkie(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *PushPullRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -6969,6 +7156,64 @@ func (m *TimeTicket) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *DocEvent) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DocEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DocEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.DocumentKeys) > 0 { + for iNdEx := len(m.DocumentKeys) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DocumentKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintYorkie(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.Publisher != nil { + { + size, err := m.Publisher.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintYorkie(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Type != 0 { + i = encodeVarintYorkie(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintYorkie(dAtA []byte, offset int, v uint64) int { offset -= sovYorkie(v) base := offset @@ -6980,23 +7225,55 @@ func encodeVarintYorkie(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *ActivateClientRequest) Size() (n int) { +func (m *BroadcastEventRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.ClientKey) + l = len(m.PublisherId) if l > 0 { n += 1 + l + sovYorkie(uint64(l)) } + if m.Event != nil { + l = m.Event.Size() + n += 1 + l + sovYorkie(uint64(l)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } -func (m *ActivateClientResponse) Size() (n int) { +func (m *BroadcastEventResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ActivateClientRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClientKey) + if l > 0 { + n += 1 + l + sovYorkie(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ActivateClientResponse) Size() (n int) { if m == nil { return 0 } @@ -7177,7 +7454,7 @@ func (m *WatchDocumentsResponse_Initialization_) Size() (n int) { } return n } -func (m *WatchDocumentsResponse_Event_) Size() (n int) { +func (m *WatchDocumentsResponse_Event) Size() (n int) { if m == nil { return 0 } @@ -7214,31 +7491,6 @@ func (m *WatchDocumentsResponse_Initialization) Size() (n int) { return n } -func (m *WatchDocumentsResponse_Event) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Client != nil { - l = m.Client.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - if m.EventType != 0 { - n += 1 + sovYorkie(uint64(m.EventType)) - } - if len(m.DocumentKeys) > 0 { - for _, e := range m.DocumentKeys { - l = e.Size() - n += 1 + l + sovYorkie(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - func (m *PushPullRequest) Size() (n int) { if m == nil { return 0 @@ -8354,12 +8606,215 @@ func (m *TimeTicket) Size() (n int) { return n } +func (m *DocEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Type != 0 { + n += 1 + sovYorkie(uint64(m.Type)) + } + if m.Publisher != nil { + l = m.Publisher.Size() + n += 1 + l + sovYorkie(uint64(l)) + } + if len(m.DocumentKeys) > 0 { + for _, e := range m.DocumentKeys { + l = e.Size() + n += 1 + l + sovYorkie(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + func sovYorkie(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozYorkie(x uint64) (n int) { return sovYorkie(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *BroadcastEventRequest) 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 ErrIntOverflowYorkie + } + 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: BroadcastEventRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BroadcastEventRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PublisherId", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYorkie + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthYorkie + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthYorkie + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PublisherId = append(m.PublisherId[:0], dAtA[iNdEx:postIndex]...) + if m.PublisherId == nil { + m.PublisherId = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Event", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYorkie + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthYorkie + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthYorkie + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Event == nil { + m.Event = &DocEvent{} + } + if err := m.Event.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipYorkie(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BroadcastEventResponse) 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 ErrIntOverflowYorkie + } + 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: BroadcastEventResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BroadcastEventResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipYorkie(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *ActivateClientRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -8427,7 +8882,10 @@ func (m *ActivateClientRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -8544,7 +9002,10 @@ func (m *ActivateClientResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -8629,7 +9090,10 @@ func (m *DeactivateClientRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -8714,7 +9178,10 @@ func (m *DeactivateClientResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -8835,7 +9302,10 @@ func (m *AttachDocumentRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -8956,7 +9426,10 @@ func (m *AttachDocumentResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -9077,7 +9550,10 @@ func (m *DetachDocumentRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -9196,7 +9672,10 @@ func (m *DetachDocumentResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -9317,7 +9796,10 @@ func (m *WatchDocumentsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -9426,11 +9908,11 @@ func (m *WatchDocumentsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &WatchDocumentsResponse_Event{} + v := &DocEvent{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Body = &WatchDocumentsResponse_Event_{v} + m.Body = &WatchDocumentsResponse_Event{v} iNdEx = postIndex default: iNdEx = preIndex @@ -9438,7 +9920,10 @@ func (m *WatchDocumentsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -9571,186 +10056,46 @@ func (m *WatchDocumentsResponse_Initialization) Unmarshal(dAtA []byte) error { return ErrIntOverflowYorkie } if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthYorkie - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthYorkie - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &Clients{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.PeersMapByDoc[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipYorkie(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthYorkie - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WatchDocumentsResponse_Event) 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 ErrIntOverflowYorkie - } - 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: Event: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Event: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Client", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Client == nil { - m.Client = &Client{} - } - if err := m.Client.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EventType", wireType) - } - m.EventType = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EventType |= EventType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DocumentKeys", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYorkie - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthYorkie + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthYorkie + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &Clients{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipYorkie(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy } } - if msglen < 0 { - return ErrInvalidLengthYorkie - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthYorkie - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DocumentKeys = append(m.DocumentKeys, &DocumentKey{}) - if err := m.DocumentKeys[len(m.DocumentKeys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.PeersMapByDoc[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -9758,7 +10103,10 @@ func (m *WatchDocumentsResponse_Event) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -9879,7 +10227,10 @@ func (m *PushPullRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -10000,7 +10351,10 @@ func (m *PushPullResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -10227,7 +10581,10 @@ func (m *ChangePack) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -10380,7 +10737,10 @@ func (m *Change) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -10503,7 +10863,10 @@ func (m *ChangeID) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -10869,7 +11232,10 @@ func (m *Operation) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -11060,7 +11426,10 @@ func (m *Operation_Set) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -11255,7 +11624,10 @@ func (m *Operation_Add) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -11450,7 +11822,10 @@ func (m *Operation_Move) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -11609,7 +11984,10 @@ func (m *Operation_Remove) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -11880,7 +12258,7 @@ func (m *Operation_Edit) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > postIndex { @@ -11965,7 +12343,10 @@ func (m *Operation_Edit) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -12160,7 +12541,10 @@ func (m *Operation_Select) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -12431,7 +12815,7 @@ func (m *Operation_RichEdit) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > postIndex { @@ -12590,7 +12974,7 @@ func (m *Operation_RichEdit) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > postIndex { @@ -12643,7 +13027,10 @@ func (m *Operation_RichEdit) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -12912,7 +13299,7 @@ func (m *Operation_Style) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > postIndex { @@ -12965,7 +13352,10 @@ func (m *Operation_Style) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -13124,7 +13514,10 @@ func (m *Operation_Increase) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -13336,7 +13729,10 @@ func (m *JSONElementSimple) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -13597,7 +13993,10 @@ func (m *JSONElement) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -13790,7 +14189,10 @@ func (m *JSONElement_JSONObject) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -13983,7 +14385,10 @@ func (m *JSONElement_JSONArray) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -14195,7 +14600,10 @@ func (m *JSONElement_Primitive) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -14388,7 +14796,10 @@ func (m *JSONElement_Text) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -14581,7 +14992,10 @@ func (m *JSONElement_RichText) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -14793,7 +15207,10 @@ func (m *JSONElement_Counter) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -14912,7 +15329,10 @@ func (m *RHTNode) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -15035,7 +15455,10 @@ func (m *RGANode) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -15226,7 +15649,10 @@ func (m *TextNode) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -15377,7 +15803,10 @@ func (m *RichTextNodeAttr) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -15576,7 +16005,7 @@ func (m *RichTextNode) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > postIndex { @@ -15697,7 +16126,10 @@ func (m *RichTextNode) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -15803,7 +16235,10 @@ func (m *TextNodeID) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -15998,7 +16433,7 @@ func (m *Client) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > postIndex { @@ -16015,7 +16450,10 @@ func (m *Client) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -16100,7 +16538,10 @@ func (m *Clients) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -16215,7 +16656,10 @@ func (m *DocumentKey) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -16304,7 +16748,10 @@ func (m *Checkpoint) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -16429,7 +16876,10 @@ func (m *TextNodePos) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { @@ -16552,7 +17002,153 @@ func (m *TimeTicket) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DocEvent) 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 ErrIntOverflowYorkie + } + 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: DocEvent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DocEvent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYorkie + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= DocEventType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Publisher", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYorkie + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthYorkie + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthYorkie + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Publisher == nil { + m.Publisher = &Client{} + } + if err := m.Publisher.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DocumentKeys", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYorkie + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthYorkie + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthYorkie + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DocumentKeys = append(m.DocumentKeys, &DocumentKey{}) + if err := m.DocumentKeys[len(m.DocumentKeys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipYorkie(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthYorkie + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthYorkie } if (iNdEx + skippy) > l { diff --git a/api/yorkie.proto b/api/yorkie.proto index 966a43fa3..ce33f8fd4 100644 --- a/api/yorkie.proto +++ b/api/yorkie.proto @@ -27,6 +27,21 @@ service Yorkie { rpc PushPull (PushPullRequest) returns (PushPullResponse) {} } +service Cluster { + rpc BroadcastEvent (BroadcastEventRequest) returns (BroadcastEventResponse) {} +} + +///////////////////////////////////////// +// Messages for Cluster // +///////////////////////////////////////// + +message BroadcastEventRequest { + bytes publisher_id = 1; + DocEvent event = 2; +} + +message BroadcastEventResponse {} + ///////////////////////////////////////// // Messages for RPC // ///////////////////////////////////////// @@ -78,15 +93,9 @@ message WatchDocumentsResponse { map peers_map_by_doc = 1; } - message Event { - Client client = 1; - EventType event_type = 2; - repeated DocumentKey document_keys = 3; - } - oneof body { Initialization initialization = 1; - Event event = 2; + DocEvent event = 2; } } @@ -348,8 +357,14 @@ enum ValueType { DOUBLE_CNT = 14; } -enum EventType { +enum DocEventType { DOCUMENTS_CHANGED = 0; DOCUMENTS_WATCHED = 1; DOCUMENTS_UNWATCHED = 2; } + +message DocEvent { + DocEventType type = 1; + Client publisher = 2; + repeated DocumentKey document_keys = 3; +} diff --git a/client/client.go b/client/client.go index db64ad1ec..c7fac7891 100644 --- a/client/client.go +++ b/client/client.go @@ -332,7 +332,7 @@ func (c *Client) Metadata() map[string]string { // WatchResponse is a structure representing response of Watch. type WatchResponse struct { Publisher *types.Client - EventType types.EventType + EventType types.DocEventType Keys []*key.Key Err error } @@ -352,7 +352,7 @@ func (c *Client) Watch(ctx context.Context, docs ...*document.Document) <-chan W ID: c.id, Metadata: c.metadata, }), - DocumentKeys: converter.ToDocumentKeys(keys...), + DocumentKeys: converter.ToDocumentKeys(keys), }) if err != nil { rch <- WatchResponse{Err: err} @@ -362,12 +362,12 @@ func (c *Client) Watch(ctx context.Context, docs ...*document.Document) <-chan W handleResponse := func(pbResp *api.WatchDocumentsResponse) error { switch resp := pbResp.Body.(type) { - case *api.WatchDocumentsResponse_Event_: - publisher, err := converter.FromClient(resp.Event.Client) + case *api.WatchDocumentsResponse_Event: + publisher, err := converter.FromClient(resp.Event.Publisher) if err != nil { return err } - eventType, err := converter.FromEventType(resp.Event.EventType) + eventType, err := converter.FromEventType(resp.Event.Type) if err != nil { return err } diff --git a/pkg/types/event.go b/pkg/types/event.go index 556665728..abe960a8c 100644 --- a/pkg/types/event.go +++ b/pkg/types/event.go @@ -1,18 +1,18 @@ package types -// EventType represents the event that the Agent delivers to the client. -type EventType string +// DocEventType represents the event that the Agent delivers to the client. +type DocEventType string const ( - // DocumentsChangeEvent is an event indicating that documents are being + // DocumentsChangedEvent is an event indicating that documents are being // modified by a change. - DocumentsChangeEvent EventType = "documents-change" + DocumentsChangedEvent DocEventType = "documents-changed" // DocumentsWatchedEvent is an event that occurs when documents are watched // by other clients. - DocumentsWatchedEvent EventType = "documents-watched" + DocumentsWatchedEvent DocEventType = "documents-watched" // DocumentsUnwatchedEvent is an event that occurs when documents are // unwatched by other clients. - DocumentsUnwatchedEvent EventType = "documents-unwatched" + DocumentsUnwatchedEvent DocEventType = "documents-unwatched" ) diff --git a/test/integration/cluster_mode_test.go b/test/integration/cluster_mode_test.go index de27a612e..2c934d77b 100644 --- a/test/integration/cluster_mode_test.go +++ b/test/integration/cluster_mode_test.go @@ -118,10 +118,12 @@ func TestClusterMode(t *testing.T) { }) assert.NoError(t, err) + err = clientB.Sync(ctx) + assert.NoError(t, err) + wg.Wait() - // TODO(hackerwins): uncomment below test - // assert.Equal(t, docA.Marshal(), docB.Marshal()) + assert.Equal(t, docA.Marshal(), docB.Marshal()) defer func() { assert.NoError(t, clientA.Deactivate(ctx)) diff --git a/yorkie/backend/sync/coordinator.go b/yorkie/backend/sync/coordinator.go index bcf5c07a0..7b388b569 100644 --- a/yorkie/backend/sync/coordinator.go +++ b/yorkie/backend/sync/coordinator.go @@ -19,8 +19,6 @@ package sync import ( "errors" gotime "time" - - "github.com/yorkie-team/yorkie/pkg/types" ) var ( @@ -28,13 +26,6 @@ var ( ErrEmptyTopics = errors.New("empty topics") ) -// DocEvent represents events that occur related to the document. -type DocEvent struct { - Type types.EventType - DocKey string - Publisher types.Client -} - // AgentInfo represents the information of the Agent. type AgentInfo struct { ID string `json:"id"` diff --git a/yorkie/backend/sync/etcd/client.go b/yorkie/backend/sync/etcd/client.go index 5e4922308..c896f0bd9 100644 --- a/yorkie/backend/sync/etcd/client.go +++ b/yorkie/backend/sync/etcd/client.go @@ -24,6 +24,7 @@ import ( "go.etcd.io/etcd/clientv3" "google.golang.org/grpc" + "github.com/yorkie-team/yorkie/api" "github.com/yorkie-team/yorkie/internal/log" "github.com/yorkie-team/yorkie/yorkie/backend/sync" "github.com/yorkie-team/yorkie/yorkie/backend/sync/memory" @@ -47,6 +48,12 @@ type Config struct { LockLeaseTimeSec int `json:"LockLeaseTimeSec"` } +// clusterClientInfo represents a cluster client and its connection. +type clusterClientInfo struct { + client api.ClusterClient + conn *grpc.ClientConn +} + // Client is a client that connects to ETCD. type Client struct { config *Config @@ -56,8 +63,10 @@ type Client struct { pubSub *memory.PubSub - memberMapMu *gosync.RWMutex - memberMap map[string]*sync.AgentInfo + memberMapMu *gosync.RWMutex + memberMap map[string]*sync.AgentInfo + clusterClientMapMu *gosync.RWMutex + clusterClientMap map[string]*clusterClientInfo ctx context.Context cancelFunc context.CancelFunc @@ -80,8 +89,10 @@ func newClient(conf *Config, agentInfo *sync.AgentInfo) *Client { pubSub: memory.NewPubSub(), - memberMapMu: &gosync.RWMutex{}, - memberMap: make(map[string]*sync.AgentInfo), + memberMapMu: &gosync.RWMutex{}, + memberMap: make(map[string]*sync.AgentInfo), + clusterClientMapMu: &gosync.RWMutex{}, + clusterClientMap: make(map[string]*clusterClientInfo), ctx: ctx, cancelFunc: cancelFunc, diff --git a/yorkie/backend/sync/etcd/membermap.go b/yorkie/backend/sync/etcd/membermap.go index f74e36136..3c35aae04 100644 --- a/yorkie/backend/sync/etcd/membermap.go +++ b/yorkie/backend/sync/etcd/membermap.go @@ -153,6 +153,7 @@ func (c *Client) syncAgents() { c.setAgentInfo(string(event.Kv.Key), info) case mvccpb.DELETE: c.removeAgentInfo(string(event.Kv.Key)) + c.removeClusterClient(string(event.Kv.Key)) } } case <-c.ctx.Done(): @@ -170,9 +171,9 @@ func (c *Client) setAgentInfo(key string, value sync.AgentInfo) { } // removeAgentInfo removes the given agentInfo from the local member map. -func (c *Client) removeAgentInfo(key string) { +func (c *Client) removeAgentInfo(id string) { c.memberMapMu.Lock() defer c.memberMapMu.Unlock() - delete(c.memberMap, key) + delete(c.memberMap, id) } diff --git a/yorkie/backend/sync/etcd/pubsub.go b/yorkie/backend/sync/etcd/pubsub.go index c94326a50..7c6efb268 100644 --- a/yorkie/backend/sync/etcd/pubsub.go +++ b/yorkie/backend/sync/etcd/pubsub.go @@ -17,6 +17,14 @@ package etcd import ( + "context" + + "google.golang.org/grpc" + + "github.com/yorkie-team/yorkie/api" + "github.com/yorkie-team/yorkie/api/converter" + "github.com/yorkie-team/yorkie/internal/log" + "github.com/yorkie-team/yorkie/pkg/document/key" "github.com/yorkie-team/yorkie/pkg/document/time" "github.com/yorkie-team/yorkie/pkg/types" "github.com/yorkie-team/yorkie/yorkie/backend/sync" @@ -25,27 +33,111 @@ import ( // Subscribe subscribes to the given topics. func (c *Client) Subscribe( subscriber types.Client, - topics []string, + topics []*key.Key, ) (*sync.Subscription, map[string][]types.Client, error) { // TODO(hackerwins): build peersMap. return c.pubSub.Subscribe(subscriber, topics) } // Unsubscribe unsubscribes the given topics. -func (c *Client) Unsubscribe(topics []string, sub *sync.Subscription) { +func (c *Client) Unsubscribe(topics []*key.Key, sub *sync.Subscription) { c.pubSub.Unsubscribe(topics, sub) } // Publish publishes the given event to the given Topic. func (c *Client) Publish( + ctx context.Context, + publisherID *time.ActorID, + event sync.DocEvent, +) { + c.PublishToLocal(ctx, publisherID, event) + + for _, member := range c.Members() { + memberAddr := member.RPCAddr + if memberAddr == c.agentInfo.RPCAddr { + continue + } + + clientInfo, err := c.ensureClusterClient(member) + if err != nil { + continue + } + + if err := c.publishToMember( + ctx, + clientInfo, + publisherID, + event, + ); err != nil { + continue + } + } +} + +// PublishToLocal publishes the given event to the given Topic. +func (c *Client) PublishToLocal( + ctx context.Context, publisherID *time.ActorID, - topic string, event sync.DocEvent, ) { - c.pubSub.Publish(publisherID, topic, event) + c.pubSub.Publish(ctx, publisherID, event) +} + +// ensureClusterClient return the cluster client from the cache or creates it. +func (c *Client) ensureClusterClient(member *sync.AgentInfo) (*clusterClientInfo, error) { + c.clusterClientMapMu.Lock() + defer c.clusterClientMapMu.Unlock() + + if _, ok := c.clusterClientMap[member.ID]; !ok { + conn, err := grpc.Dial(member.RPCAddr, grpc.WithInsecure()) + if err != nil { + log.Logger.Error(err) + return nil, err + } + + c.clusterClientMap[member.ID] = &clusterClientInfo{ + client: api.NewClusterClient(conn), + conn: conn, + } + } + + return c.clusterClientMap[member.ID], nil +} + +// removeClusterClient removes the cluster client of the given ID. +func (c *Client) removeClusterClient(id string) { + c.clusterClientMapMu.Lock() + defer c.clusterClientMapMu.Unlock() + + if info, ok := c.clusterClientMap[id]; ok { + if err := info.conn.Close(); err != nil { + log.Logger.Error(err) + } + + delete(c.clusterClientMap, id) + } +} + +// publishToMember publishes events to other agents. +func (c *Client) publishToMember( + ctx context.Context, + clientInfo *clusterClientInfo, + publisherID *time.ActorID, + event sync.DocEvent, +) error { + docEvent, err := converter.ToDocEvent(event) + if err != nil { + log.Logger.Error(err) + return err + } + + if _, err := clientInfo.client.BroadcastEvent(ctx, &api.BroadcastEventRequest{ + PublisherId: publisherID.Bytes(), + Event: docEvent, + }); err != nil { + log.Logger.Error(err) + return err + } - // TODO(hackerwins): broadcast the event to other agents. - // for _, member := range c.Members() { - // member.RPCAddr - // } + return nil } diff --git a/yorkie/backend/sync/memory/coordinator.go b/yorkie/backend/sync/memory/coordinator.go index 7c6dfc9e1..d1cc80d56 100644 --- a/yorkie/backend/sync/memory/coordinator.go +++ b/yorkie/backend/sync/memory/coordinator.go @@ -21,6 +21,7 @@ import ( "github.com/moby/locker" + "github.com/yorkie-team/yorkie/pkg/document/key" "github.com/yorkie-team/yorkie/pkg/document/time" "github.com/yorkie-team/yorkie/pkg/types" "github.com/yorkie-team/yorkie/yorkie/backend/sync" @@ -57,23 +58,32 @@ func (m *Coordinator) NewLocker( // Subscribe subscribes to the given topics. func (m *Coordinator) Subscribe( subscriber types.Client, - topics []string, + topics []*key.Key, ) (*sync.Subscription, map[string][]types.Client, error) { return m.pubSub.Subscribe(subscriber, topics) } // Unsubscribe unsubscribes the given topics. -func (m *Coordinator) Unsubscribe(topics []string, sub *sync.Subscription) { +func (m *Coordinator) Unsubscribe(topics []*key.Key, sub *sync.Subscription) { m.pubSub.Unsubscribe(topics, sub) } -// Publish publishes the given event to the given Topic. +// Publish publishes the given event. func (m *Coordinator) Publish( + ctx context.Context, + publisherID *time.ActorID, + event sync.DocEvent, +) { + m.pubSub.PublishToLocal(ctx, publisherID, event) +} + +// PublishToLocal publishes the given event. +func (m *Coordinator) PublishToLocal( + ctx context.Context, publisherID *time.ActorID, - topic string, event sync.DocEvent, ) { - m.pubSub.Publish(publisherID, topic, event) + m.pubSub.PublishToLocal(ctx, publisherID, event) } // Members returns the members of this cluster. diff --git a/yorkie/backend/sync/memory/pubsub.go b/yorkie/backend/sync/memory/pubsub.go index 50e8cf912..8e1a795cb 100644 --- a/yorkie/backend/sync/memory/pubsub.go +++ b/yorkie/backend/sync/memory/pubsub.go @@ -17,9 +17,11 @@ package memory import ( + "context" gosync "sync" "github.com/yorkie-team/yorkie/internal/log" + "github.com/yorkie-team/yorkie/pkg/document/key" "github.com/yorkie-team/yorkie/pkg/document/time" "github.com/yorkie-team/yorkie/pkg/types" "github.com/yorkie-team/yorkie/yorkie/backend/sync" @@ -78,7 +80,7 @@ func NewPubSub() *PubSub { // Subscribe subscribes to the given topics. func (m *PubSub) Subscribe( subscriber types.Client, - topics []string, + topics []*key.Key, ) (*sync.Subscription, map[string][]types.Client, error) { if len(topics) == 0 { return nil, nil, sync.ErrEmptyTopics @@ -89,7 +91,7 @@ func (m *PubSub) Subscribe( log.Logger.Debugf( `Subscribe(%s,%s) Start`, - topics[0], + topics[0].BSONKey(), subscriber.ID.String(), ) @@ -97,73 +99,95 @@ func (m *PubSub) Subscribe( peersMap := make(map[string][]types.Client) for _, topic := range topics { - if _, ok := m.subscriptionsMapByTopic[topic]; !ok { - m.subscriptionsMapByTopic[topic] = newSubscriptions() + topicKey := topic.BSONKey() + if _, ok := m.subscriptionsMapByTopic[topicKey]; !ok { + m.subscriptionsMapByTopic[topicKey] = newSubscriptions() } - m.subscriptionsMapByTopic[topic].Add(sub) + m.subscriptionsMapByTopic[topicKey].Add(sub) var peers []types.Client - for _, sub := range m.subscriptionsMapByTopic[topic].Map() { + for _, sub := range m.subscriptionsMapByTopic[topicKey].Map() { peers = append(peers, sub.Subscriber()) } - peersMap[topic] = peers + peersMap[topicKey] = peers } log.Logger.Debugf( `Subscribe(%s,%s) End`, - topics[0], + topics[0].BSONKey(), subscriber.ID.String(), ) return sub, peersMap, nil } // Unsubscribe unsubscribes the given topics. -func (m *PubSub) Unsubscribe(topics []string, sub *sync.Subscription) { +func (m *PubSub) Unsubscribe(topics []*key.Key, sub *sync.Subscription) { m.subscriptionsMapMu.Lock() defer m.subscriptionsMapMu.Unlock() - log.Logger.Debugf(`Unsubscribe(%s,%s) Start`, topics[0], sub.SubscriberID()) + log.Logger.Debugf( + `Unsubscribe(%s,%s) Start`, + topics[0].BSONKey(), + sub.SubscriberID(), + ) for _, topic := range topics { - if subs, ok := m.subscriptionsMapByTopic[topic]; ok { + topicKey := topic.BSONKey() + if subs, ok := m.subscriptionsMapByTopic[topicKey]; ok { subs.Delete(sub.ID()) if subs.Len() == 0 { - delete(m.subscriptionsMapByTopic, topic) + delete(m.subscriptionsMapByTopic, topicKey) } } } sub.Close() - log.Logger.Debugf(`Unsubscribe(%s,%s) End`, topics[0], sub.SubscriberID()) + log.Logger.Debugf( + `Unsubscribe(%s,%s) End`, + topics[0].BSONKey(), + sub.SubscriberID(), + ) } -// Publish publishes the given event to the given Topic. +// Publish publishes the given event. func (m *PubSub) Publish( + ctx context.Context, + publisherID *time.ActorID, + event sync.DocEvent, +) { + m.PublishToLocal(ctx, publisherID, event) +} + +// PublishToLocal publishes the given event. +func (m *PubSub) PublishToLocal( + _ context.Context, publisherID *time.ActorID, - topic string, event sync.DocEvent, ) { m.subscriptionsMapMu.RLock() defer m.subscriptionsMapMu.RUnlock() - log.Logger.Debugf(`Publish(%s,%s) Start`, event.DocKey, publisherID.String()) + for _, docKey := range event.DocumentKeys { + topic := docKey.BSONKey() - if subs, ok := m.subscriptionsMapByTopic[topic]; ok { - for _, sub := range subs.Map() { - if sub.Subscriber().ID.Compare(publisherID) == 0 { - continue - } + log.Logger.Debugf(`Publish(%s,%s) Start`, topic, publisherID.String()) - log.Logger.Debugf( - `Publish(%s,%s) to %s`, - event.DocKey, - publisherID.String(), - sub.SubscriberID(), - ) - sub.Events() <- event + if subs, ok := m.subscriptionsMapByTopic[topic]; ok { + for _, sub := range subs.Map() { + if sub.Subscriber().ID.Compare(publisherID) == 0 { + continue + } + + log.Logger.Debugf( + `Publish(%s,%s) to %s`, + topic, + publisherID.String(), + sub.SubscriberID(), + ) + sub.Events() <- event + } } + log.Logger.Debugf(`Publish(%s,%s) End`, topic, publisherID.String()) } - - log.Logger.Debugf(`Publish(%s,%s) End`, event.DocKey, publisherID.String()) } diff --git a/yorkie/backend/sync/memory/pubsub_test.go b/yorkie/backend/sync/memory/pubsub_test.go index bdecc7bab..b7fb94481 100644 --- a/yorkie/backend/sync/memory/pubsub_test.go +++ b/yorkie/backend/sync/memory/pubsub_test.go @@ -17,13 +17,16 @@ package memory_test import ( + "context" gosync "sync" "testing" "github.com/stretchr/testify/assert" + "github.com/yorkie-team/yorkie/pkg/document/key" "github.com/yorkie-team/yorkie/pkg/document/time" "github.com/yorkie-team/yorkie/pkg/types" + "github.com/yorkie-team/yorkie/test/helper" "github.com/yorkie-team/yorkie/yorkie/backend/sync" "github.com/yorkie-team/yorkie/yorkie/backend/sync/memory" ) @@ -34,17 +37,23 @@ func TestPubSub(t *testing.T) { t.Run("publish subscribe test", func(t *testing.T) { pubSub := memory.NewPubSub() + docKeys := []*key.Key{ + { + Collection: helper.Collection, + Document: t.Name(), + }, + } event := sync.DocEvent{ - Type: types.DocumentsWatchedEvent, - DocKey: t.Name(), - Publisher: actorB, + Type: types.DocumentsWatchedEvent, + Publisher: actorB, + DocumentKeys: docKeys, } // subscribe the topic by actorA - subA, _, err := pubSub.Subscribe(actorA, []string{t.Name()}) + subA, _, err := pubSub.Subscribe(actorA, docKeys) assert.NoError(t, err) defer func() { - pubSub.Unsubscribe([]string{t.Name()}, subA) + pubSub.Unsubscribe(docKeys, subA) }() var wg gosync.WaitGroup @@ -56,17 +65,23 @@ func TestPubSub(t *testing.T) { }() // publish the event to the topic by actorB - pubSub.Publish(actorB.ID, t.Name(), event) + pubSub.Publish(context.Background(), actorB.ID, event) wg.Wait() }) t.Run("subscriptions map test", func(t *testing.T) { pubSub := memory.NewPubSub() + docKeys := []*key.Key{ + { + Collection: helper.Collection, + Document: t.Name(), + }, + } for i := 0; i < 5; i++ { - _, subs, err := pubSub.Subscribe(actorA, []string{t.Name()}) + _, subs, err := pubSub.Subscribe(actorA, docKeys) assert.NoError(t, err) - assert.Len(t, subs[t.Name()], i+1) + assert.Len(t, subs[docKeys[0].BSONKey()], i+1) } }) } diff --git a/yorkie/backend/sync/pubsub.go b/yorkie/backend/sync/pubsub.go index 3e5fe92fb..9e5f89446 100644 --- a/yorkie/backend/sync/pubsub.go +++ b/yorkie/backend/sync/pubsub.go @@ -17,8 +17,11 @@ package sync import ( + "context" + "github.com/rs/xid" + "github.com/yorkie-team/yorkie/pkg/document/key" "github.com/yorkie-team/yorkie/pkg/document/time" "github.com/yorkie-team/yorkie/pkg/types" ) @@ -46,6 +49,13 @@ func (s *Subscription) ID() string { return s.id } +// DocEvent represents events that occur related to the document. +type DocEvent struct { + Type types.DocEventType + Publisher types.Client + DocumentKeys []*key.Key +} + // Events returns the DocEvent channel of this subscription. func (s *Subscription) Events() chan DocEvent { return s.events @@ -76,12 +86,15 @@ type PubSub interface { // Subscribe subscribes to the given topics. Subscribe( subscriber types.Client, - topics []string, + topics []*key.Key, ) (*Subscription, map[string][]types.Client, error) // Unsubscribe unsubscribes the given topics. - Unsubscribe(topics []string, sub *Subscription) + Unsubscribe(topics []*key.Key, sub *Subscription) + + // Publish publishes the given event. + Publish(ctx context.Context, publisherID *time.ActorID, event DocEvent) - // Publish publishes the given event to the given Topic. - Publish(publisherID *time.ActorID, topic string, event DocEvent) + // PublishToLocal publishes the given event. + PublishToLocal(ctx context.Context, publisherID *time.ActorID, event DocEvent) } diff --git a/yorkie/packs/pack_service.go b/yorkie/packs/pack_service.go index 6fb61a841..58e4bea48 100644 --- a/yorkie/packs/pack_service.go +++ b/yorkie/packs/pack_service.go @@ -27,6 +27,7 @@ import ( "github.com/yorkie-team/yorkie/pkg/document" "github.com/yorkie-team/yorkie/pkg/document/change" "github.com/yorkie-team/yorkie/pkg/document/checkpoint" + "github.com/yorkie-team/yorkie/pkg/document/key" "github.com/yorkie-team/yorkie/pkg/document/time" "github.com/yorkie-team/yorkie/pkg/types" "github.com/yorkie-team/yorkie/yorkie/backend" @@ -127,12 +128,12 @@ func PushPull( }() be.Coordinator.Publish( + ctx, publisherID, - reqPack.DocumentKey.BSONKey(), sync.DocEvent{ - Type: types.DocumentsChangeEvent, - DocKey: reqPack.DocumentKey.BSONKey(), - Publisher: types.Client{ID: publisherID}, + Type: types.DocumentsChangedEvent, + Publisher: types.Client{ID: publisherID}, + DocumentKeys: []*key.Key{reqPack.DocumentKey}, }, ) diff --git a/yorkie/rpc/cluster.go b/yorkie/rpc/cluster.go new file mode 100644 index 000000000..7ba601f6f --- /dev/null +++ b/yorkie/rpc/cluster.go @@ -0,0 +1,36 @@ +package rpc + +import ( + "context" + + "github.com/yorkie-team/yorkie/api" + "github.com/yorkie-team/yorkie/api/converter" + "github.com/yorkie-team/yorkie/internal/log" + "github.com/yorkie-team/yorkie/pkg/document/time" +) + +// BroadcastEvent publishes the given event to the given Topic. +func (s *Server) BroadcastEvent( + ctx context.Context, + request *api.BroadcastEventRequest, +) (*api.BroadcastEventResponse, error) { + actorID, err := time.ActorIDFromBytes(request.PublisherId) + if err != nil { + log.Logger.Error(err) + return nil, err + } + + docEvent, err := converter.FromDocEvent(request.Event) + if err != nil { + log.Logger.Error(err) + return nil, err + } + + s.backend.Coordinator.PublishToLocal( + ctx, + actorID, + *docEvent, + ) + + return &api.BroadcastEventResponse{}, nil +} diff --git a/yorkie/rpc/server.go b/yorkie/rpc/server.go index dce472216..9e860bcc6 100644 --- a/yorkie/rpc/server.go +++ b/yorkie/rpc/server.go @@ -93,6 +93,7 @@ func NewServer(conf *Config, be *backend.Backend) (*Server, error) { backend: be, } api.RegisterYorkieServer(rpcServer.grpcServer, rpcServer) + api.RegisterClusterServer(rpcServer.grpcServer, rpcServer) grpcprometheus.Register(rpcServer.grpcServer) return rpcServer, nil @@ -379,12 +380,10 @@ func (s *Server) WatchDocuments( if err != nil { return err } - var docKeys []string - for _, docKey := range converter.FromDocumentKeys(req.DocumentKeys) { - docKeys = append(docKeys, docKey.BSONKey()) - } + docKeys := converter.FromDocumentKeys(req.DocumentKeys) subscription, peersMap, err := s.watchDocs( + stream.Context(), *client, docKeys, ) @@ -411,24 +410,17 @@ func (s *Server) WatchDocuments( s.unwatchDocs(docKeys, subscription) return nil case event := <-subscription.Events(): - k, err := key.FromBSONKey(event.DocKey) - if err != nil { - log.Logger.Error(err) - s.unwatchDocs(docKeys, subscription) - return err - } - - eventType, err := converter.ToEventType(event.Type) + eventType, err := converter.ToDocEventType(event.Type) if err != nil { return err } if err := stream.Send(&api.WatchDocumentsResponse{ - Body: &api.WatchDocumentsResponse_Event_{ - Event: &api.WatchDocumentsResponse_Event{ - Client: converter.ToClient(event.Publisher), - EventType: eventType, - DocumentKeys: converter.ToDocumentKeys(k), + Body: &api.WatchDocumentsResponse_Event{ + Event: &api.DocEvent{ + Type: eventType, + Publisher: converter.ToClient(event.Publisher), + DocumentKeys: converter.ToDocumentKeys(event.DocumentKeys), }, }, }); err != nil { @@ -461,8 +453,9 @@ func (s *Server) listenAndServeGRPC() error { } func (s *Server) watchDocs( + ctx context.Context, client types.Client, - docKeys []string, + docKeys []*key.Key, ) (*sync.Subscription, map[string][]types.Client, error) { subscription, peersMap, err := s.backend.Coordinator.Subscribe( client, @@ -473,33 +466,32 @@ func (s *Server) watchDocs( return nil, nil, err } - for _, docKey := range docKeys { - s.backend.Coordinator.Publish( - subscription.Subscriber().ID, - docKey, - sync.DocEvent{ - Type: types.DocumentsWatchedEvent, - DocKey: docKey, - Publisher: subscription.Subscriber(), - }, - ) - } + s.backend.Coordinator.Publish( + ctx, + subscription.Subscriber().ID, + sync.DocEvent{ + Type: types.DocumentsWatchedEvent, + Publisher: subscription.Subscriber(), + DocumentKeys: docKeys, + }, + ) return subscription, peersMap, nil } -func (s *Server) unwatchDocs(docKeys []string, subscription *sync.Subscription) { +func (s *Server) unwatchDocs( + docKeys []*key.Key, + subscription *sync.Subscription, +) { s.backend.Coordinator.Unsubscribe(docKeys, subscription) - for _, docKey := range docKeys { - s.backend.Coordinator.Publish( - subscription.Subscriber().ID, - docKey, - sync.DocEvent{ - Type: types.DocumentsUnwatchedEvent, - DocKey: docKey, - Publisher: subscription.Subscriber(), - }, - ) - } + s.backend.Coordinator.Publish( + context.Background(), + subscription.Subscriber().ID, + sync.DocEvent{ + Type: types.DocumentsUnwatchedEvent, + Publisher: subscription.Subscriber(), + DocumentKeys: docKeys, + }, + ) }