dragonfly/pkg/rpc/scheduler/scheduler.pb.go

1507 lines
54 KiB
Go

//
// Copyright 2020 The Dragonfly Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1
// protoc v3.18.1
// source: pkg/rpc/scheduler/scheduler.proto
package scheduler
import (
context "context"
base "d7y.io/dragonfly/v2/pkg/rpc/base"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
emptypb "google.golang.org/protobuf/types/known/emptypb"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type PeerTaskRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// universal resource locator for different kind of storage
Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
// url meta info
UrlMeta *base.UrlMeta `protobuf:"bytes,2,opt,name=url_meta,json=urlMeta,proto3" json:"url_meta,omitempty"`
// peer's id and must be global uniqueness
PeerId string `protobuf:"bytes,3,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
// peer host info
PeerHost *PeerHost `protobuf:"bytes,4,opt,name=peer_host,json=peerHost,proto3" json:"peer_host,omitempty"`
// current host load
HostLoad *base.HostLoad `protobuf:"bytes,5,opt,name=host_load,json=hostLoad,proto3" json:"host_load,omitempty"`
// whether this request is caused by migration
IsMigrating bool `protobuf:"varint,6,opt,name=is_migrating,json=isMigrating,proto3" json:"is_migrating,omitempty"`
}
func (x *PeerTaskRequest) Reset() {
*x = PeerTaskRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PeerTaskRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PeerTaskRequest) ProtoMessage() {}
func (x *PeerTaskRequest) ProtoReflect() protoreflect.Message {
mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[0]
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 PeerTaskRequest.ProtoReflect.Descriptor instead.
func (*PeerTaskRequest) Descriptor() ([]byte, []int) {
return file_pkg_rpc_scheduler_scheduler_proto_rawDescGZIP(), []int{0}
}
func (x *PeerTaskRequest) GetUrl() string {
if x != nil {
return x.Url
}
return ""
}
func (x *PeerTaskRequest) GetUrlMeta() *base.UrlMeta {
if x != nil {
return x.UrlMeta
}
return nil
}
func (x *PeerTaskRequest) GetPeerId() string {
if x != nil {
return x.PeerId
}
return ""
}
func (x *PeerTaskRequest) GetPeerHost() *PeerHost {
if x != nil {
return x.PeerHost
}
return nil
}
func (x *PeerTaskRequest) GetHostLoad() *base.HostLoad {
if x != nil {
return x.HostLoad
}
return nil
}
func (x *PeerTaskRequest) GetIsMigrating() bool {
if x != nil {
return x.IsMigrating
}
return false
}
type RegisterResult struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// task id
TaskId string `protobuf:"bytes,2,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
// file content length scope for the url
SizeScope base.SizeScope `protobuf:"varint,3,opt,name=size_scope,json=sizeScope,proto3,enum=base.SizeScope" json:"size_scope,omitempty"`
// download the only piece directly for small or tiny file
//
// Types that are assignable to DirectPiece:
// *RegisterResult_SinglePiece
// *RegisterResult_PieceContent
DirectPiece isRegisterResult_DirectPiece `protobuf_oneof:"direct_piece"`
}
func (x *RegisterResult) Reset() {
*x = RegisterResult{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RegisterResult) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RegisterResult) ProtoMessage() {}
func (x *RegisterResult) ProtoReflect() protoreflect.Message {
mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[1]
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 RegisterResult.ProtoReflect.Descriptor instead.
func (*RegisterResult) Descriptor() ([]byte, []int) {
return file_pkg_rpc_scheduler_scheduler_proto_rawDescGZIP(), []int{1}
}
func (x *RegisterResult) GetTaskId() string {
if x != nil {
return x.TaskId
}
return ""
}
func (x *RegisterResult) GetSizeScope() base.SizeScope {
if x != nil {
return x.SizeScope
}
return base.SizeScope(0)
}
func (m *RegisterResult) GetDirectPiece() isRegisterResult_DirectPiece {
if m != nil {
return m.DirectPiece
}
return nil
}
func (x *RegisterResult) GetSinglePiece() *SinglePiece {
if x, ok := x.GetDirectPiece().(*RegisterResult_SinglePiece); ok {
return x.SinglePiece
}
return nil
}
func (x *RegisterResult) GetPieceContent() []byte {
if x, ok := x.GetDirectPiece().(*RegisterResult_PieceContent); ok {
return x.PieceContent
}
return nil
}
type isRegisterResult_DirectPiece interface {
isRegisterResult_DirectPiece()
}
type RegisterResult_SinglePiece struct {
// for small file
SinglePiece *SinglePiece `protobuf:"bytes,4,opt,name=single_piece,json=singlePiece,proto3,oneof"`
}
type RegisterResult_PieceContent struct {
// for tiny file
PieceContent []byte `protobuf:"bytes,5,opt,name=piece_content,json=pieceContent,proto3,oneof"`
}
func (*RegisterResult_SinglePiece) isRegisterResult_DirectPiece() {}
func (*RegisterResult_PieceContent) isRegisterResult_DirectPiece() {}
type SinglePiece struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// destination peer id
DstPid string `protobuf:"bytes,1,opt,name=dst_pid,json=dstPid,proto3" json:"dst_pid,omitempty"`
// download address(ip:port)
DstAddr string `protobuf:"bytes,2,opt,name=dst_addr,json=dstAddr,proto3" json:"dst_addr,omitempty"`
// one piece info
PieceInfo *base.PieceInfo `protobuf:"bytes,3,opt,name=piece_info,json=pieceInfo,proto3" json:"piece_info,omitempty"`
}
func (x *SinglePiece) Reset() {
*x = SinglePiece{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SinglePiece) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SinglePiece) ProtoMessage() {}
func (x *SinglePiece) ProtoReflect() protoreflect.Message {
mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[2]
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 SinglePiece.ProtoReflect.Descriptor instead.
func (*SinglePiece) Descriptor() ([]byte, []int) {
return file_pkg_rpc_scheduler_scheduler_proto_rawDescGZIP(), []int{2}
}
func (x *SinglePiece) GetDstPid() string {
if x != nil {
return x.DstPid
}
return ""
}
func (x *SinglePiece) GetDstAddr() string {
if x != nil {
return x.DstAddr
}
return ""
}
func (x *SinglePiece) GetPieceInfo() *base.PieceInfo {
if x != nil {
return x.PieceInfo
}
return nil
}
type PeerHost struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// each time the daemon starts, it will generate a different uuid
Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
// peer host ip
Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"`
// rpc service port for peer
RpcPort int32 `protobuf:"varint,3,opt,name=rpc_port,json=rpcPort,proto3" json:"rpc_port,omitempty"`
// piece downloading port for peer
DownPort int32 `protobuf:"varint,4,opt,name=down_port,json=downPort,proto3" json:"down_port,omitempty"`
// peer host name
HostName string `protobuf:"bytes,5,opt,name=host_name,json=hostName,proto3" json:"host_name,omitempty"`
// security isolation domain for network
SecurityDomain string `protobuf:"bytes,6,opt,name=security_domain,json=securityDomain,proto3" json:"security_domain,omitempty"`
// location path: area|country|province|city|...
Location string `protobuf:"bytes,7,opt,name=location,proto3" json:"location,omitempty"`
// idc where the peer host is located
Idc string `protobuf:"bytes,8,opt,name=idc,proto3" json:"idc,omitempty"`
// network device path: switch|router|...
NetTopology string `protobuf:"bytes,9,opt,name=net_topology,json=netTopology,proto3" json:"net_topology,omitempty"`
}
func (x *PeerHost) Reset() {
*x = PeerHost{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PeerHost) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PeerHost) ProtoMessage() {}
func (x *PeerHost) ProtoReflect() protoreflect.Message {
mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[3]
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 PeerHost.ProtoReflect.Descriptor instead.
func (*PeerHost) Descriptor() ([]byte, []int) {
return file_pkg_rpc_scheduler_scheduler_proto_rawDescGZIP(), []int{3}
}
func (x *PeerHost) GetUuid() string {
if x != nil {
return x.Uuid
}
return ""
}
func (x *PeerHost) GetIp() string {
if x != nil {
return x.Ip
}
return ""
}
func (x *PeerHost) GetRpcPort() int32 {
if x != nil {
return x.RpcPort
}
return 0
}
func (x *PeerHost) GetDownPort() int32 {
if x != nil {
return x.DownPort
}
return 0
}
func (x *PeerHost) GetHostName() string {
if x != nil {
return x.HostName
}
return ""
}
func (x *PeerHost) GetSecurityDomain() string {
if x != nil {
return x.SecurityDomain
}
return ""
}
func (x *PeerHost) GetLocation() string {
if x != nil {
return x.Location
}
return ""
}
func (x *PeerHost) GetIdc() string {
if x != nil {
return x.Idc
}
return ""
}
func (x *PeerHost) GetNetTopology() string {
if x != nil {
return x.NetTopology
}
return ""
}
type PieceResult 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"`
// source peer id
SrcPid string `protobuf:"bytes,2,opt,name=src_pid,json=srcPid,proto3" json:"src_pid,omitempty"`
// dest peer id
DstPid string `protobuf:"bytes,3,opt,name=dst_pid,json=dstPid,proto3" json:"dst_pid,omitempty"`
// piece info
PieceInfo *base.PieceInfo `protobuf:"bytes,4,opt,name=piece_info,json=pieceInfo,proto3" json:"piece_info,omitempty"`
// begin time for the piece downloading
BeginTime uint64 `protobuf:"varint,5,opt,name=begin_time,json=beginTime,proto3" json:"begin_time,omitempty"`
// end time for the piece downloading
EndTime uint64 `protobuf:"varint,6,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"`
// whether the piece downloading is successfully
Success bool `protobuf:"varint,7,opt,name=success,proto3" json:"success,omitempty"`
// result code
Code base.Code `protobuf:"varint,8,opt,name=code,proto3,enum=base.Code" json:"code,omitempty"`
// current host resource usage
HostLoad *base.HostLoad `protobuf:"bytes,9,opt,name=host_load,json=hostLoad,proto3" json:"host_load,omitempty"`
// currently completed piece count, -1 represent download failed
FinishedCount int32 `protobuf:"varint,10,opt,name=finished_count,json=finishedCount,proto3" json:"finished_count,omitempty"`
}
func (x *PieceResult) Reset() {
*x = PieceResult{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PieceResult) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PieceResult) ProtoMessage() {}
func (x *PieceResult) ProtoReflect() protoreflect.Message {
mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[4]
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 PieceResult.ProtoReflect.Descriptor instead.
func (*PieceResult) Descriptor() ([]byte, []int) {
return file_pkg_rpc_scheduler_scheduler_proto_rawDescGZIP(), []int{4}
}
func (x *PieceResult) GetTaskId() string {
if x != nil {
return x.TaskId
}
return ""
}
func (x *PieceResult) GetSrcPid() string {
if x != nil {
return x.SrcPid
}
return ""
}
func (x *PieceResult) GetDstPid() string {
if x != nil {
return x.DstPid
}
return ""
}
func (x *PieceResult) GetPieceInfo() *base.PieceInfo {
if x != nil {
return x.PieceInfo
}
return nil
}
func (x *PieceResult) GetBeginTime() uint64 {
if x != nil {
return x.BeginTime
}
return 0
}
func (x *PieceResult) GetEndTime() uint64 {
if x != nil {
return x.EndTime
}
return 0
}
func (x *PieceResult) GetSuccess() bool {
if x != nil {
return x.Success
}
return false
}
func (x *PieceResult) GetCode() base.Code {
if x != nil {
return x.Code
}
return base.Code(0)
}
func (x *PieceResult) GetHostLoad() *base.HostLoad {
if x != nil {
return x.HostLoad
}
return nil
}
func (x *PieceResult) GetFinishedCount() int32 {
if x != nil {
return x.FinishedCount
}
return 0
}
type PeerPacket struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
TaskId string `protobuf:"bytes,2,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
// source peer id
SrcPid string `protobuf:"bytes,3,opt,name=src_pid,json=srcPid,proto3" json:"src_pid,omitempty"`
// concurrent downloading count from main peer
ParallelCount int32 `protobuf:"varint,4,opt,name=parallel_count,json=parallelCount,proto3" json:"parallel_count,omitempty"`
MainPeer *PeerPacket_DestPeer `protobuf:"bytes,5,opt,name=main_peer,json=mainPeer,proto3" json:"main_peer,omitempty"`
StealPeers []*PeerPacket_DestPeer `protobuf:"bytes,6,rep,name=steal_peers,json=stealPeers,proto3" json:"steal_peers,omitempty"`
// result code
Code base.Code `protobuf:"varint,7,opt,name=code,proto3,enum=base.Code" json:"code,omitempty"`
}
func (x *PeerPacket) Reset() {
*x = PeerPacket{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PeerPacket) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PeerPacket) ProtoMessage() {}
func (x *PeerPacket) ProtoReflect() protoreflect.Message {
mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[5]
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 PeerPacket.ProtoReflect.Descriptor instead.
func (*PeerPacket) Descriptor() ([]byte, []int) {
return file_pkg_rpc_scheduler_scheduler_proto_rawDescGZIP(), []int{5}
}
func (x *PeerPacket) GetTaskId() string {
if x != nil {
return x.TaskId
}
return ""
}
func (x *PeerPacket) GetSrcPid() string {
if x != nil {
return x.SrcPid
}
return ""
}
func (x *PeerPacket) GetParallelCount() int32 {
if x != nil {
return x.ParallelCount
}
return 0
}
func (x *PeerPacket) GetMainPeer() *PeerPacket_DestPeer {
if x != nil {
return x.MainPeer
}
return nil
}
func (x *PeerPacket) GetStealPeers() []*PeerPacket_DestPeer {
if x != nil {
return x.StealPeers
}
return nil
}
func (x *PeerPacket) GetCode() base.Code {
if x != nil {
return x.Code
}
return base.Code(0)
}
type PeerResult struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
PeerId string `protobuf:"bytes,2,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
SrcIp string `protobuf:"bytes,3,opt,name=src_ip,json=srcIp,proto3" json:"src_ip,omitempty"`
SecurityDomain string `protobuf:"bytes,4,opt,name=security_domain,json=securityDomain,proto3" json:"security_domain,omitempty"`
Idc string `protobuf:"bytes,5,opt,name=idc,proto3" json:"idc,omitempty"`
Url string `protobuf:"bytes,6,opt,name=url,proto3" json:"url,omitempty"`
// total content length(byte)
ContentLength int64 `protobuf:"varint,7,opt,name=content_length,json=contentLength,proto3" json:"content_length,omitempty"`
// total network traffic(byte)
Traffic uint64 `protobuf:"varint,8,opt,name=traffic,proto3" json:"traffic,omitempty"`
// total time(millisecond) consumed
Cost uint32 `protobuf:"varint,9,opt,name=cost,proto3" json:"cost,omitempty"`
// whether peer downloading file is successfully
Success bool `protobuf:"varint,10,opt,name=success,proto3" json:"success,omitempty"`
// result code
Code base.Code `protobuf:"varint,11,opt,name=code,proto3,enum=base.Code" json:"code,omitempty"`
// -1 represent task is running or download failed
TotalPieceCount int32 `protobuf:"varint,12,opt,name=total_piece_count,json=totalPieceCount,proto3" json:"total_piece_count,omitempty"`
}
func (x *PeerResult) Reset() {
*x = PeerResult{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PeerResult) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PeerResult) ProtoMessage() {}
func (x *PeerResult) ProtoReflect() protoreflect.Message {
mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[6]
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 PeerResult.ProtoReflect.Descriptor instead.
func (*PeerResult) Descriptor() ([]byte, []int) {
return file_pkg_rpc_scheduler_scheduler_proto_rawDescGZIP(), []int{6}
}
func (x *PeerResult) GetTaskId() string {
if x != nil {
return x.TaskId
}
return ""
}
func (x *PeerResult) GetPeerId() string {
if x != nil {
return x.PeerId
}
return ""
}
func (x *PeerResult) GetSrcIp() string {
if x != nil {
return x.SrcIp
}
return ""
}
func (x *PeerResult) GetSecurityDomain() string {
if x != nil {
return x.SecurityDomain
}
return ""
}
func (x *PeerResult) GetIdc() string {
if x != nil {
return x.Idc
}
return ""
}
func (x *PeerResult) GetUrl() string {
if x != nil {
return x.Url
}
return ""
}
func (x *PeerResult) GetContentLength() int64 {
if x != nil {
return x.ContentLength
}
return 0
}
func (x *PeerResult) GetTraffic() uint64 {
if x != nil {
return x.Traffic
}
return 0
}
func (x *PeerResult) GetCost() uint32 {
if x != nil {
return x.Cost
}
return 0
}
func (x *PeerResult) GetSuccess() bool {
if x != nil {
return x.Success
}
return false
}
func (x *PeerResult) GetCode() base.Code {
if x != nil {
return x.Code
}
return base.Code(0)
}
func (x *PeerResult) GetTotalPieceCount() int32 {
if x != nil {
return x.TotalPieceCount
}
return 0
}
type PeerTarget struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
PeerId string `protobuf:"bytes,2,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
}
func (x *PeerTarget) Reset() {
*x = PeerTarget{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PeerTarget) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PeerTarget) ProtoMessage() {}
func (x *PeerTarget) ProtoReflect() protoreflect.Message {
mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[7]
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 PeerTarget.ProtoReflect.Descriptor instead.
func (*PeerTarget) Descriptor() ([]byte, []int) {
return file_pkg_rpc_scheduler_scheduler_proto_rawDescGZIP(), []int{7}
}
func (x *PeerTarget) GetTaskId() string {
if x != nil {
return x.TaskId
}
return ""
}
func (x *PeerTarget) GetPeerId() string {
if x != nil {
return x.PeerId
}
return ""
}
type PeerPacket_DestPeer struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// dest ip
Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"`
// rpc service port for dest peer
RpcPort int32 `protobuf:"varint,2,opt,name=rpc_port,json=rpcPort,proto3" json:"rpc_port,omitempty"`
// dest peer id
PeerId string `protobuf:"bytes,3,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
}
func (x *PeerPacket_DestPeer) Reset() {
*x = PeerPacket_DestPeer{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PeerPacket_DestPeer) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PeerPacket_DestPeer) ProtoMessage() {}
func (x *PeerPacket_DestPeer) ProtoReflect() protoreflect.Message {
mi := &file_pkg_rpc_scheduler_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 PeerPacket_DestPeer.ProtoReflect.Descriptor instead.
func (*PeerPacket_DestPeer) Descriptor() ([]byte, []int) {
return file_pkg_rpc_scheduler_scheduler_proto_rawDescGZIP(), []int{5, 0}
}
func (x *PeerPacket_DestPeer) GetIp() string {
if x != nil {
return x.Ip
}
return ""
}
func (x *PeerPacket_DestPeer) GetRpcPort() int32 {
if x != nil {
return x.RpcPort
}
return 0
}
func (x *PeerPacket_DestPeer) GetPeerId() string {
if x != nil {
return x.PeerId
}
return ""
}
var File_pkg_rpc_scheduler_scheduler_proto protoreflect.FileDescriptor
var file_pkg_rpc_scheduler_scheduler_proto_rawDesc = []byte{
0x0a, 0x21, 0x70, 0x6b, 0x67, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75,
0x6c, 0x65, 0x72, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x12, 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x1a, 0x17,
0x70, 0x6b, 0x67, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x62, 0x61, 0x73,
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74,
0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x85, 0x02,
0x0a, 0x0f, 0x50, 0x65, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x1a, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08,
0xfa, 0x42, 0x05, 0x72, 0x03, 0x88, 0x01, 0x01, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x32, 0x0a,
0x08, 0x75, 0x72, 0x6c, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x0d, 0x2e, 0x62, 0x61, 0x73, 0x65, 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, 0x20, 0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x70, 0x65, 0x65,
0x72, 0x49, 0x64, 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, 0x2b, 0x0a, 0x09, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x6c, 0x6f,
0x61, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e,
0x48, 0x6f, 0x73, 0x74, 0x4c, 0x6f, 0x61, 0x64, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x4c, 0x6f,
0x61, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69,
0x6e, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x4d, 0x69, 0x67, 0x72,
0x61, 0x74, 0x69, 0x6e, 0x67, 0x22, 0xe0, 0x01, 0x0a, 0x0e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74,
0x65, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b,
0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02,
0x10, 0x01, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x38, 0x0a, 0x0a, 0x73, 0x69,
0x7a, 0x65, 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f,
0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x53, 0x69, 0x7a, 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x42,
0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x09, 0x73, 0x69, 0x7a, 0x65, 0x53,
0x63, 0x6f, 0x70, 0x65, 0x12, 0x3b, 0x0a, 0x0c, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x5f, 0x70,
0x69, 0x65, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x63, 0x68,
0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x50, 0x69, 0x65,
0x63, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x50, 0x69, 0x65, 0x63,
0x65, 0x12, 0x25, 0x0a, 0x0d, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65,
0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0c, 0x70, 0x69, 0x65, 0x63,
0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x42, 0x0e, 0x0a, 0x0c, 0x64, 0x69, 0x72, 0x65,
0x63, 0x74, 0x5f, 0x70, 0x69, 0x65, 0x63, 0x65, 0x22, 0x83, 0x01, 0x0a, 0x0b, 0x53, 0x69, 0x6e,
0x67, 0x6c, 0x65, 0x50, 0x69, 0x65, 0x63, 0x65, 0x12, 0x20, 0x0a, 0x07, 0x64, 0x73, 0x74, 0x5f,
0x70, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02,
0x10, 0x01, 0x52, 0x06, 0x64, 0x73, 0x74, 0x50, 0x69, 0x64, 0x12, 0x22, 0x0a, 0x08, 0x64, 0x73,
0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42,
0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x64, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x12, 0x2e,
0x0a, 0x0a, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x49,
0x6e, 0x66, 0x6f, 0x52, 0x09, 0x70, 0x69, 0x65, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0xb5,
0x02, 0x0a, 0x08, 0x50, 0x65, 0x65, 0x72, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x04, 0x75,
0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03,
0xb0, 0x01, 0x01, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x70, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x70, 0x01, 0x52, 0x02,
0x69, 0x70, 0x12, 0x27, 0x0a, 0x08, 0x72, 0x70, 0x63, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03,
0x20, 0x01, 0x28, 0x05, 0x42, 0x0c, 0xfa, 0x42, 0x09, 0x1a, 0x07, 0x10, 0xff, 0xff, 0x03, 0x28,
0x80, 0x08, 0x52, 0x07, 0x72, 0x70, 0x63, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x29, 0x0a, 0x09, 0x64,
0x6f, 0x77, 0x6e, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0c,
0xfa, 0x42, 0x09, 0x1a, 0x07, 0x10, 0xff, 0xff, 0x03, 0x28, 0x80, 0x08, 0x52, 0x08, 0x64, 0x6f,
0x77, 0x6e, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x24, 0x0a, 0x09, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x6e,
0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02,
0x68, 0x01, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f,
0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18,
0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x44,
0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x63, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
0x69, 0x64, 0x63, 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x65, 0x74, 0x5f, 0x74, 0x6f, 0x70, 0x6f, 0x6c,
0x6f, 0x67, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x65, 0x74, 0x54, 0x6f,
0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x22, 0xe2, 0x02, 0x0a, 0x0b, 0x50, 0x69, 0x65, 0x63, 0x65,
0x52, 0x65, 0x73, 0x75, 0x6c, 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, 0x73, 0x72, 0x63, 0x5f,
0x70, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02,
0x10, 0x01, 0x52, 0x06, 0x73, 0x72, 0x63, 0x50, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x73,
0x74, 0x5f, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x73, 0x74,
0x50, 0x69, 0x64, 0x12, 0x2e, 0x0a, 0x0a, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x69, 0x6e, 0x66,
0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x50,
0x69, 0x65, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x70, 0x69, 0x65, 0x63, 0x65, 0x49,
0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x5f, 0x74, 0x69, 0x6d,
0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x54, 0x69,
0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06,
0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a,
0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07,
0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18,
0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x43, 0x6f, 0x64,
0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x2b, 0x0a, 0x09, 0x68, 0x6f, 0x73, 0x74, 0x5f,
0x6c, 0x6f, 0x61, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x62, 0x61, 0x73,
0x65, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x4c, 0x6f, 0x61, 0x64, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74,
0x4c, 0x6f, 0x61, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64,
0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x66, 0x69,
0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x8e, 0x03, 0x0a, 0x0a,
0x50, 0x65, 0x65, 0x72, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x74, 0x61,
0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 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,
0x73, 0x72, 0x63, 0x5f, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa,
0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x73, 0x72, 0x63, 0x50, 0x69, 0x64, 0x12, 0x2e,
0x0a, 0x0e, 0x70, 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74,
0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x1a, 0x02, 0x28, 0x01, 0x52,
0x0d, 0x70, 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3b,
0x0a, 0x09, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x50, 0x65,
0x65, 0x72, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x44, 0x65, 0x73, 0x74, 0x50, 0x65, 0x65,
0x72, 0x52, 0x08, 0x6d, 0x61, 0x69, 0x6e, 0x50, 0x65, 0x65, 0x72, 0x12, 0x3f, 0x0a, 0x0b, 0x73,
0x74, 0x65, 0x61, 0x6c, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x1e, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x50, 0x65, 0x65,
0x72, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x44, 0x65, 0x73, 0x74, 0x50, 0x65, 0x65, 0x72,
0x52, 0x0a, 0x73, 0x74, 0x65, 0x61, 0x6c, 0x50, 0x65, 0x65, 0x72, 0x73, 0x12, 0x1e, 0x0a, 0x04,
0x63, 0x6f, 0x64, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x62, 0x61, 0x73,
0x65, 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x1a, 0x6e, 0x0a, 0x08,
0x44, 0x65, 0x73, 0x74, 0x50, 0x65, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x70, 0x01, 0x52, 0x02, 0x69,
0x70, 0x12, 0x27, 0x0a, 0x08, 0x72, 0x70, 0x63, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20,
0x01, 0x28, 0x05, 0x42, 0x0c, 0xfa, 0x42, 0x09, 0x1a, 0x07, 0x10, 0xff, 0xff, 0x03, 0x28, 0x80,
0x08, 0x52, 0x07, 0x72, 0x70, 0x63, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x70, 0x65,
0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04,
0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x22, 0x82, 0x03, 0x0a,
0x0a, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 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, 0x12,
0x1e, 0x0a, 0x06, 0x73, 0x72, 0x63, 0x5f, 0x69, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42,
0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x70, 0x01, 0x52, 0x05, 0x73, 0x72, 0x63, 0x49, 0x70, 0x12,
0x27, 0x0a, 0x0f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x64, 0x6f, 0x6d, 0x61,
0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69,
0x74, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x63, 0x18,
0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x69, 0x64, 0x63, 0x12, 0x1a, 0x0a, 0x03, 0x75, 0x72,
0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0x88, 0x01,
0x01, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
0x74, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d,
0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x18, 0x0a,
0x07, 0x74, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07,
0x74, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x73, 0x74, 0x18,
0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73,
0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75,
0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x0b, 0x20,
0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x52,
0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x70,
0x69, 0x65, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05,
0x52, 0x0f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x50, 0x69, 0x65, 0x63, 0x65, 0x43, 0x6f, 0x75, 0x6e,
0x74, 0x22, 0x50, 0x0a, 0x0a, 0x50, 0x65, 0x65, 0x72, 0x54, 0x61, 0x72, 0x67, 0x65, 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, 0x32, 0x9d, 0x02, 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, 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, 0x42, 0x27, 0x5a, 0x25, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x64, 0x72,
0x61, 0x67, 0x6f, 0x6e, 0x66, 0x6c, 0x79, 0x2f, 0x76, 0x32, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x72,
0x70, 0x63, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}
var (
file_pkg_rpc_scheduler_scheduler_proto_rawDescOnce sync.Once
file_pkg_rpc_scheduler_scheduler_proto_rawDescData = file_pkg_rpc_scheduler_scheduler_proto_rawDesc
)
func file_pkg_rpc_scheduler_scheduler_proto_rawDescGZIP() []byte {
file_pkg_rpc_scheduler_scheduler_proto_rawDescOnce.Do(func() {
file_pkg_rpc_scheduler_scheduler_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_rpc_scheduler_scheduler_proto_rawDescData)
})
return file_pkg_rpc_scheduler_scheduler_proto_rawDescData
}
var file_pkg_rpc_scheduler_scheduler_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
var file_pkg_rpc_scheduler_scheduler_proto_goTypes = []interface{}{
(*PeerTaskRequest)(nil), // 0: scheduler.PeerTaskRequest
(*RegisterResult)(nil), // 1: scheduler.RegisterResult
(*SinglePiece)(nil), // 2: scheduler.SinglePiece
(*PeerHost)(nil), // 3: scheduler.PeerHost
(*PieceResult)(nil), // 4: scheduler.PieceResult
(*PeerPacket)(nil), // 5: scheduler.PeerPacket
(*PeerResult)(nil), // 6: scheduler.PeerResult
(*PeerTarget)(nil), // 7: scheduler.PeerTarget
(*PeerPacket_DestPeer)(nil), // 8: scheduler.PeerPacket.DestPeer
(*base.UrlMeta)(nil), // 9: base.UrlMeta
(*base.HostLoad)(nil), // 10: base.HostLoad
(base.SizeScope)(0), // 11: base.SizeScope
(*base.PieceInfo)(nil), // 12: base.PieceInfo
(base.Code)(0), // 13: base.Code
(*emptypb.Empty)(nil), // 14: google.protobuf.Empty
}
var file_pkg_rpc_scheduler_scheduler_proto_depIdxs = []int32{
9, // 0: scheduler.PeerTaskRequest.url_meta:type_name -> base.UrlMeta
3, // 1: scheduler.PeerTaskRequest.peer_host:type_name -> scheduler.PeerHost
10, // 2: scheduler.PeerTaskRequest.host_load:type_name -> base.HostLoad
11, // 3: scheduler.RegisterResult.size_scope:type_name -> base.SizeScope
2, // 4: scheduler.RegisterResult.single_piece:type_name -> scheduler.SinglePiece
12, // 5: scheduler.SinglePiece.piece_info:type_name -> base.PieceInfo
12, // 6: scheduler.PieceResult.piece_info:type_name -> base.PieceInfo
13, // 7: scheduler.PieceResult.code:type_name -> base.Code
10, // 8: scheduler.PieceResult.host_load:type_name -> base.HostLoad
8, // 9: scheduler.PeerPacket.main_peer:type_name -> scheduler.PeerPacket.DestPeer
8, // 10: scheduler.PeerPacket.steal_peers:type_name -> scheduler.PeerPacket.DestPeer
13, // 11: scheduler.PeerPacket.code:type_name -> base.Code
13, // 12: scheduler.PeerResult.code:type_name -> base.Code
0, // 13: scheduler.Scheduler.RegisterPeerTask:input_type -> scheduler.PeerTaskRequest
4, // 14: scheduler.Scheduler.ReportPieceResult:input_type -> scheduler.PieceResult
6, // 15: scheduler.Scheduler.ReportPeerResult:input_type -> scheduler.PeerResult
7, // 16: scheduler.Scheduler.LeaveTask:input_type -> scheduler.PeerTarget
1, // 17: scheduler.Scheduler.RegisterPeerTask:output_type -> scheduler.RegisterResult
5, // 18: scheduler.Scheduler.ReportPieceResult:output_type -> scheduler.PeerPacket
14, // 19: scheduler.Scheduler.ReportPeerResult:output_type -> google.protobuf.Empty
14, // 20: scheduler.Scheduler.LeaveTask:output_type -> google.protobuf.Empty
17, // [17:21] is the sub-list for method output_type
13, // [13:17] is the sub-list for method input_type
13, // [13:13] is the sub-list for extension type_name
13, // [13:13] is the sub-list for extension extendee
0, // [0:13] is the sub-list for field type_name
}
func init() { file_pkg_rpc_scheduler_scheduler_proto_init() }
func file_pkg_rpc_scheduler_scheduler_proto_init() {
if File_pkg_rpc_scheduler_scheduler_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_pkg_rpc_scheduler_scheduler_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PeerTaskRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pkg_rpc_scheduler_scheduler_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RegisterResult); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pkg_rpc_scheduler_scheduler_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SinglePiece); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pkg_rpc_scheduler_scheduler_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PeerHost); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pkg_rpc_scheduler_scheduler_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PieceResult); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pkg_rpc_scheduler_scheduler_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PeerPacket); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pkg_rpc_scheduler_scheduler_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PeerResult); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pkg_rpc_scheduler_scheduler_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PeerTarget); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pkg_rpc_scheduler_scheduler_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PeerPacket_DestPeer); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
file_pkg_rpc_scheduler_scheduler_proto_msgTypes[1].OneofWrappers = []interface{}{
(*RegisterResult_SinglePiece)(nil),
(*RegisterResult_PieceContent)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_pkg_rpc_scheduler_scheduler_proto_rawDesc,
NumEnums: 0,
NumMessages: 9,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_pkg_rpc_scheduler_scheduler_proto_goTypes,
DependencyIndexes: file_pkg_rpc_scheduler_scheduler_proto_depIdxs,
MessageInfos: file_pkg_rpc_scheduler_scheduler_proto_msgTypes,
}.Build()
File_pkg_rpc_scheduler_scheduler_proto = out.File
file_pkg_rpc_scheduler_scheduler_proto_rawDesc = nil
file_pkg_rpc_scheduler_scheduler_proto_goTypes = nil
file_pkg_rpc_scheduler_scheduler_proto_depIdxs = nil
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConnInterface
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion6
// SchedulerClient is the client API for Scheduler service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type SchedulerClient interface {
// RegisterPeerTask registers a peer into one task.
RegisterPeerTask(ctx context.Context, in *PeerTaskRequest, opts ...grpc.CallOption) (*RegisterResult, error)
// ReportPieceResult reports piece results and receives peer packets.
// when migrating to another scheduler,
// it will send the last piece result to the new scheduler.
ReportPieceResult(ctx context.Context, opts ...grpc.CallOption) (Scheduler_ReportPieceResultClient, error)
// ReportPeerResult reports downloading result for the peer task.
ReportPeerResult(ctx context.Context, in *PeerResult, opts ...grpc.CallOption) (*emptypb.Empty, error)
// LeaveTask makes the peer leaving from scheduling overlay for the task.
LeaveTask(ctx context.Context, in *PeerTarget, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
type schedulerClient struct {
cc grpc.ClientConnInterface
}
func NewSchedulerClient(cc grpc.ClientConnInterface) SchedulerClient {
return &schedulerClient{cc}
}
func (c *schedulerClient) RegisterPeerTask(ctx context.Context, in *PeerTaskRequest, opts ...grpc.CallOption) (*RegisterResult, error) {
out := new(RegisterResult)
err := c.cc.Invoke(ctx, "/scheduler.Scheduler/RegisterPeerTask", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *schedulerClient) ReportPieceResult(ctx context.Context, opts ...grpc.CallOption) (Scheduler_ReportPieceResultClient, error) {
stream, err := c.cc.NewStream(ctx, &_Scheduler_serviceDesc.Streams[0], "/scheduler.Scheduler/ReportPieceResult", opts...)
if err != nil {
return nil, err
}
x := &schedulerReportPieceResultClient{stream}
return x, nil
}
type Scheduler_ReportPieceResultClient interface {
Send(*PieceResult) error
Recv() (*PeerPacket, error)
grpc.ClientStream
}
type schedulerReportPieceResultClient struct {
grpc.ClientStream
}
func (x *schedulerReportPieceResultClient) Send(m *PieceResult) error {
return x.ClientStream.SendMsg(m)
}
func (x *schedulerReportPieceResultClient) Recv() (*PeerPacket, error) {
m := new(PeerPacket)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *schedulerClient) ReportPeerResult(ctx context.Context, in *PeerResult, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/scheduler.Scheduler/ReportPeerResult", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *schedulerClient) LeaveTask(ctx context.Context, in *PeerTarget, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/scheduler.Scheduler/LeaveTask", 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 one task.
RegisterPeerTask(context.Context, *PeerTaskRequest) (*RegisterResult, error)
// ReportPieceResult reports piece results and receives peer packets.
// when migrating to another scheduler,
// it will send the last piece result to the new scheduler.
ReportPieceResult(Scheduler_ReportPieceResultServer) error
// ReportPeerResult reports downloading result for the peer task.
ReportPeerResult(context.Context, *PeerResult) (*emptypb.Empty, error)
// LeaveTask makes the peer leaving from scheduling overlay for the task.
LeaveTask(context.Context, *PeerTarget) (*emptypb.Empty, error)
}
// UnimplementedSchedulerServer can be embedded to have forward compatible implementations.
type UnimplementedSchedulerServer struct {
}
func (*UnimplementedSchedulerServer) RegisterPeerTask(context.Context, *PeerTaskRequest) (*RegisterResult, error) {
return nil, status.Errorf(codes.Unimplemented, "method RegisterPeerTask not implemented")
}
func (*UnimplementedSchedulerServer) ReportPieceResult(Scheduler_ReportPieceResultServer) error {
return status.Errorf(codes.Unimplemented, "method ReportPieceResult not implemented")
}
func (*UnimplementedSchedulerServer) ReportPeerResult(context.Context, *PeerResult) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method ReportPeerResult not implemented")
}
func (*UnimplementedSchedulerServer) LeaveTask(context.Context, *PeerTarget) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method LeaveTask not implemented")
}
func RegisterSchedulerServer(s *grpc.Server, srv SchedulerServer) {
s.RegisterService(&_Scheduler_serviceDesc, srv)
}
func _Scheduler_RegisterPeerTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PeerTaskRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SchedulerServer).RegisterPeerTask(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/scheduler.Scheduler/RegisterPeerTask",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SchedulerServer).RegisterPeerTask(ctx, req.(*PeerTaskRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Scheduler_ReportPieceResult_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(SchedulerServer).ReportPieceResult(&schedulerReportPieceResultServer{stream})
}
type Scheduler_ReportPieceResultServer interface {
Send(*PeerPacket) error
Recv() (*PieceResult, error)
grpc.ServerStream
}
type schedulerReportPieceResultServer struct {
grpc.ServerStream
}
func (x *schedulerReportPieceResultServer) Send(m *PeerPacket) error {
return x.ServerStream.SendMsg(m)
}
func (x *schedulerReportPieceResultServer) Recv() (*PieceResult, error) {
m := new(PieceResult)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func _Scheduler_ReportPeerResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PeerResult)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SchedulerServer).ReportPeerResult(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/scheduler.Scheduler/ReportPeerResult",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SchedulerServer).ReportPeerResult(ctx, req.(*PeerResult))
}
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(PeerTarget)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SchedulerServer).LeaveTask(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/scheduler.Scheduler/LeaveTask",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SchedulerServer).LeaveTask(ctx, req.(*PeerTarget))
}
return interceptor(ctx, in, info, handler)
}
var _Scheduler_serviceDesc = grpc.ServiceDesc{
ServiceName: "scheduler.Scheduler",
HandlerType: (*SchedulerServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "RegisterPeerTask",
Handler: _Scheduler_RegisterPeerTask_Handler,
},
{
MethodName: "ReportPeerResult",
Handler: _Scheduler_ReportPeerResult_Handler,
},
{
MethodName: "LeaveTask",
Handler: _Scheduler_LeaveTask_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "ReportPieceResult",
Handler: _Scheduler_ReportPieceResult_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "pkg/rpc/scheduler/scheduler.proto",
}