Documentation ¶
Index ¶
- type Service
- func (s *Service) AnnounceTask(ctx context.Context, req *schedulerv1.AnnounceTaskRequest) error
- func (s *Service) LeaveTask(ctx context.Context, req *schedulerv1.PeerTarget) error
- func (s *Service) RegisterPeerTask(ctx context.Context, req *schedulerv1.PeerTaskRequest) (*schedulerv1.RegisterResult, error)
- func (s *Service) ReportPeerResult(ctx context.Context, req *schedulerv1.PeerResult) error
- func (s *Service) ReportPieceResult(stream schedulerv1.Scheduler_ReportPieceResultServer) error
- func (s *Service) StatTask(ctx context.Context, req *schedulerv1.StatTaskRequest) (*schedulerv1.Task, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New( cfg *config.Config, resource resource.Resource, scheduler scheduler.Scheduler, dynconfig config.DynconfigInterface, storage storage.Storage, ) *Service
New service instance.
func (*Service) AnnounceTask ¶ added in v2.0.3
func (s *Service) AnnounceTask(ctx context.Context, req *schedulerv1.AnnounceTaskRequest) error
AnnounceTask informs scheduler a peer has completed task.
func (*Service) LeaveTask ¶
func (s *Service) LeaveTask(ctx context.Context, req *schedulerv1.PeerTarget) error
LeaveTask makes the peer unschedulable.
func (*Service) RegisterPeerTask ¶
func (s *Service) RegisterPeerTask(ctx context.Context, req *schedulerv1.PeerTaskRequest) (*schedulerv1.RegisterResult, error)
RegisterPeerTask registers peer and triggers seed peer download task.
func (*Service) ReportPeerResult ¶
func (s *Service) ReportPeerResult(ctx context.Context, req *schedulerv1.PeerResult) error
ReportPeerResult handles peer result reported by dfdaemon.
func (*Service) ReportPieceResult ¶
func (s *Service) ReportPieceResult(stream schedulerv1.Scheduler_ReportPieceResultServer) error
ReportPieceResult handles the piece information reported by dfdaemon.
func (*Service) StatTask ¶ added in v2.0.3
func (s *Service) StatTask(ctx context.Context, req *schedulerv1.StatTaskRequest) (*schedulerv1.Task, error)
StatTask checks the current state of the task.
Click to show internal directories.
Click to hide internal directories.