refactor: support multi digest not only md5 (#236)

Signed-off-by: zuozheng.hzz <zuozheng.hzz@alibaba-inc.com>
This commit is contained in:
加菲 2021-05-20 11:33:21 +08:00 committed by Gaius
parent f592032f72
commit 19e70ecce8
No known key found for this signature in database
GPG Key ID: 8B4E5D1290FA2FFB
11 changed files with 159 additions and 162 deletions

View File

@ -58,8 +58,8 @@ func constructRegisterRequest(req *cdnsystem.SeedRequest) (*types.TaskRegisterRe
meta := req.UrlMeta
header := make(map[string]string)
if meta != nil {
if !stringutils.IsBlank(meta.Md5) {
header["md5"] = meta.Md5
if !stringutils.IsBlank(meta.Digest) {
header["md5"] = meta.Digest
}
if !stringutils.IsBlank(meta.Range) {
header["range"] = meta.Range

View File

@ -332,8 +332,8 @@ func (pm *pieceManager) DownloadSource(ctx context.Context, pt PeerTask, request
reader := body.(io.Reader)
// calc total md5
if pm.calculateDigest && request.UrlMata.Md5 != "" {
reader = digestutils.NewDigestReader(body, request.UrlMata.Md5)
if pm.calculateDigest && request.UrlMata.Digest != "" {
reader = digestutils.NewDigestReader(body, request.UrlMata.Digest)
}
// 2. save to storage

View File

@ -182,13 +182,13 @@ func TestPieceManager_DownloadSource(t *testing.T) {
request := &scheduler.PeerTaskRequest{
Url: ts.URL,
UrlMata: &base.UrlMeta{
Md5: "",
Digest: "",
Range: "",
Header: nil,
},
}
if tc.checkDigest {
request.UrlMata.Md5 = digest
request.UrlMata.Digest = digest
}
err = pm.DownloadSource(context.Background(), mockPeerTask, request)

View File

@ -160,7 +160,7 @@ func (rt *transport) download(req *http.Request) (*http.Response, error) {
// Set meta range's value
if rg := req.Header.Get("Range"); len(rg) > 0 {
meta.Md5 = ""
meta.Digest = ""
meta.Range = rg
}

View File

@ -67,7 +67,7 @@ func Download(cfg *config.DfgetConfig, client dfclient.DaemonClient) error {
request := &dfdaemongrpc.DownRequest{
Url: cfg.URL,
UrlMeta: &base.UrlMeta{
Md5: cfg.Md5,
Digest: cfg.Digest,
Range: hdr[headers.Range],
Header: hdr,
},

View File

@ -38,8 +38,8 @@ func TaskID(url string, filter string, meta *base.UrlMeta, bizID string) string
data = append(data, urlutils.FilterURLParam(url, strings.Split(filter, "&")))
if meta != nil {
if meta.Md5 != "" {
data = append(data, meta.Md5)
if meta.Digest != "" {
data = append(data, meta.Digest)
}
if meta.Range != "" {

View File

@ -238,12 +238,12 @@ type UrlMeta struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// used as follows:
// format:md5:xxx or sha256:yyy, used as follows:
//
// 1. check whether downloaded content is consistent with the source file
//
// 2. generate different task ids for same url
Md5 string `protobuf:"bytes,1,opt,name=md5,proto3" json:"md5,omitempty"`
Digest string `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"`
// downloaded range for url
Range string `protobuf:"bytes,2,opt,name=range,proto3" json:"range,omitempty"`
// other attributes for url
@ -283,9 +283,9 @@ func (*UrlMeta) Descriptor() ([]byte, []int) {
return file_pkg_rpc_base_base_proto_rawDescGZIP(), []int{1}
}
func (x *UrlMeta) GetMd5() string {
func (x *UrlMeta) GetDigest() string {
if x != nil {
return x.Md5
return x.Digest
}
return ""
}
@ -645,71 +645,72 @@ var file_pkg_rpc_base_base_proto_rawDesc = []byte{
0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x62,
0x61, 0x73, 0x65, 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18,
0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x9f, 0x01, 0x0a, 0x07, 0x55, 0x72, 0x6c,
0x4d, 0x65, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x64, 0x35, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x03, 0x6d, 0x64, 0x35, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x31, 0x0a, 0x06,
0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x62,
0x61, 0x73, 0x65, 0x2e, 0x55, 0x72, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x2e, 0x48, 0x65, 0x61, 0x64,
0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a,
0x39, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10,
0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79,
0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x63, 0x0a, 0x08, 0x48, 0x6f,
0x73, 0x74, 0x4c, 0x6f, 0x61, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x70, 0x75, 0x5f, 0x72, 0x61,
0x74, 0x69, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x08, 0x63, 0x70, 0x75, 0x52, 0x61,
0x74, 0x69, 0x6f, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x65, 0x6d, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f,
0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x08, 0x6d, 0x65, 0x6d, 0x52, 0x61, 0x74, 0x69, 0x6f,
0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x69, 0x73, 0x6b, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x03,
0x20, 0x01, 0x28, 0x02, 0x52, 0x09, 0x64, 0x69, 0x73, 0x6b, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x22,
0x90, 0x01, 0x0a, 0x10, 0x50, 0x69, 0x65, 0x63, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x17, 0x0a,
0x07, 0x73, 0x72, 0x63, 0x5f, 0x70, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 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,
0x1b, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01,
0x28, 0x05, 0x52, 0x08, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x05,
0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d,
0x69, 0x74, 0x22, 0xdb, 0x01, 0x0a, 0x09, 0x50, 0x69, 0x65, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f,
0x12, 0x1b, 0x0a, 0x09, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20,
0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x69, 0x65, 0x63, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1f, 0x0a,
0x0b, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01,
0x28, 0x04, 0x52, 0x0a, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1d,
0x0a, 0x0a, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01,
0x28, 0x05, 0x52, 0x09, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1b, 0x0a,
0x09, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x6d, 0x64, 0x35, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,
0x52, 0x08, 0x70, 0x69, 0x65, 0x63, 0x65, 0x4d, 0x64, 0x35, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x69,
0x65, 0x63, 0x65, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04,
0x52, 0x0b, 0x70, 0x69, 0x65, 0x63, 0x65, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x31, 0x0a,
0x0b, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01,
0x28, 0x0e, 0x32, 0x10, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x53,
0x74, 0x79, 0x6c, 0x65, 0x52, 0x0a, 0x70, 0x69, 0x65, 0x63, 0x65, 0x53, 0x74, 0x79, 0x6c, 0x65,
0x22, 0xfa, 0x01, 0x0a, 0x0b, 0x50, 0x69, 0x65, 0x63, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74,
0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 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, 0x19, 0x0a, 0x08, 0x64, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x04,
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x12, 0x30, 0x0a,
0x0b, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x05, 0x20, 0x03,
0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x49,
0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x70, 0x69, 0x65, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x12,
0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x69, 0x65, 0x63, 0x65, 0x18, 0x06,
0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x50, 0x69, 0x65, 0x63, 0x65,
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, 0x24, 0x0a, 0x0e, 0x70, 0x69, 0x65, 0x63, 0x65,
0x5f, 0x6d, 0x64, 0x35, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0c, 0x70, 0x69, 0x65, 0x63, 0x65, 0x4d, 0x64, 0x35, 0x53, 0x69, 0x67, 0x6e, 0x2a, 0x19, 0x0a,
0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x11, 0x0a, 0x0d, 0x58, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45,
0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x2a, 0x17, 0x0a, 0x0a, 0x50, 0x69, 0x65, 0x63,
0x65, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x50, 0x4c, 0x41, 0x49, 0x4e, 0x10,
0x00, 0x2a, 0x2c, 0x0a, 0x09, 0x53, 0x69, 0x7a, 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x0a,
0x0a, 0x06, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x4d,
0x41, 0x4c, 0x4c, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x49, 0x4e, 0x59, 0x10, 0x02, 0x42,
0x22, 0x5a, 0x20, 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, 0x62,
0x61, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xa5, 0x01, 0x0a, 0x07, 0x55, 0x72, 0x6c,
0x4d, 0x65, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05,
0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x72, 0x61, 0x6e,
0x67, 0x65, 0x12, 0x31, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x03,
0x28, 0x0b, 0x32, 0x19, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x55, 0x72, 0x6c, 0x4d, 0x65, 0x74,
0x61, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x68,
0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x39, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45,
0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01,
0x22, 0x63, 0x0a, 0x08, 0x48, 0x6f, 0x73, 0x74, 0x4c, 0x6f, 0x61, 0x64, 0x12, 0x1b, 0x0a, 0x09,
0x63, 0x70, 0x75, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52,
0x08, 0x63, 0x70, 0x75, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x65, 0x6d,
0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x08, 0x6d, 0x65,
0x6d, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x69, 0x73, 0x6b, 0x5f, 0x72,
0x61, 0x74, 0x69, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x09, 0x64, 0x69, 0x73, 0x6b,
0x52, 0x61, 0x74, 0x69, 0x6f, 0x22, 0x90, 0x01, 0x0a, 0x10, 0x50, 0x69, 0x65, 0x63, 0x65, 0x54,
0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61,
0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73,
0x6b, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x72, 0x63, 0x5f, 0x70, 0x69, 0x64, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 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, 0x1b, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x6e,
0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4e,
0x75, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28,
0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0xdb, 0x01, 0x0a, 0x09, 0x50, 0x69, 0x65,
0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f,
0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x69, 0x65, 0x63, 0x65,
0x4e, 0x75, 0x6d, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x73, 0x74, 0x61,
0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x53,
0x74, 0x61, 0x72, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x73, 0x69,
0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x53,
0x69, 0x7a, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x6d, 0x64, 0x35,
0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x69, 0x65, 0x63, 0x65, 0x4d, 0x64, 0x35,
0x12, 0x21, 0x0a, 0x0c, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74,
0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x70, 0x69, 0x65, 0x63, 0x65, 0x4f, 0x66, 0x66,
0x73, 0x65, 0x74, 0x12, 0x31, 0x0a, 0x0b, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x73, 0x74, 0x79,
0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e,
0x50, 0x69, 0x65, 0x63, 0x65, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x52, 0x0a, 0x70, 0x69, 0x65, 0x63,
0x65, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x22, 0xfa, 0x01, 0x0a, 0x0b, 0x50, 0x69, 0x65, 0x63, 0x65,
0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69,
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 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, 0x19, 0x0a, 0x08, 0x64, 0x73, 0x74, 0x5f,
0x61, 0x64, 0x64, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x73, 0x74, 0x41,
0x64, 0x64, 0x72, 0x12, 0x30, 0x0a, 0x0b, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x69, 0x6e, 0x66,
0x6f, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e,
0x50, 0x69, 0x65, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x70, 0x69, 0x65, 0x63, 0x65,
0x49, 0x6e, 0x66, 0x6f, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x70,
0x69, 0x65, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61,
0x6c, 0x50, 0x69, 0x65, 0x63, 0x65, 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, 0x24, 0x0a,
0x0e, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x6d, 0x64, 0x35, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x18,
0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x69, 0x65, 0x63, 0x65, 0x4d, 0x64, 0x35, 0x53,
0x69, 0x67, 0x6e, 0x2a, 0x19, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x11, 0x0a, 0x0d, 0x58,
0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x2a, 0x17,
0x0a, 0x0a, 0x50, 0x69, 0x65, 0x63, 0x65, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x09, 0x0a, 0x05,
0x50, 0x4c, 0x41, 0x49, 0x4e, 0x10, 0x00, 0x2a, 0x2c, 0x0a, 0x09, 0x53, 0x69, 0x7a, 0x65, 0x53,
0x63, 0x6f, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x00,
0x12, 0x09, 0x0a, 0x05, 0x53, 0x4d, 0x41, 0x4c, 0x4c, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x54,
0x49, 0x4e, 0x59, 0x10, 0x02, 0x42, 0x22, 0x5a, 0x20, 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, 0x62, 0x61, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (

View File

@ -42,12 +42,12 @@ message GrpcDfError {
}
message UrlMeta{
// used as follows:
// format:md5:xxx or sha256:yyy, used as follows:
//
// 1. check whether downloaded content is consistent with the source file
//
// 2. generate different task ids for same url
string md5 = 1;
string digest = 1;
// downloaded range for url
string range = 2;
// other attributes for url

View File

@ -16,8 +16,8 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.14.0
// source: manager.proto
// protoc v3.15.8
// source: pkg/rpc/manager/manager.proto
package manager
@ -71,11 +71,11 @@ func (x ResourceType) String() string {
}
func (ResourceType) Descriptor() protoreflect.EnumDescriptor {
return file_manager_proto_enumTypes[0].Descriptor()
return file_pkg_rpc_manager_manager_proto_enumTypes[0].Descriptor()
}
func (ResourceType) Type() protoreflect.EnumType {
return &file_manager_proto_enumTypes[0]
return &file_pkg_rpc_manager_manager_proto_enumTypes[0]
}
func (x ResourceType) Number() protoreflect.EnumNumber {
@ -84,7 +84,7 @@ func (x ResourceType) Number() protoreflect.EnumNumber {
// Deprecated: Use ResourceType.Descriptor instead.
func (ResourceType) EnumDescriptor() ([]byte, []int) {
return file_manager_proto_rawDescGZIP(), []int{0}
return file_pkg_rpc_manager_manager_proto_rawDescGZIP(), []int{0}
}
type GetSchedulersRequest struct {
@ -103,7 +103,7 @@ type GetSchedulersRequest struct {
func (x *GetSchedulersRequest) Reset() {
*x = GetSchedulersRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_manager_proto_msgTypes[0]
mi := &file_pkg_rpc_manager_manager_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -116,7 +116,7 @@ func (x *GetSchedulersRequest) String() string {
func (*GetSchedulersRequest) ProtoMessage() {}
func (x *GetSchedulersRequest) ProtoReflect() protoreflect.Message {
mi := &file_manager_proto_msgTypes[0]
mi := &file_pkg_rpc_manager_manager_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -129,7 +129,7 @@ func (x *GetSchedulersRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetSchedulersRequest.ProtoReflect.Descriptor instead.
func (*GetSchedulersRequest) Descriptor() ([]byte, []int) {
return file_manager_proto_rawDescGZIP(), []int{0}
return file_pkg_rpc_manager_manager_proto_rawDescGZIP(), []int{0}
}
func (x *GetSchedulersRequest) GetIp() string {
@ -166,7 +166,7 @@ type SchedulerNodes struct {
func (x *SchedulerNodes) Reset() {
*x = SchedulerNodes{}
if protoimpl.UnsafeEnabled {
mi := &file_manager_proto_msgTypes[1]
mi := &file_pkg_rpc_manager_manager_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -179,7 +179,7 @@ func (x *SchedulerNodes) String() string {
func (*SchedulerNodes) ProtoMessage() {}
func (x *SchedulerNodes) ProtoReflect() protoreflect.Message {
mi := &file_manager_proto_msgTypes[1]
mi := &file_pkg_rpc_manager_manager_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -192,7 +192,7 @@ func (x *SchedulerNodes) ProtoReflect() protoreflect.Message {
// Deprecated: Use SchedulerNodes.ProtoReflect.Descriptor instead.
func (*SchedulerNodes) Descriptor() ([]byte, []int) {
return file_manager_proto_rawDescGZIP(), []int{1}
return file_pkg_rpc_manager_manager_proto_rawDescGZIP(), []int{1}
}
func (x *SchedulerNodes) GetAddrs() []string {
@ -222,7 +222,7 @@ type KeepAliveRequest struct {
func (x *KeepAliveRequest) Reset() {
*x = KeepAliveRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_manager_proto_msgTypes[2]
mi := &file_pkg_rpc_manager_manager_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -235,7 +235,7 @@ func (x *KeepAliveRequest) String() string {
func (*KeepAliveRequest) ProtoMessage() {}
func (x *KeepAliveRequest) ProtoReflect() protoreflect.Message {
mi := &file_manager_proto_msgTypes[2]
mi := &file_pkg_rpc_manager_manager_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -248,7 +248,7 @@ func (x *KeepAliveRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use KeepAliveRequest.ProtoReflect.Descriptor instead.
func (*KeepAliveRequest) Descriptor() ([]byte, []int) {
return file_manager_proto_rawDescGZIP(), []int{2}
return file_pkg_rpc_manager_manager_proto_rawDescGZIP(), []int{2}
}
func (x *KeepAliveRequest) GetHostName() string {
@ -278,7 +278,7 @@ type GetClusterConfigRequest struct {
func (x *GetClusterConfigRequest) Reset() {
*x = GetClusterConfigRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_manager_proto_msgTypes[3]
mi := &file_pkg_rpc_manager_manager_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -291,7 +291,7 @@ func (x *GetClusterConfigRequest) String() string {
func (*GetClusterConfigRequest) ProtoMessage() {}
func (x *GetClusterConfigRequest) ProtoReflect() protoreflect.Message {
mi := &file_manager_proto_msgTypes[3]
mi := &file_pkg_rpc_manager_manager_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -304,7 +304,7 @@ func (x *GetClusterConfigRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetClusterConfigRequest.ProtoReflect.Descriptor instead.
func (*GetClusterConfigRequest) Descriptor() ([]byte, []int) {
return file_manager_proto_rawDescGZIP(), []int{3}
return file_pkg_rpc_manager_manager_proto_rawDescGZIP(), []int{3}
}
func (x *GetClusterConfigRequest) GetHostName() string {
@ -330,7 +330,7 @@ type ClientConfig struct {
func (x *ClientConfig) Reset() {
*x = ClientConfig{}
if protoimpl.UnsafeEnabled {
mi := &file_manager_proto_msgTypes[4]
mi := &file_pkg_rpc_manager_manager_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -343,7 +343,7 @@ func (x *ClientConfig) String() string {
func (*ClientConfig) ProtoMessage() {}
func (x *ClientConfig) ProtoReflect() protoreflect.Message {
mi := &file_manager_proto_msgTypes[4]
mi := &file_pkg_rpc_manager_manager_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -356,7 +356,7 @@ func (x *ClientConfig) ProtoReflect() protoreflect.Message {
// Deprecated: Use ClientConfig.ProtoReflect.Descriptor instead.
func (*ClientConfig) Descriptor() ([]byte, []int) {
return file_manager_proto_rawDescGZIP(), []int{4}
return file_pkg_rpc_manager_manager_proto_rawDescGZIP(), []int{4}
}
type CdnConfig struct {
@ -374,7 +374,7 @@ type CdnConfig struct {
func (x *CdnConfig) Reset() {
*x = CdnConfig{}
if protoimpl.UnsafeEnabled {
mi := &file_manager_proto_msgTypes[5]
mi := &file_pkg_rpc_manager_manager_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -387,7 +387,7 @@ func (x *CdnConfig) String() string {
func (*CdnConfig) ProtoMessage() {}
func (x *CdnConfig) ProtoReflect() protoreflect.Message {
mi := &file_manager_proto_msgTypes[5]
mi := &file_pkg_rpc_manager_manager_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -400,7 +400,7 @@ func (x *CdnConfig) ProtoReflect() protoreflect.Message {
// Deprecated: Use CdnConfig.ProtoReflect.Descriptor instead.
func (*CdnConfig) Descriptor() ([]byte, []int) {
return file_manager_proto_rawDescGZIP(), []int{5}
return file_pkg_rpc_manager_manager_proto_rawDescGZIP(), []int{5}
}
func (x *CdnConfig) GetClusterId() string {
@ -455,7 +455,7 @@ type SchedulerConfig struct {
func (x *SchedulerConfig) Reset() {
*x = SchedulerConfig{}
if protoimpl.UnsafeEnabled {
mi := &file_manager_proto_msgTypes[6]
mi := &file_pkg_rpc_manager_manager_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -468,7 +468,7 @@ func (x *SchedulerConfig) String() string {
func (*SchedulerConfig) ProtoMessage() {}
func (x *SchedulerConfig) ProtoReflect() protoreflect.Message {
mi := &file_manager_proto_msgTypes[6]
mi := &file_pkg_rpc_manager_manager_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -481,7 +481,7 @@ func (x *SchedulerConfig) ProtoReflect() protoreflect.Message {
// Deprecated: Use SchedulerConfig.ProtoReflect.Descriptor instead.
func (*SchedulerConfig) Descriptor() ([]byte, []int) {
return file_manager_proto_rawDescGZIP(), []int{6}
return file_pkg_rpc_manager_manager_proto_rawDescGZIP(), []int{6}
}
func (x *SchedulerConfig) GetClusterId() string {
@ -547,7 +547,7 @@ type ClusterConfig struct {
func (x *ClusterConfig) Reset() {
*x = ClusterConfig{}
if protoimpl.UnsafeEnabled {
mi := &file_manager_proto_msgTypes[7]
mi := &file_pkg_rpc_manager_manager_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -560,7 +560,7 @@ func (x *ClusterConfig) String() string {
func (*ClusterConfig) ProtoMessage() {}
func (x *ClusterConfig) ProtoReflect() protoreflect.Message {
mi := &file_manager_proto_msgTypes[7]
mi := &file_pkg_rpc_manager_manager_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -573,7 +573,7 @@ func (x *ClusterConfig) ProtoReflect() protoreflect.Message {
// Deprecated: Use ClusterConfig.ProtoReflect.Descriptor instead.
func (*ClusterConfig) Descriptor() ([]byte, []int) {
return file_manager_proto_rawDescGZIP(), []int{7}
return file_pkg_rpc_manager_manager_proto_rawDescGZIP(), []int{7}
}
func (m *ClusterConfig) GetConfig() isClusterConfig_Config {
@ -626,7 +626,7 @@ type ServerInfo struct {
func (x *ServerInfo) Reset() {
*x = ServerInfo{}
if protoimpl.UnsafeEnabled {
mi := &file_manager_proto_msgTypes[8]
mi := &file_pkg_rpc_manager_manager_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -639,7 +639,7 @@ func (x *ServerInfo) String() string {
func (*ServerInfo) ProtoMessage() {}
func (x *ServerInfo) ProtoReflect() protoreflect.Message {
mi := &file_manager_proto_msgTypes[8]
mi := &file_pkg_rpc_manager_manager_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -652,7 +652,7 @@ func (x *ServerInfo) ProtoReflect() protoreflect.Message {
// Deprecated: Use ServerInfo.ProtoReflect.Descriptor instead.
func (*ServerInfo) Descriptor() ([]byte, []int) {
return file_manager_proto_rawDescGZIP(), []int{8}
return file_pkg_rpc_manager_manager_proto_rawDescGZIP(), []int{8}
}
func (x *ServerInfo) GetHostInfo() *HostInfo {
@ -695,7 +695,7 @@ type HostInfo struct {
func (x *HostInfo) Reset() {
*x = HostInfo{}
if protoimpl.UnsafeEnabled {
mi := &file_manager_proto_msgTypes[9]
mi := &file_pkg_rpc_manager_manager_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -708,7 +708,7 @@ func (x *HostInfo) String() string {
func (*HostInfo) ProtoMessage() {}
func (x *HostInfo) ProtoReflect() protoreflect.Message {
mi := &file_manager_proto_msgTypes[9]
mi := &file_pkg_rpc_manager_manager_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -721,7 +721,7 @@ func (x *HostInfo) ProtoReflect() protoreflect.Message {
// Deprecated: Use HostInfo.ProtoReflect.Descriptor instead.
func (*HostInfo) Descriptor() ([]byte, []int) {
return file_manager_proto_rawDescGZIP(), []int{9}
return file_pkg_rpc_manager_manager_proto_rawDescGZIP(), []int{9}
}
func (x *HostInfo) GetIp() string {
@ -773,10 +773,11 @@ func (x *HostInfo) GetNetTopology() string {
return ""
}
var File_manager_proto protoreflect.FileDescriptor
var File_pkg_rpc_manager_manager_proto protoreflect.FileDescriptor
var file_manager_proto_rawDesc = []byte{
0x0a, 0x0d, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
var file_pkg_rpc_manager_manager_proto_rawDesc = []byte{
0x0a, 0x1d, 0x70, 0x6b, 0x67, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65,
0x72, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
0x07, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 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, 0x5e, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65,
@ -896,20 +897,20 @@ var file_manager_proto_rawDesc = []byte{
}
var (
file_manager_proto_rawDescOnce sync.Once
file_manager_proto_rawDescData = file_manager_proto_rawDesc
file_pkg_rpc_manager_manager_proto_rawDescOnce sync.Once
file_pkg_rpc_manager_manager_proto_rawDescData = file_pkg_rpc_manager_manager_proto_rawDesc
)
func file_manager_proto_rawDescGZIP() []byte {
file_manager_proto_rawDescOnce.Do(func() {
file_manager_proto_rawDescData = protoimpl.X.CompressGZIP(file_manager_proto_rawDescData)
func file_pkg_rpc_manager_manager_proto_rawDescGZIP() []byte {
file_pkg_rpc_manager_manager_proto_rawDescOnce.Do(func() {
file_pkg_rpc_manager_manager_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_rpc_manager_manager_proto_rawDescData)
})
return file_manager_proto_rawDescData
return file_pkg_rpc_manager_manager_proto_rawDescData
}
var file_manager_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_manager_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
var file_manager_proto_goTypes = []interface{}{
var file_pkg_rpc_manager_manager_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_pkg_rpc_manager_manager_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
var file_pkg_rpc_manager_manager_proto_goTypes = []interface{}{
(ResourceType)(0), // 0: manager.ResourceType
(*GetSchedulersRequest)(nil), // 1: manager.GetSchedulersRequest
(*SchedulerNodes)(nil), // 2: manager.SchedulerNodes
@ -924,7 +925,7 @@ var file_manager_proto_goTypes = []interface{}{
nil, // 11: manager.HostInfo.ProxyDomainEntry
(*emptypb.Empty)(nil), // 12: google.protobuf.Empty
}
var file_manager_proto_depIdxs = []int32{
var file_pkg_rpc_manager_manager_proto_depIdxs = []int32{
10, // 0: manager.SchedulerNodes.client_host:type_name -> manager.HostInfo
0, // 1: manager.KeepAliveRequest.type:type_name -> manager.ResourceType
0, // 2: manager.GetClusterConfigRequest.type:type_name -> manager.ResourceType
@ -946,13 +947,13 @@ var file_manager_proto_depIdxs = []int32{
0, // [0:8] is the sub-list for field type_name
}
func init() { file_manager_proto_init() }
func file_manager_proto_init() {
if File_manager_proto != nil {
func init() { file_pkg_rpc_manager_manager_proto_init() }
func file_pkg_rpc_manager_manager_proto_init() {
if File_pkg_rpc_manager_manager_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_manager_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_pkg_rpc_manager_manager_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetSchedulersRequest); i {
case 0:
return &v.state
@ -964,7 +965,7 @@ func file_manager_proto_init() {
return nil
}
}
file_manager_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_pkg_rpc_manager_manager_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SchedulerNodes); i {
case 0:
return &v.state
@ -976,7 +977,7 @@ func file_manager_proto_init() {
return nil
}
}
file_manager_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
file_pkg_rpc_manager_manager_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*KeepAliveRequest); i {
case 0:
return &v.state
@ -988,7 +989,7 @@ func file_manager_proto_init() {
return nil
}
}
file_manager_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
file_pkg_rpc_manager_manager_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetClusterConfigRequest); i {
case 0:
return &v.state
@ -1000,7 +1001,7 @@ func file_manager_proto_init() {
return nil
}
}
file_manager_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
file_pkg_rpc_manager_manager_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ClientConfig); i {
case 0:
return &v.state
@ -1012,7 +1013,7 @@ func file_manager_proto_init() {
return nil
}
}
file_manager_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
file_pkg_rpc_manager_manager_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CdnConfig); i {
case 0:
return &v.state
@ -1024,7 +1025,7 @@ func file_manager_proto_init() {
return nil
}
}
file_manager_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
file_pkg_rpc_manager_manager_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SchedulerConfig); i {
case 0:
return &v.state
@ -1036,7 +1037,7 @@ func file_manager_proto_init() {
return nil
}
}
file_manager_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
file_pkg_rpc_manager_manager_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ClusterConfig); i {
case 0:
return &v.state
@ -1048,7 +1049,7 @@ func file_manager_proto_init() {
return nil
}
}
file_manager_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
file_pkg_rpc_manager_manager_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ServerInfo); i {
case 0:
return &v.state
@ -1060,7 +1061,7 @@ func file_manager_proto_init() {
return nil
}
}
file_manager_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
file_pkg_rpc_manager_manager_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*HostInfo); i {
case 0:
return &v.state
@ -1073,7 +1074,7 @@ func file_manager_proto_init() {
}
}
}
file_manager_proto_msgTypes[7].OneofWrappers = []interface{}{
file_pkg_rpc_manager_manager_proto_msgTypes[7].OneofWrappers = []interface{}{
(*ClusterConfig_SchedulerConfig)(nil),
(*ClusterConfig_CdnConfig)(nil),
}
@ -1081,19 +1082,19 @@ func file_manager_proto_init() {
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_manager_proto_rawDesc,
RawDescriptor: file_pkg_rpc_manager_manager_proto_rawDesc,
NumEnums: 1,
NumMessages: 11,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_manager_proto_goTypes,
DependencyIndexes: file_manager_proto_depIdxs,
EnumInfos: file_manager_proto_enumTypes,
MessageInfos: file_manager_proto_msgTypes,
GoTypes: file_pkg_rpc_manager_manager_proto_goTypes,
DependencyIndexes: file_pkg_rpc_manager_manager_proto_depIdxs,
EnumInfos: file_pkg_rpc_manager_manager_proto_enumTypes,
MessageInfos: file_pkg_rpc_manager_manager_proto_msgTypes,
}.Build()
File_manager_proto = out.File
file_manager_proto_rawDesc = nil
file_manager_proto_goTypes = nil
file_manager_proto_depIdxs = nil
File_pkg_rpc_manager_manager_proto = out.File
file_pkg_rpc_manager_manager_proto_rawDesc = nil
file_pkg_rpc_manager_manager_proto_goTypes = nil
file_pkg_rpc_manager_manager_proto_depIdxs = nil
}

View File

@ -12,7 +12,6 @@ import (
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// ManagerClient is the client API for Manager service.
@ -110,7 +109,7 @@ type UnsafeManagerServer interface {
}
func RegisterManagerServer(s grpc.ServiceRegistrar, srv ManagerServer) {
s.RegisterService(&Manager_ServiceDesc, srv)
s.RegisterService(&_Manager_serviceDesc, srv)
}
func _Manager_GetSchedulers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
@ -167,10 +166,7 @@ func _Manager_GetClusterConfig_Handler(srv interface{}, ctx context.Context, dec
return interceptor(ctx, in, info, handler)
}
// Manager_ServiceDesc is the grpc.ServiceDesc for Manager service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Manager_ServiceDesc = grpc.ServiceDesc{
var _Manager_serviceDesc = grpc.ServiceDesc{
ServiceName: "manager.Manager",
HandlerType: (*ManagerServer)(nil),
Methods: []grpc.MethodDesc{
@ -188,5 +184,5 @@ var Manager_ServiceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "manager.proto",
Metadata: "pkg/rpc/manager/manager.proto",
}

View File

@ -22,14 +22,13 @@
package scheduler
import (
reflect "reflect"
sync "sync"
base "d7y.io/dragonfly/v2/pkg/rpc/base"
proto "github.com/golang/protobuf/proto"
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 (