feat: add leave host proto (#28)

Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
Gaius 2022-10-26 12:59:38 +08:00 committed by GitHub
parent d8018bfab8
commit b336cac496
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 550 additions and 871 deletions

View File

@ -163,6 +163,26 @@ func (mr *MockSchedulerClientMockRecorder) AnnounceTask(ctx, in interface{}, opt
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AnnounceTask", reflect.TypeOf((*MockSchedulerClient)(nil).AnnounceTask), varargs...)
}
// LeaveHost mocks base method.
func (m *MockSchedulerClient) LeaveHost(ctx context.Context, in *v1.LeaveHostRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "LeaveHost", varargs...)
ret0, _ := ret[0].(*emptypb.Empty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// LeaveHost indicates an expected call of LeaveHost.
func (mr *MockSchedulerClientMockRecorder) LeaveHost(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LeaveHost", reflect.TypeOf((*MockSchedulerClient)(nil).LeaveHost), varargs...)
}
// LeaveTask mocks base method.
func (m *MockSchedulerClient) LeaveTask(ctx context.Context, in *v1.PeerTarget, opts ...grpc.CallOption) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
@ -183,26 +203,6 @@ func (mr *MockSchedulerClientMockRecorder) LeaveTask(ctx, in interface{}, opts .
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LeaveTask", reflect.TypeOf((*MockSchedulerClient)(nil).LeaveTask), varargs...)
}
// LeaveTasks mocks base method.
func (m *MockSchedulerClient) LeaveTasks(ctx context.Context, in *v1.LeaveTasksRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "LeaveTasks", varargs...)
ret0, _ := ret[0].(*emptypb.Empty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// LeaveTasks indicates an expected call of LeaveTasks.
func (mr *MockSchedulerClientMockRecorder) LeaveTasks(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LeaveTasks", reflect.TypeOf((*MockSchedulerClient)(nil).LeaveTasks), varargs...)
}
// RegisterPeerTask mocks base method.
func (m *MockSchedulerClient) RegisterPeerTask(ctx context.Context, in *v1.PeerTaskRequest, opts ...grpc.CallOption) (*v1.RegisterResult, error) {
m.ctrl.T.Helper()
@ -458,6 +458,21 @@ func (mr *MockSchedulerServerMockRecorder) AnnounceTask(arg0, arg1 interface{})
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AnnounceTask", reflect.TypeOf((*MockSchedulerServer)(nil).AnnounceTask), arg0, arg1)
}
// LeaveHost mocks base method.
func (m *MockSchedulerServer) LeaveHost(arg0 context.Context, arg1 *v1.LeaveHostRequest) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "LeaveHost", arg0, arg1)
ret0, _ := ret[0].(*emptypb.Empty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// LeaveHost indicates an expected call of LeaveHost.
func (mr *MockSchedulerServerMockRecorder) LeaveHost(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LeaveHost", reflect.TypeOf((*MockSchedulerServer)(nil).LeaveHost), arg0, arg1)
}
// LeaveTask mocks base method.
func (m *MockSchedulerServer) LeaveTask(arg0 context.Context, arg1 *v1.PeerTarget) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
@ -473,21 +488,6 @@ func (mr *MockSchedulerServerMockRecorder) LeaveTask(arg0, arg1 interface{}) *go
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LeaveTask", reflect.TypeOf((*MockSchedulerServer)(nil).LeaveTask), arg0, arg1)
}
// LeaveTasks mocks base method.
func (m *MockSchedulerServer) LeaveTasks(arg0 context.Context, arg1 *v1.LeaveTasksRequest) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "LeaveTasks", arg0, arg1)
ret0, _ := ret[0].(*emptypb.Empty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// LeaveTasks indicates an expected call of LeaveTasks.
func (mr *MockSchedulerServerMockRecorder) LeaveTasks(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LeaveTasks", reflect.TypeOf((*MockSchedulerServer)(nil).LeaveTasks), arg0, arg1)
}
// RegisterPeerTask mocks base method.
func (m *MockSchedulerServer) RegisterPeerTask(arg0 context.Context, arg1 *v1.PeerTaskRequest) (*v1.RegisterResult, error) {
m.ctrl.T.Helper()

View File

@ -965,63 +965,6 @@ func (x *PeerTarget) GetPeerId() string {
return ""
}
type LeaveTasksRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Task ids.
TaskIds []string `protobuf:"bytes,1,rep,name=task_ids,json=taskIds,proto3" json:"task_ids,omitempty"`
// Peer ids.
PeerIds []string `protobuf:"bytes,2,rep,name=peer_ids,json=peerIds,proto3" json:"peer_ids,omitempty"`
}
func (x *LeaveTasksRequest) Reset() {
*x = LeaveTasksRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_scheduler_v1_scheduler_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *LeaveTasksRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*LeaveTasksRequest) ProtoMessage() {}
func (x *LeaveTasksRequest) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_scheduler_v1_scheduler_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use LeaveTasksRequest.ProtoReflect.Descriptor instead.
func (*LeaveTasksRequest) Descriptor() ([]byte, []int) {
return file_pkg_apis_scheduler_v1_scheduler_proto_rawDescGZIP(), []int{8}
}
func (x *LeaveTasksRequest) GetTaskIds() []string {
if x != nil {
return x.TaskIds
}
return nil
}
func (x *LeaveTasksRequest) GetPeerIds() []string {
if x != nil {
return x.PeerIds
}
return nil
}
// StatTaskRequest represents request of StatTask.
type StatTaskRequest struct {
state protoimpl.MessageState
@ -1035,7 +978,7 @@ type StatTaskRequest struct {
func (x *StatTaskRequest) Reset() {
*x = StatTaskRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_scheduler_v1_scheduler_proto_msgTypes[9]
mi := &file_pkg_apis_scheduler_v1_scheduler_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -1048,7 +991,7 @@ func (x *StatTaskRequest) String() string {
func (*StatTaskRequest) ProtoMessage() {}
func (x *StatTaskRequest) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_scheduler_v1_scheduler_proto_msgTypes[9]
mi := &file_pkg_apis_scheduler_v1_scheduler_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -1061,7 +1004,7 @@ func (x *StatTaskRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use StatTaskRequest.ProtoReflect.Descriptor instead.
func (*StatTaskRequest) Descriptor() ([]byte, []int) {
return file_pkg_apis_scheduler_v1_scheduler_proto_rawDescGZIP(), []int{9}
return file_pkg_apis_scheduler_v1_scheduler_proto_rawDescGZIP(), []int{8}
}
func (x *StatTaskRequest) GetTaskId() string {
@ -1096,7 +1039,7 @@ type Task struct {
func (x *Task) Reset() {
*x = Task{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_scheduler_v1_scheduler_proto_msgTypes[10]
mi := &file_pkg_apis_scheduler_v1_scheduler_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -1109,7 +1052,7 @@ func (x *Task) String() string {
func (*Task) ProtoMessage() {}
func (x *Task) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_scheduler_v1_scheduler_proto_msgTypes[10]
mi := &file_pkg_apis_scheduler_v1_scheduler_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -1122,7 +1065,7 @@ func (x *Task) ProtoReflect() protoreflect.Message {
// Deprecated: Use Task.ProtoReflect.Descriptor instead.
func (*Task) Descriptor() ([]byte, []int) {
return file_pkg_apis_scheduler_v1_scheduler_proto_rawDescGZIP(), []int{10}
return file_pkg_apis_scheduler_v1_scheduler_proto_rawDescGZIP(), []int{9}
}
func (x *Task) GetId() string {
@ -1197,7 +1140,7 @@ type AnnounceTaskRequest struct {
func (x *AnnounceTaskRequest) Reset() {
*x = AnnounceTaskRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_scheduler_v1_scheduler_proto_msgTypes[11]
mi := &file_pkg_apis_scheduler_v1_scheduler_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -1210,7 +1153,7 @@ func (x *AnnounceTaskRequest) String() string {
func (*AnnounceTaskRequest) ProtoMessage() {}
func (x *AnnounceTaskRequest) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_scheduler_v1_scheduler_proto_msgTypes[11]
mi := &file_pkg_apis_scheduler_v1_scheduler_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -1223,7 +1166,7 @@ func (x *AnnounceTaskRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use AnnounceTaskRequest.ProtoReflect.Descriptor instead.
func (*AnnounceTaskRequest) Descriptor() ([]byte, []int) {
return file_pkg_apis_scheduler_v1_scheduler_proto_rawDescGZIP(), []int{11}
return file_pkg_apis_scheduler_v1_scheduler_proto_rawDescGZIP(), []int{10}
}
func (x *AnnounceTaskRequest) GetTaskId() string {
@ -1268,6 +1211,55 @@ func (x *AnnounceTaskRequest) GetTaskType() v1.TaskType {
return v1.TaskType(0)
}
// LeaveHostRequest represents request of LeaveHost.
type LeaveHostRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Host id.
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
}
func (x *LeaveHostRequest) Reset() {
*x = LeaveHostRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_scheduler_v1_scheduler_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *LeaveHostRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*LeaveHostRequest) ProtoMessage() {}
func (x *LeaveHostRequest) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_scheduler_v1_scheduler_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use LeaveHostRequest.ProtoReflect.Descriptor instead.
func (*LeaveHostRequest) Descriptor() ([]byte, []int) {
return file_pkg_apis_scheduler_v1_scheduler_proto_rawDescGZIP(), []int{11}
}
func (x *LeaveHostRequest) GetId() string {
if x != nil {
return x.Id
}
return ""
}
type PeerPacket_DestPeer struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -1512,86 +1504,83 @@ var file_pkg_apis_scheduler_v1_scheduler_proto_rawDesc = []byte{
0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x74, 0x61,
0x73, 0x6b, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06,
0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x22, 0x5f, 0x0a, 0x11, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x54,
0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x08, 0x74,
0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x42, 0x0a, 0xfa,
0x42, 0x07, 0x92, 0x01, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x49,
0x64, 0x73, 0x12, 0x23, 0x0a, 0x08, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02,
0x20, 0x03, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x08, 0x01, 0x52, 0x07,
0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x73, 0x22, 0x33, 0x0a, 0x0f, 0x53, 0x74, 0x61, 0x74, 0x54,
0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x74, 0x61,
0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04,
0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x9d, 0x02, 0x0a,
0x04, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x24,
0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x63,
0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04,
0x74, 0x79, 0x70, 0x65, 0x12, 0x2e, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f,
0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42,
0x04, 0x22, 0x02, 0x28, 0x01, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4c, 0x65,
0x6e, 0x67, 0x74, 0x68, 0x12, 0x33, 0x0a, 0x11, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x69,
0x65, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x42,
0x07, 0xfa, 0x42, 0x04, 0x1a, 0x02, 0x28, 0x01, 0x52, 0x0f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x50,
0x69, 0x65, 0x63, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x05, 0x73, 0x74, 0x61,
0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10,
0x01, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x26, 0x0a, 0x0a, 0x70, 0x65, 0x65, 0x72,
0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x42, 0x07, 0xfa, 0x42,
0x04, 0x1a, 0x02, 0x28, 0x00, 0x52, 0x09, 0x70, 0x65, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74,
0x12, 0x2a, 0x0a, 0x10, 0x68, 0x61, 0x73, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65,
0x50, 0x65, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x68, 0x61, 0x73, 0x41,
0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x65, 0x65, 0x72, 0x22, 0xaf, 0x02, 0x0a,
0x13, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06,
0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x42, 0x0b, 0xfa, 0x42, 0x08, 0x72, 0x06, 0x88, 0x01, 0x01, 0xd0, 0x01, 0x01,
0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x34, 0x0a, 0x08, 0x75, 0x72, 0x6c, 0x5f, 0x6d, 0x65, 0x74,
0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,
0x2e, 0x55, 0x72, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02,
0x10, 0x01, 0x52, 0x07, 0x75, 0x72, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x30, 0x0a, 0x09, 0x70,
0x65, 0x65, 0x72, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13,
0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x48,
0x6f, 0x73, 0x74, 0x52, 0x08, 0x70, 0x65, 0x65, 0x72, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x40, 0x0a,
0x0c, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x05, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x69, 0x65,
0x63, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02,
0x10, 0x01, 0x52, 0x0b, 0x70, 0x69, 0x65, 0x63, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x12,
0x2d, 0x0a, 0x09, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01,
0x28, 0x0e, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x54, 0x61, 0x73, 0x6b,
0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x32, 0xe2,
0x03, 0x0a, 0x09, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x12, 0x49, 0x0a, 0x10,
0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x65, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b,
0x12, 0x1a, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x50, 0x65, 0x65,
0x72, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x73,
0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65,
0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x46, 0x0a, 0x11, 0x52, 0x65, 0x70, 0x6f, 0x72,
0x74, 0x50, 0x69, 0x65, 0x63, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x16, 0x2e, 0x73,
0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x52, 0x65,
0x73, 0x75, 0x6c, 0x74, 0x1a, 0x15, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72,
0x2e, 0x50, 0x65, 0x65, 0x72, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x28, 0x01, 0x30, 0x01, 0x12,
0x41, 0x0a, 0x10, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x73,
0x75, 0x6c, 0x74, 0x12, 0x15, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e,
0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70,
0x74, 0x79, 0x12, 0x3a, 0x0a, 0x09, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12,
0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x22, 0x33, 0x0a, 0x0f, 0x53, 0x74, 0x61, 0x74, 0x54, 0x61,
0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x74, 0x61, 0x73,
0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72,
0x02, 0x10, 0x01, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x9d, 0x02, 0x0a, 0x04,
0x54, 0x61, 0x73, 0x6b, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x24, 0x0a,
0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x63, 0x6f,
0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74,
0x79, 0x70, 0x65, 0x12, 0x2e, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x6c,
0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04,
0x22, 0x02, 0x28, 0x01, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x6e,
0x67, 0x74, 0x68, 0x12, 0x33, 0x0a, 0x11, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x69, 0x65,
0x63, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x07,
0xfa, 0x42, 0x04, 0x1a, 0x02, 0x28, 0x01, 0x52, 0x0f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x50, 0x69,
0x65, 0x63, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74,
0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01,
0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x26, 0x0a, 0x0a, 0x70, 0x65, 0x65, 0x72, 0x5f,
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x42, 0x07, 0xfa, 0x42, 0x04,
0x1a, 0x02, 0x28, 0x00, 0x52, 0x09, 0x70, 0x65, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12,
0x2a, 0x0a, 0x10, 0x68, 0x61, 0x73, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x50,
0x65, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x68, 0x61, 0x73, 0x41, 0x76,
0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x65, 0x65, 0x72, 0x22, 0xaf, 0x02, 0x0a, 0x13,
0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x74,
0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x42, 0x0b, 0xfa, 0x42, 0x08, 0x72, 0x06, 0x88, 0x01, 0x01, 0xd0, 0x01, 0x01, 0x52,
0x03, 0x75, 0x72, 0x6c, 0x12, 0x34, 0x0a, 0x08, 0x75, 0x72, 0x6c, 0x5f, 0x6d, 0x65, 0x74, 0x61,
0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e,
0x55, 0x72, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10,
0x01, 0x52, 0x07, 0x75, 0x72, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x30, 0x0a, 0x09, 0x70, 0x65,
0x65, 0x72, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e,
0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x48, 0x6f,
0x73, 0x74, 0x52, 0x08, 0x70, 0x65, 0x65, 0x72, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x0c,
0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x69, 0x65, 0x63,
0x65, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10,
0x01, 0x52, 0x0b, 0x70, 0x69, 0x65, 0x63, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x2d,
0x0a, 0x09, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28,
0x0e, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x54,
0x79, 0x70, 0x65, 0x52, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x22, 0x2b, 0x0a,
0x10, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x48, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa,
0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, 0x32, 0xe0, 0x03, 0x0a, 0x09, 0x53,
0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x12, 0x49, 0x0a, 0x10, 0x52, 0x65, 0x67, 0x69,
0x73, 0x74, 0x65, 0x72, 0x50, 0x65, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1a, 0x2e, 0x73,
0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x54, 0x61, 0x73,
0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64,
0x75, 0x6c, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73,
0x75, 0x6c, 0x74, 0x12, 0x46, 0x0a, 0x11, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x69, 0x65,
0x63, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x16, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64,
0x75, 0x6c, 0x65, 0x72, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74,
0x1a, 0x15, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x50, 0x65, 0x65,
0x72, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x28, 0x01, 0x30, 0x01, 0x12, 0x41, 0x0a, 0x10, 0x52,
0x65, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12,
0x15, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x50, 0x65, 0x65, 0x72,
0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x42,
0x0a, 0x0a, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x1c, 0x2e, 0x73,
0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x54, 0x61,
0x73, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70,
0x74, 0x79, 0x12, 0x37, 0x0a, 0x08, 0x53, 0x74, 0x61, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1a,
0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x54,
0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x73, 0x63, 0x68,
0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x46, 0x0a, 0x0c, 0x41,
0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1e, 0x2e, 0x73, 0x63,
0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65,
0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d,
0x70, 0x74, 0x79, 0x42, 0x22, 0x5a, 0x20, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70,
0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x64,
0x75, 0x6c, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3a,
0x0a, 0x09, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x15, 0x2e, 0x73, 0x63,
0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x54, 0x61, 0x72, 0x67,
0x65, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x37, 0x0a, 0x08, 0x53, 0x74,
0x61, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1a, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c,
0x65, 0x72, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x54,
0x61, 0x73, 0x6b, 0x12, 0x46, 0x0a, 0x0c, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x54,
0x61, 0x73, 0x6b, 0x12, 0x1e, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e,
0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x40, 0x0a, 0x09, 0x4c,
0x65, 0x61, 0x76, 0x65, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x1b, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64,
0x75, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x48, 0x6f, 0x73, 0x74, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x22, 0x5a,
0x20, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f,
0x61, 0x70, 0x69, 0x73, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2f, 0x76,
0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -1616,10 +1605,10 @@ var file_pkg_apis_scheduler_v1_scheduler_proto_goTypes = []interface{}{
(*PeerPacket)(nil), // 5: scheduler.PeerPacket
(*PeerResult)(nil), // 6: scheduler.PeerResult
(*PeerTarget)(nil), // 7: scheduler.PeerTarget
(*LeaveTasksRequest)(nil), // 8: scheduler.LeaveTasksRequest
(*StatTaskRequest)(nil), // 9: scheduler.StatTaskRequest
(*Task)(nil), // 10: scheduler.Task
(*AnnounceTaskRequest)(nil), // 11: scheduler.AnnounceTaskRequest
(*StatTaskRequest)(nil), // 8: scheduler.StatTaskRequest
(*Task)(nil), // 9: scheduler.Task
(*AnnounceTaskRequest)(nil), // 10: scheduler.AnnounceTaskRequest
(*LeaveHostRequest)(nil), // 11: scheduler.LeaveHostRequest
(*PeerPacket_DestPeer)(nil), // 12: scheduler.PeerPacket.DestPeer
(*v1.UrlMeta)(nil), // 13: common.UrlMeta
(*v1.HostLoad)(nil), // 14: common.HostLoad
@ -1662,16 +1651,16 @@ var file_pkg_apis_scheduler_v1_scheduler_proto_depIdxs = []int32{
4, // 25: scheduler.Scheduler.ReportPieceResult:input_type -> scheduler.PieceResult
6, // 26: scheduler.Scheduler.ReportPeerResult:input_type -> scheduler.PeerResult
7, // 27: scheduler.Scheduler.LeaveTask:input_type -> scheduler.PeerTarget
8, // 28: scheduler.Scheduler.LeaveTasks:input_type -> scheduler.LeaveTasksRequest
9, // 29: scheduler.Scheduler.StatTask:input_type -> scheduler.StatTaskRequest
11, // 30: scheduler.Scheduler.AnnounceTask:input_type -> scheduler.AnnounceTaskRequest
8, // 28: scheduler.Scheduler.StatTask:input_type -> scheduler.StatTaskRequest
10, // 29: scheduler.Scheduler.AnnounceTask:input_type -> scheduler.AnnounceTaskRequest
11, // 30: scheduler.Scheduler.LeaveHost:input_type -> scheduler.LeaveHostRequest
1, // 31: scheduler.Scheduler.RegisterPeerTask:output_type -> scheduler.RegisterResult
5, // 32: scheduler.Scheduler.ReportPieceResult:output_type -> scheduler.PeerPacket
23, // 33: scheduler.Scheduler.ReportPeerResult:output_type -> google.protobuf.Empty
23, // 34: scheduler.Scheduler.LeaveTask:output_type -> google.protobuf.Empty
23, // 35: scheduler.Scheduler.LeaveTasks:output_type -> google.protobuf.Empty
10, // 36: scheduler.Scheduler.StatTask:output_type -> scheduler.Task
23, // 37: scheduler.Scheduler.AnnounceTask:output_type -> google.protobuf.Empty
9, // 35: scheduler.Scheduler.StatTask:output_type -> scheduler.Task
23, // 36: scheduler.Scheduler.AnnounceTask:output_type -> google.protobuf.Empty
23, // 37: scheduler.Scheduler.LeaveHost:output_type -> google.protobuf.Empty
31, // [31:38] is the sub-list for method output_type
24, // [24:31] is the sub-list for method input_type
24, // [24:24] is the sub-list for extension type_name
@ -1782,18 +1771,6 @@ func file_pkg_apis_scheduler_v1_scheduler_proto_init() {
}
}
file_pkg_apis_scheduler_v1_scheduler_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*LeaveTasksRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pkg_apis_scheduler_v1_scheduler_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*StatTaskRequest); i {
case 0:
return &v.state
@ -1805,7 +1782,7 @@ func file_pkg_apis_scheduler_v1_scheduler_proto_init() {
return nil
}
}
file_pkg_apis_scheduler_v1_scheduler_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
file_pkg_apis_scheduler_v1_scheduler_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Task); i {
case 0:
return &v.state
@ -1817,7 +1794,7 @@ func file_pkg_apis_scheduler_v1_scheduler_proto_init() {
return nil
}
}
file_pkg_apis_scheduler_v1_scheduler_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
file_pkg_apis_scheduler_v1_scheduler_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AnnounceTaskRequest); i {
case 0:
return &v.state
@ -1829,6 +1806,18 @@ func file_pkg_apis_scheduler_v1_scheduler_proto_init() {
return nil
}
}
file_pkg_apis_scheduler_v1_scheduler_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*LeaveHostRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pkg_apis_scheduler_v1_scheduler_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PeerPacket_DestPeer); i {
case 0:
@ -1892,12 +1881,12 @@ type SchedulerClient interface {
ReportPeerResult(ctx context.Context, in *PeerResult, opts ...grpc.CallOption) (*emptypb.Empty, error)
// LeaveTask makes the peer leaving from task.
LeaveTask(ctx context.Context, in *PeerTarget, opts ...grpc.CallOption) (*emptypb.Empty, error)
// LeaveTasks makes the peers leaving from task.
LeaveTasks(ctx context.Context, in *LeaveTasksRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// Checks if any peer has the given task.
StatTask(ctx context.Context, in *StatTaskRequest, opts ...grpc.CallOption) (*Task, error)
// A peer announces that it has the announced task to other peers.
AnnounceTask(ctx context.Context, in *AnnounceTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// LeaveHost makes the peers leaving from host.
LeaveHost(ctx context.Context, in *LeaveHostRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
type schedulerClient struct {
@ -1966,15 +1955,6 @@ func (c *schedulerClient) LeaveTask(ctx context.Context, in *PeerTarget, opts ..
return out, nil
}
func (c *schedulerClient) LeaveTasks(ctx context.Context, in *LeaveTasksRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/scheduler.Scheduler/LeaveTasks", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *schedulerClient) StatTask(ctx context.Context, in *StatTaskRequest, opts ...grpc.CallOption) (*Task, error) {
out := new(Task)
err := c.cc.Invoke(ctx, "/scheduler.Scheduler/StatTask", in, out, opts...)
@ -1993,6 +1973,15 @@ func (c *schedulerClient) AnnounceTask(ctx context.Context, in *AnnounceTaskRequ
return out, nil
}
func (c *schedulerClient) LeaveHost(ctx context.Context, in *LeaveHostRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/scheduler.Scheduler/LeaveHost", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// SchedulerServer is the server API for Scheduler service.
type SchedulerServer interface {
// RegisterPeerTask registers a peer into task.
@ -2003,12 +1992,12 @@ type SchedulerServer interface {
ReportPeerResult(context.Context, *PeerResult) (*emptypb.Empty, error)
// LeaveTask makes the peer leaving from task.
LeaveTask(context.Context, *PeerTarget) (*emptypb.Empty, error)
// LeaveTasks makes the peers leaving from task.
LeaveTasks(context.Context, *LeaveTasksRequest) (*emptypb.Empty, error)
// Checks if any peer has the given task.
StatTask(context.Context, *StatTaskRequest) (*Task, error)
// A peer announces that it has the announced task to other peers.
AnnounceTask(context.Context, *AnnounceTaskRequest) (*emptypb.Empty, error)
// LeaveHost makes the peers leaving from host.
LeaveHost(context.Context, *LeaveHostRequest) (*emptypb.Empty, error)
}
// UnimplementedSchedulerServer can be embedded to have forward compatible implementations.
@ -2027,15 +2016,15 @@ func (*UnimplementedSchedulerServer) ReportPeerResult(context.Context, *PeerResu
func (*UnimplementedSchedulerServer) LeaveTask(context.Context, *PeerTarget) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method LeaveTask not implemented")
}
func (*UnimplementedSchedulerServer) LeaveTasks(context.Context, *LeaveTasksRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method LeaveTasks not implemented")
}
func (*UnimplementedSchedulerServer) StatTask(context.Context, *StatTaskRequest) (*Task, error) {
return nil, status.Errorf(codes.Unimplemented, "method StatTask not implemented")
}
func (*UnimplementedSchedulerServer) AnnounceTask(context.Context, *AnnounceTaskRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method AnnounceTask not implemented")
}
func (*UnimplementedSchedulerServer) LeaveHost(context.Context, *LeaveHostRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method LeaveHost not implemented")
}
func RegisterSchedulerServer(s *grpc.Server, srv SchedulerServer) {
s.RegisterService(&_Scheduler_serviceDesc, srv)
@ -2121,24 +2110,6 @@ func _Scheduler_LeaveTask_Handler(srv interface{}, ctx context.Context, dec func
return interceptor(ctx, in, info, handler)
}
func _Scheduler_LeaveTasks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(LeaveTasksRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SchedulerServer).LeaveTasks(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/scheduler.Scheduler/LeaveTasks",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SchedulerServer).LeaveTasks(ctx, req.(*LeaveTasksRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Scheduler_StatTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StatTaskRequest)
if err := dec(in); err != nil {
@ -2175,6 +2146,24 @@ func _Scheduler_AnnounceTask_Handler(srv interface{}, ctx context.Context, dec f
return interceptor(ctx, in, info, handler)
}
func _Scheduler_LeaveHost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(LeaveHostRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SchedulerServer).LeaveHost(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/scheduler.Scheduler/LeaveHost",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SchedulerServer).LeaveHost(ctx, req.(*LeaveHostRequest))
}
return interceptor(ctx, in, info, handler)
}
var _Scheduler_serviceDesc = grpc.ServiceDesc{
ServiceName: "scheduler.Scheduler",
HandlerType: (*SchedulerServer)(nil),
@ -2191,10 +2180,6 @@ var _Scheduler_serviceDesc = grpc.ServiceDesc{
MethodName: "LeaveTask",
Handler: _Scheduler_LeaveTask_Handler,
},
{
MethodName: "LeaveTasks",
Handler: _Scheduler_LeaveTasks_Handler,
},
{
MethodName: "StatTask",
Handler: _Scheduler_StatTask_Handler,
@ -2203,6 +2188,10 @@ var _Scheduler_serviceDesc = grpc.ServiceDesc{
MethodName: "AnnounceTask",
Handler: _Scheduler_AnnounceTask_Handler,
},
{
MethodName: "LeaveHost",
Handler: _Scheduler_LeaveHost_Handler,
},
},
Streams: []grpc.StreamDesc{
{

View File

@ -1591,134 +1591,6 @@ var _ interface {
ErrorName() string
} = PeerTargetValidationError{}
// Validate checks the field values on LeaveTasksRequest with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *LeaveTasksRequest) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on LeaveTasksRequest with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// LeaveTasksRequestMultiError, or nil if none found.
func (m *LeaveTasksRequest) ValidateAll() error {
return m.validate(true)
}
func (m *LeaveTasksRequest) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if len(m.GetTaskIds()) > 0 {
if len(m.GetTaskIds()) < 1 {
err := LeaveTasksRequestValidationError{
field: "TaskIds",
reason: "value must contain at least 1 item(s)",
}
if !all {
return err
}
errors = append(errors, err)
}
}
if len(m.GetPeerIds()) < 1 {
err := LeaveTasksRequestValidationError{
field: "PeerIds",
reason: "value must contain at least 1 item(s)",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(errors) > 0 {
return LeaveTasksRequestMultiError(errors)
}
return nil
}
// LeaveTasksRequestMultiError is an error wrapping multiple validation errors
// returned by LeaveTasksRequest.ValidateAll() if the designated constraints
// aren't met.
type LeaveTasksRequestMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m LeaveTasksRequestMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m LeaveTasksRequestMultiError) AllErrors() []error { return m }
// LeaveTasksRequestValidationError is the validation error returned by
// LeaveTasksRequest.Validate if the designated constraints aren't met.
type LeaveTasksRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e LeaveTasksRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e LeaveTasksRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e LeaveTasksRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e LeaveTasksRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e LeaveTasksRequestValidationError) ErrorName() string {
return "LeaveTasksRequestValidationError"
}
// Error satisfies the builtin error interface
func (e LeaveTasksRequestValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sLeaveTasksRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = LeaveTasksRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = LeaveTasksRequestValidationError{}
// Validate checks the field values on StatTaskRequest with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
@ -2236,6 +2108,117 @@ var _ interface {
ErrorName() string
} = AnnounceTaskRequestValidationError{}
// Validate checks the field values on LeaveHostRequest with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *LeaveHostRequest) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on LeaveHostRequest with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// LeaveHostRequestMultiError, or nil if none found.
func (m *LeaveHostRequest) ValidateAll() error {
return m.validate(true)
}
func (m *LeaveHostRequest) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if utf8.RuneCountInString(m.GetId()) < 1 {
err := LeaveHostRequestValidationError{
field: "Id",
reason: "value length must be at least 1 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(errors) > 0 {
return LeaveHostRequestMultiError(errors)
}
return nil
}
// LeaveHostRequestMultiError is an error wrapping multiple validation errors
// returned by LeaveHostRequest.ValidateAll() if the designated constraints
// aren't met.
type LeaveHostRequestMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m LeaveHostRequestMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m LeaveHostRequestMultiError) AllErrors() []error { return m }
// LeaveHostRequestValidationError is the validation error returned by
// LeaveHostRequest.Validate if the designated constraints aren't met.
type LeaveHostRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e LeaveHostRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e LeaveHostRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e LeaveHostRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e LeaveHostRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e LeaveHostRequestValidationError) ErrorName() string { return "LeaveHostRequestValidationError" }
// Error satisfies the builtin error interface
func (e LeaveHostRequestValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sLeaveHostRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = LeaveHostRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = LeaveHostRequestValidationError{}
// Validate checks the field values on PeerPacket_DestPeer with the rules
// defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.

View File

@ -195,13 +195,6 @@ message PeerTarget{
string peer_id = 2 [(validate.rules).string.min_len = 1];
}
message LeaveTasksRequest{
// Task ids.
repeated string task_ids = 1 [(validate.rules).repeated = {min_items: 1, ignore_empty: true}];
// Peer ids.
repeated string peer_ids = 2 [(validate.rules).repeated = {min_items: 1}];
}
// StatTaskRequest represents request of StatTask.
message StatTaskRequest{
// Task id.
@ -242,6 +235,12 @@ message AnnounceTaskRequest{
common.TaskType task_type = 6;
}
// LeaveHostRequest represents request of LeaveHost.
message LeaveHostRequest{
// Host id.
string id = 1 [(validate.rules).string.min_len = 1];
}
// Scheduler RPC Service.
service Scheduler{
// RegisterPeerTask registers a peer into task.
@ -256,12 +255,12 @@ service Scheduler{
// LeaveTask makes the peer leaving from task.
rpc LeaveTask(PeerTarget)returns(google.protobuf.Empty);
// LeaveTasks makes the peers leaving from task.
rpc LeaveTasks(LeaveTasksRequest)returns(google.protobuf.Empty);
// Checks if any peer has the given task.
rpc StatTask(StatTaskRequest)returns(Task);
// A peer announces that it has the announced task to other peers.
rpc AnnounceTask(AnnounceTaskRequest) returns(google.protobuf.Empty);
// LeaveHost makes the peers leaving from host.
rpc LeaveHost(LeaveHostRequest)returns(google.protobuf.Empty);
}

View File

@ -148,6 +148,26 @@ func (mr *MockSchedulerClientMockRecorder) ExchangePeer(ctx, in interface{}, opt
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExchangePeer", reflect.TypeOf((*MockSchedulerClient)(nil).ExchangePeer), varargs...)
}
// LeaveHost mocks base method.
func (m *MockSchedulerClient) LeaveHost(ctx context.Context, in *v2.LeaveHostRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "LeaveHost", varargs...)
ret0, _ := ret[0].(*emptypb.Empty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// LeaveHost indicates an expected call of LeaveHost.
func (mr *MockSchedulerClientMockRecorder) LeaveHost(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LeaveHost", reflect.TypeOf((*MockSchedulerClient)(nil).LeaveHost), varargs...)
}
// LeavePeer mocks base method.
func (m *MockSchedulerClient) LeavePeer(ctx context.Context, in *v2.LeavePeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
@ -168,46 +188,6 @@ func (mr *MockSchedulerClientMockRecorder) LeavePeer(ctx, in interface{}, opts .
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LeavePeer", reflect.TypeOf((*MockSchedulerClient)(nil).LeavePeer), varargs...)
}
// LeavePeers mocks base method.
func (m *MockSchedulerClient) LeavePeers(ctx context.Context, in *v2.LeavePeersRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "LeavePeers", varargs...)
ret0, _ := ret[0].(*emptypb.Empty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// LeavePeers indicates an expected call of LeavePeers.
func (mr *MockSchedulerClientMockRecorder) LeavePeers(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LeavePeers", reflect.TypeOf((*MockSchedulerClient)(nil).LeavePeers), varargs...)
}
// LeaveTask mocks base method.
func (m *MockSchedulerClient) LeaveTask(ctx context.Context, in *v2.LeaveTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "LeaveTask", varargs...)
ret0, _ := ret[0].(*emptypb.Empty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// LeaveTask indicates an expected call of LeaveTask.
func (mr *MockSchedulerClientMockRecorder) LeaveTask(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LeaveTask", reflect.TypeOf((*MockSchedulerClient)(nil).LeaveTask), varargs...)
}
// StatPeer mocks base method.
func (m *MockSchedulerClient) StatPeer(ctx context.Context, in *v2.StatPeerRequest, opts ...grpc.CallOption) (*v2.Peer, error) {
m.ctrl.T.Helper()
@ -437,6 +417,21 @@ func (mr *MockSchedulerServerMockRecorder) ExchangePeer(arg0, arg1 interface{})
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExchangePeer", reflect.TypeOf((*MockSchedulerServer)(nil).ExchangePeer), arg0, arg1)
}
// LeaveHost mocks base method.
func (m *MockSchedulerServer) LeaveHost(arg0 context.Context, arg1 *v2.LeaveHostRequest) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "LeaveHost", arg0, arg1)
ret0, _ := ret[0].(*emptypb.Empty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// LeaveHost indicates an expected call of LeaveHost.
func (mr *MockSchedulerServerMockRecorder) LeaveHost(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LeaveHost", reflect.TypeOf((*MockSchedulerServer)(nil).LeaveHost), arg0, arg1)
}
// LeavePeer mocks base method.
func (m *MockSchedulerServer) LeavePeer(arg0 context.Context, arg1 *v2.LeavePeerRequest) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
@ -452,36 +447,6 @@ func (mr *MockSchedulerServerMockRecorder) LeavePeer(arg0, arg1 interface{}) *go
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LeavePeer", reflect.TypeOf((*MockSchedulerServer)(nil).LeavePeer), arg0, arg1)
}
// LeavePeers mocks base method.
func (m *MockSchedulerServer) LeavePeers(arg0 context.Context, arg1 *v2.LeavePeersRequest) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "LeavePeers", arg0, arg1)
ret0, _ := ret[0].(*emptypb.Empty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// LeavePeers indicates an expected call of LeavePeers.
func (mr *MockSchedulerServerMockRecorder) LeavePeers(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LeavePeers", reflect.TypeOf((*MockSchedulerServer)(nil).LeavePeers), arg0, arg1)
}
// LeaveTask mocks base method.
func (m *MockSchedulerServer) LeaveTask(arg0 context.Context, arg1 *v2.LeaveTaskRequest) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "LeaveTask", arg0, arg1)
ret0, _ := ret[0].(*emptypb.Empty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// LeaveTask indicates an expected call of LeaveTask.
func (mr *MockSchedulerServerMockRecorder) LeaveTask(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LeaveTask", reflect.TypeOf((*MockSchedulerServer)(nil).LeaveTask), arg0, arg1)
}
// StatPeer mocks base method.
func (m *MockSchedulerServer) StatPeer(arg0 context.Context, arg1 *v2.StatPeerRequest) (*v2.Peer, error) {
m.ctrl.T.Helper()

View File

@ -1374,10 +1374,8 @@ type LeavePeerRequest struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Task id.
TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
// Peer id.
PeerId string `protobuf:"bytes,2,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
}
func (x *LeavePeerRequest) Reset() {
@ -1412,69 +1410,13 @@ func (*LeavePeerRequest) Descriptor() ([]byte, []int) {
return file_pkg_apis_scheduler_v2_scheduler_proto_rawDescGZIP(), []int{17}
}
func (x *LeavePeerRequest) GetTaskId() string {
func (x *LeavePeerRequest) GetId() string {
if x != nil {
return x.TaskId
return x.Id
}
return ""
}
func (x *LeavePeerRequest) GetPeerId() string {
if x != nil {
return x.PeerId
}
return ""
}
// LeavePeersRequest represents request of LeavePeers.
type LeavePeersRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Peer ids.
PeerIds []string `protobuf:"bytes,1,rep,name=peer_ids,json=peerIds,proto3" json:"peer_ids,omitempty"`
}
func (x *LeavePeersRequest) Reset() {
*x = LeavePeersRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_scheduler_v2_scheduler_proto_msgTypes[18]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *LeavePeersRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*LeavePeersRequest) ProtoMessage() {}
func (x *LeavePeersRequest) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_scheduler_v2_scheduler_proto_msgTypes[18]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use LeavePeersRequest.ProtoReflect.Descriptor instead.
func (*LeavePeersRequest) Descriptor() ([]byte, []int) {
return file_pkg_apis_scheduler_v2_scheduler_proto_rawDescGZIP(), []int{18}
}
func (x *LeavePeersRequest) GetPeerIds() []string {
if x != nil {
return x.PeerIds
}
return nil
}
// StatTaskRequest represents request of StatTask.
type StatTaskRequest struct {
state protoimpl.MessageState
@ -1482,13 +1424,13 @@ type StatTaskRequest struct {
unknownFields protoimpl.UnknownFields
// Task id.
TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
}
func (x *StatTaskRequest) Reset() {
*x = StatTaskRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_scheduler_v2_scheduler_proto_msgTypes[19]
mi := &file_pkg_apis_scheduler_v2_scheduler_proto_msgTypes[18]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -1501,7 +1443,7 @@ func (x *StatTaskRequest) String() string {
func (*StatTaskRequest) ProtoMessage() {}
func (x *StatTaskRequest) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_scheduler_v2_scheduler_proto_msgTypes[19]
mi := &file_pkg_apis_scheduler_v2_scheduler_proto_msgTypes[18]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -1514,43 +1456,43 @@ func (x *StatTaskRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use StatTaskRequest.ProtoReflect.Descriptor instead.
func (*StatTaskRequest) Descriptor() ([]byte, []int) {
return file_pkg_apis_scheduler_v2_scheduler_proto_rawDescGZIP(), []int{19}
return file_pkg_apis_scheduler_v2_scheduler_proto_rawDescGZIP(), []int{18}
}
func (x *StatTaskRequest) GetTaskId() string {
func (x *StatTaskRequest) GetId() string {
if x != nil {
return x.TaskId
return x.Id
}
return ""
}
// LeaveTaskRequest represents request of LeaveTask.
type LeaveTaskRequest struct {
// LeaveHostRequest represents request of LeaveHost.
type LeaveHostRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Task id.
TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
// Host id.
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
}
func (x *LeaveTaskRequest) Reset() {
*x = LeaveTaskRequest{}
func (x *LeaveHostRequest) Reset() {
*x = LeaveHostRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_scheduler_v2_scheduler_proto_msgTypes[20]
mi := &file_pkg_apis_scheduler_v2_scheduler_proto_msgTypes[19]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *LeaveTaskRequest) String() string {
func (x *LeaveHostRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*LeaveTaskRequest) ProtoMessage() {}
func (*LeaveHostRequest) ProtoMessage() {}
func (x *LeaveTaskRequest) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_scheduler_v2_scheduler_proto_msgTypes[20]
func (x *LeaveHostRequest) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_scheduler_v2_scheduler_proto_msgTypes[19]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -1561,14 +1503,14 @@ func (x *LeaveTaskRequest) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use LeaveTaskRequest.ProtoReflect.Descriptor instead.
func (*LeaveTaskRequest) Descriptor() ([]byte, []int) {
return file_pkg_apis_scheduler_v2_scheduler_proto_rawDescGZIP(), []int{20}
// Deprecated: Use LeaveHostRequest.ProtoReflect.Descriptor instead.
func (*LeaveHostRequest) Descriptor() ([]byte, []int) {
return file_pkg_apis_scheduler_v2_scheduler_proto_rawDescGZIP(), []int{19}
}
func (x *LeaveTaskRequest) GetTaskId() string {
func (x *LeaveHostRequest) GetId() string {
if x != nil {
return x.TaskId
return x.Id
}
return ""
}
@ -1824,56 +1766,45 @@ var file_pkg_apis_scheduler_v2_scheduler_proto_rawDesc = []byte{
0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42,
0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64,
0x22, 0x16, 0x0a, 0x14, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x65, 0x65, 0x72,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x56, 0x0a, 0x10, 0x4c, 0x65, 0x61, 0x76,
0x65, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07,
0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa,
0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x20,
0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42,
0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64,
0x22, 0x38, 0x0a, 0x11, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x50, 0x65, 0x65, 0x72, 0x73, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x08, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64,
0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x08,
0x01, 0x52, 0x07, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x73, 0x22, 0x33, 0x0a, 0x0f, 0x53, 0x74,
0x61, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a,
0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07,
0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22,
0x34, 0x0a, 0x10, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x74,
0x61, 0x73, 0x6b, 0x49, 0x64, 0x32, 0xeb, 0x03, 0x0a, 0x09, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75,
0x6c, 0x65, 0x72, 0x12, 0x53, 0x0a, 0x0c, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x50,
0x65, 0x65, 0x72, 0x12, 0x1e, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e,
0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e,
0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x37, 0x0a, 0x08, 0x53, 0x74, 0x61, 0x74,
0x50, 0x65, 0x65, 0x72, 0x12, 0x1a, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72,
0x2e, 0x53, 0x74, 0x61, 0x74, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x0f, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x50, 0x65, 0x65,
0x72, 0x12, 0x40, 0x0a, 0x09, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x50, 0x65, 0x65, 0x72, 0x12, 0x1b,
0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x65, 0x61, 0x76, 0x65,
0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d,
0x70, 0x74, 0x79, 0x12, 0x42, 0x0a, 0x0a, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x50, 0x65, 0x65, 0x72,
0x73, 0x12, 0x1c, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x65,
0x61, 0x76, 0x65, 0x50, 0x65, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x4f, 0x0a, 0x0c, 0x45, 0x78, 0x63, 0x68, 0x61,
0x6e, 0x67, 0x65, 0x50, 0x65, 0x65, 0x72, 0x12, 0x1e, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75,
0x6c, 0x65, 0x72, 0x2e, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x65, 0x65, 0x72,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75,
0x6c, 0x65, 0x72, 0x2e, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x65, 0x65, 0x72,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x08, 0x53, 0x74, 0x61, 0x74,
0x54, 0x61, 0x73, 0x6b, 0x12, 0x1a, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72,
0x2e, 0x53, 0x74, 0x61, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x0f, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x54, 0x61, 0x73,
0x6b, 0x12, 0x40, 0x0a, 0x09, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1b,
0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x65, 0x61, 0x76, 0x65,
0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d,
0x70, 0x74, 0x79, 0x42, 0x22, 0x5a, 0x20, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70,
0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x64,
0x75, 0x6c, 0x65, 0x72, 0x2f, 0x76, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b, 0x0a, 0x10, 0x4c, 0x65, 0x61, 0x76,
0x65, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x02,
0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10,
0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x2a, 0x0a, 0x0f, 0x53, 0x74, 0x61, 0x74, 0x54, 0x61, 0x73,
0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69,
0x64, 0x22, 0x2b, 0x0a, 0x10, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x48, 0x6f, 0x73, 0x74, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, 0x32, 0xa7,
0x03, 0x0a, 0x09, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x12, 0x53, 0x0a, 0x0c,
0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x50, 0x65, 0x65, 0x72, 0x12, 0x1e, 0x2e, 0x73,
0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63,
0x65, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x73,
0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63,
0x65, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30,
0x01, 0x12, 0x37, 0x0a, 0x08, 0x53, 0x74, 0x61, 0x74, 0x50, 0x65, 0x65, 0x72, 0x12, 0x1a, 0x2e,
0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x50, 0x65,
0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x73, 0x63, 0x68, 0x65,
0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x12, 0x40, 0x0a, 0x09, 0x4c, 0x65,
0x61, 0x76, 0x65, 0x50, 0x65, 0x65, 0x72, 0x12, 0x1b, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75,
0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x4f, 0x0a, 0x0c,
0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x65, 0x65, 0x72, 0x12, 0x1e, 0x2e, 0x73,
0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67,
0x65, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x73,
0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67,
0x65, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a,
0x08, 0x53, 0x74, 0x61, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1a, 0x2e, 0x73, 0x63, 0x68, 0x65,
0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65,
0x72, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x40, 0x0a, 0x09, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x48,
0x6f, 0x73, 0x74, 0x12, 0x1b, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e,
0x4c, 0x65, 0x61, 0x76, 0x65, 0x48, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x22, 0x5a, 0x20, 0x64, 0x37, 0x79, 0x2e,
0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f,
0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2f, 0x76, 0x32, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -1888,7 +1819,7 @@ func file_pkg_apis_scheduler_v2_scheduler_proto_rawDescGZIP() []byte {
return file_pkg_apis_scheduler_v2_scheduler_proto_rawDescData
}
var file_pkg_apis_scheduler_v2_scheduler_proto_msgTypes = make([]protoimpl.MessageInfo, 21)
var file_pkg_apis_scheduler_v2_scheduler_proto_msgTypes = make([]protoimpl.MessageInfo, 20)
var file_pkg_apis_scheduler_v2_scheduler_proto_goTypes = []interface{}{
(*Peer)(nil), // 0: scheduler.Peer
(*Task)(nil), // 1: scheduler.Task
@ -1908,69 +1839,66 @@ var file_pkg_apis_scheduler_v2_scheduler_proto_goTypes = []interface{}{
(*ExchangePeerRequest)(nil), // 15: scheduler.ExchangePeerRequest
(*ExchangePeerResponse)(nil), // 16: scheduler.ExchangePeerResponse
(*LeavePeerRequest)(nil), // 17: scheduler.LeavePeerRequest
(*LeavePeersRequest)(nil), // 18: scheduler.LeavePeersRequest
(*StatTaskRequest)(nil), // 19: scheduler.StatTaskRequest
(*LeaveTaskRequest)(nil), // 20: scheduler.LeaveTaskRequest
(*v2.Piece)(nil), // 21: common.Piece
(*timestamppb.Timestamp)(nil), // 22: google.protobuf.Timestamp
(v2.SizeScope)(0), // 23: common.SizeScope
(*v2.Metadata)(nil), // 24: common.Metadata
(v2.TaskType)(0), // 25: common.TaskType
(v2.Pattern)(0), // 26: common.Pattern
(*v21.PeerDownloadBackToSourceFailed)(nil), // 27: errordetails.PeerDownloadBackToSourceFailed
(*v21.PieceDownloadFailed)(nil), // 28: errordetails.PieceDownloadFailed
(*v21.PieceInfoSyncFailed)(nil), // 29: errordetails.PieceInfoSyncFailed
(*v21.ScheduleFailed)(nil), // 30: errordetails.ScheduleFailed
(*emptypb.Empty)(nil), // 31: google.protobuf.Empty
(*StatTaskRequest)(nil), // 18: scheduler.StatTaskRequest
(*LeaveHostRequest)(nil), // 19: scheduler.LeaveHostRequest
(*v2.Piece)(nil), // 20: common.Piece
(*timestamppb.Timestamp)(nil), // 21: google.protobuf.Timestamp
(v2.SizeScope)(0), // 22: common.SizeScope
(*v2.Metadata)(nil), // 23: common.Metadata
(v2.TaskType)(0), // 24: common.TaskType
(v2.Pattern)(0), // 25: common.Pattern
(*v21.PeerDownloadBackToSourceFailed)(nil), // 26: errordetails.PeerDownloadBackToSourceFailed
(*v21.PieceDownloadFailed)(nil), // 27: errordetails.PieceDownloadFailed
(*v21.PieceInfoSyncFailed)(nil), // 28: errordetails.PieceInfoSyncFailed
(*v21.ScheduleFailed)(nil), // 29: errordetails.ScheduleFailed
(*emptypb.Empty)(nil), // 30: google.protobuf.Empty
}
var file_pkg_apis_scheduler_v2_scheduler_proto_depIdxs = []int32{
21, // 0: scheduler.Peer.pieces:type_name -> common.Piece
20, // 0: scheduler.Peer.pieces:type_name -> common.Piece
1, // 1: scheduler.Peer.task:type_name -> scheduler.Task
2, // 2: scheduler.Peer.host:type_name -> scheduler.Host
22, // 3: scheduler.Peer.created_at:type_name -> google.protobuf.Timestamp
22, // 4: scheduler.Peer.updated_at:type_name -> google.protobuf.Timestamp
23, // 5: scheduler.Task.size_scope:type_name -> common.SizeScope
21, // 6: scheduler.Task.pieces:type_name -> common.Piece
24, // 7: scheduler.Task.metadata:type_name -> common.Metadata
22, // 8: scheduler.Task.created_at:type_name -> google.protobuf.Timestamp
22, // 9: scheduler.Task.updated_at:type_name -> google.protobuf.Timestamp
24, // 10: scheduler.RegisterRequest.metadata:type_name -> common.Metadata
21, // 3: scheduler.Peer.created_at:type_name -> google.protobuf.Timestamp
21, // 4: scheduler.Peer.updated_at:type_name -> google.protobuf.Timestamp
22, // 5: scheduler.Task.size_scope:type_name -> common.SizeScope
20, // 6: scheduler.Task.pieces:type_name -> common.Piece
23, // 7: scheduler.Task.metadata:type_name -> common.Metadata
21, // 8: scheduler.Task.created_at:type_name -> google.protobuf.Timestamp
21, // 9: scheduler.Task.updated_at:type_name -> google.protobuf.Timestamp
23, // 10: scheduler.RegisterRequest.metadata:type_name -> common.Metadata
2, // 11: scheduler.RegisterRequest.host:type_name -> scheduler.Host
25, // 12: scheduler.RegisterRequest.task_type:type_name -> common.TaskType
26, // 13: scheduler.RegisterRequest.pattern:type_name -> common.Pattern
21, // 14: scheduler.PieceDownloadFinishedRequest.piece:type_name -> common.Piece
24, // 12: scheduler.RegisterRequest.task_type:type_name -> common.TaskType
25, // 13: scheduler.RegisterRequest.pattern:type_name -> common.Pattern
20, // 14: scheduler.PieceDownloadFinishedRequest.piece:type_name -> common.Piece
3, // 15: scheduler.AnnouncePeerRequest.register_request:type_name -> scheduler.RegisterRequest
4, // 16: scheduler.AnnouncePeerRequest.peer_download_started_request:type_name -> scheduler.PeerDownloadStartedRequest
5, // 17: scheduler.AnnouncePeerRequest.peer_download_back_to_source_request:type_name -> scheduler.PeerDownloadBackToSourceRequest
6, // 18: scheduler.AnnouncePeerRequest.peer_download_finished_request:type_name -> scheduler.PeerDownloadFinishedRequest
7, // 19: scheduler.AnnouncePeerRequest.piece_download_finished_request:type_name -> scheduler.PieceDownloadFinishedRequest
27, // 20: scheduler.AnnouncePeerRequest.peer_download_back_to_source_failed:type_name -> errordetails.PeerDownloadBackToSourceFailed
28, // 21: scheduler.AnnouncePeerRequest.piece_download_failed:type_name -> errordetails.PieceDownloadFailed
29, // 22: scheduler.AnnouncePeerRequest.piece_info_sync_failed:type_name -> errordetails.PieceInfoSyncFailed
30, // 23: scheduler.AnnouncePeerRequest.schedule_failed:type_name -> errordetails.ScheduleFailed
21, // 24: scheduler.SmallTaskResponse.piece:type_name -> common.Piece
26, // 20: scheduler.AnnouncePeerRequest.peer_download_back_to_source_failed:type_name -> errordetails.PeerDownloadBackToSourceFailed
27, // 21: scheduler.AnnouncePeerRequest.piece_download_failed:type_name -> errordetails.PieceDownloadFailed
28, // 22: scheduler.AnnouncePeerRequest.piece_info_sync_failed:type_name -> errordetails.PieceInfoSyncFailed
29, // 23: scheduler.AnnouncePeerRequest.schedule_failed:type_name -> errordetails.ScheduleFailed
20, // 24: scheduler.SmallTaskResponse.piece:type_name -> common.Piece
0, // 25: scheduler.NormalTaskResponse.candidate_parents:type_name -> scheduler.Peer
9, // 26: scheduler.AnnouncePeerResponse.tiny_task_response:type_name -> scheduler.TinyTaskResponse
10, // 27: scheduler.AnnouncePeerResponse.small_task_response:type_name -> scheduler.SmallTaskResponse
11, // 28: scheduler.AnnouncePeerResponse.normal_task_response:type_name -> scheduler.NormalTaskResponse
12, // 29: scheduler.AnnouncePeerResponse.need_back_to_source_response:type_name -> scheduler.NeedBackToSourceResponse
30, // 30: scheduler.AnnouncePeerResponse.scheduleFailed:type_name -> errordetails.ScheduleFailed
29, // 30: scheduler.AnnouncePeerResponse.scheduleFailed:type_name -> errordetails.ScheduleFailed
8, // 31: scheduler.Scheduler.AnnouncePeer:input_type -> scheduler.AnnouncePeerRequest
14, // 32: scheduler.Scheduler.StatPeer:input_type -> scheduler.StatPeerRequest
17, // 33: scheduler.Scheduler.LeavePeer:input_type -> scheduler.LeavePeerRequest
18, // 34: scheduler.Scheduler.LeavePeers:input_type -> scheduler.LeavePeersRequest
15, // 35: scheduler.Scheduler.ExchangePeer:input_type -> scheduler.ExchangePeerRequest
19, // 36: scheduler.Scheduler.StatTask:input_type -> scheduler.StatTaskRequest
20, // 37: scheduler.Scheduler.LeaveTask:input_type -> scheduler.LeaveTaskRequest
13, // 38: scheduler.Scheduler.AnnouncePeer:output_type -> scheduler.AnnouncePeerResponse
0, // 39: scheduler.Scheduler.StatPeer:output_type -> scheduler.Peer
31, // 40: scheduler.Scheduler.LeavePeer:output_type -> google.protobuf.Empty
31, // 41: scheduler.Scheduler.LeavePeers:output_type -> google.protobuf.Empty
16, // 42: scheduler.Scheduler.ExchangePeer:output_type -> scheduler.ExchangePeerResponse
1, // 43: scheduler.Scheduler.StatTask:output_type -> scheduler.Task
31, // 44: scheduler.Scheduler.LeaveTask:output_type -> google.protobuf.Empty
38, // [38:45] is the sub-list for method output_type
31, // [31:38] is the sub-list for method input_type
15, // 34: scheduler.Scheduler.ExchangePeer:input_type -> scheduler.ExchangePeerRequest
18, // 35: scheduler.Scheduler.StatTask:input_type -> scheduler.StatTaskRequest
19, // 36: scheduler.Scheduler.LeaveHost:input_type -> scheduler.LeaveHostRequest
13, // 37: scheduler.Scheduler.AnnouncePeer:output_type -> scheduler.AnnouncePeerResponse
0, // 38: scheduler.Scheduler.StatPeer:output_type -> scheduler.Peer
30, // 39: scheduler.Scheduler.LeavePeer:output_type -> google.protobuf.Empty
16, // 40: scheduler.Scheduler.ExchangePeer:output_type -> scheduler.ExchangePeerResponse
1, // 41: scheduler.Scheduler.StatTask:output_type -> scheduler.Task
30, // 42: scheduler.Scheduler.LeaveHost:output_type -> google.protobuf.Empty
37, // [37:43] is the sub-list for method output_type
31, // [31:37] is the sub-list for method input_type
31, // [31:31] is the sub-list for extension type_name
31, // [31:31] is the sub-list for extension extendee
0, // [0:31] is the sub-list for field type_name
@ -2199,18 +2127,6 @@ func file_pkg_apis_scheduler_v2_scheduler_proto_init() {
}
}
file_pkg_apis_scheduler_v2_scheduler_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*LeavePeersRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pkg_apis_scheduler_v2_scheduler_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*StatTaskRequest); i {
case 0:
return &v.state
@ -2222,8 +2138,8 @@ func file_pkg_apis_scheduler_v2_scheduler_proto_init() {
return nil
}
}
file_pkg_apis_scheduler_v2_scheduler_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*LeaveTaskRequest); i {
file_pkg_apis_scheduler_v2_scheduler_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*LeaveHostRequest); i {
case 0:
return &v.state
case 1:
@ -2259,7 +2175,7 @@ func file_pkg_apis_scheduler_v2_scheduler_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_pkg_apis_scheduler_v2_scheduler_proto_rawDesc,
NumEnums: 0,
NumMessages: 21,
NumMessages: 20,
NumExtensions: 0,
NumServices: 1,
},
@ -2291,15 +2207,13 @@ type SchedulerClient interface {
StatPeer(ctx context.Context, in *StatPeerRequest, opts ...grpc.CallOption) (*Peer, error)
// LeavePeer releases peer in scheduler.
LeavePeer(ctx context.Context, in *LeavePeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// LeavePeers releases peers in scheduler.
LeavePeers(ctx context.Context, in *LeavePeersRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// TODO exchange peer api definition.
// ExchangePeer exchanges peer information.
ExchangePeer(ctx context.Context, in *ExchangePeerRequest, opts ...grpc.CallOption) (*ExchangePeerResponse, error)
// Checks information of task.
StatTask(ctx context.Context, in *StatTaskRequest, opts ...grpc.CallOption) (*Task, error)
// LeaveTask releases task in scheduler.
LeaveTask(ctx context.Context, in *LeaveTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// LeaveHost releases host in scheduler.
LeaveHost(ctx context.Context, in *LeaveHostRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
type schedulerClient struct {
@ -2359,15 +2273,6 @@ func (c *schedulerClient) LeavePeer(ctx context.Context, in *LeavePeerRequest, o
return out, nil
}
func (c *schedulerClient) LeavePeers(ctx context.Context, in *LeavePeersRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/scheduler.Scheduler/LeavePeers", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *schedulerClient) ExchangePeer(ctx context.Context, in *ExchangePeerRequest, opts ...grpc.CallOption) (*ExchangePeerResponse, error) {
out := new(ExchangePeerResponse)
err := c.cc.Invoke(ctx, "/scheduler.Scheduler/ExchangePeer", in, out, opts...)
@ -2386,9 +2291,9 @@ func (c *schedulerClient) StatTask(ctx context.Context, in *StatTaskRequest, opt
return out, nil
}
func (c *schedulerClient) LeaveTask(ctx context.Context, in *LeaveTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
func (c *schedulerClient) LeaveHost(ctx context.Context, in *LeaveHostRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/scheduler.Scheduler/LeaveTask", in, out, opts...)
err := c.cc.Invoke(ctx, "/scheduler.Scheduler/LeaveHost", in, out, opts...)
if err != nil {
return nil, err
}
@ -2403,15 +2308,13 @@ type SchedulerServer interface {
StatPeer(context.Context, *StatPeerRequest) (*Peer, error)
// LeavePeer releases peer in scheduler.
LeavePeer(context.Context, *LeavePeerRequest) (*emptypb.Empty, error)
// LeavePeers releases peers in scheduler.
LeavePeers(context.Context, *LeavePeersRequest) (*emptypb.Empty, error)
// TODO exchange peer api definition.
// ExchangePeer exchanges peer information.
ExchangePeer(context.Context, *ExchangePeerRequest) (*ExchangePeerResponse, error)
// Checks information of task.
StatTask(context.Context, *StatTaskRequest) (*Task, error)
// LeaveTask releases task in scheduler.
LeaveTask(context.Context, *LeaveTaskRequest) (*emptypb.Empty, error)
// LeaveHost releases host in scheduler.
LeaveHost(context.Context, *LeaveHostRequest) (*emptypb.Empty, error)
}
// UnimplementedSchedulerServer can be embedded to have forward compatible implementations.
@ -2427,17 +2330,14 @@ func (*UnimplementedSchedulerServer) StatPeer(context.Context, *StatPeerRequest)
func (*UnimplementedSchedulerServer) LeavePeer(context.Context, *LeavePeerRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method LeavePeer not implemented")
}
func (*UnimplementedSchedulerServer) LeavePeers(context.Context, *LeavePeersRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method LeavePeers not implemented")
}
func (*UnimplementedSchedulerServer) ExchangePeer(context.Context, *ExchangePeerRequest) (*ExchangePeerResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ExchangePeer not implemented")
}
func (*UnimplementedSchedulerServer) StatTask(context.Context, *StatTaskRequest) (*Task, error) {
return nil, status.Errorf(codes.Unimplemented, "method StatTask not implemented")
}
func (*UnimplementedSchedulerServer) LeaveTask(context.Context, *LeaveTaskRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method LeaveTask not implemented")
func (*UnimplementedSchedulerServer) LeaveHost(context.Context, *LeaveHostRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method LeaveHost not implemented")
}
func RegisterSchedulerServer(s *grpc.Server, srv SchedulerServer) {
@ -2506,24 +2406,6 @@ func _Scheduler_LeavePeer_Handler(srv interface{}, ctx context.Context, dec func
return interceptor(ctx, in, info, handler)
}
func _Scheduler_LeavePeers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(LeavePeersRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SchedulerServer).LeavePeers(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/scheduler.Scheduler/LeavePeers",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SchedulerServer).LeavePeers(ctx, req.(*LeavePeersRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Scheduler_ExchangePeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ExchangePeerRequest)
if err := dec(in); err != nil {
@ -2560,20 +2442,20 @@ func _Scheduler_StatTask_Handler(srv interface{}, ctx context.Context, dec func(
return interceptor(ctx, in, info, handler)
}
func _Scheduler_LeaveTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(LeaveTaskRequest)
func _Scheduler_LeaveHost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(LeaveHostRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SchedulerServer).LeaveTask(ctx, in)
return srv.(SchedulerServer).LeaveHost(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/scheduler.Scheduler/LeaveTask",
FullMethod: "/scheduler.Scheduler/LeaveHost",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SchedulerServer).LeaveTask(ctx, req.(*LeaveTaskRequest))
return srv.(SchedulerServer).LeaveHost(ctx, req.(*LeaveHostRequest))
}
return interceptor(ctx, in, info, handler)
}
@ -2590,10 +2472,6 @@ var _Scheduler_serviceDesc = grpc.ServiceDesc{
MethodName: "LeavePeer",
Handler: _Scheduler_LeavePeer_Handler,
},
{
MethodName: "LeavePeers",
Handler: _Scheduler_LeavePeers_Handler,
},
{
MethodName: "ExchangePeer",
Handler: _Scheduler_ExchangePeer_Handler,
@ -2603,8 +2481,8 @@ var _Scheduler_serviceDesc = grpc.ServiceDesc{
Handler: _Scheduler_StatTask_Handler,
},
{
MethodName: "LeaveTask",
Handler: _Scheduler_LeaveTask_Handler,
MethodName: "LeaveHost",
Handler: _Scheduler_LeaveHost_Handler,
},
},
Streams: []grpc.StreamDesc{

View File

@ -3097,20 +3097,9 @@ func (m *LeavePeerRequest) validate(all bool) error {
var errors []error
if utf8.RuneCountInString(m.GetTaskId()) < 1 {
if utf8.RuneCountInString(m.GetId()) < 1 {
err := LeavePeerRequestValidationError{
field: "TaskId",
reason: "value length must be at least 1 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if utf8.RuneCountInString(m.GetPeerId()) < 1 {
err := LeavePeerRequestValidationError{
field: "PeerId",
field: "Id",
reason: "value length must be at least 1 runes",
}
if !all {
@ -3197,119 +3186,6 @@ var _ interface {
ErrorName() string
} = LeavePeerRequestValidationError{}
// Validate checks the field values on LeavePeersRequest with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *LeavePeersRequest) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on LeavePeersRequest with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// LeavePeersRequestMultiError, or nil if none found.
func (m *LeavePeersRequest) ValidateAll() error {
return m.validate(true)
}
func (m *LeavePeersRequest) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if len(m.GetPeerIds()) < 1 {
err := LeavePeersRequestValidationError{
field: "PeerIds",
reason: "value must contain at least 1 item(s)",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(errors) > 0 {
return LeavePeersRequestMultiError(errors)
}
return nil
}
// LeavePeersRequestMultiError is an error wrapping multiple validation errors
// returned by LeavePeersRequest.ValidateAll() if the designated constraints
// aren't met.
type LeavePeersRequestMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m LeavePeersRequestMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m LeavePeersRequestMultiError) AllErrors() []error { return m }
// LeavePeersRequestValidationError is the validation error returned by
// LeavePeersRequest.Validate if the designated constraints aren't met.
type LeavePeersRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e LeavePeersRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e LeavePeersRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e LeavePeersRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e LeavePeersRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e LeavePeersRequestValidationError) ErrorName() string {
return "LeavePeersRequestValidationError"
}
// Error satisfies the builtin error interface
func (e LeavePeersRequestValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sLeavePeersRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = LeavePeersRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = LeavePeersRequestValidationError{}
// Validate checks the field values on StatTaskRequest with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
@ -3332,9 +3208,9 @@ func (m *StatTaskRequest) validate(all bool) error {
var errors []error
if utf8.RuneCountInString(m.GetTaskId()) < 1 {
if utf8.RuneCountInString(m.GetId()) < 1 {
err := StatTaskRequestValidationError{
field: "TaskId",
field: "Id",
reason: "value length must be at least 1 runes",
}
if !all {
@ -3421,31 +3297,31 @@ var _ interface {
ErrorName() string
} = StatTaskRequestValidationError{}
// Validate checks the field values on LeaveTaskRequest with the rules defined
// Validate checks the field values on LeaveHostRequest with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *LeaveTaskRequest) Validate() error {
func (m *LeaveHostRequest) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on LeaveTaskRequest with the rules
// ValidateAll checks the field values on LeaveHostRequest with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// LeaveTaskRequestMultiError, or nil if none found.
func (m *LeaveTaskRequest) ValidateAll() error {
// LeaveHostRequestMultiError, or nil if none found.
func (m *LeaveHostRequest) ValidateAll() error {
return m.validate(true)
}
func (m *LeaveTaskRequest) validate(all bool) error {
func (m *LeaveHostRequest) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if utf8.RuneCountInString(m.GetTaskId()) < 1 {
err := LeaveTaskRequestValidationError{
field: "TaskId",
if utf8.RuneCountInString(m.GetId()) < 1 {
err := LeaveHostRequestValidationError{
field: "Id",
reason: "value length must be at least 1 runes",
}
if !all {
@ -3455,19 +3331,19 @@ func (m *LeaveTaskRequest) validate(all bool) error {
}
if len(errors) > 0 {
return LeaveTaskRequestMultiError(errors)
return LeaveHostRequestMultiError(errors)
}
return nil
}
// LeaveTaskRequestMultiError is an error wrapping multiple validation errors
// returned by LeaveTaskRequest.ValidateAll() if the designated constraints
// LeaveHostRequestMultiError is an error wrapping multiple validation errors
// returned by LeaveHostRequest.ValidateAll() if the designated constraints
// aren't met.
type LeaveTaskRequestMultiError []error
type LeaveHostRequestMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m LeaveTaskRequestMultiError) Error() string {
func (m LeaveHostRequestMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
@ -3476,11 +3352,11 @@ func (m LeaveTaskRequestMultiError) Error() string {
}
// AllErrors returns a list of validation violation errors.
func (m LeaveTaskRequestMultiError) AllErrors() []error { return m }
func (m LeaveHostRequestMultiError) AllErrors() []error { return m }
// LeaveTaskRequestValidationError is the validation error returned by
// LeaveTaskRequest.Validate if the designated constraints aren't met.
type LeaveTaskRequestValidationError struct {
// LeaveHostRequestValidationError is the validation error returned by
// LeaveHostRequest.Validate if the designated constraints aren't met.
type LeaveHostRequestValidationError struct {
field string
reason string
cause error
@ -3488,22 +3364,22 @@ type LeaveTaskRequestValidationError struct {
}
// Field function returns field value.
func (e LeaveTaskRequestValidationError) Field() string { return e.field }
func (e LeaveHostRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e LeaveTaskRequestValidationError) Reason() string { return e.reason }
func (e LeaveHostRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e LeaveTaskRequestValidationError) Cause() error { return e.cause }
func (e LeaveHostRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e LeaveTaskRequestValidationError) Key() bool { return e.key }
func (e LeaveHostRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e LeaveTaskRequestValidationError) ErrorName() string { return "LeaveTaskRequestValidationError" }
func (e LeaveHostRequestValidationError) ErrorName() string { return "LeaveHostRequestValidationError" }
// Error satisfies the builtin error interface
func (e LeaveTaskRequestValidationError) Error() string {
func (e LeaveHostRequestValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
@ -3515,14 +3391,14 @@ func (e LeaveTaskRequestValidationError) Error() string {
}
return fmt.Sprintf(
"invalid %sLeaveTaskRequest.%s: %s%s",
"invalid %sLeaveHostRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = LeaveTaskRequestValidationError{}
var _ error = LeaveHostRequestValidationError{}
var _ interface {
Field() string
@ -3530,4 +3406,4 @@ var _ interface {
Key() bool
Cause() error
ErrorName() string
} = LeaveTaskRequestValidationError{}
} = LeaveHostRequestValidationError{}

View File

@ -213,28 +213,20 @@ message ExchangePeerResponse{
// LeavePeerRequest represents request of LeavePeer.
message LeavePeerRequest{
// Task id.
string task_id = 1 [(validate.rules).string.min_len = 1];
// Peer id.
string peer_id = 2 [(validate.rules).string.min_len = 1];
}
// LeavePeersRequest represents request of LeavePeers.
message LeavePeersRequest{
// Peer ids.
repeated string peer_ids = 1 [(validate.rules).repeated = {min_items: 1}];
string id = 1 [(validate.rules).string.min_len = 1];
}
// StatTaskRequest represents request of StatTask.
message StatTaskRequest{
// Task id.
string task_id = 1 [(validate.rules).string.min_len = 1];
string id = 1 [(validate.rules).string.min_len = 1];
}
// LeaveTaskRequest represents request of LeaveTask.
message LeaveTaskRequest{
// Task id.
string task_id = 1 [(validate.rules).string.min_len = 1];
// LeaveHostRequest represents request of LeaveHost.
message LeaveHostRequest{
// Host id.
string id = 1 [(validate.rules).string.min_len = 1];
}
// Scheduler RPC Service.
@ -248,9 +240,6 @@ service Scheduler{
// LeavePeer releases peer in scheduler.
rpc LeavePeer(LeavePeerRequest)returns(google.protobuf.Empty);
// LeavePeers releases peers in scheduler.
rpc LeavePeers(LeavePeersRequest)returns(google.protobuf.Empty);
// TODO exchange peer api definition.
// ExchangePeer exchanges peer information.
rpc ExchangePeer(ExchangePeerRequest)returns(ExchangePeerResponse);
@ -258,6 +247,6 @@ service Scheduler{
// Checks information of task.
rpc StatTask(StatTaskRequest)returns(Task);
// LeaveTask releases task in scheduler.
rpc LeaveTask(LeaveTaskRequest)returns(google.protobuf.Empty);
// LeaveHost releases host in scheduler.
rpc LeaveHost(LeaveHostRequest)returns(google.protobuf.Empty);
}