diff --git a/master/rest.go b/master/rest.go index 8cc351d40..72c641fad 100644 --- a/master/rest.go +++ b/master/rest.go @@ -17,6 +17,7 @@ package master import ( "bufio" "context" + "encoding/binary" "encoding/json" "fmt" "io" @@ -45,10 +46,13 @@ import ( "github.com/zhenghaoz/gorse/config" "github.com/zhenghaoz/gorse/model/click" "github.com/zhenghaoz/gorse/model/ranking" + "github.com/zhenghaoz/gorse/protocol" "github.com/zhenghaoz/gorse/server" "github.com/zhenghaoz/gorse/storage/cache" "github.com/zhenghaoz/gorse/storage/data" "go.uber.org/zap" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/timestamppb" ) func (m *Master) CreateWebService() { @@ -225,6 +229,8 @@ func (m *Master) StartHttpServer() { container.Handle("/api/bulk/users", http.HandlerFunc(m.importExportUsers)) container.Handle("/api/bulk/items", http.HandlerFunc(m.importExportItems)) container.Handle("/api/bulk/feedback", http.HandlerFunc(m.importExportFeedback)) + container.Handle("/api/dump", http.HandlerFunc(m.dump)) + container.Handle("/api/restore", http.HandlerFunc(m.restore)) if m.workerScheduleHandler == nil { container.Handle("/api/admin/schedule", http.HandlerFunc(m.scheduleAPIHandler)) } else { @@ -1499,3 +1505,306 @@ func (s *Master) checkAdmin(request *http.Request) bool { } return false } + +const ( + EOF = int64(0) + UserStream = int64(-1) + ItemStream = int64(-2) + FeedbackStream = int64(-3) +) + +type DumpStats struct { + Users int + Items int + Feedback int + Duration time.Duration +} + +func writeDump[T proto.Message](w io.Writer, data T) error { + bytes, err := proto.Marshal(data) + if err != nil { + return err + } + if err = binary.Write(w, binary.LittleEndian, int64(len(bytes))); err != nil { + return err + } + if _, err = w.Write(bytes); err != nil { + return err + } + return nil +} + +func readDump[T proto.Message](r io.Reader, data T) (int64, error) { + var size int64 + if err := binary.Read(r, binary.LittleEndian, &size); err != nil { + return 0, err + } + if size <= 0 { + return size, nil + } + bytes := make([]byte, size) + if _, err := r.Read(bytes); err != nil { + return 0, err + } + return size, proto.Unmarshal(bytes, data) +} + +func (m *Master) dump(response http.ResponseWriter, request *http.Request) { + if !m.checkAdmin(request) { + writeError(response, http.StatusUnauthorized, "unauthorized") + return + } + if request.Method != http.MethodGet { + writeError(response, http.StatusMethodNotAllowed, "method not allowed") + return + } + response.Header().Set("Content-Type", "application/octet-stream") + var stats DumpStats + start := time.Now() + // dump users + if err := binary.Write(response, binary.LittleEndian, UserStream); err != nil { + writeError(response, http.StatusInternalServerError, err.Error()) + return + } + userStream, errChan := m.DataClient.GetUserStream(context.Background(), batchSize) + for users := range userStream { + for _, user := range users { + labels, err := json.Marshal(user.Labels) + if err != nil { + writeError(response, http.StatusInternalServerError, err.Error()) + return + } + if err := writeDump(response, &protocol.User{ + UserId: user.UserId, + Labels: labels, + Comment: user.Comment, + }); err != nil { + writeError(response, http.StatusInternalServerError, err.Error()) + return + } + stats.Users++ + } + } + if err := <-errChan; err != nil { + writeError(response, http.StatusInternalServerError, err.Error()) + return + } + // dump items + if err := binary.Write(response, binary.LittleEndian, ItemStream); err != nil { + writeError(response, http.StatusInternalServerError, err.Error()) + return + } + itemStream, errChan := m.DataClient.GetItemStream(context.Background(), batchSize, nil) + for items := range itemStream { + for _, item := range items { + labels, err := json.Marshal(item.Labels) + if err != nil { + writeError(response, http.StatusInternalServerError, err.Error()) + return + } + if err := writeDump(response, &protocol.Item{ + ItemId: item.ItemId, + IsHidden: item.IsHidden, + Categories: item.Categories, + Timestamp: timestamppb.New(item.Timestamp), + Labels: labels, + Comment: item.Comment, + }); err != nil { + writeError(response, http.StatusInternalServerError, err.Error()) + return + } + stats.Items++ + } + } + if err := <-errChan; err != nil { + writeError(response, http.StatusInternalServerError, err.Error()) + return + } + // dump feedback + if err := binary.Write(response, binary.LittleEndian, FeedbackStream); err != nil { + writeError(response, http.StatusInternalServerError, err.Error()) + return + } + feedbackStream, errChan := m.DataClient.GetFeedbackStream(context.Background(), batchSize, data.WithEndTime(*m.Config.Now())) + for feedbacks := range feedbackStream { + for _, feedback := range feedbacks { + if err := writeDump(response, &protocol.Feedback{ + FeedbackType: feedback.FeedbackType, + UserId: feedback.UserId, + ItemId: feedback.ItemId, + Timestamp: timestamppb.New(feedback.Timestamp), + Comment: feedback.Comment, + }); err != nil { + writeError(response, http.StatusInternalServerError, err.Error()) + return + } + stats.Feedback++ + } + } + if err := <-errChan; err != nil { + writeError(response, http.StatusInternalServerError, err.Error()) + return + } + // dump EOF + if err := binary.Write(response, binary.LittleEndian, EOF); err != nil { + writeError(response, http.StatusInternalServerError, err.Error()) + return + } + stats.Duration = time.Since(start) + log.Logger().Info("complete dump", + zap.Int("users", stats.Users), + zap.Int("items", stats.Items), + zap.Int("feedback", stats.Feedback), + zap.Duration("duration", stats.Duration)) + server.Ok(restful.NewResponse(response), stats) +} + +func (m *Master) restore(response http.ResponseWriter, request *http.Request) { + if !m.checkAdmin(request) { + writeError(response, http.StatusUnauthorized, "unauthorized") + return + } + if request.Method != http.MethodPost { + writeError(response, http.StatusMethodNotAllowed, "method not allowed") + return + } + var ( + flag int64 + err error + stats DumpStats + start = time.Now() + ) + if err = binary.Read(request.Body, binary.LittleEndian, &flag); err != nil { + if errors.Is(err, io.EOF) { + server.Ok(restful.NewResponse(response), struct{}{}) + return + } else { + writeError(response, http.StatusInternalServerError, err.Error()) + return + } + } + for flag != EOF { + switch flag { + case UserStream: + users := make([]data.User, 0, batchSize) + for { + var user protocol.User + if flag, err = readDump(request.Body, &user); err != nil { + writeError(response, http.StatusInternalServerError, err.Error()) + return + } + if flag <= 0 { + break + } + labels := make(map[string]interface{}) + if err := json.Unmarshal(user.Labels, &labels); err != nil { + writeError(response, http.StatusInternalServerError, err.Error()) + return + } + users = append(users, data.User{ + UserId: user.UserId, + Labels: labels, + Comment: user.Comment, + }) + stats.Users++ + if len(users) == batchSize { + if err := m.DataClient.BatchInsertUsers(context.Background(), users); err != nil { + writeError(response, http.StatusInternalServerError, err.Error()) + return + } + users = users[:0] + } + } + if len(users) > 0 { + if err := m.DataClient.BatchInsertUsers(context.Background(), users); err != nil { + writeError(response, http.StatusInternalServerError, err.Error()) + return + } + } + case ItemStream: + items := make([]data.Item, 0, batchSize) + for { + var item protocol.Item + if flag, err = readDump(request.Body, &item); err != nil { + writeError(response, http.StatusInternalServerError, err.Error()) + return + } + if flag <= 0 { + break + } + labels := make(map[string]interface{}) + if err := json.Unmarshal(item.Labels, &labels); err != nil { + writeError(response, http.StatusInternalServerError, err.Error()) + return + } + items = append(items, data.Item{ + ItemId: item.ItemId, + IsHidden: item.IsHidden, + Categories: item.Categories, + Timestamp: item.Timestamp.AsTime(), + Labels: labels, + Comment: item.Comment, + }) + stats.Items++ + if len(items) == batchSize { + if err := m.DataClient.BatchInsertItems(context.Background(), items); err != nil { + writeError(response, http.StatusInternalServerError, err.Error()) + return + } + items = items[:0] + } + } + if len(items) > 0 { + if err := m.DataClient.BatchInsertItems(context.Background(), items); err != nil { + writeError(response, http.StatusInternalServerError, err.Error()) + return + } + } + case FeedbackStream: + feedbacks := make([]data.Feedback, 0, batchSize) + for { + var feedback protocol.Feedback + if flag, err = readDump(request.Body, &feedback); err != nil { + writeError(response, http.StatusInternalServerError, err.Error()) + return + } + if flag <= 0 { + break + } + feedbacks = append(feedbacks, data.Feedback{ + FeedbackKey: data.FeedbackKey{ + FeedbackType: feedback.FeedbackType, + UserId: feedback.UserId, + ItemId: feedback.ItemId, + }, + Timestamp: feedback.Timestamp.AsTime(), + Comment: feedback.Comment, + }) + stats.Feedback++ + if len(feedbacks) == batchSize { + if err := m.DataClient.BatchInsertFeedback(context.Background(), feedbacks, true, true, true); err != nil { + writeError(response, http.StatusInternalServerError, err.Error()) + return + } + feedbacks = feedbacks[:0] + } + } + if len(feedbacks) > 0 { + if err := m.DataClient.BatchInsertFeedback(context.Background(), feedbacks, true, true, true); err != nil { + writeError(response, http.StatusInternalServerError, err.Error()) + return + } + } + default: + writeError(response, http.StatusInternalServerError, fmt.Sprintf("unknown flag %v", flag)) + return + } + } + stats.Duration = time.Since(start) + log.Logger().Info("complete restore", + zap.Int("users", stats.Users), + zap.Int("items", stats.Items), + zap.Int("feedback", stats.Feedback), + zap.Duration("duration", stats.Duration)) + server.Ok(restful.NewResponse(response), stats) +} diff --git a/master/rest_test.go b/master/rest_test.go index bb5e4d843..692d4f239 100644 --- a/master/rest_test.go +++ b/master/rest_test.go @@ -991,3 +991,76 @@ func TestMaster_TokenLogin(t *testing.T) { Status(http.StatusOK). End() } + +func TestDumpAndRestore(t *testing.T) { + s, cookie := newMockServer(t) + defer s.Close(t) + ctx := context.Background() + // insert users + users := make([]data.User, batchSize+1) + for i := range users { + users[i] = data.User{ + UserId: fmt.Sprintf("%05d", i), + Labels: map[string]any{"a": fmt.Sprintf("%d", 2*i+1), "b": fmt.Sprintf("%d", 2*i+2)}, + } + } + err := s.DataClient.BatchInsertUsers(ctx, users) + assert.NoError(t, err) + // insert items + items := make([]data.Item, batchSize+1) + for i := range items { + items[i] = data.Item{ + ItemId: fmt.Sprintf("%05d", i), + Labels: map[string]any{"a": fmt.Sprintf("%d", 2*i+1), "b": fmt.Sprintf("%d", 2*i+2)}, + } + } + err = s.DataClient.BatchInsertItems(ctx, items) + assert.NoError(t, err) + // insert feedback + feedback := make([]data.Feedback, batchSize+1) + for i := range feedback { + feedback[i] = data.Feedback{ + FeedbackKey: data.FeedbackKey{ + FeedbackType: "click", + UserId: fmt.Sprintf("%05d", i), + ItemId: fmt.Sprintf("%05d", i), + }, + } + } + err = s.DataClient.BatchInsertFeedback(ctx, feedback, true, true, true) + assert.NoError(t, err) + + // dump data + req := httptest.NewRequest("GET", "https://example.com/", nil) + req.Header.Set("Cookie", cookie) + w := httptest.NewRecorder() + s.dump(w, req) + assert.Equal(t, http.StatusOK, w.Code) + + // restore data + err = s.DataClient.Purge() + assert.NoError(t, err) + req = httptest.NewRequest("POST", "https://example.com/", bytes.NewReader(w.Body.Bytes())) + req.Header.Set("Cookie", cookie) + req.Header.Set("Content-Type", "application/octet-stream") + w = httptest.NewRecorder() + s.restore(w, req) + assert.Equal(t, http.StatusOK, w.Code) + + // check data + _, returnUsers, err := s.DataClient.GetUsers(ctx, "", len(users)) + assert.NoError(t, err) + if assert.Equal(t, len(users), len(returnUsers)) { + assert.Equal(t, users, returnUsers) + } + _, returnItems, err := s.DataClient.GetItems(ctx, "", len(items), nil) + assert.NoError(t, err) + if assert.Equal(t, len(items), len(returnItems)) { + assert.Equal(t, items, returnItems) + } + _, returnFeedback, err := s.DataClient.GetFeedback(ctx, "", len(feedback), nil, lo.ToPtr(time.Now())) + assert.NoError(t, err) + if assert.Equal(t, len(feedback), len(returnFeedback)) { + assert.Equal(t, feedback, returnFeedback) + } +} diff --git a/protocol/protocol.pb.go b/protocol/protocol.pb.go index f14fd456e..dc447388f 100644 --- a/protocol/protocol.pb.go +++ b/protocol/protocol.pb.go @@ -1,24 +1,39 @@ +// Copyright 2020 gorse Project Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.35.1 +// protoc v5.28.3 // source: protocol.proto package protocol import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type NodeType int32 @@ -28,463 +43,894 @@ const ( NodeType_ClientNode NodeType = 2 ) -var NodeType_name = map[int32]string{ - 0: "ServerNode", - 1: "WorkerNode", - 2: "ClientNode", -} +// Enum value maps for NodeType. +var ( + NodeType_name = map[int32]string{ + 0: "ServerNode", + 1: "WorkerNode", + 2: "ClientNode", + } + NodeType_value = map[string]int32{ + "ServerNode": 0, + "WorkerNode": 1, + "ClientNode": 2, + } +) -var NodeType_value = map[string]int32{ - "ServerNode": 0, - "WorkerNode": 1, - "ClientNode": 2, +func (x NodeType) Enum() *NodeType { + p := new(NodeType) + *p = x + return p } func (x NodeType) String() string { - return proto.EnumName(NodeType_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (NodeType) Descriptor() protoreflect.EnumDescriptor { + return file_protocol_proto_enumTypes[0].Descriptor() +} + +func (NodeType) Type() protoreflect.EnumType { + return &file_protocol_proto_enumTypes[0] } +func (x NodeType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use NodeType.Descriptor instead. func (NodeType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_2bc2336598a3f7e0, []int{0} + return file_protocol_proto_rawDescGZIP(), []int{0} } -type Meta struct { - Config string `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` - RankingModelVersion int64 `protobuf:"varint,3,opt,name=ranking_model_version,json=rankingModelVersion,proto3" json:"ranking_model_version,omitempty"` - ClickModelVersion int64 `protobuf:"varint,4,opt,name=click_model_version,json=clickModelVersion,proto3" json:"click_model_version,omitempty"` - Me string `protobuf:"bytes,5,opt,name=me,proto3" json:"me,omitempty"` - Servers []string `protobuf:"bytes,6,rep,name=servers,proto3" json:"servers,omitempty"` - Workers []string `protobuf:"bytes,7,rep,name=workers,proto3" json:"workers,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Meta) Reset() { *m = Meta{} } -func (m *Meta) String() string { return proto.CompactTextString(m) } -func (*Meta) ProtoMessage() {} -func (*Meta) Descriptor() ([]byte, []int) { - return fileDescriptor_2bc2336598a3f7e0, []int{0} +type User struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Labels []byte `protobuf:"bytes,2,opt,name=labels,proto3" json:"labels,omitempty"` + Comment string `protobuf:"bytes,3,opt,name=comment,proto3" json:"comment,omitempty"` } -func (m *Meta) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Meta.Unmarshal(m, b) +func (x *User) Reset() { + *x = User{} + mi := &file_protocol_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *Meta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Meta.Marshal(b, m, deterministic) + +func (x *User) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Meta) XXX_Merge(src proto.Message) { - xxx_messageInfo_Meta.Merge(m, src) + +func (*User) ProtoMessage() {} + +func (x *User) ProtoReflect() protoreflect.Message { + mi := &file_protocol_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *Meta) XXX_Size() int { - return xxx_messageInfo_Meta.Size(m) + +// Deprecated: Use User.ProtoReflect.Descriptor instead. +func (*User) Descriptor() ([]byte, []int) { + return file_protocol_proto_rawDescGZIP(), []int{0} } -func (m *Meta) XXX_DiscardUnknown() { - xxx_messageInfo_Meta.DiscardUnknown(m) + +func (x *User) GetUserId() string { + if x != nil { + return x.UserId + } + return "" } -var xxx_messageInfo_Meta proto.InternalMessageInfo +func (x *User) GetLabels() []byte { + if x != nil { + return x.Labels + } + return nil +} -func (m *Meta) GetConfig() string { - if m != nil { - return m.Config +func (x *User) GetComment() string { + if x != nil { + return x.Comment } return "" } -func (m *Meta) GetRankingModelVersion() int64 { - if m != nil { - return m.RankingModelVersion +type Item struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + ItemId string `protobuf:"bytes,2,opt,name=item_id,json=itemId,proto3" json:"item_id,omitempty"` + IsHidden bool `protobuf:"varint,3,opt,name=is_hidden,json=isHidden,proto3" json:"is_hidden,omitempty"` + Categories []string `protobuf:"bytes,4,rep,name=categories,proto3" json:"categories,omitempty"` + Timestamp *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Labels []byte `protobuf:"bytes,6,opt,name=labels,proto3" json:"labels,omitempty"` + Comment string `protobuf:"bytes,7,opt,name=comment,proto3" json:"comment,omitempty"` +} + +func (x *Item) Reset() { + *x = Item{} + mi := &file_protocol_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Item) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Item) ProtoMessage() {} + +func (x *Item) ProtoReflect() protoreflect.Message { + mi := &file_protocol_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return 0 + return mi.MessageOf(x) } -func (m *Meta) GetClickModelVersion() int64 { - if m != nil { - return m.ClickModelVersion +// Deprecated: Use Item.ProtoReflect.Descriptor instead. +func (*Item) Descriptor() ([]byte, []int) { + return file_protocol_proto_rawDescGZIP(), []int{1} +} + +func (x *Item) GetNamespace() string { + if x != nil { + return x.Namespace } - return 0 + return "" } -func (m *Meta) GetMe() string { - if m != nil { - return m.Me +func (x *Item) GetItemId() string { + if x != nil { + return x.ItemId } return "" } -func (m *Meta) GetServers() []string { - if m != nil { - return m.Servers +func (x *Item) GetIsHidden() bool { + if x != nil { + return x.IsHidden + } + return false +} + +func (x *Item) GetCategories() []string { + if x != nil { + return x.Categories } return nil } -func (m *Meta) GetWorkers() []string { - if m != nil { - return m.Workers +func (x *Item) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.Timestamp } return nil } -type Fragment struct { - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (x *Item) GetLabels() []byte { + if x != nil { + return x.Labels + } + return nil } -func (m *Fragment) Reset() { *m = Fragment{} } -func (m *Fragment) String() string { return proto.CompactTextString(m) } -func (*Fragment) ProtoMessage() {} -func (*Fragment) Descriptor() ([]byte, []int) { - return fileDescriptor_2bc2336598a3f7e0, []int{1} +func (x *Item) GetComment() string { + if x != nil { + return x.Comment + } + return "" } -func (m *Fragment) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Fragment.Unmarshal(m, b) +type Feedback struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + FeedbackType string `protobuf:"bytes,2,opt,name=feedback_type,json=feedbackType,proto3" json:"feedback_type,omitempty"` + UserId string `protobuf:"bytes,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + ItemId string `protobuf:"bytes,4,opt,name=item_id,json=itemId,proto3" json:"item_id,omitempty"` + Timestamp *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Comment string `protobuf:"bytes,6,opt,name=comment,proto3" json:"comment,omitempty"` } -func (m *Fragment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Fragment.Marshal(b, m, deterministic) + +func (x *Feedback) Reset() { + *x = Feedback{} + mi := &file_protocol_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *Fragment) XXX_Merge(src proto.Message) { - xxx_messageInfo_Fragment.Merge(m, src) + +func (x *Feedback) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Fragment) XXX_Size() int { - return xxx_messageInfo_Fragment.Size(m) + +func (*Feedback) ProtoMessage() {} + +func (x *Feedback) ProtoReflect() protoreflect.Message { + mi := &file_protocol_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *Fragment) XXX_DiscardUnknown() { - xxx_messageInfo_Fragment.DiscardUnknown(m) + +// Deprecated: Use Feedback.ProtoReflect.Descriptor instead. +func (*Feedback) Descriptor() ([]byte, []int) { + return file_protocol_proto_rawDescGZIP(), []int{2} } -var xxx_messageInfo_Fragment proto.InternalMessageInfo +func (x *Feedback) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *Feedback) GetFeedbackType() string { + if x != nil { + return x.FeedbackType + } + return "" +} + +func (x *Feedback) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} -func (m *Fragment) GetData() []byte { - if m != nil { - return m.Data +func (x *Feedback) GetItemId() string { + if x != nil { + return x.ItemId + } + return "" +} + +func (x *Feedback) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.Timestamp } return nil } -type VersionInfo struct { - Version int64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (x *Feedback) GetComment() string { + if x != nil { + return x.Comment + } + return "" } -func (m *VersionInfo) Reset() { *m = VersionInfo{} } -func (m *VersionInfo) String() string { return proto.CompactTextString(m) } -func (*VersionInfo) ProtoMessage() {} -func (*VersionInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_2bc2336598a3f7e0, []int{2} +type Meta struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Config string `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` + RankingModelVersion int64 `protobuf:"varint,3,opt,name=ranking_model_version,json=rankingModelVersion,proto3" json:"ranking_model_version,omitempty"` + ClickModelVersion int64 `protobuf:"varint,4,opt,name=click_model_version,json=clickModelVersion,proto3" json:"click_model_version,omitempty"` + Me string `protobuf:"bytes,5,opt,name=me,proto3" json:"me,omitempty"` + Servers []string `protobuf:"bytes,6,rep,name=servers,proto3" json:"servers,omitempty"` + Workers []string `protobuf:"bytes,7,rep,name=workers,proto3" json:"workers,omitempty"` } -func (m *VersionInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VersionInfo.Unmarshal(m, b) +func (x *Meta) Reset() { + *x = Meta{} + mi := &file_protocol_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *VersionInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VersionInfo.Marshal(b, m, deterministic) + +func (x *Meta) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *VersionInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_VersionInfo.Merge(m, src) + +func (*Meta) ProtoMessage() {} + +func (x *Meta) ProtoReflect() protoreflect.Message { + mi := &file_protocol_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *VersionInfo) XXX_Size() int { - return xxx_messageInfo_VersionInfo.Size(m) + +// Deprecated: Use Meta.ProtoReflect.Descriptor instead. +func (*Meta) Descriptor() ([]byte, []int) { + return file_protocol_proto_rawDescGZIP(), []int{3} } -func (m *VersionInfo) XXX_DiscardUnknown() { - xxx_messageInfo_VersionInfo.DiscardUnknown(m) + +func (x *Meta) GetConfig() string { + if x != nil { + return x.Config + } + return "" } -var xxx_messageInfo_VersionInfo proto.InternalMessageInfo +func (x *Meta) GetRankingModelVersion() int64 { + if x != nil { + return x.RankingModelVersion + } + return 0 +} -func (m *VersionInfo) GetVersion() int64 { - if m != nil { - return m.Version +func (x *Meta) GetClickModelVersion() int64 { + if x != nil { + return x.ClickModelVersion } return 0 } -type NodeInfo struct { - NodeType NodeType `protobuf:"varint,1,opt,name=node_type,json=nodeType,proto3,enum=protocol.NodeType" json:"node_type,omitempty"` - NodeName string `protobuf:"bytes,2,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - HttpPort int64 `protobuf:"varint,3,opt,name=http_port,json=httpPort,proto3" json:"http_port,omitempty"` - BinaryVersion string `protobuf:"bytes,4,opt,name=binary_version,json=binaryVersion,proto3" json:"binary_version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NodeInfo) Reset() { *m = NodeInfo{} } -func (m *NodeInfo) String() string { return proto.CompactTextString(m) } -func (*NodeInfo) ProtoMessage() {} -func (*NodeInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_2bc2336598a3f7e0, []int{3} +func (x *Meta) GetMe() string { + if x != nil { + return x.Me + } + return "" } -func (m *NodeInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NodeInfo.Unmarshal(m, b) +func (x *Meta) GetServers() []string { + if x != nil { + return x.Servers + } + return nil } -func (m *NodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NodeInfo.Marshal(b, m, deterministic) + +func (x *Meta) GetWorkers() []string { + if x != nil { + return x.Workers + } + return nil } -func (m *NodeInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_NodeInfo.Merge(m, src) + +type Fragment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` } -func (m *NodeInfo) XXX_Size() int { - return xxx_messageInfo_NodeInfo.Size(m) + +func (x *Fragment) Reset() { + *x = Fragment{} + mi := &file_protocol_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *NodeInfo) XXX_DiscardUnknown() { - xxx_messageInfo_NodeInfo.DiscardUnknown(m) + +func (x *Fragment) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_NodeInfo proto.InternalMessageInfo +func (*Fragment) ProtoMessage() {} -func (m *NodeInfo) GetNodeType() NodeType { - if m != nil { - return m.NodeType +func (x *Fragment) ProtoReflect() protoreflect.Message { + mi := &file_protocol_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Fragment.ProtoReflect.Descriptor instead. +func (*Fragment) Descriptor() ([]byte, []int) { + return file_protocol_proto_rawDescGZIP(), []int{4} +} + +func (x *Fragment) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +type VersionInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version int64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` +} + +func (x *VersionInfo) Reset() { + *x = VersionInfo{} + mi := &file_protocol_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *VersionInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VersionInfo) ProtoMessage() {} + +func (x *VersionInfo) ProtoReflect() protoreflect.Message { + mi := &file_protocol_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VersionInfo.ProtoReflect.Descriptor instead. +func (*VersionInfo) Descriptor() ([]byte, []int) { + return file_protocol_proto_rawDescGZIP(), []int{5} +} + +func (x *VersionInfo) GetVersion() int64 { + if x != nil { + return x.Version + } + return 0 +} + +type NodeInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeType NodeType `protobuf:"varint,1,opt,name=node_type,json=nodeType,proto3,enum=protocol.NodeType" json:"node_type,omitempty"` + NodeName string `protobuf:"bytes,2,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` + HttpPort int64 `protobuf:"varint,3,opt,name=http_port,json=httpPort,proto3" json:"http_port,omitempty"` + BinaryVersion string `protobuf:"bytes,4,opt,name=binary_version,json=binaryVersion,proto3" json:"binary_version,omitempty"` +} + +func (x *NodeInfo) Reset() { + *x = NodeInfo{} + mi := &file_protocol_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *NodeInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NodeInfo) ProtoMessage() {} + +func (x *NodeInfo) ProtoReflect() protoreflect.Message { + mi := &file_protocol_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NodeInfo.ProtoReflect.Descriptor instead. +func (*NodeInfo) Descriptor() ([]byte, []int) { + return file_protocol_proto_rawDescGZIP(), []int{6} +} + +func (x *NodeInfo) GetNodeType() NodeType { + if x != nil { + return x.NodeType } return NodeType_ServerNode } -func (m *NodeInfo) GetNodeName() string { - if m != nil { - return m.NodeName +func (x *NodeInfo) GetNodeName() string { + if x != nil { + return x.NodeName } return "" } -func (m *NodeInfo) GetHttpPort() int64 { - if m != nil { - return m.HttpPort +func (x *NodeInfo) GetHttpPort() int64 { + if x != nil { + return x.HttpPort } return 0 } -func (m *NodeInfo) GetBinaryVersion() string { - if m != nil { - return m.BinaryVersion +func (x *NodeInfo) GetBinaryVersion() string { + if x != nil { + return x.BinaryVersion } return "" } type Progress struct { - Tracer string `protobuf:"bytes,1,opt,name=tracer,proto3" json:"tracer,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` - Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"` - Count int64 `protobuf:"varint,5,opt,name=count,proto3" json:"count,omitempty"` - Total int64 `protobuf:"varint,6,opt,name=total,proto3" json:"total,omitempty"` - StartTime int64 `protobuf:"varint,7,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` - FinishTime int64 `protobuf:"varint,8,opt,name=finish_time,json=finishTime,proto3" json:"finish_time,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Progress) Reset() { *m = Progress{} } -func (m *Progress) String() string { return proto.CompactTextString(m) } -func (*Progress) ProtoMessage() {} -func (*Progress) Descriptor() ([]byte, []int) { - return fileDescriptor_2bc2336598a3f7e0, []int{4} -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Progress) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Progress.Unmarshal(m, b) -} -func (m *Progress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Progress.Marshal(b, m, deterministic) + Tracer string `protobuf:"bytes,1,opt,name=tracer,proto3" json:"tracer,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` + Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"` + Count int64 `protobuf:"varint,5,opt,name=count,proto3" json:"count,omitempty"` + Total int64 `protobuf:"varint,6,opt,name=total,proto3" json:"total,omitempty"` + StartTime int64 `protobuf:"varint,7,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + FinishTime int64 `protobuf:"varint,8,opt,name=finish_time,json=finishTime,proto3" json:"finish_time,omitempty"` } -func (m *Progress) XXX_Merge(src proto.Message) { - xxx_messageInfo_Progress.Merge(m, src) + +func (x *Progress) Reset() { + *x = Progress{} + mi := &file_protocol_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *Progress) XXX_Size() int { - return xxx_messageInfo_Progress.Size(m) + +func (x *Progress) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Progress) XXX_DiscardUnknown() { - xxx_messageInfo_Progress.DiscardUnknown(m) + +func (*Progress) ProtoMessage() {} + +func (x *Progress) ProtoReflect() protoreflect.Message { + mi := &file_protocol_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Progress proto.InternalMessageInfo +// Deprecated: Use Progress.ProtoReflect.Descriptor instead. +func (*Progress) Descriptor() ([]byte, []int) { + return file_protocol_proto_rawDescGZIP(), []int{7} +} -func (m *Progress) GetTracer() string { - if m != nil { - return m.Tracer +func (x *Progress) GetTracer() string { + if x != nil { + return x.Tracer } return "" } -func (m *Progress) GetName() string { - if m != nil { - return m.Name +func (x *Progress) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *Progress) GetStatus() string { - if m != nil { - return m.Status +func (x *Progress) GetStatus() string { + if x != nil { + return x.Status } return "" } -func (m *Progress) GetError() string { - if m != nil { - return m.Error +func (x *Progress) GetError() string { + if x != nil { + return x.Error } return "" } -func (m *Progress) GetCount() int64 { - if m != nil { - return m.Count +func (x *Progress) GetCount() int64 { + if x != nil { + return x.Count } return 0 } -func (m *Progress) GetTotal() int64 { - if m != nil { - return m.Total +func (x *Progress) GetTotal() int64 { + if x != nil { + return x.Total } return 0 } -func (m *Progress) GetStartTime() int64 { - if m != nil { - return m.StartTime +func (x *Progress) GetStartTime() int64 { + if x != nil { + return x.StartTime } return 0 } -func (m *Progress) GetFinishTime() int64 { - if m != nil { - return m.FinishTime +func (x *Progress) GetFinishTime() int64 { + if x != nil { + return x.FinishTime } return 0 } type PushProgressRequest struct { - Progress []*Progress `protobuf:"bytes,1,rep,name=progress,proto3" json:"progress,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *PushProgressRequest) Reset() { *m = PushProgressRequest{} } -func (m *PushProgressRequest) String() string { return proto.CompactTextString(m) } -func (*PushProgressRequest) ProtoMessage() {} -func (*PushProgressRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2bc2336598a3f7e0, []int{5} + Progress []*Progress `protobuf:"bytes,1,rep,name=progress,proto3" json:"progress,omitempty"` } -func (m *PushProgressRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PushProgressRequest.Unmarshal(m, b) +func (x *PushProgressRequest) Reset() { + *x = PushProgressRequest{} + mi := &file_protocol_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *PushProgressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PushProgressRequest.Marshal(b, m, deterministic) -} -func (m *PushProgressRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_PushProgressRequest.Merge(m, src) -} -func (m *PushProgressRequest) XXX_Size() int { - return xxx_messageInfo_PushProgressRequest.Size(m) + +func (x *PushProgressRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *PushProgressRequest) XXX_DiscardUnknown() { - xxx_messageInfo_PushProgressRequest.DiscardUnknown(m) + +func (*PushProgressRequest) ProtoMessage() {} + +func (x *PushProgressRequest) ProtoReflect() protoreflect.Message { + mi := &file_protocol_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_PushProgressRequest proto.InternalMessageInfo +// Deprecated: Use PushProgressRequest.ProtoReflect.Descriptor instead. +func (*PushProgressRequest) Descriptor() ([]byte, []int) { + return file_protocol_proto_rawDescGZIP(), []int{8} +} -func (m *PushProgressRequest) GetProgress() []*Progress { - if m != nil { - return m.Progress +func (x *PushProgressRequest) GetProgress() []*Progress { + if x != nil { + return x.Progress } return nil } type PushProgressResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -func (m *PushProgressResponse) Reset() { *m = PushProgressResponse{} } -func (m *PushProgressResponse) String() string { return proto.CompactTextString(m) } -func (*PushProgressResponse) ProtoMessage() {} +func (x *PushProgressResponse) Reset() { + *x = PushProgressResponse{} + mi := &file_protocol_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PushProgressResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PushProgressResponse) ProtoMessage() {} + +func (x *PushProgressResponse) ProtoReflect() protoreflect.Message { + mi := &file_protocol_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PushProgressResponse.ProtoReflect.Descriptor instead. func (*PushProgressResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2bc2336598a3f7e0, []int{6} -} - -func (m *PushProgressResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PushProgressResponse.Unmarshal(m, b) -} -func (m *PushProgressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PushProgressResponse.Marshal(b, m, deterministic) -} -func (m *PushProgressResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_PushProgressResponse.Merge(m, src) -} -func (m *PushProgressResponse) XXX_Size() int { - return xxx_messageInfo_PushProgressResponse.Size(m) -} -func (m *PushProgressResponse) XXX_DiscardUnknown() { - xxx_messageInfo_PushProgressResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_PushProgressResponse proto.InternalMessageInfo - -func init() { - proto.RegisterEnum("protocol.NodeType", NodeType_name, NodeType_value) - proto.RegisterType((*Meta)(nil), "protocol.Meta") - proto.RegisterType((*Fragment)(nil), "protocol.Fragment") - proto.RegisterType((*VersionInfo)(nil), "protocol.VersionInfo") - proto.RegisterType((*NodeInfo)(nil), "protocol.NodeInfo") - proto.RegisterType((*Progress)(nil), "protocol.Progress") - proto.RegisterType((*PushProgressRequest)(nil), "protocol.PushProgressRequest") - proto.RegisterType((*PushProgressResponse)(nil), "protocol.PushProgressResponse") -} - -func init() { - proto.RegisterFile("protocol.proto", fileDescriptor_2bc2336598a3f7e0) -} - -var fileDescriptor_2bc2336598a3f7e0 = []byte{ - // 592 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0xcd, 0x6e, 0xd3, 0x4e, - 0x10, 0x8f, 0x93, 0x36, 0x71, 0xa6, 0x6d, 0xfe, 0x7f, 0xb6, 0x1f, 0xb2, 0x8a, 0x5a, 0x22, 0xa3, - 0x8a, 0x88, 0x43, 0x82, 0xca, 0x8d, 0x03, 0x42, 0x54, 0x50, 0x71, 0x68, 0xa9, 0x4c, 0x05, 0x12, - 0x97, 0x68, 0xeb, 0x4c, 0x6d, 0xab, 0xf1, 0xae, 0xd9, 0x9d, 0x80, 0xda, 0x67, 0xe0, 0x11, 0x78, - 0x1e, 0xce, 0x3c, 0x12, 0xda, 0xb1, 0x9d, 0xba, 0x45, 0x1c, 0xb8, 0xed, 0xef, 0x63, 0xf6, 0xe3, - 0x37, 0xb3, 0x30, 0x28, 0x8c, 0x26, 0x1d, 0xeb, 0xf9, 0x98, 0x17, 0xc2, 0xaf, 0x71, 0xf8, 0xd3, - 0x83, 0x95, 0x13, 0x24, 0x29, 0x76, 0xa0, 0x1b, 0x6b, 0x75, 0x99, 0x25, 0x81, 0x37, 0xf4, 0x46, - 0xfd, 0xa8, 0x42, 0xe2, 0x10, 0xb6, 0x8d, 0x54, 0x57, 0x99, 0x4a, 0xa6, 0xb9, 0x9e, 0xe1, 0x7c, - 0xfa, 0x15, 0x8d, 0xcd, 0xb4, 0x0a, 0x3a, 0x43, 0x6f, 0xd4, 0x89, 0x36, 0x2b, 0xf1, 0xc4, 0x69, - 0x1f, 0x4b, 0x49, 0x8c, 0x61, 0x33, 0x9e, 0x67, 0xf1, 0xd5, 0xbd, 0x8a, 0x15, 0xae, 0x78, 0xc0, - 0xd2, 0x1d, 0xff, 0x00, 0xda, 0x39, 0x06, 0xab, 0x7c, 0x6e, 0x3b, 0x47, 0x11, 0x40, 0xcf, 0xa2, - 0x71, 0x65, 0x41, 0x77, 0xd8, 0x19, 0xf5, 0xa3, 0x1a, 0x3a, 0xe5, 0x9b, 0x36, 0x57, 0x4e, 0xe9, - 0x95, 0x4a, 0x05, 0xc3, 0x7d, 0xf0, 0xdf, 0x1a, 0x99, 0xe4, 0xa8, 0x48, 0x08, 0x58, 0x99, 0x49, - 0x92, 0xfc, 0x92, 0xf5, 0x88, 0xd7, 0xe1, 0x13, 0x58, 0xab, 0x8e, 0x7b, 0xa7, 0x2e, 0xb5, 0xdb, - 0xa8, 0xbe, 0x96, 0xc7, 0xd7, 0xaa, 0x61, 0xf8, 0xc3, 0x03, 0xff, 0x54, 0xcf, 0x90, 0x6d, 0x13, - 0xe8, 0x2b, 0x3d, 0xc3, 0x29, 0x5d, 0x17, 0xc8, 0xc6, 0xc1, 0xa1, 0x18, 0x2f, 0xc3, 0x74, 0xb6, - 0xf3, 0xeb, 0x02, 0x23, 0x5f, 0x55, 0x2b, 0xf1, 0xb0, 0x2a, 0x50, 0x32, 0xc7, 0xa0, 0xcd, 0x2f, - 0x62, 0xf1, 0x54, 0xe6, 0x2c, 0xa6, 0x44, 0xc5, 0xb4, 0xd0, 0x86, 0xaa, 0xfc, 0x7c, 0x47, 0x9c, - 0x69, 0x43, 0xe2, 0x00, 0x06, 0x17, 0x99, 0x92, 0xe6, 0xfa, 0x4e, 0x5e, 0xfd, 0x68, 0xa3, 0x64, - 0xab, 0xcb, 0x87, 0xbf, 0x3c, 0xf0, 0xcf, 0x8c, 0x4e, 0x0c, 0x5a, 0xeb, 0x9a, 0x46, 0x46, 0xc6, - 0x68, 0xea, 0xa6, 0x95, 0xc8, 0x05, 0xd0, 0xb8, 0x00, 0xaf, 0x9d, 0xd7, 0x92, 0xa4, 0x85, 0xe5, - 0x93, 0xfb, 0x51, 0x85, 0xc4, 0x16, 0xac, 0xa2, 0x31, 0xda, 0x54, 0xc7, 0x95, 0xc0, 0xb1, 0xb1, - 0x5e, 0x28, 0xe2, 0xae, 0x74, 0xa2, 0x12, 0x38, 0x96, 0x34, 0xc9, 0x79, 0xd0, 0x2d, 0x59, 0x06, - 0x62, 0x0f, 0xc0, 0x92, 0x34, 0x34, 0xa5, 0x2c, 0xc7, 0xa0, 0xc7, 0x52, 0x9f, 0x99, 0xf3, 0x2c, - 0x47, 0xf1, 0x08, 0xd6, 0x2e, 0x33, 0x95, 0xd9, 0xb4, 0xd4, 0x7d, 0xd6, 0xa1, 0xa4, 0x9c, 0x21, - 0x7c, 0x03, 0x9b, 0x67, 0x0b, 0x9b, 0xd6, 0xaf, 0x8a, 0xf0, 0xcb, 0x02, 0x2d, 0x89, 0x31, 0xb8, - 0x31, 0x65, 0x2a, 0xf0, 0x86, 0x9d, 0xd1, 0x5a, 0x33, 0xfa, 0xa5, 0x79, 0xe9, 0x09, 0x77, 0x60, - 0xeb, 0xee, 0x36, 0xb6, 0xd0, 0xca, 0xe2, 0xd3, 0x17, 0x65, 0x3f, 0xb9, 0x3d, 0x03, 0x80, 0x0f, - 0x3c, 0x4a, 0x8e, 0xf9, 0xbf, 0xe5, 0xf0, 0x27, 0x1e, 0x20, 0xc6, 0x9e, 0xc3, 0x47, 0xf3, 0x0c, - 0x15, 0x31, 0x6e, 0x1f, 0x7e, 0x6f, 0x43, 0xf7, 0x44, 0x5a, 0x42, 0x23, 0x26, 0xd0, 0x3b, 0x46, - 0xe2, 0xbf, 0x72, 0x6f, 0x04, 0xdc, 0xa4, 0xec, 0x0e, 0x6e, 0x39, 0xe7, 0x09, 0x5b, 0xe2, 0x15, - 0xfc, 0x77, 0x8c, 0x14, 0x35, 0xfe, 0x87, 0xd8, 0xbe, 0x35, 0x35, 0x86, 0x71, 0xb7, 0xb1, 0x5f, - 0x3d, 0xc3, 0x61, 0xeb, 0x99, 0x27, 0x5e, 0xc2, 0xc6, 0x31, 0xd2, 0xd1, 0xf2, 0xbf, 0xfc, 0x6b, - 0xfd, 0x7b, 0x58, 0x6f, 0x26, 0x22, 0xf6, 0x1a, 0xf9, 0xfd, 0x19, 0xf8, 0xee, 0xfe, 0xdf, 0xe4, - 0x32, 0xc8, 0xb0, 0xf5, 0xfa, 0xe0, 0xf3, 0xe3, 0x24, 0xa3, 0x74, 0x71, 0x31, 0x8e, 0x75, 0x3e, - 0xb9, 0x49, 0x51, 0x25, 0xa9, 0xd4, 0x37, 0x93, 0x44, 0x1b, 0x8b, 0x93, 0xba, 0xfa, 0xa2, 0xcb, - 0xab, 0xe7, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x0e, 0x9c, 0xdb, 0xcd, 0x77, 0x04, 0x00, 0x00, + return file_protocol_proto_rawDescGZIP(), []int{9} +} + +var File_protocol_proto protoreflect.FileDescriptor + +var file_protocol_proto_rawDesc = []byte{ + 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x51, 0x0a, 0x04, 0x55, + 0x73, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, + 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6c, 0x61, + 0x62, 0x65, 0x6c, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0xe6, + 0x01, 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x1b, + 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x68, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x08, 0x69, 0x73, 0x48, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x63, + 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x18, 0x0a, + 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0xd3, 0x01, 0x0a, 0x08, 0x46, 0x65, 0x65, 0x64, + 0x62, 0x61, 0x63, 0x6b, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x64, 0x62, + 0x61, 0x63, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, + 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, + 0x12, 0x17, 0x0a, 0x07, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x69, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0xc6, 0x01, + 0x0a, 0x04, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x32, + 0x0a, 0x15, 0x72, 0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x13, 0x72, + 0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x13, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x6d, 0x6f, 0x64, 0x65, + 0x6c, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x11, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x12, 0x18, 0x0a, 0x07, + 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x77, + 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x73, 0x22, 0x1e, 0x0a, 0x08, 0x46, 0x72, 0x61, 0x67, 0x6d, 0x65, + 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x27, 0x0a, 0x0b, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, + 0x9c, 0x01, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x2f, 0x0a, 0x09, + 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, + 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x68, 0x74, + 0x74, 0x70, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x68, + 0x74, 0x74, 0x70, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x62, 0x69, 0x6e, 0x61, 0x72, + 0x79, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0d, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xd0, + 0x01, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x74, + 0x72, 0x61, 0x63, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x72, 0x61, + 0x63, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, + 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x54, 0x69, 0x6d, + 0x65, 0x22, 0x45, 0x0a, 0x13, 0x50, 0x75, 0x73, 0x68, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x67, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x08, + 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0x16, 0x0a, 0x14, 0x50, 0x75, 0x73, 0x68, + 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2a, 0x3a, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x0a, + 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, + 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, + 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x10, 0x02, 0x32, 0x8c, 0x02, 0x0a, + 0x06, 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x12, 0x2f, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4d, 0x65, + 0x74, 0x61, 0x12, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x4e, 0x6f, + 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x0e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x52, + 0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x15, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x6e, + 0x66, 0x6f, 0x1a, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x46, 0x72, + 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x00, 0x30, 0x01, 0x12, 0x3e, 0x0a, 0x0d, 0x47, 0x65, + 0x74, 0x43, 0x6c, 0x69, 0x63, 0x6b, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x15, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x6e, + 0x66, 0x6f, 0x1a, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x46, 0x72, + 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x00, 0x30, 0x01, 0x12, 0x4f, 0x0a, 0x0c, 0x50, 0x75, + 0x73, 0x68, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1d, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, + 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x25, 0x5a, 0x23, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x68, 0x65, 0x6e, 0x67, 0x68, + 0x61, 0x6f, 0x7a, 0x2f, 0x67, 0x6f, 0x72, 0x73, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_protocol_proto_rawDescOnce sync.Once + file_protocol_proto_rawDescData = file_protocol_proto_rawDesc +) + +func file_protocol_proto_rawDescGZIP() []byte { + file_protocol_proto_rawDescOnce.Do(func() { + file_protocol_proto_rawDescData = protoimpl.X.CompressGZIP(file_protocol_proto_rawDescData) + }) + return file_protocol_proto_rawDescData +} + +var file_protocol_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_protocol_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_protocol_proto_goTypes = []any{ + (NodeType)(0), // 0: protocol.NodeType + (*User)(nil), // 1: protocol.User + (*Item)(nil), // 2: protocol.Item + (*Feedback)(nil), // 3: protocol.Feedback + (*Meta)(nil), // 4: protocol.Meta + (*Fragment)(nil), // 5: protocol.Fragment + (*VersionInfo)(nil), // 6: protocol.VersionInfo + (*NodeInfo)(nil), // 7: protocol.NodeInfo + (*Progress)(nil), // 8: protocol.Progress + (*PushProgressRequest)(nil), // 9: protocol.PushProgressRequest + (*PushProgressResponse)(nil), // 10: protocol.PushProgressResponse + (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp +} +var file_protocol_proto_depIdxs = []int32{ + 11, // 0: protocol.Item.timestamp:type_name -> google.protobuf.Timestamp + 11, // 1: protocol.Feedback.timestamp:type_name -> google.protobuf.Timestamp + 0, // 2: protocol.NodeInfo.node_type:type_name -> protocol.NodeType + 8, // 3: protocol.PushProgressRequest.progress:type_name -> protocol.Progress + 7, // 4: protocol.Master.GetMeta:input_type -> protocol.NodeInfo + 6, // 5: protocol.Master.GetRankingModel:input_type -> protocol.VersionInfo + 6, // 6: protocol.Master.GetClickModel:input_type -> protocol.VersionInfo + 9, // 7: protocol.Master.PushProgress:input_type -> protocol.PushProgressRequest + 4, // 8: protocol.Master.GetMeta:output_type -> protocol.Meta + 5, // 9: protocol.Master.GetRankingModel:output_type -> protocol.Fragment + 5, // 10: protocol.Master.GetClickModel:output_type -> protocol.Fragment + 10, // 11: protocol.Master.PushProgress:output_type -> protocol.PushProgressResponse + 8, // [8:12] is the sub-list for method output_type + 4, // [4:8] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_protocol_proto_init() } +func file_protocol_proto_init() { + if File_protocol_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_protocol_proto_rawDesc, + NumEnums: 1, + NumMessages: 10, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_protocol_proto_goTypes, + DependencyIndexes: file_protocol_proto_depIdxs, + EnumInfos: file_protocol_proto_enumTypes, + MessageInfos: file_protocol_proto_msgTypes, + }.Build() + File_protocol_proto = out.File + file_protocol_proto_rawDesc = nil + file_protocol_proto_goTypes = nil + file_protocol_proto_depIdxs = nil } diff --git a/protocol/protocol.proto b/protocol/protocol.proto index 54c1c43ec..cd1779e56 100644 --- a/protocol/protocol.proto +++ b/protocol/protocol.proto @@ -17,6 +17,33 @@ option go_package = "github.com/zhenghaoz/gorse/protocol"; package protocol; +import "google/protobuf/timestamp.proto"; + +message User { + string user_id = 1; + bytes labels = 2; + string comment = 3; +} + +message Item { + string namespace = 1; + string item_id = 2; + bool is_hidden = 3; + repeated string categories = 4; + google.protobuf.Timestamp timestamp = 5; + bytes labels = 6; + string comment = 7; +} + +message Feedback { + string namespace = 1; + string feedback_type = 2; + string user_id = 3; + string item_id = 4; + google.protobuf.Timestamp timestamp = 5; + string comment = 6; +} + enum NodeType { ServerNode = 0; WorkerNode = 1; diff --git a/protocol/protocol_grpc.pb.go b/protocol/protocol_grpc.pb.go index c76123352..7a720c69d 100644 --- a/protocol/protocol_grpc.pb.go +++ b/protocol/protocol_grpc.pb.go @@ -14,8 +14,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v3.12.4 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.28.3 // source: protocol.proto package protocol @@ -29,8 +29,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Master_GetMeta_FullMethodName = "/protocol.Master/GetMeta" @@ -46,8 +46,8 @@ type MasterClient interface { // meta distribute GetMeta(ctx context.Context, in *NodeInfo, opts ...grpc.CallOption) (*Meta, error) // data distribute - GetRankingModel(ctx context.Context, in *VersionInfo, opts ...grpc.CallOption) (Master_GetRankingModelClient, error) - GetClickModel(ctx context.Context, in *VersionInfo, opts ...grpc.CallOption) (Master_GetClickModelClient, error) + GetRankingModel(ctx context.Context, in *VersionInfo, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Fragment], error) + GetClickModel(ctx context.Context, in *VersionInfo, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Fragment], error) PushProgress(ctx context.Context, in *PushProgressRequest, opts ...grpc.CallOption) (*PushProgressResponse, error) } @@ -60,20 +60,22 @@ func NewMasterClient(cc grpc.ClientConnInterface) MasterClient { } func (c *masterClient) GetMeta(ctx context.Context, in *NodeInfo, opts ...grpc.CallOption) (*Meta, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Meta) - err := c.cc.Invoke(ctx, Master_GetMeta_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Master_GetMeta_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *masterClient) GetRankingModel(ctx context.Context, in *VersionInfo, opts ...grpc.CallOption) (Master_GetRankingModelClient, error) { - stream, err := c.cc.NewStream(ctx, &Master_ServiceDesc.Streams[0], Master_GetRankingModel_FullMethodName, opts...) +func (c *masterClient) GetRankingModel(ctx context.Context, in *VersionInfo, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Fragment], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &Master_ServiceDesc.Streams[0], Master_GetRankingModel_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &masterGetRankingModelClient{stream} + x := &grpc.GenericClientStream[VersionInfo, Fragment]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -83,29 +85,16 @@ func (c *masterClient) GetRankingModel(ctx context.Context, in *VersionInfo, opt return x, nil } -type Master_GetRankingModelClient interface { - Recv() (*Fragment, error) - grpc.ClientStream -} - -type masterGetRankingModelClient struct { - grpc.ClientStream -} - -func (x *masterGetRankingModelClient) Recv() (*Fragment, error) { - m := new(Fragment) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Master_GetRankingModelClient = grpc.ServerStreamingClient[Fragment] -func (c *masterClient) GetClickModel(ctx context.Context, in *VersionInfo, opts ...grpc.CallOption) (Master_GetClickModelClient, error) { - stream, err := c.cc.NewStream(ctx, &Master_ServiceDesc.Streams[1], Master_GetClickModel_FullMethodName, opts...) +func (c *masterClient) GetClickModel(ctx context.Context, in *VersionInfo, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Fragment], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &Master_ServiceDesc.Streams[1], Master_GetClickModel_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &masterGetClickModelClient{stream} + x := &grpc.GenericClientStream[VersionInfo, Fragment]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -115,26 +104,13 @@ func (c *masterClient) GetClickModel(ctx context.Context, in *VersionInfo, opts return x, nil } -type Master_GetClickModelClient interface { - Recv() (*Fragment, error) - grpc.ClientStream -} - -type masterGetClickModelClient struct { - grpc.ClientStream -} - -func (x *masterGetClickModelClient) Recv() (*Fragment, error) { - m := new(Fragment) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Master_GetClickModelClient = grpc.ServerStreamingClient[Fragment] func (c *masterClient) PushProgress(ctx context.Context, in *PushProgressRequest, opts ...grpc.CallOption) (*PushProgressResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(PushProgressResponse) - err := c.cc.Invoke(ctx, Master_PushProgress_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Master_PushProgress_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -143,34 +119,38 @@ func (c *masterClient) PushProgress(ctx context.Context, in *PushProgressRequest // MasterServer is the server API for Master service. // All implementations must embed UnimplementedMasterServer -// for forward compatibility +// for forward compatibility. type MasterServer interface { // meta distribute GetMeta(context.Context, *NodeInfo) (*Meta, error) // data distribute - GetRankingModel(*VersionInfo, Master_GetRankingModelServer) error - GetClickModel(*VersionInfo, Master_GetClickModelServer) error + GetRankingModel(*VersionInfo, grpc.ServerStreamingServer[Fragment]) error + GetClickModel(*VersionInfo, grpc.ServerStreamingServer[Fragment]) error PushProgress(context.Context, *PushProgressRequest) (*PushProgressResponse, error) mustEmbedUnimplementedMasterServer() } -// UnimplementedMasterServer must be embedded to have forward compatible implementations. -type UnimplementedMasterServer struct { -} +// UnimplementedMasterServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMasterServer struct{} func (UnimplementedMasterServer) GetMeta(context.Context, *NodeInfo) (*Meta, error) { return nil, status.Errorf(codes.Unimplemented, "method GetMeta not implemented") } -func (UnimplementedMasterServer) GetRankingModel(*VersionInfo, Master_GetRankingModelServer) error { +func (UnimplementedMasterServer) GetRankingModel(*VersionInfo, grpc.ServerStreamingServer[Fragment]) error { return status.Errorf(codes.Unimplemented, "method GetRankingModel not implemented") } -func (UnimplementedMasterServer) GetClickModel(*VersionInfo, Master_GetClickModelServer) error { +func (UnimplementedMasterServer) GetClickModel(*VersionInfo, grpc.ServerStreamingServer[Fragment]) error { return status.Errorf(codes.Unimplemented, "method GetClickModel not implemented") } func (UnimplementedMasterServer) PushProgress(context.Context, *PushProgressRequest) (*PushProgressResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PushProgress not implemented") } func (UnimplementedMasterServer) mustEmbedUnimplementedMasterServer() {} +func (UnimplementedMasterServer) testEmbeddedByValue() {} // UnsafeMasterServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to MasterServer will @@ -180,6 +160,13 @@ type UnsafeMasterServer interface { } func RegisterMasterServer(s grpc.ServiceRegistrar, srv MasterServer) { + // If the following call pancis, it indicates UnimplementedMasterServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Master_ServiceDesc, srv) } @@ -206,42 +193,22 @@ func _Master_GetRankingModel_Handler(srv interface{}, stream grpc.ServerStream) if err := stream.RecvMsg(m); err != nil { return err } - return srv.(MasterServer).GetRankingModel(m, &masterGetRankingModelServer{stream}) + return srv.(MasterServer).GetRankingModel(m, &grpc.GenericServerStream[VersionInfo, Fragment]{ServerStream: stream}) } -type Master_GetRankingModelServer interface { - Send(*Fragment) error - grpc.ServerStream -} - -type masterGetRankingModelServer struct { - grpc.ServerStream -} - -func (x *masterGetRankingModelServer) Send(m *Fragment) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Master_GetRankingModelServer = grpc.ServerStreamingServer[Fragment] func _Master_GetClickModel_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(VersionInfo) if err := stream.RecvMsg(m); err != nil { return err } - return srv.(MasterServer).GetClickModel(m, &masterGetClickModelServer{stream}) -} - -type Master_GetClickModelServer interface { - Send(*Fragment) error - grpc.ServerStream + return srv.(MasterServer).GetClickModel(m, &grpc.GenericServerStream[VersionInfo, Fragment]{ServerStream: stream}) } -type masterGetClickModelServer struct { - grpc.ServerStream -} - -func (x *masterGetClickModelServer) Send(m *Fragment) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Master_GetClickModelServer = grpc.ServerStreamingServer[Fragment] func _Master_PushProgress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(PushProgressRequest)