From 5010ae10ae30f793b7deb6abb7d5e28ffe32e177 Mon Sep 17 00:00:00 2001 From: Gaius Date: Fri, 19 Nov 2021 17:13:12 +0800 Subject: [PATCH] fix: manager typo and cdn peer id (#809) * fix: manager typo and cdn peer id Signed-off-by: Gaius --- cdn/rpcserver/rpcserver.go | 2 +- internal/idgen/peer_id.go | 2 +- manager/handlers/application.go | 4 +- manager/handlers/cdn.go | 4 +- manager/handlers/cdn_cluster.go | 4 +- manager/handlers/config.go | 4 +- manager/handlers/job.go | 4 +- manager/handlers/oauth.go | 4 +- manager/handlers/scheduler.go | 4 +- manager/handlers/scheduler_cluster.go | 4 +- manager/handlers/security_group.go | 4 +- manager/handlers/security_rule.go | 4 +- manager/model/application.go | 3 +- manager/model/cdn.go | 6 +- manager/model/cdn_cluster.go | 3 +- manager/model/job.go | 2 +- manager/model/scheduler.go | 6 +- manager/model/scheduler_cluster.go | 3 +- manager/searcher/searcher.go | 11 +- manager/searcher/searcher_test.go | 37 +- manager/searcher/testdata/main.go | 3 +- manager/searcher/testdata/plugin/searcher.go | 7 +- manager/service/job.go | 18 +- manager/service/preheat.go | 32 +- manager/service/scheduler.go | 2 +- manager/service/service_grpc.go | 30 +- manager/types/application.go | 24 +- manager/types/cdn.go | 2 +- manager/types/job.go | 2 +- manager/types/preheat.go | 2 +- manager/types/scheduler.go | 2 +- pkg/rpc/base/base.pb.go | 2 +- pkg/rpc/cdnsystem/cdnsystem.pb.go | 2 +- pkg/rpc/cdnsystem/cdnsystem_grpc.pb.go | 18 +- pkg/rpc/dfdaemon/dfdaemon.pb.go | 2 +- pkg/rpc/dfdaemon/dfdaemon_grpc.pb.go | 22 +- pkg/rpc/manager/manager.pb.go | 348 +++++++++---------- pkg/rpc/manager/manager.pb.validate.go | 4 +- pkg/rpc/manager/manager.proto | 4 +- pkg/rpc/manager/manager_grpc.pb.go | 11 +- pkg/rpc/scheduler/scheduler.pb.go | 2 +- pkg/rpc/scheduler/scheduler_grpc.pb.go | 10 +- scheduler/core/events.go | 29 +- test/e2e/manager/preheat.go | 2 +- 44 files changed, 369 insertions(+), 326 deletions(-) diff --git a/cdn/rpcserver/rpcserver.go b/cdn/rpcserver/rpcserver.go index 82201ce2268..28a026a0444 100644 --- a/cdn/rpcserver/rpcserver.go +++ b/cdn/rpcserver/rpcserver.go @@ -232,7 +232,7 @@ func (css *server) GetPieceTasks(ctx context.Context, req *base.PieceTaskRequest } pp := &base.PiecePacket{ TaskId: req.TaskId, - DstPid: fmt.Sprintf("%s-%s_%s", iputils.HostName, req.TaskId, "CDN"), + DstPid: req.DstPid, DstAddr: fmt.Sprintf("%s:%d", css.cfg.AdvertiseIP, css.cfg.DownloadPort), PieceInfos: pieceInfos, TotalPiece: task.PieceTotal, diff --git a/internal/idgen/peer_id.go b/internal/idgen/peer_id.go index 42813f7ea3f..c3b37a676b9 100644 --- a/internal/idgen/peer_id.go +++ b/internal/idgen/peer_id.go @@ -24,7 +24,7 @@ import ( ) func CDNPeerID(ip string) string { - return fmt.Sprintf("%s-%s", PeerID(ip), "cdn") + return fmt.Sprintf("%s_%s", PeerID(ip), "CDN") } func PeerID(ip string) string { diff --git a/manager/handlers/application.go b/manager/handlers/application.go index 6ddff1b76ff..2f7db3d36e3 100644 --- a/manager/handlers/application.go +++ b/manager/handlers/application.go @@ -94,13 +94,13 @@ func (h *Handlers) DestroyApplication(ctx *gin.Context) { func (h *Handlers) UpdateApplication(ctx *gin.Context) { var params types.ApplicationParams if err := ctx.ShouldBindUri(¶ms); err != nil { - ctx.Error(err) // nolint: errcheck + ctx.JSON(http.StatusUnprocessableEntity, gin.H{"errors": err.Error()}) return } var json types.UpdateApplicationRequest if err := ctx.ShouldBindJSON(&json); err != nil { - ctx.Error(err) // nolint: errcheck + ctx.JSON(http.StatusUnprocessableEntity, gin.H{"errors": err.Error()}) return } diff --git a/manager/handlers/cdn.go b/manager/handlers/cdn.go index 90d6f73b0bd..22112572cda 100644 --- a/manager/handlers/cdn.go +++ b/manager/handlers/cdn.go @@ -94,13 +94,13 @@ func (h *Handlers) DestroyCDN(ctx *gin.Context) { func (h *Handlers) UpdateCDN(ctx *gin.Context) { var params types.CDNParams if err := ctx.ShouldBindUri(¶ms); err != nil { - ctx.Error(err) // nolint: errcheck + ctx.JSON(http.StatusUnprocessableEntity, gin.H{"errors": err.Error()}) return } var json types.UpdateCDNRequest if err := ctx.ShouldBindJSON(&json); err != nil { - ctx.Error(err) // nolint: errcheck + ctx.JSON(http.StatusUnprocessableEntity, gin.H{"errors": err.Error()}) return } diff --git a/manager/handlers/cdn_cluster.go b/manager/handlers/cdn_cluster.go index 222a3ee3046..6000d119415 100644 --- a/manager/handlers/cdn_cluster.go +++ b/manager/handlers/cdn_cluster.go @@ -94,13 +94,13 @@ func (h *Handlers) DestroyCDNCluster(ctx *gin.Context) { func (h *Handlers) UpdateCDNCluster(ctx *gin.Context) { var params types.CDNClusterParams if err := ctx.ShouldBindUri(¶ms); err != nil { - ctx.Error(err) // nolint: errcheck + ctx.JSON(http.StatusUnprocessableEntity, gin.H{"errors": err.Error()}) return } var json types.UpdateCDNClusterRequest if err := ctx.ShouldBindJSON(&json); err != nil { - ctx.Error(err) // nolint: errcheck + ctx.JSON(http.StatusUnprocessableEntity, gin.H{"errors": err.Error()}) return } diff --git a/manager/handlers/config.go b/manager/handlers/config.go index d76a7f25884..e91e4100c44 100644 --- a/manager/handlers/config.go +++ b/manager/handlers/config.go @@ -94,13 +94,13 @@ func (h *Handlers) DestroyConfig(ctx *gin.Context) { func (h *Handlers) UpdateConfig(ctx *gin.Context) { var params types.ConfigParams if err := ctx.ShouldBindUri(¶ms); err != nil { - ctx.Error(err) // nolint: errcheck + ctx.JSON(http.StatusUnprocessableEntity, gin.H{"errors": err.Error()}) return } var json types.UpdateConfigRequest if err := ctx.ShouldBindJSON(&json); err != nil { - ctx.Error(err) // nolint: errcheck + ctx.JSON(http.StatusUnprocessableEntity, gin.H{"errors": err.Error()}) return } diff --git a/manager/handlers/job.go b/manager/handlers/job.go index 4ff841ebeab..9b47a086217 100644 --- a/manager/handlers/job.go +++ b/manager/handlers/job.go @@ -90,13 +90,13 @@ func (h *Handlers) DestroyJob(ctx *gin.Context) { func (h *Handlers) UpdateJob(ctx *gin.Context) { var params types.JobParams if err := ctx.ShouldBindUri(¶ms); err != nil { - ctx.Error(err) // nolint: errcheck + ctx.JSON(http.StatusUnprocessableEntity, gin.H{"errors": err.Error()}) return } var json types.UpdateJobRequest if err := ctx.ShouldBindJSON(&json); err != nil { - ctx.Error(err) // nolint: errcheck + ctx.JSON(http.StatusUnprocessableEntity, gin.H{"errors": err.Error()}) return } diff --git a/manager/handlers/oauth.go b/manager/handlers/oauth.go index a9410c69982..67eedfc197d 100644 --- a/manager/handlers/oauth.go +++ b/manager/handlers/oauth.go @@ -94,13 +94,13 @@ func (h *Handlers) DestroyOauth(ctx *gin.Context) { func (h *Handlers) UpdateOauth(ctx *gin.Context) { var params types.OauthParams if err := ctx.ShouldBindUri(¶ms); err != nil { - ctx.Error(err) // nolint: errcheck + ctx.JSON(http.StatusUnprocessableEntity, gin.H{"errors": err.Error()}) return } var json types.UpdateOauthRequest if err := ctx.ShouldBindJSON(&json); err != nil { - ctx.Error(err) // nolint: errcheck + ctx.JSON(http.StatusUnprocessableEntity, gin.H{"errors": err.Error()}) return } diff --git a/manager/handlers/scheduler.go b/manager/handlers/scheduler.go index d73a7e35fac..a1b675cf715 100644 --- a/manager/handlers/scheduler.go +++ b/manager/handlers/scheduler.go @@ -94,13 +94,13 @@ func (h *Handlers) DestroyScheduler(ctx *gin.Context) { func (h *Handlers) UpdateScheduler(ctx *gin.Context) { var params types.SchedulerParams if err := ctx.ShouldBindUri(¶ms); err != nil { - ctx.Error(err) // nolint: errcheck + ctx.JSON(http.StatusUnprocessableEntity, gin.H{"errors": err.Error()}) return } var json types.UpdateSchedulerRequest if err := ctx.ShouldBindJSON(&json); err != nil { - ctx.Error(err) // nolint: errcheck + ctx.JSON(http.StatusUnprocessableEntity, gin.H{"errors": err.Error()}) return } diff --git a/manager/handlers/scheduler_cluster.go b/manager/handlers/scheduler_cluster.go index c56c1efc13a..d10673a024d 100644 --- a/manager/handlers/scheduler_cluster.go +++ b/manager/handlers/scheduler_cluster.go @@ -94,13 +94,13 @@ func (h *Handlers) DestroySchedulerCluster(ctx *gin.Context) { func (h *Handlers) UpdateSchedulerCluster(ctx *gin.Context) { var params types.SchedulerClusterParams if err := ctx.ShouldBindUri(¶ms); err != nil { - ctx.Error(err) // nolint: errcheck + ctx.JSON(http.StatusUnprocessableEntity, gin.H{"errors": err.Error()}) return } var json types.UpdateSchedulerClusterRequest if err := ctx.ShouldBindJSON(&json); err != nil { - ctx.Error(err) // nolint: errcheck + ctx.JSON(http.StatusUnprocessableEntity, gin.H{"errors": err.Error()}) return } diff --git a/manager/handlers/security_group.go b/manager/handlers/security_group.go index 4daa3ced306..1eec326caad 100644 --- a/manager/handlers/security_group.go +++ b/manager/handlers/security_group.go @@ -94,13 +94,13 @@ func (h *Handlers) DestroySecurityGroup(ctx *gin.Context) { func (h *Handlers) UpdateSecurityGroup(ctx *gin.Context) { var params types.SecurityGroupParams if err := ctx.ShouldBindUri(¶ms); err != nil { - ctx.Error(err) // nolint: errcheck + ctx.JSON(http.StatusUnprocessableEntity, gin.H{"errors": err.Error()}) return } var json types.UpdateSecurityGroupRequest if err := ctx.ShouldBindJSON(&json); err != nil { - ctx.Error(err) // nolint: errcheck + ctx.JSON(http.StatusUnprocessableEntity, gin.H{"errors": err.Error()}) return } diff --git a/manager/handlers/security_rule.go b/manager/handlers/security_rule.go index 706999de240..3a8ef2a32bb 100644 --- a/manager/handlers/security_rule.go +++ b/manager/handlers/security_rule.go @@ -94,13 +94,13 @@ func (h *Handlers) DestroySecurityRule(ctx *gin.Context) { func (h *Handlers) UpdateSecurityRule(ctx *gin.Context) { var params types.SecurityRuleParams if err := ctx.ShouldBindUri(¶ms); err != nil { - ctx.Error(err) // nolint: errcheck + ctx.JSON(http.StatusUnprocessableEntity, gin.H{"errors": err.Error()}) return } var json types.UpdateSecurityRuleRequest if err := ctx.ShouldBindJSON(&json); err != nil { - ctx.Error(err) // nolint: errcheck + ctx.JSON(http.StatusUnprocessableEntity, gin.H{"errors": err.Error()}) return } diff --git a/manager/model/application.go b/manager/model/application.go index f288643d9ce..8d60ede4322 100644 --- a/manager/model/application.go +++ b/manager/model/application.go @@ -19,11 +19,12 @@ package model type Application struct { Model Name string `gorm:"column:name;type:varchar(256);index:uk_application_name,unique;not null;comment:name" json:"name"` - DownloadRateLimit string `gorm:"column:download_rate_limit;type:varchar(1024);comment:download_rate_limit" json:"download_rate_limit"` + DownloadRateLimit uint `gorm:"column:download_rate_limit;comment:download rate limit" json:"download_rate_limit"` URL string `gorm:"column:url;not null;comment:url" json:"url"` State string `gorm:"column:state;type:varchar(256);default:'enable';comment:state" json:"state"` BIO string `gorm:"column:bio;type:varchar(1024);comment:biography" json:"bio"` UserID uint `gorm:"comment:user id" json:"user_id"` + User User `json:"-"` SchedulerClusters []SchedulerCluster `json:"-"` CDNClusters []CDNCluster `json:"-"` } diff --git a/manager/model/cdn.go b/manager/model/cdn.go index a23584f7ba2..568ab99aacd 100644 --- a/manager/model/cdn.go +++ b/manager/model/cdn.go @@ -17,8 +17,8 @@ package model const ( - CDNStatusActive = "active" - CDNStatusInactive = "inactive" + CDNStateActive = "active" + CDNStateInactive = "inactive" ) type CDN struct { @@ -29,7 +29,7 @@ type CDN struct { IP string `gorm:"column:ip;type:varchar(256);not null;comment:ip address" json:"ip"` Port int32 `gorm:"column:port;not null;comment:grpc service listening port" json:"port"` DownloadPort int32 `gorm:"column:download_port;not null;comment:download service listening port" json:"download_port"` - Status string `gorm:"column:status;type:varchar(256);default:'inactive';comment:service status" json:"status"` + State string `gorm:"column:state;type:varchar(256);default:'inactive';comment:service state" json:"state"` CDNClusterID uint `gorm:"index:uk_cdn,unique;not null;comment:cdn cluster id"` CDNCluster CDNCluster `json:"-"` } diff --git a/manager/model/cdn_cluster.go b/manager/model/cdn_cluster.go index 187640ccfb3..7979bd6f37e 100644 --- a/manager/model/cdn_cluster.go +++ b/manager/model/cdn_cluster.go @@ -24,8 +24,9 @@ type CDNCluster struct { SchedulerClusters []SchedulerCluster `gorm:"many2many:cdn_cluster_scheduler_cluster;" json:"scheduler_clusters"` IsDefault bool `gorm:"column:is_default;not null;default:false;comment:default cdn cluster" json:"is_default"` CDNs []CDN `json:"-"` - SecurityGroupID uint `gorm:"comment:security group id" json:"security_group_id"` ApplicationID uint `gorm:"comment:application id" json:"application_id"` + Application Application `json:"-"` + SecurityGroupID uint `gorm:"comment:security group id" json:"security_group_id"` SecurityGroup SecurityGroup `json:"-"` Jobs []Job `gorm:"many2many:job_cdn_cluster;" json:"jobs"` } diff --git a/manager/model/job.go b/manager/model/job.go index 663fd8fb250..e46eee9aa3e 100644 --- a/manager/model/job.go +++ b/manager/model/job.go @@ -21,7 +21,7 @@ type Job struct { TaskID string `gorm:"column:task_id;type:varchar(256);not null;comment:task id" json:"task_id"` BIO string `gorm:"column:bio;type:varchar(1024);comment:biography" json:"bio"` Type string `gorm:"column:type;type:varchar(256);comment:type" json:"type"` - Status string `gorm:"column:status;type:varchar(256);not null;default:'PENDING';comment:service status" json:"status"` + State string `gorm:"column:state;type:varchar(256);not null;default:'PENDING';comment:service state" json:"state"` Args JSONMap `gorm:"column:args;not null;comment:task request args" json:"args"` Result JSONMap `gorm:"column:result;comment:task result" json:"result"` UserID uint `gorm:"column:user_id;comment:user id" json:"user_id"` diff --git a/manager/model/scheduler.go b/manager/model/scheduler.go index 6e099464306..3d5678b68cc 100644 --- a/manager/model/scheduler.go +++ b/manager/model/scheduler.go @@ -17,8 +17,8 @@ package model const ( - SchedulerStatusActive = "active" - SchedulerStatusInactive = "inactive" + SchedulerStateActive = "active" + SchedulerStateInactive = "inactive" ) type Scheduler struct { @@ -30,7 +30,7 @@ type Scheduler struct { NetConfig JSONMap `gorm:"column:net_config;comment:network configuration" json:"net_config"` IP string `gorm:"column:ip;type:varchar(256);not null;comment:ip address" json:"ip"` Port int32 `gorm:"column:port;not null;comment:grpc service listening port" json:"port"` - Status string `gorm:"column:status;type:varchar(256);default:'inactive';comment:service status" json:"status"` + State string `gorm:"column:state;type:varchar(256);default:'inactive';comment:service state" json:"state"` SchedulerClusterID uint `gorm:"index:uk_scheduler,unique;not null;comment:scheduler cluster id"` SchedulerCluster SchedulerCluster `json:"-"` } diff --git a/manager/model/scheduler_cluster.go b/manager/model/scheduler_cluster.go index d9fb0be1975..c8aa162d82f 100644 --- a/manager/model/scheduler_cluster.go +++ b/manager/model/scheduler_cluster.go @@ -26,8 +26,9 @@ type SchedulerCluster struct { IsDefault bool `gorm:"column:is_default;not null;default:false;comment:default scheduler cluster" json:"is_default"` CDNClusters []CDNCluster `gorm:"many2many:cdn_cluster_scheduler_cluster;" json:"cdn_clusters"` Schedulers []Scheduler `json:"-"` + ApplicationID uint `gorm:"comment:application id" json:"application_id"` + Application Application `json:"-"` SecurityGroupID uint `gorm:"comment:security group id" json:"security_group_id"` SecurityGroup SecurityGroup `json:"-"` Jobs []Job `gorm:"many2many:job_scheduler_cluster;" json:"jobs"` - ApplicationID uint `gorm:"comment:application id" json:"application_id"` } diff --git a/manager/searcher/searcher.go b/manager/searcher/searcher.go index 50e9545412d..4c5b5a1422a 100644 --- a/manager/searcher/searcher.go +++ b/manager/searcher/searcher.go @@ -21,7 +21,9 @@ import ( "github.com/mitchellh/mapstructure" + logger "d7y.io/dragonfly/v2/internal/dflog" "d7y.io/dragonfly/v2/manager/model" + "d7y.io/dragonfly/v2/pkg/rpc/manager" "d7y.io/dragonfly/v2/pkg/util/mathutils" ) @@ -70,7 +72,7 @@ type Scopes struct { } type Searcher interface { - FindSchedulerCluster([]model.SchedulerCluster, map[string]string) (model.SchedulerCluster, bool) + FindSchedulerCluster([]model.SchedulerCluster, *manager.ListSchedulersRequest) (model.SchedulerCluster, bool) } type searcher struct{} @@ -84,7 +86,8 @@ func New() Searcher { return s } -func (s *searcher) FindSchedulerCluster(schedulerClusters []model.SchedulerCluster, conditions map[string]string) (model.SchedulerCluster, bool) { +func (s *searcher) FindSchedulerCluster(schedulerClusters []model.SchedulerCluster, client *manager.ListSchedulersRequest) (model.SchedulerCluster, bool) { + conditions := client.HostInfo if len(schedulerClusters) <= 0 || len(conditions) <= 0 { return model.SchedulerCluster{}, false } @@ -94,6 +97,10 @@ func (s *searcher) FindSchedulerCluster(schedulerClusters []model.SchedulerClust // Then use clusters sets to score according to scopes. var clusters []model.SchedulerCluster securityDomain := conditions[conditionSecurityDomain] + if securityDomain == "" { + logger.Infof("client %s %s have empty security domain", client.HostName, client.Ip) + } + for _, schedulerCluster := range schedulerClusters { if len(schedulerCluster.Schedulers) > 0 { if securityDomain == "" { diff --git a/manager/searcher/searcher_test.go b/manager/searcher/searcher_test.go index b9c67e4309a..f68d1ed5e4a 100644 --- a/manager/searcher/searcher_test.go +++ b/manager/searcher/searcher_test.go @@ -22,6 +22,7 @@ import ( "github.com/stretchr/testify/assert" "d7y.io/dragonfly/v2/manager/model" + "d7y.io/dragonfly/v2/pkg/rpc/manager" ) func TestSchedulerCluster(t *testing.T) { @@ -64,7 +65,7 @@ func TestSchedulerCluster(t *testing.T) { Schedulers: []model.Scheduler{ { HostName: "foo", - Status: "active", + State: "active", }, }, }, @@ -90,7 +91,7 @@ func TestSchedulerCluster(t *testing.T) { Schedulers: []model.Scheduler{ { HostName: "foo", - Status: "active", + State: "active", }, }, }, @@ -99,7 +100,7 @@ func TestSchedulerCluster(t *testing.T) { Schedulers: []model.Scheduler{ { HostName: "bar", - Status: "active", + State: "active", }, }, }, @@ -122,7 +123,7 @@ func TestSchedulerCluster(t *testing.T) { Schedulers: []model.Scheduler{ { HostName: "foo", - Status: "active", + State: "active", }, }, }, @@ -131,7 +132,7 @@ func TestSchedulerCluster(t *testing.T) { Schedulers: []model.Scheduler{ { HostName: "bar", - Status: "active", + State: "active", }, }, }, @@ -154,7 +155,7 @@ func TestSchedulerCluster(t *testing.T) { Schedulers: []model.Scheduler{ { HostName: "foo", - Status: "active", + State: "active", }, }, }, @@ -163,7 +164,7 @@ func TestSchedulerCluster(t *testing.T) { Schedulers: []model.Scheduler{ { HostName: "bar", - Status: "active", + State: "active", }, }, }, @@ -187,7 +188,7 @@ func TestSchedulerCluster(t *testing.T) { Schedulers: []model.Scheduler{ { HostName: "foo", - Status: "active", + State: "active", }, }, }, @@ -196,7 +197,7 @@ func TestSchedulerCluster(t *testing.T) { Schedulers: []model.Scheduler{ { HostName: "bar", - Status: "active", + State: "active", }, }, }, @@ -229,7 +230,7 @@ func TestSchedulerCluster(t *testing.T) { Schedulers: []model.Scheduler{ { HostName: "foo", - Status: "active", + State: "active", }, }, }, @@ -238,7 +239,7 @@ func TestSchedulerCluster(t *testing.T) { Schedulers: []model.Scheduler{ { HostName: "bar", - Status: "active", + State: "active", }, }, }, @@ -271,7 +272,7 @@ func TestSchedulerCluster(t *testing.T) { Schedulers: []model.Scheduler{ { HostName: "foo", - Status: "active", + State: "active", }, }, }, @@ -280,7 +281,7 @@ func TestSchedulerCluster(t *testing.T) { Schedulers: []model.Scheduler{ { HostName: "bar", - Status: "active", + State: "active", }, }, }, @@ -314,7 +315,7 @@ func TestSchedulerCluster(t *testing.T) { Schedulers: []model.Scheduler{ { HostName: "foo", - Status: "active", + State: "active", }, }, }, @@ -323,7 +324,7 @@ func TestSchedulerCluster(t *testing.T) { Schedulers: []model.Scheduler{ { HostName: "bar", - Status: "active", + State: "active", }, }, }, @@ -344,7 +345,11 @@ func TestSchedulerCluster(t *testing.T) { for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { searcher := New() - clusters, ok := searcher.FindSchedulerCluster(tc.schedulerClusters, tc.conditions) + clusters, ok := searcher.FindSchedulerCluster(tc.schedulerClusters, &manager.ListSchedulersRequest{ + HostName: "foo", + Ip: "127.0.0.1", + HostInfo: tc.conditions, + }) tc.expect(t, clusters, ok) }) } diff --git a/manager/searcher/testdata/main.go b/manager/searcher/testdata/main.go index 880b4710803..9e386b1bca1 100644 --- a/manager/searcher/testdata/main.go +++ b/manager/searcher/testdata/main.go @@ -24,6 +24,7 @@ import ( "d7y.io/dragonfly/v2/internal/dfpath" "d7y.io/dragonfly/v2/manager/model" "d7y.io/dragonfly/v2/manager/searcher" + "d7y.io/dragonfly/v2/pkg/rpc/manager" ) func init() { @@ -39,7 +40,7 @@ func main() { os.Exit(1) } - cluster, ok := s.FindSchedulerCluster([]model.SchedulerCluster{}, map[string]string{}) + cluster, ok := s.FindSchedulerCluster([]model.SchedulerCluster{}, &manager.ListSchedulersRequest{}) if !ok { fmt.Println("scheduler cluster not found") os.Exit(1) diff --git a/manager/searcher/testdata/plugin/searcher.go b/manager/searcher/testdata/plugin/searcher.go index 5b400f374ba..10d4ea97667 100644 --- a/manager/searcher/testdata/plugin/searcher.go +++ b/manager/searcher/testdata/plugin/searcher.go @@ -16,11 +16,14 @@ package main -import "d7y.io/dragonfly/v2/manager/model" +import ( + "d7y.io/dragonfly/v2/manager/model" + "d7y.io/dragonfly/v2/pkg/rpc/manager" +) type searcher struct{} -func (s *searcher) FindSchedulerCluster(schedulerClusters []model.SchedulerCluster, conditions map[string]string) (model.SchedulerCluster, bool) { +func (s *searcher) FindSchedulerCluster(schedulerClusters []model.SchedulerCluster, client *manager.ListSchedulersRequest) (model.SchedulerCluster, bool) { return model.SchedulerCluster{Name: "foo"}, true } diff --git a/manager/service/job.go b/manager/service/job.go index 89fb325edb7..245ddb2ac3d 100644 --- a/manager/service/job.go +++ b/manager/service/job.go @@ -44,7 +44,7 @@ func (s *rest) CreatePreheatJob(ctx context.Context, json types.CreatePreheatJob scheduler := model.Scheduler{} if err := s.db.WithContext(ctx).First(&scheduler, model.Scheduler{ SchedulerClusterID: schedulerCluster.ID, - Status: model.SchedulerStatusActive, + State: model.SchedulerStateActive, }).Error; err != nil { return nil, err } @@ -59,7 +59,7 @@ func (s *rest) CreatePreheatJob(ctx context.Context, json types.CreatePreheatJob scheduler := model.Scheduler{} if err := s.db.WithContext(ctx).First(&scheduler, model.Scheduler{ SchedulerClusterID: schedulerCluster.ID, - Status: model.SchedulerStatusActive, + State: model.SchedulerStateActive, }).Error; err != nil { continue } @@ -82,7 +82,7 @@ func (s *rest) CreatePreheatJob(ctx context.Context, json types.CreatePreheatJob TaskID: groupJobState.GroupUUID, BIO: json.BIO, Type: json.Type, - Status: groupJobState.State, + State: groupJobState.State, Args: args, UserID: json.UserID, SchedulerClusters: schedulerClusters, @@ -108,13 +108,13 @@ func (s *rest) pollingJob(ctx context.Context, id uint, taskID string) { } if err := s.db.WithContext(ctx).First(&job, id).Updates(model.Job{ - Status: groupJob.State, + State: groupJob.State, }).Error; err != nil { logger.Errorf("polling job %d and task %s store failed: %v", id, taskID, err) return nil, true, err } - switch job.Status { + switch job.State { case machineryv1tasks.StateSuccess: logger.Infof("polling job %d and task %s is finally successful", id, taskID) return nil, true, nil @@ -122,17 +122,17 @@ func (s *rest) pollingJob(ctx context.Context, id uint, taskID string) { logger.Errorf("polling job %d and task %s is finally failed", id, taskID) return nil, true, nil default: - return nil, false, fmt.Errorf("polling job %d and task %s status is %s", id, taskID, job.Status) + return nil, false, fmt.Errorf("polling job %d and task %s status is %s", id, taskID, job.State) } }, 5, 10, 120, nil); err != nil { logger.Errorf("polling job %d and task %s failed %s", id, taskID, err) } // Polling timeout and failed - if job.Status != machineryv1tasks.StateSuccess && job.Status != machineryv1tasks.StateFailure { + if job.State != machineryv1tasks.StateSuccess && job.State != machineryv1tasks.StateFailure { job := model.Job{} if err := s.db.WithContext(ctx).First(&job, id).Updates(model.Job{ - Status: machineryv1tasks.StateFailure, + State: machineryv1tasks.StateFailure, }).Error; err != nil { logger.Errorf("polling job %d and task %s store failed: %v", id, taskID, err) } @@ -179,7 +179,7 @@ func (s *rest) GetJobs(ctx context.Context, q types.GetJobsQuery) (*[]model.Job, var jobs []model.Job if err := s.db.WithContext(ctx).Scopes(model.Paginate(q.Page, q.PerPage)).Where(&model.Job{ Type: q.Type, - Status: q.Status, + State: q.State, UserID: q.UserID, }).Find(&jobs).Count(&count).Error; err != nil { return nil, 0, err diff --git a/manager/service/preheat.go b/manager/service/preheat.go index 9e97d8f135d..ad90e401d63 100644 --- a/manager/service/preheat.go +++ b/manager/service/preheat.go @@ -31,17 +31,17 @@ import ( ) const ( - // V1PreheatingStatusPending is the preheating is waiting for starting - V1PreheatingStatusPending = "WAITING" + // V1PreheatingStatePending is the preheating is waiting for starting + V1PreheatingStatePending = "WAITING" - // V1PreheatingStatusRunning is the preheating is running - V1PreheatingStatusRunning = "RUNNING" + // V1PreheatingStateRunning is the preheating is running + V1PreheatingStateRunning = "RUNNING" - // V1PreheatingStatusSuccess is the preheating is success - V1PreheatingStatusSuccess = "SUCCESS" + // V1PreheatingStateSuccess is the preheating is success + V1PreheatingStateSuccess = "SUCCESS" - // V1PreheatingStatusFail is the preheating is failed - V1PreheatingStatusFail = "FAIL" + // V1PreheatingStateFail is the preheating is failed + V1PreheatingStateFail = "FAIL" ) func (s *rest) CreateV1Preheat(ctx context.Context, json types.CreateV1PreheatRequest) (*types.CreateV1PreheatResponse, error) { @@ -76,23 +76,23 @@ func (s *rest) GetV1Preheat(ctx context.Context, rawID string) (*types.GetV1Preh return &types.GetV1PreheatResponse{ ID: strconv.FormatUint(uint64(job.ID), 10), - Status: convertStatus(job.Status), + State: convertState(job.State), StartTime: job.CreatedAt.String(), FinishTime: job.UpdatedAt.String(), }, nil } -func convertStatus(status string) string { - switch status { +func convertState(state string) string { + switch state { case machineryv1tasks.StatePending, machineryv1tasks.StateReceived, machineryv1tasks.StateRetry: - return V1PreheatingStatusPending + return V1PreheatingStatePending case machineryv1tasks.StateStarted: - return V1PreheatingStatusRunning + return V1PreheatingStateRunning case machineryv1tasks.StateSuccess: - return V1PreheatingStatusSuccess + return V1PreheatingStateSuccess case machineryv1tasks.StateFailure: - return V1PreheatingStatusFail + return V1PreheatingStateFail } - return V1PreheatingStatusFail + return V1PreheatingStateFail } diff --git a/manager/service/scheduler.go b/manager/service/scheduler.go index d9519344c7f..e87f4062e56 100644 --- a/manager/service/scheduler.go +++ b/manager/service/scheduler.go @@ -89,7 +89,7 @@ func (s *rest) GetSchedulers(ctx context.Context, q types.GetSchedulersQuery) (* IDC: q.IDC, Location: q.Location, IP: q.IP, - Status: q.Status, + State: q.State, SchedulerClusterID: q.SchedulerClusterID, }).Find(&schedulers).Count(&count).Error; err != nil { return nil, 0, err diff --git a/manager/service/service_grpc.go b/manager/service/service_grpc.go index 28b94be55c6..b295f0f4b16 100644 --- a/manager/service/service_grpc.go +++ b/manager/service/service_grpc.go @@ -86,7 +86,7 @@ func (s *GRPC) GetCDN(ctx context.Context, req *manager.GetCDNRequest) (*manager Ip: cdn.IP, Port: cdn.Port, DownloadPort: cdn.DownloadPort, - Status: cdn.Status, + State: cdn.State, CdnClusterId: uint64(cdn.CDNClusterID), CdnCluster: &manager.CDNCluster{ Id: uint64(cdn.CDNCluster.ID), @@ -131,7 +131,7 @@ func (s *GRPC) createCDN(ctx context.Context, req *manager.UpdateCDNRequest) (*m Port: cdn.Port, DownloadPort: cdn.DownloadPort, CdnClusterId: uint64(cdn.CDNClusterID), - Status: cdn.Status, + State: cdn.State, }, nil } @@ -173,7 +173,7 @@ func (s *GRPC) UpdateCDN(ctx context.Context, req *manager.UpdateCDNRequest) (*m Port: cdn.Port, DownloadPort: cdn.DownloadPort, CdnClusterId: uint64(cdn.CDNClusterID), - Status: cdn.Status, + State: cdn.State, }, nil } @@ -191,7 +191,7 @@ func (s *GRPC) GetScheduler(ctx context.Context, req *manager.GetSchedulerReques logger.Infof("%s cache miss", cacheKey) scheduler := model.Scheduler{} if err := s.db.WithContext(ctx).Preload("SchedulerCluster").Preload("SchedulerCluster.CDNClusters.CDNs", &model.CDN{ - Status: model.CDNStatusActive, + State: model.CDNStateActive, }).First(&scheduler, &model.Scheduler{ HostName: req.HostName, SchedulerClusterID: uint(req.SchedulerClusterId), @@ -237,7 +237,7 @@ func (s *GRPC) GetScheduler(ctx context.Context, req *manager.GetSchedulerReques Bio: cdnCluster.BIO, Config: cdnClusterConfig, }, - Status: cdn.Status, + State: cdn.State, }) } } @@ -251,7 +251,7 @@ func (s *GRPC) GetScheduler(ctx context.Context, req *manager.GetSchedulerReques NetConfig: schedulerNetConfig, Ip: scheduler.IP, Port: scheduler.Port, - Status: scheduler.Status, + State: scheduler.State, SchedulerClusterId: uint64(scheduler.SchedulerClusterID), SchedulerCluster: &manager.SchedulerCluster{ Id: uint64(scheduler.SchedulerCluster.ID), @@ -307,7 +307,7 @@ func (s *GRPC) createScheduler(ctx context.Context, req *manager.UpdateScheduler NetConfig: req.NetConfig, Ip: scheduler.IP, Port: scheduler.Port, - Status: scheduler.Status, + State: scheduler.State, SchedulerClusterId: uint64(scheduler.SchedulerClusterID), }, nil } @@ -360,7 +360,7 @@ func (s *GRPC) UpdateScheduler(ctx context.Context, req *manager.UpdateScheduler Ip: scheduler.IP, Port: scheduler.Port, SchedulerClusterId: uint64(scheduler.SchedulerClusterID), - Status: scheduler.Status, + State: scheduler.State, }, nil } @@ -382,7 +382,7 @@ func (s *GRPC) ListSchedulers(ctx context.Context, req *manager.ListSchedulersRe } // Search optimal scheduler cluster - schedulerCluster, ok := s.searcher.FindSchedulerCluster(schedulerClusters, req.HostInfo) + schedulerCluster, ok := s.searcher.FindSchedulerCluster(schedulerClusters, req) if !ok { if err := s.db.WithContext(ctx).Find(&schedulerCluster, &model.SchedulerCluster{ IsDefault: true, @@ -393,7 +393,7 @@ func (s *GRPC) ListSchedulers(ctx context.Context, req *manager.ListSchedulersRe schedulers := []model.Scheduler{} if err := s.db.WithContext(ctx).Find(&schedulers, &model.Scheduler{ - Status: model.SchedulerStatusActive, + State: model.SchedulerStateActive, SchedulerClusterID: schedulerCluster.ID, }).Error; err != nil { return nil, status.Error(codes.Unknown, err.Error()) @@ -415,7 +415,7 @@ func (s *GRPC) ListSchedulers(ctx context.Context, req *manager.ListSchedulersRe Ip: scheduler.IP, Port: scheduler.Port, SchedulerClusterId: uint64(scheduler.SchedulerClusterID), - Status: scheduler.Status, + State: scheduler.State, }) } @@ -449,7 +449,7 @@ func (s *GRPC) KeepAlive(m manager.Manager_KeepAliveServer) error { HostName: hostName, SchedulerClusterID: clusterID, }).Updates(model.Scheduler{ - Status: model.SchedulerStatusActive, + State: model.SchedulerStateActive, }).Error; err != nil { return status.Error(codes.Unknown, err.Error()) } @@ -469,7 +469,7 @@ func (s *GRPC) KeepAlive(m manager.Manager_KeepAliveServer) error { HostName: hostName, CDNClusterID: clusterID, }).Updates(model.CDN{ - Status: model.CDNStatusActive, + State: model.CDNStateActive, }).Error; err != nil { return status.Error(codes.Unknown, err.Error()) } @@ -492,7 +492,7 @@ func (s *GRPC) KeepAlive(m manager.Manager_KeepAliveServer) error { HostName: hostName, SchedulerClusterID: clusterID, }).Updates(model.Scheduler{ - Status: model.SchedulerStatusInactive, + State: model.SchedulerStateInactive, }).Error; err != nil { return status.Error(codes.Unknown, err.Error()) } @@ -512,7 +512,7 @@ func (s *GRPC) KeepAlive(m manager.Manager_KeepAliveServer) error { HostName: hostName, CDNClusterID: clusterID, }).Updates(model.CDN{ - Status: model.CDNStatusInactive, + State: model.CDNStateInactive, }).Error; err != nil { return status.Error(codes.Unknown, err.Error()) } diff --git a/manager/types/application.go b/manager/types/application.go index 3f1f7f5746f..9f592492e38 100644 --- a/manager/types/application.go +++ b/manager/types/application.go @@ -42,23 +42,25 @@ type DeleteCDNClusterToApplicationParams struct { type CreateApplicationRequest struct { Name string `json:"name" binding:"required"` - DownloadRateLimit string `json:"download_rate_limit" binding:"omitempty"` - URL string `json:"url" binding:"omitempty"` BIO string `json:"bio" binding:"omitempty"` - UserID uint `json:"user_id" binding:"omitempty"` - State string `json:"state" binding:"required,oneof=enable disable"` + URL string `json:"url" binding:"omitempty"` + DownloadRateLimit uint `json:"download_rate_limit" binding:"omitempty"` + State string `json:"state" binding:"omitempty,oneof=enable disable"` + UserID uint `json:"user_id" binding:"required"` } type UpdateApplicationRequest struct { - Name string `json:"name" binding:"required"` - DownloadRateLimit string `json:"download_rate_limit" binding:"required"` - URL string `json:"url" binding:"required"` - State string `json:"state" binding:"required,oneof=enable disable"` + Name string `json:"name" binding:"omitempty"` BIO string `json:"bio" binding:"omitempty"` - UserID uint `json:"user_id" binding:"omitempty"` + URL string `json:"url" binding:"omitempty"` + DownloadRateLimit uint `json:"download_rate_limit" binding:"omitempty"` + State string `json:"state" binding:"omitempty,oneof=enable disable"` + UserID uint `json:"user_id" binding:"required"` } type GetApplicationsQuery struct { - Page int `form:"page" binding:"omitempty,gte=1"` - PerPage int `form:"per_page" binding:"omitempty,gte=1,lte=50"` + Name string `form:"name" binding:"omitempty"` + State string `form:"state" binding:"omitempty,oneof=enable disable"` + Page int `form:"page" binding:"omitempty,gte=1"` + PerPage int `form:"per_page" binding:"omitempty,gte=1,lte=50"` } diff --git a/manager/types/cdn.go b/manager/types/cdn.go index b7d87d3c8c5..00031cb457e 100644 --- a/manager/types/cdn.go +++ b/manager/types/cdn.go @@ -49,5 +49,5 @@ type GetCDNsQuery struct { CDNClusterID uint `form:"cdn_cluster_id" binding:"omitempty"` Page int `form:"page" binding:"omitempty,gte=1"` PerPage int `form:"per_page" binding:"omitempty,gte=1,lte=50"` - Status string `form:"status" binding:"omitempty,oneof=active inactive"` + State string `form:"state" binding:"omitempty,oneof=active inactive"` } diff --git a/manager/types/job.go b/manager/types/job.go index 9b68432a9df..535485427de 100644 --- a/manager/types/job.go +++ b/manager/types/job.go @@ -37,7 +37,7 @@ type JobParams struct { type GetJobsQuery struct { Type string `form:"type" binding:"omitempty"` - Status string `form:"status" binding:"omitempty,oneof=PENDING RECEIVED STARTED RETRY SUCCESS FAILURE"` + State string `form:"state" binding:"omitempty,oneof=PENDING RECEIVED STARTED RETRY SUCCESS FAILURE"` UserID uint `form:"user_id" binding:"omitempty"` Page int `form:"page" binding:"omitempty,gte=1"` PerPage int `form:"per_page" binding:"omitempty,gte=1,lte=50"` diff --git a/manager/types/preheat.go b/manager/types/preheat.go index 930de0c8adb..08013157394 100644 --- a/manager/types/preheat.go +++ b/manager/types/preheat.go @@ -29,7 +29,7 @@ type CreateV1PreheatResponse struct { type GetV1PreheatResponse struct { ID string `json:"id"` - Status string `json:"status"` + State string `json:"state"` StartTime string `json:"startTime,omitempty"` FinishTime string `json:"finishTime,omitempty"` } diff --git a/manager/types/scheduler.go b/manager/types/scheduler.go index 29c3858e45a..0da373ea6aa 100644 --- a/manager/types/scheduler.go +++ b/manager/types/scheduler.go @@ -49,6 +49,6 @@ type GetSchedulersQuery struct { IDC string `form:"idc" binding:"omitempty"` Location string `form:"location" binding:"omitempty"` IP string `form:"ip" binding:"omitempty"` - Status string `form:"status" binding:"omitempty,oneof=active inactive"` + State string `form:"state" binding:"omitempty,oneof=active inactive"` SchedulerClusterID uint `form:"scheduler_cluster_id" binding:"omitempty"` } diff --git a/pkg/rpc/base/base.pb.go b/pkg/rpc/base/base.pb.go index 1533f919414..a93bdc883af 100644 --- a/pkg/rpc/base/base.pb.go +++ b/pkg/rpc/base/base.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.15.8 +// protoc v3.17.3 // source: pkg/rpc/base/base.proto package base diff --git a/pkg/rpc/cdnsystem/cdnsystem.pb.go b/pkg/rpc/cdnsystem/cdnsystem.pb.go index 745f520f700..2da63c7afdf 100644 --- a/pkg/rpc/cdnsystem/cdnsystem.pb.go +++ b/pkg/rpc/cdnsystem/cdnsystem.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.15.8 +// protoc v3.17.3 // source: pkg/rpc/cdnsystem/cdnsystem.proto package cdnsystem diff --git a/pkg/rpc/cdnsystem/cdnsystem_grpc.pb.go b/pkg/rpc/cdnsystem/cdnsystem_grpc.pb.go index d5b70a7c4e2..515837aaebf 100644 --- a/pkg/rpc/cdnsystem/cdnsystem_grpc.pb.go +++ b/pkg/rpc/cdnsystem/cdnsystem_grpc.pb.go @@ -12,15 +12,16 @@ 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 // SeederClient is the client API for Seeder service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type SeederClient interface { - // generate seeds and return to scheduler + // Generate seeds and return to scheduler ObtainSeeds(ctx context.Context, in *SeedRequest, opts ...grpc.CallOption) (Seeder_ObtainSeedsClient, error) - // get piece tasks from cdn + // Get piece tasks from cdn GetPieceTasks(ctx context.Context, in *base.PieceTaskRequest, opts ...grpc.CallOption) (*base.PiecePacket, error) } @@ -33,7 +34,7 @@ func NewSeederClient(cc grpc.ClientConnInterface) SeederClient { } func (c *seederClient) ObtainSeeds(ctx context.Context, in *SeedRequest, opts ...grpc.CallOption) (Seeder_ObtainSeedsClient, error) { - stream, err := c.cc.NewStream(ctx, &_Seeder_serviceDesc.Streams[0], "/cdnsystem.Seeder/ObtainSeeds", opts...) + stream, err := c.cc.NewStream(ctx, &Seeder_ServiceDesc.Streams[0], "/cdnsystem.Seeder/ObtainSeeds", opts...) if err != nil { return nil, err } @@ -77,9 +78,9 @@ func (c *seederClient) GetPieceTasks(ctx context.Context, in *base.PieceTaskRequ // All implementations must embed UnimplementedSeederServer // for forward compatibility type SeederServer interface { - // generate seeds and return to scheduler + // Generate seeds and return to scheduler ObtainSeeds(*SeedRequest, Seeder_ObtainSeedsServer) error - // get piece tasks from cdn + // Get piece tasks from cdn GetPieceTasks(context.Context, *base.PieceTaskRequest) (*base.PiecePacket, error) mustEmbedUnimplementedSeederServer() } @@ -104,7 +105,7 @@ type UnsafeSeederServer interface { } func RegisterSeederServer(s grpc.ServiceRegistrar, srv SeederServer) { - s.RegisterService(&_Seeder_serviceDesc, srv) + s.RegisterService(&Seeder_ServiceDesc, srv) } func _Seeder_ObtainSeeds_Handler(srv interface{}, stream grpc.ServerStream) error { @@ -146,7 +147,10 @@ func _Seeder_GetPieceTasks_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } -var _Seeder_serviceDesc = grpc.ServiceDesc{ +// Seeder_ServiceDesc is the grpc.ServiceDesc for Seeder service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Seeder_ServiceDesc = grpc.ServiceDesc{ ServiceName: "cdnsystem.Seeder", HandlerType: (*SeederServer)(nil), Methods: []grpc.MethodDesc{ diff --git a/pkg/rpc/dfdaemon/dfdaemon.pb.go b/pkg/rpc/dfdaemon/dfdaemon.pb.go index 2cf15322e05..33f4b805def 100644 --- a/pkg/rpc/dfdaemon/dfdaemon.pb.go +++ b/pkg/rpc/dfdaemon/dfdaemon.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.15.8 +// protoc v3.17.3 // source: pkg/rpc/dfdaemon/dfdaemon.proto package dfdaemon diff --git a/pkg/rpc/dfdaemon/dfdaemon_grpc.pb.go b/pkg/rpc/dfdaemon/dfdaemon_grpc.pb.go index 851f7c117e4..3307b9b3c4d 100644 --- a/pkg/rpc/dfdaemon/dfdaemon_grpc.pb.go +++ b/pkg/rpc/dfdaemon/dfdaemon_grpc.pb.go @@ -13,17 +13,18 @@ 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 // DaemonClient is the client API for Daemon service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type DaemonClient interface { - // trigger client to download file + // Trigger client to download file Download(ctx context.Context, in *DownRequest, opts ...grpc.CallOption) (Daemon_DownloadClient, error) - // get piece tasks from other peers + // Get piece tasks from other peers GetPieceTasks(ctx context.Context, in *base.PieceTaskRequest, opts ...grpc.CallOption) (*base.PiecePacket, error) - // check daemon health + // Check daemon health CheckHealth(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) } @@ -36,7 +37,7 @@ func NewDaemonClient(cc grpc.ClientConnInterface) DaemonClient { } func (c *daemonClient) Download(ctx context.Context, in *DownRequest, opts ...grpc.CallOption) (Daemon_DownloadClient, error) { - stream, err := c.cc.NewStream(ctx, &_Daemon_serviceDesc.Streams[0], "/dfdaemon.Daemon/Download", opts...) + stream, err := c.cc.NewStream(ctx, &Daemon_ServiceDesc.Streams[0], "/dfdaemon.Daemon/Download", opts...) if err != nil { return nil, err } @@ -89,11 +90,11 @@ func (c *daemonClient) CheckHealth(ctx context.Context, in *emptypb.Empty, opts // All implementations must embed UnimplementedDaemonServer // for forward compatibility type DaemonServer interface { - // trigger client to download file + // Trigger client to download file Download(*DownRequest, Daemon_DownloadServer) error - // get piece tasks from other peers + // Get piece tasks from other peers GetPieceTasks(context.Context, *base.PieceTaskRequest) (*base.PiecePacket, error) - // check daemon health + // Check daemon health CheckHealth(context.Context, *emptypb.Empty) (*emptypb.Empty, error) mustEmbedUnimplementedDaemonServer() } @@ -121,7 +122,7 @@ type UnsafeDaemonServer interface { } func RegisterDaemonServer(s grpc.ServiceRegistrar, srv DaemonServer) { - s.RegisterService(&_Daemon_serviceDesc, srv) + s.RegisterService(&Daemon_ServiceDesc, srv) } func _Daemon_Download_Handler(srv interface{}, stream grpc.ServerStream) error { @@ -181,7 +182,10 @@ func _Daemon_CheckHealth_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } -var _Daemon_serviceDesc = grpc.ServiceDesc{ +// Daemon_ServiceDesc is the grpc.ServiceDesc for Daemon service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Daemon_ServiceDesc = grpc.ServiceDesc{ ServiceName: "dfdaemon.Daemon", HandlerType: (*DaemonServer)(nil), Methods: []grpc.MethodDesc{ diff --git a/pkg/rpc/manager/manager.pb.go b/pkg/rpc/manager/manager.pb.go index 4cde099dd68..ed84a3830c0 100644 --- a/pkg/rpc/manager/manager.pb.go +++ b/pkg/rpc/manager/manager.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.15.8 +// protoc v3.17.3 // source: pkg/rpc/manager/manager.proto package manager @@ -256,7 +256,7 @@ type CDN struct { Ip string `protobuf:"bytes,5,opt,name=ip,proto3" json:"ip,omitempty"` Port int32 `protobuf:"varint,6,opt,name=port,proto3" json:"port,omitempty"` DownloadPort int32 `protobuf:"varint,7,opt,name=download_port,json=downloadPort,proto3" json:"download_port,omitempty"` - Status string `protobuf:"bytes,8,opt,name=status,proto3" json:"status,omitempty"` + State string `protobuf:"bytes,8,opt,name=state,proto3" json:"state,omitempty"` CdnClusterId uint64 `protobuf:"varint,9,opt,name=cdn_cluster_id,json=cdnClusterId,proto3" json:"cdn_cluster_id,omitempty"` CdnCluster *CDNCluster `protobuf:"bytes,10,opt,name=cdn_cluster,json=cdnCluster,proto3" json:"cdn_cluster,omitempty"` } @@ -342,9 +342,9 @@ func (x *CDN) GetDownloadPort() int32 { return 0 } -func (x *CDN) GetStatus() string { +func (x *CDN) GetState() string { if x != nil { - return x.Status + return x.State } return "" } @@ -629,7 +629,7 @@ type Scheduler struct { NetConfig []byte `protobuf:"bytes,6,opt,name=net_config,json=netConfig,proto3" json:"net_config,omitempty"` Ip string `protobuf:"bytes,7,opt,name=ip,proto3" json:"ip,omitempty"` Port int32 `protobuf:"varint,8,opt,name=port,proto3" json:"port,omitempty"` - Status string `protobuf:"bytes,9,opt,name=status,proto3" json:"status,omitempty"` + State string `protobuf:"bytes,9,opt,name=state,proto3" json:"state,omitempty"` SchedulerClusterId uint64 `protobuf:"varint,10,opt,name=scheduler_cluster_id,json=schedulerClusterId,proto3" json:"scheduler_cluster_id,omitempty"` SchedulerCluster *SchedulerCluster `protobuf:"bytes,11,opt,name=scheduler_cluster,json=schedulerCluster,proto3" json:"scheduler_cluster,omitempty"` Cdns []*CDN `protobuf:"bytes,12,rep,name=cdns,proto3" json:"cdns,omitempty"` @@ -723,9 +723,9 @@ func (x *Scheduler) GetPort() int32 { return 0 } -func (x *Scheduler) GetStatus() string { +func (x *Scheduler) GetState() string { if x != nil { - return x.Status + return x.State } return "" } @@ -1132,7 +1132,7 @@ var file_pkg_rpc_manager_manager_proto_rawDesc = []byte{ 0x69, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x22, 0x9d, 0x02, + 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x22, 0x9b, 0x02, 0x0a, 0x03, 0x43, 0x44, 0x4e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x4e, 0x61, @@ -1143,185 +1143,185 @@ var file_pkg_rpc_manager_manager_proto_rawDesc = []byte{ 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x64, 0x6f, 0x77, - 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x64, 0x6e, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x63, 0x64, 0x6e, 0x43, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x34, 0x0a, 0x0b, 0x63, 0x64, 0x6e, 0x5f, 0x63, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x43, 0x44, 0x4e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x52, 0x0a, 0x63, 0x64, 0x6e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x22, 0xa4, 0x01, - 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x43, 0x44, 0x4e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x3e, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x53, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, - 0x02, 0x10, 0x01, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x24, 0x0a, 0x09, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x68, 0x01, 0x52, 0x08, 0x68, 0x6f, 0x73, - 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2d, 0x0a, 0x0e, 0x63, 0x64, 0x6e, 0x5f, 0x63, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, + 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, + 0x24, 0x0a, 0x0e, 0x63, 0x64, 0x6e, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, + 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x63, 0x64, 0x6e, 0x43, 0x6c, 0x75, 0x73, + 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x34, 0x0a, 0x0b, 0x63, 0x64, 0x6e, 0x5f, 0x63, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x72, 0x2e, 0x43, 0x44, 0x4e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, + 0x0a, 0x63, 0x64, 0x6e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x22, 0xa4, 0x01, 0x0a, 0x0d, + 0x47, 0x65, 0x74, 0x43, 0x44, 0x4e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, + 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x53, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, + 0x01, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a, + 0x09, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x68, 0x01, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x2d, 0x0a, 0x0e, 0x63, 0x64, 0x6e, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, + 0x32, 0x02, 0x28, 0x01, 0x52, 0x0c, 0x63, 0x64, 0x6e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, + 0x49, 0x64, 0x22, 0xdf, 0x02, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x44, 0x4e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x68, 0x6f, 0x73, 0x74, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, + 0x02, 0x68, 0x01, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, + 0x03, 0x69, 0x64, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xfa, 0x42, 0x0a, 0x72, + 0x08, 0x10, 0x01, 0x18, 0x80, 0x08, 0xd0, 0x01, 0x01, 0x52, 0x03, 0x69, 0x64, 0x63, 0x12, 0x27, + 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x0b, 0xfa, 0x42, 0x08, 0x72, 0x06, 0x18, 0x80, 0x08, 0xd0, 0x01, 0x01, 0x52, 0x08, 0x6c, + 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x70, 0x01, 0x52, 0x02, 0x69, 0x70, + 0x12, 0x20, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0c, + 0xfa, 0x42, 0x09, 0x1a, 0x07, 0x10, 0xff, 0xff, 0x03, 0x28, 0x80, 0x08, 0x52, 0x04, 0x70, 0x6f, + 0x72, 0x74, 0x12, 0x31, 0x0a, 0x0d, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x70, + 0x6f, 0x72, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0c, 0xfa, 0x42, 0x09, 0x1a, 0x07, + 0x10, 0xff, 0xff, 0x03, 0x28, 0x80, 0x08, 0x52, 0x0c, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, + 0x64, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x2d, 0x0a, 0x0e, 0x63, 0x64, 0x6e, 0x5f, 0x63, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x28, 0x01, 0x52, 0x0c, 0x63, 0x64, 0x6e, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x49, 0x64, 0x22, 0xdf, 0x02, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, - 0x44, 0x4e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x0b, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, - 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, - 0x79, 0x70, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x68, 0x6f, 0x73, - 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, - 0x04, 0x72, 0x02, 0x68, 0x01, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x1f, 0x0a, 0x03, 0x69, 0x64, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xfa, 0x42, - 0x0a, 0x72, 0x08, 0x10, 0x01, 0x18, 0x80, 0x08, 0xd0, 0x01, 0x01, 0x52, 0x03, 0x69, 0x64, 0x63, - 0x12, 0x27, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x0b, 0xfa, 0x42, 0x08, 0x72, 0x06, 0x18, 0x80, 0x08, 0xd0, 0x01, 0x01, 0x52, - 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x70, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x70, 0x01, 0x52, 0x02, - 0x69, 0x70, 0x12, 0x20, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, - 0x42, 0x0c, 0xfa, 0x42, 0x09, 0x1a, 0x07, 0x10, 0xff, 0xff, 0x03, 0x28, 0x80, 0x08, 0x52, 0x04, - 0x70, 0x6f, 0x72, 0x74, 0x12, 0x31, 0x0a, 0x0d, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, - 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0c, 0xfa, 0x42, 0x09, - 0x1a, 0x07, 0x10, 0xff, 0xff, 0x03, 0x28, 0x80, 0x08, 0x52, 0x0c, 0x64, 0x6f, 0x77, 0x6e, 0x6c, - 0x6f, 0x61, 0x64, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x2d, 0x0a, 0x0e, 0x63, 0x64, 0x6e, 0x5f, 0x63, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x42, - 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x28, 0x01, 0x52, 0x0c, 0x63, 0x64, 0x6e, 0x43, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0xc4, 0x01, 0x0a, 0x10, 0x53, 0x63, 0x68, 0x65, 0x64, - 0x75, 0x6c, 0x65, 0x72, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x10, 0x0a, 0x03, 0x62, 0x69, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x62, 0x69, - 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x0c, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3d, - 0x0a, 0x0e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, - 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x0d, - 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x22, 0xf1, 0x02, - 0x0a, 0x09, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x68, - 0x6f, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x68, 0x6f, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x76, 0x69, 0x70, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x76, 0x69, 0x70, 0x73, 0x12, 0x10, 0x0a, 0x03, - 0x69, 0x64, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x69, 0x64, 0x63, 0x12, 0x1a, - 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x65, - 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, - 0x6e, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, - 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, - 0x65, 0x72, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x0a, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x12, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x43, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x46, 0x0a, 0x11, 0x73, 0x63, 0x68, 0x65, 0x64, - 0x75, 0x6c, 0x65, 0x72, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x53, 0x63, 0x68, - 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x10, 0x73, - 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, - 0x20, 0x0a, 0x04, 0x63, 0x64, 0x6e, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, - 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x43, 0x44, 0x4e, 0x52, 0x04, 0x63, 0x64, 0x6e, - 0x73, 0x22, 0xb6, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x0b, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, - 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, - 0x79, 0x70, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x68, 0x6f, 0x73, - 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, - 0x04, 0x72, 0x02, 0x68, 0x01, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x39, 0x0a, 0x14, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x5f, 0x63, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, - 0x42, 0x04, 0x32, 0x02, 0x28, 0x01, 0x52, 0x12, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, - 0x72, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x8b, 0x03, 0x0a, 0x16, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x52, 0x65, + 0x65, 0x72, 0x49, 0x64, 0x22, 0xc4, 0x01, 0x0a, 0x10, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, + 0x65, 0x72, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, + 0x03, 0x62, 0x69, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x62, 0x69, 0x6f, 0x12, + 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, + 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3d, 0x0a, 0x0e, + 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x53, + 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x0d, 0x73, 0x65, + 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x22, 0xef, 0x02, 0x0a, 0x09, + 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x68, 0x6f, 0x73, + 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, + 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x76, 0x69, 0x70, 0x73, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x76, 0x69, 0x70, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, + 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x69, 0x64, 0x63, 0x12, 0x1a, 0x0a, 0x08, + 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x65, 0x74, 0x5f, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x6e, 0x65, + 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x12, 0x30, 0x0a, 0x14, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x5f, 0x63, + 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x12, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x46, 0x0a, 0x11, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, + 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, + 0x65, 0x72, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x10, 0x73, 0x63, 0x68, 0x65, 0x64, + 0x75, 0x6c, 0x65, 0x72, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x04, 0x63, + 0x64, 0x6e, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x6d, 0x61, 0x6e, 0x61, + 0x67, 0x65, 0x72, 0x2e, 0x43, 0x44, 0x4e, 0x52, 0x04, 0x63, 0x64, 0x6e, 0x73, 0x22, 0xb6, 0x01, + 0x0a, 0x13, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x68, - 0x01, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x04, 0x76, - 0x69, 0x70, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xfa, 0x42, 0x0a, 0x72, 0x08, - 0x10, 0x01, 0x18, 0x80, 0x08, 0xd0, 0x01, 0x01, 0x52, 0x04, 0x76, 0x69, 0x70, 0x73, 0x12, 0x1f, - 0x0a, 0x03, 0x69, 0x64, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xfa, 0x42, 0x0a, - 0x72, 0x08, 0x10, 0x01, 0x18, 0x80, 0x08, 0xd0, 0x01, 0x01, 0x52, 0x03, 0x69, 0x64, 0x63, 0x12, - 0x27, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x0b, 0xfa, 0x42, 0x08, 0x72, 0x06, 0x18, 0x80, 0x08, 0xd0, 0x01, 0x01, 0x52, 0x08, - 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x0a, 0x6e, 0x65, 0x74, 0x5f, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x09, 0xfa, 0x42, - 0x06, 0x7a, 0x04, 0x10, 0x01, 0x70, 0x01, 0x52, 0x09, 0x6e, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, - 0xfa, 0x42, 0x04, 0x72, 0x02, 0x70, 0x01, 0x52, 0x02, 0x69, 0x70, 0x12, 0x20, 0x0a, 0x04, 0x70, - 0x6f, 0x72, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0c, 0xfa, 0x42, 0x09, 0x1a, 0x07, - 0x10, 0xff, 0xff, 0x03, 0x28, 0x80, 0x08, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x39, 0x0a, - 0x14, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, - 0x32, 0x02, 0x28, 0x01, 0x52, 0x12, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x43, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0xa8, 0x02, 0x0a, 0x15, 0x4c, 0x69, 0x73, - 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x01, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x14, 0x73, + 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, + 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, + 0x28, 0x01, 0x52, 0x12, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x43, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x8b, 0x03, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x3e, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, + 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, + 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x24, 0x0a, 0x09, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x68, 0x01, 0x52, 0x08, 0x68, + 0x6f, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x04, 0x76, 0x69, 0x70, 0x73, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xfa, 0x42, 0x0a, 0x72, 0x08, 0x10, 0x01, 0x18, 0x80, + 0x08, 0xd0, 0x01, 0x01, 0x52, 0x04, 0x76, 0x69, 0x70, 0x73, 0x12, 0x1f, 0x0a, 0x03, 0x69, 0x64, + 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xfa, 0x42, 0x0a, 0x72, 0x08, 0x10, 0x01, + 0x18, 0x80, 0x08, 0xd0, 0x01, 0x01, 0x52, 0x03, 0x69, 0x64, 0x63, 0x12, 0x27, 0x0a, 0x08, 0x6c, + 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0b, 0xfa, + 0x42, 0x08, 0x72, 0x06, 0x18, 0x80, 0x08, 0xd0, 0x01, 0x01, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x0a, 0x6e, 0x65, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x7a, 0x04, 0x10, + 0x01, 0x70, 0x01, 0x52, 0x09, 0x6e, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x17, + 0x0a, 0x02, 0x69, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, + 0x02, 0x70, 0x01, 0x52, 0x02, 0x69, 0x70, 0x12, 0x20, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0c, 0xfa, 0x42, 0x09, 0x1a, 0x07, 0x10, 0xff, 0xff, 0x03, + 0x28, 0x80, 0x08, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x39, 0x0a, 0x14, 0x73, 0x63, 0x68, + 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x28, 0x01, + 0x52, 0x12, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x43, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x49, 0x64, 0x22, 0xa8, 0x02, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, + 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, + 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x53, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, + 0x10, 0x01, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x24, + 0x0a, 0x09, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x68, 0x01, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x70, 0x01, 0x52, 0x02, 0x69, 0x70, 0x12, 0x53, 0x0a, + 0x09, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x2c, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, + 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x08, + 0xfa, 0x42, 0x05, 0x9a, 0x01, 0x02, 0x30, 0x01, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x49, 0x6e, + 0x66, 0x6f, 0x1a, 0x3b, 0x0a, 0x0d, 0x48, 0x6f, 0x73, 0x74, 0x49, 0x6e, 0x66, 0x6f, 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, + 0x4c, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x0a, 0x73, 0x63, 0x68, + 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, + 0x72, 0x52, 0x0a, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x73, 0x22, 0xa0, 0x01, + 0x0a, 0x10, 0x4b, 0x65, 0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x68, 0x01, 0x52, 0x08, - 0x68, 0x6f, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x70, 0x01, 0x52, 0x02, 0x69, - 0x70, 0x12, 0x53, 0x0a, 0x09, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x05, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x9a, 0x01, 0x02, 0x30, 0x01, 0x52, 0x08, 0x68, 0x6f, - 0x73, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x3b, 0x0a, 0x0d, 0x48, 0x6f, 0x73, 0x74, 0x49, 0x6e, - 0x66, 0x6f, 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, 0x4c, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, - 0x75, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, - 0x0a, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x53, 0x63, 0x68, 0x65, - 0x64, 0x75, 0x6c, 0x65, 0x72, 0x52, 0x0a, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, - 0x73, 0x22, 0xa0, 0x01, 0x0a, 0x10, 0x4b, 0x65, 0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, - 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, - 0x68, 0x01, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0a, - 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, - 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x28, 0x01, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x49, 0x64, 0x2a, 0x45, 0x0a, 0x0a, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, 0x5f, - 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x4c, 0x49, 0x45, - 0x4e, 0x54, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x43, - 0x44, 0x4e, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x10, 0x02, 0x32, 0x8e, 0x03, 0x0a, 0x07, - 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x12, 0x2e, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x43, 0x44, - 0x4e, 0x12, 0x16, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x43, - 0x44, 0x4e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x6d, 0x61, 0x6e, 0x61, - 0x67, 0x65, 0x72, 0x2e, 0x43, 0x44, 0x4e, 0x12, 0x34, 0x0a, 0x09, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x43, 0x44, 0x4e, 0x12, 0x19, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x44, 0x4e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x0c, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x43, 0x44, 0x4e, 0x12, 0x40, 0x0a, - 0x0c, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x12, 0x1c, 0x2e, - 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, - 0x75, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x12, - 0x46, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, - 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x53, 0x63, - 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x53, - 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x73, 0x12, 0x1e, 0x2e, 0x6d, 0x61, 0x6e, 0x61, - 0x67, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, - 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, 0x61, - 0x67, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, - 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x09, 0x4b, 0x65, - 0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x12, 0x19, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x72, 0x2e, 0x4b, 0x65, 0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, 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, 0x28, 0x01, 0x42, 0x25, 0x5a, 0x23, - 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, 0x6d, 0x61, 0x6e, 0x61, - 0x67, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x68, 0x6f, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0a, 0x63, 0x6c, 0x75, 0x73, + 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, + 0x04, 0x32, 0x02, 0x28, 0x01, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, + 0x2a, 0x45, 0x0a, 0x0a, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, + 0x0a, 0x10, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, + 0x43, 0x45, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x53, + 0x4f, 0x55, 0x52, 0x43, 0x45, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x44, 0x4e, 0x5f, 0x53, + 0x4f, 0x55, 0x52, 0x43, 0x45, 0x10, 0x02, 0x32, 0x8e, 0x03, 0x0a, 0x07, 0x4d, 0x61, 0x6e, 0x61, + 0x67, 0x65, 0x72, 0x12, 0x2e, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x43, 0x44, 0x4e, 0x12, 0x16, 0x2e, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x44, 0x4e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, + 0x43, 0x44, 0x4e, 0x12, 0x34, 0x0a, 0x09, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x44, 0x4e, + 0x12, 0x19, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x43, 0x44, 0x4e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x6d, 0x61, + 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x43, 0x44, 0x4e, 0x12, 0x40, 0x0a, 0x0c, 0x47, 0x65, 0x74, + 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x6d, 0x61, 0x6e, 0x61, + 0x67, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x72, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x12, 0x46, 0x0a, 0x0f, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x12, 0x1f, + 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, + 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x12, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, + 0x6c, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, + 0x75, 0x6c, 0x65, 0x72, 0x73, 0x12, 0x1e, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x09, 0x4b, 0x65, 0x65, 0x70, 0x41, 0x6c, + 0x69, 0x76, 0x65, 0x12, 0x19, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x4b, 0x65, + 0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, 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, 0x28, 0x01, 0x42, 0x25, 0x5a, 0x23, 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, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pkg/rpc/manager/manager.pb.validate.go b/pkg/rpc/manager/manager.pb.validate.go index 41a1f391844..c7005d721c4 100644 --- a/pkg/rpc/manager/manager.pb.validate.go +++ b/pkg/rpc/manager/manager.pb.validate.go @@ -211,7 +211,7 @@ func (m *CDN) Validate() error { // no validation rules for DownloadPort - // no validation rules for Status + // no validation rules for State // no validation rules for CdnClusterId @@ -667,7 +667,7 @@ func (m *Scheduler) Validate() error { // no validation rules for Port - // no validation rules for Status + // no validation rules for State // no validation rules for SchedulerClusterId diff --git a/pkg/rpc/manager/manager.proto b/pkg/rpc/manager/manager.proto index 468dd5a5fe5..a144c3a4f6b 100644 --- a/pkg/rpc/manager/manager.proto +++ b/pkg/rpc/manager/manager.proto @@ -53,7 +53,7 @@ message CDN { string ip = 5; int32 port = 6; int32 download_port = 7; - string status = 8; + string state = 8; uint64 cdn_cluster_id = 9; CDNCluster cdn_cluster = 10; } @@ -93,7 +93,7 @@ message Scheduler { bytes net_config = 6; string ip = 7; int32 port = 8; - string status = 9; + string state = 9; uint64 scheduler_cluster_id = 10; SchedulerCluster scheduler_cluster = 11; repeated CDN cdns = 12; diff --git a/pkg/rpc/manager/manager_grpc.pb.go b/pkg/rpc/manager/manager_grpc.pb.go index a1bd1f39182..4024ff24e66 100644 --- a/pkg/rpc/manager/manager_grpc.pb.go +++ b/pkg/rpc/manager/manager_grpc.pb.go @@ -4,7 +4,6 @@ package manager import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -13,6 +12,7 @@ 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. @@ -87,7 +87,7 @@ func (c *managerClient) ListSchedulers(ctx context.Context, in *ListSchedulersRe } func (c *managerClient) KeepAlive(ctx context.Context, opts ...grpc.CallOption) (Manager_KeepAliveClient, error) { - stream, err := c.cc.NewStream(ctx, &_Manager_serviceDesc.Streams[0], "/manager.Manager/KeepAlive", opts...) + stream, err := c.cc.NewStream(ctx, &Manager_ServiceDesc.Streams[0], "/manager.Manager/KeepAlive", opts...) if err != nil { return nil, err } @@ -171,7 +171,7 @@ type UnsafeManagerServer interface { } func RegisterManagerServer(s grpc.ServiceRegistrar, srv ManagerServer) { - s.RegisterService(&_Manager_serviceDesc, srv) + s.RegisterService(&Manager_ServiceDesc, srv) } func _Manager_GetCDN_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { @@ -290,7 +290,10 @@ func (x *managerKeepAliveServer) Recv() (*KeepAliveRequest, error) { return m, nil } -var _Manager_serviceDesc = grpc.ServiceDesc{ +// 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{ ServiceName: "manager.Manager", HandlerType: (*ManagerServer)(nil), Methods: []grpc.MethodDesc{ diff --git a/pkg/rpc/scheduler/scheduler.pb.go b/pkg/rpc/scheduler/scheduler.pb.go index 9f64d90279b..7b5d6697db1 100644 --- a/pkg/rpc/scheduler/scheduler.pb.go +++ b/pkg/rpc/scheduler/scheduler.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.15.8 +// protoc v3.17.3 // source: pkg/rpc/scheduler/scheduler.proto package scheduler diff --git a/pkg/rpc/scheduler/scheduler_grpc.pb.go b/pkg/rpc/scheduler/scheduler_grpc.pb.go index 2ac2978136f..a1b1c4149e5 100644 --- a/pkg/rpc/scheduler/scheduler_grpc.pb.go +++ b/pkg/rpc/scheduler/scheduler_grpc.pb.go @@ -12,6 +12,7 @@ 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 // SchedulerClient is the client API for Scheduler service. @@ -48,7 +49,7 @@ func (c *schedulerClient) RegisterPeerTask(ctx context.Context, in *PeerTaskRequ } 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...) + stream, err := c.cc.NewStream(ctx, &Scheduler_ServiceDesc.Streams[0], "/scheduler.Scheduler/ReportPieceResult", opts...) if err != nil { return nil, err } @@ -139,7 +140,7 @@ type UnsafeSchedulerServer interface { } func RegisterSchedulerServer(s grpc.ServiceRegistrar, srv SchedulerServer) { - s.RegisterService(&_Scheduler_serviceDesc, srv) + s.RegisterService(&Scheduler_ServiceDesc, srv) } func _Scheduler_RegisterPeerTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { @@ -222,7 +223,10 @@ func _Scheduler_LeaveTask_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } -var _Scheduler_serviceDesc = grpc.ServiceDesc{ +// Scheduler_ServiceDesc is the grpc.ServiceDesc for Scheduler service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Scheduler_ServiceDesc = grpc.ServiceDesc{ ServiceName: "scheduler.Scheduler", HandlerType: (*SchedulerServer)(nil), Methods: []grpc.MethodDesc{ diff --git a/scheduler/core/events.go b/scheduler/core/events.go index 5a7925ad371..2b6103abf66 100644 --- a/scheduler/core/events.go +++ b/scheduler/core/events.go @@ -172,30 +172,37 @@ func (e peerDownloadPieceSuccessEvent) apply(s *state) { } return } + var candidates []*supervisor.Peer parentPeer, ok := s.peerManager.Get(e.pr.DstPid) if ok { + if parentPeer.IsLeave() { + e.peer.Log().Warnf("peerDownloadPieceSuccessEvent: need reschedule parent for peer because it's parent is already left") + e.peer.ReplaceParent(nil) + var hasParent bool + parentPeer, candidates, hasParent = s.sched.ScheduleParent(e.peer, sets.NewString(parentPeer.ID)) + if !hasParent { + e.peer.Log().Warnf("peerDownloadPieceSuccessEvent: no parent node is currently available, " + + "reschedule it later") + s.waitScheduleParentPeerQueue.AddAfter(&rsPeer{peer: e.peer, blankParents: sets.NewString(parentPeer.ID)}, time.Second) + return + } + } + if oldParent, ok := e.peer.GetParent(); e.pr.DstPid != e.peer.ID && (!ok || oldParent.ID != e.pr.DstPid) { logger.WithTaskAndPeerID(e.peer.Task.ID, e.peer.ID).Debugf("parent peerID is not same as DestPid, replace it's parent node with %s", e.pr.DstPid) e.peer.ReplaceParent(parentPeer) } - } else if parentPeer.IsLeave() { - e.peer.Log().Warnf("peerDownloadPieceSuccessEvent: need reschedule parent for peer because it's parent is already left") - e.peer.ReplaceParent(nil) - var hasParent bool - parentPeer, candidates, hasParent = s.sched.ScheduleParent(e.peer, sets.NewString(parentPeer.ID)) - if !hasParent { - e.peer.Log().Warnf("peerDownloadPieceSuccessEvent: no parent node is currently available, " + - "reschedule it later") - s.waitScheduleParentPeerQueue.AddAfter(&rsPeer{peer: e.peer, blankParents: sets.NewString(parentPeer.ID)}, time.Second) - return - } + } else { + e.peer.Log().Warnf("parent peer %s not found", e.pr.DstPid) } + parentPeer.Touch() if parentPeer.ID == e.pr.DstPid { return } + // TODO if parentPeer is equal with oldParent, need schedule again ? if err := e.peer.SendSchedulePacket(constructSuccessPeerPacket(e.peer, parentPeer, candidates)); err != nil { sendErrorHandler(err, s, e.peer) diff --git a/test/e2e/manager/preheat.go b/test/e2e/manager/preheat.go index f600732266d..49020364cf2 100644 --- a/test/e2e/manager/preheat.go +++ b/test/e2e/manager/preheat.go @@ -223,7 +223,7 @@ func waitForDone(preheat *model.Job, pod *e2eutil.PodExec) bool { Expect(err).NotTo(HaveOccurred()) err = json.Unmarshal(out, preheat) Expect(err).NotTo(HaveOccurred()) - switch preheat.Status { + switch preheat.State { case machineryv1tasks.StateSuccess: return true case machineryv1tasks.StateFailure: