// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc             v3.21.6
// source: pkg/apis/scheduler/v2/scheduler.proto

package scheduler

import (
	context "context"
	v2 "d7y.io/api/v2/pkg/apis/common/v2"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	emptypb "google.golang.org/protobuf/types/known/emptypb"
)

// 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.
//
// 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 SchedulerClient interface {
	// AnnouncePeer announces peer to scheduler.
	AnnouncePeer(ctx context.Context, opts ...grpc.CallOption) (Scheduler_AnnouncePeerClient, error)
	// Checks information of peer.
	StatPeer(ctx context.Context, in *StatPeerRequest, opts ...grpc.CallOption) (*v2.Peer, error)
	// DeletePeer releases peer in scheduler.
	DeletePeer(ctx context.Context, in *DeletePeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Checks information of task.
	StatTask(ctx context.Context, in *StatTaskRequest, opts ...grpc.CallOption) (*v2.Task, error)
	// DeleteTask releases task in scheduler.
	DeleteTask(ctx context.Context, in *DeleteTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// AnnounceHost announces host to scheduler.
	AnnounceHost(ctx context.Context, in *AnnounceHostRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// ListHosts lists hosts in scheduler.
	ListHosts(ctx context.Context, in *ListHostsRequest, opts ...grpc.CallOption) (*ListHostsResponse, error)
	// DeleteHost releases host in scheduler.
	DeleteHost(ctx context.Context, in *DeleteHostRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// AnnounceCachePeer announces cache peer to scheduler.
	AnnounceCachePeer(ctx context.Context, opts ...grpc.CallOption) (Scheduler_AnnounceCachePeerClient, error)
	// Checks information of cache peer.
	StatCachePeer(ctx context.Context, in *StatCachePeerRequest, opts ...grpc.CallOption) (*v2.CachePeer, error)
	// DeleteCachePeer releases cache peer in scheduler.
	DeleteCachePeer(ctx context.Context, in *DeleteCachePeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Checks information of cache task.
	StatCacheTask(ctx context.Context, in *StatCacheTaskRequest, opts ...grpc.CallOption) (*v2.CacheTask, error)
	// DeleteCacheTask releases cache task in scheduler.
	DeleteCacheTask(ctx context.Context, in *DeleteCacheTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// AnnouncePersistentPeer announces persistent peer to scheduler.
	AnnouncePersistentPeer(ctx context.Context, opts ...grpc.CallOption) (Scheduler_AnnouncePersistentPeerClient, error)
	// Checks information of persistent peer.
	StatPersistentPeer(ctx context.Context, in *StatPersistentPeerRequest, opts ...grpc.CallOption) (*v2.PersistentPeer, error)
	// DeletePersistentPeer releases persistent peer in scheduler.
	DeletePersistentPeer(ctx context.Context, in *DeletePersistentPeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// UploadPersistentTaskStarted uploads persistent task started to scheduler.
	UploadPersistentTaskStarted(ctx context.Context, in *UploadPersistentTaskStartedRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// UploadPersistentTaskFinished uploads persistent task finished to scheduler.
	UploadPersistentTaskFinished(ctx context.Context, in *UploadPersistentTaskFinishedRequest, opts ...grpc.CallOption) (*v2.PersistentTask, error)
	// UploadPersistentTaskFailed uploads persistent task failed to scheduler.
	UploadPersistentTaskFailed(ctx context.Context, in *UploadPersistentTaskFailedRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Checks information of persistent task.
	StatPersistentTask(ctx context.Context, in *StatPersistentTaskRequest, opts ...grpc.CallOption) (*v2.PersistentTask, error)
	// DeletePersistentTask releases persistent task in scheduler.
	DeletePersistentTask(ctx context.Context, in *DeletePersistentTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// AnnouncePersistentCachePeer announces persistent cache peer to scheduler.
	AnnouncePersistentCachePeer(ctx context.Context, opts ...grpc.CallOption) (Scheduler_AnnouncePersistentCachePeerClient, error)
	// Checks information of persistent cache peer.
	StatPersistentCachePeer(ctx context.Context, in *StatPersistentCachePeerRequest, opts ...grpc.CallOption) (*v2.PersistentCachePeer, error)
	// DeletePersistentCachePeer releases persistent cache peer in scheduler.
	DeletePersistentCachePeer(ctx context.Context, in *DeletePersistentCachePeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// UploadPersistentCacheTaskStarted uploads persistent cache task started to scheduler.
	UploadPersistentCacheTaskStarted(ctx context.Context, in *UploadPersistentCacheTaskStartedRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// UploadPersistentCacheTaskFinished uploads persistent cache task finished to scheduler.
	UploadPersistentCacheTaskFinished(ctx context.Context, in *UploadPersistentCacheTaskFinishedRequest, opts ...grpc.CallOption) (*v2.PersistentCacheTask, error)
	// UploadPersistentCacheTaskFailed uploads persistent cache task failed to scheduler.
	UploadPersistentCacheTaskFailed(ctx context.Context, in *UploadPersistentCacheTaskFailedRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Checks information of persistent cache task.
	StatPersistentCacheTask(ctx context.Context, in *StatPersistentCacheTaskRequest, opts ...grpc.CallOption) (*v2.PersistentCacheTask, error)
	// DeletePersistentCacheTask releases persistent cache task in scheduler.
	DeletePersistentCacheTask(ctx context.Context, in *DeletePersistentCacheTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// PreheatImage synchronously resolves an image manifest and triggers an asynchronous preheat task.
	//
	// This is a blocking call. The RPC will not return until the server has completed the
	// initial synchronous work: resolving the image manifest and preparing all layer URLs.
	//
	// After this call successfully returns, a scheduler on the server begins the actual
	// preheating process, instructing peers to download the layers in the background.
	//
	// A successful response (google.protobuf.Empty) confirms that the preparation is complete
	// and the asynchronous download task has been scheduled.
	PreheatImage(ctx context.Context, in *PreheatImageRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// StatImage provides detailed status for a container image's distribution in peers.
	//
	// This is a blocking call that first resolves the image manifest and then queries
	// all peers to collect the image's download state across the network.
	// The response includes both layer information and the status on each peer.
	StatImage(ctx context.Context, in *StatImageRequest, opts ...grpc.CallOption) (*StatImageResponse, error)
	// PreheatFile synchronously resolves a file URL and triggers an asynchronous preheat task.
	//
	// This is a blocking call. The RPC will not return until the server has completed the
	// initial synchronous work: resolving the file URL.
	//
	// After this call successfully returns, a scheduler on the server begins the actual
	// preheating process, instructing peers to download the file in the background.
	//
	// A successful response (google.protobuf.Empty) confirms that the preparation is complete
	// and the asynchronous download task has been scheduled.
	PreheatFile(ctx context.Context, in *PreheatFileRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// StatFile provides detailed status for a file's distribution in peers.
	//
	// This is a blocking call that first resolves the file URL and then queries
	// all peers to collect the file's download state across the network.
	// The response includes both file information and the status on each peer.
	StatFile(ctx context.Context, in *StatFileRequest, opts ...grpc.CallOption) (*StatFileResponse, error)
}

type schedulerClient struct {
	cc grpc.ClientConnInterface
}

func NewSchedulerClient(cc grpc.ClientConnInterface) SchedulerClient {
	return &schedulerClient{cc}
}

func (c *schedulerClient) AnnouncePeer(ctx context.Context, opts ...grpc.CallOption) (Scheduler_AnnouncePeerClient, error) {
	stream, err := c.cc.NewStream(ctx, &Scheduler_ServiceDesc.Streams[0], "/scheduler.v2.Scheduler/AnnouncePeer", opts...)
	if err != nil {
		return nil, err
	}
	x := &schedulerAnnouncePeerClient{stream}
	return x, nil
}

type Scheduler_AnnouncePeerClient interface {
	Send(*AnnouncePeerRequest) error
	Recv() (*AnnouncePeerResponse, error)
	grpc.ClientStream
}

type schedulerAnnouncePeerClient struct {
	grpc.ClientStream
}

func (x *schedulerAnnouncePeerClient) Send(m *AnnouncePeerRequest) error {
	return x.ClientStream.SendMsg(m)
}

func (x *schedulerAnnouncePeerClient) Recv() (*AnnouncePeerResponse, error) {
	m := new(AnnouncePeerResponse)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func (c *schedulerClient) StatPeer(ctx context.Context, in *StatPeerRequest, opts ...grpc.CallOption) (*v2.Peer, error) {
	out := new(v2.Peer)
	err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/StatPeer", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *schedulerClient) DeletePeer(ctx context.Context, in *DeletePeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/DeletePeer", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *schedulerClient) StatTask(ctx context.Context, in *StatTaskRequest, opts ...grpc.CallOption) (*v2.Task, error) {
	out := new(v2.Task)
	err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/StatTask", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *schedulerClient) DeleteTask(ctx context.Context, in *DeleteTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/DeleteTask", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *schedulerClient) AnnounceHost(ctx context.Context, in *AnnounceHostRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/AnnounceHost", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *schedulerClient) ListHosts(ctx context.Context, in *ListHostsRequest, opts ...grpc.CallOption) (*ListHostsResponse, error) {
	out := new(ListHostsResponse)
	err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/ListHosts", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *schedulerClient) DeleteHost(ctx context.Context, in *DeleteHostRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/DeleteHost", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *schedulerClient) AnnounceCachePeer(ctx context.Context, opts ...grpc.CallOption) (Scheduler_AnnounceCachePeerClient, error) {
	stream, err := c.cc.NewStream(ctx, &Scheduler_ServiceDesc.Streams[1], "/scheduler.v2.Scheduler/AnnounceCachePeer", opts...)
	if err != nil {
		return nil, err
	}
	x := &schedulerAnnounceCachePeerClient{stream}
	return x, nil
}

type Scheduler_AnnounceCachePeerClient interface {
	Send(*AnnounceCachePeerRequest) error
	Recv() (*AnnounceCachePeerResponse, error)
	grpc.ClientStream
}

type schedulerAnnounceCachePeerClient struct {
	grpc.ClientStream
}

func (x *schedulerAnnounceCachePeerClient) Send(m *AnnounceCachePeerRequest) error {
	return x.ClientStream.SendMsg(m)
}

func (x *schedulerAnnounceCachePeerClient) Recv() (*AnnounceCachePeerResponse, error) {
	m := new(AnnounceCachePeerResponse)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func (c *schedulerClient) StatCachePeer(ctx context.Context, in *StatCachePeerRequest, opts ...grpc.CallOption) (*v2.CachePeer, error) {
	out := new(v2.CachePeer)
	err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/StatCachePeer", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *schedulerClient) DeleteCachePeer(ctx context.Context, in *DeleteCachePeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/DeleteCachePeer", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *schedulerClient) StatCacheTask(ctx context.Context, in *StatCacheTaskRequest, opts ...grpc.CallOption) (*v2.CacheTask, error) {
	out := new(v2.CacheTask)
	err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/StatCacheTask", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *schedulerClient) DeleteCacheTask(ctx context.Context, in *DeleteCacheTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/DeleteCacheTask", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *schedulerClient) AnnouncePersistentPeer(ctx context.Context, opts ...grpc.CallOption) (Scheduler_AnnouncePersistentPeerClient, error) {
	stream, err := c.cc.NewStream(ctx, &Scheduler_ServiceDesc.Streams[2], "/scheduler.v2.Scheduler/AnnouncePersistentPeer", opts...)
	if err != nil {
		return nil, err
	}
	x := &schedulerAnnouncePersistentPeerClient{stream}
	return x, nil
}

type Scheduler_AnnouncePersistentPeerClient interface {
	Send(*AnnouncePersistentPeerRequest) error
	Recv() (*AnnouncePersistentPeerResponse, error)
	grpc.ClientStream
}

type schedulerAnnouncePersistentPeerClient struct {
	grpc.ClientStream
}

func (x *schedulerAnnouncePersistentPeerClient) Send(m *AnnouncePersistentPeerRequest) error {
	return x.ClientStream.SendMsg(m)
}

func (x *schedulerAnnouncePersistentPeerClient) Recv() (*AnnouncePersistentPeerResponse, error) {
	m := new(AnnouncePersistentPeerResponse)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func (c *schedulerClient) StatPersistentPeer(ctx context.Context, in *StatPersistentPeerRequest, opts ...grpc.CallOption) (*v2.PersistentPeer, error) {
	out := new(v2.PersistentPeer)
	err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/StatPersistentPeer", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *schedulerClient) DeletePersistentPeer(ctx context.Context, in *DeletePersistentPeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/DeletePersistentPeer", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *schedulerClient) UploadPersistentTaskStarted(ctx context.Context, in *UploadPersistentTaskStartedRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/UploadPersistentTaskStarted", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *schedulerClient) UploadPersistentTaskFinished(ctx context.Context, in *UploadPersistentTaskFinishedRequest, opts ...grpc.CallOption) (*v2.PersistentTask, error) {
	out := new(v2.PersistentTask)
	err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/UploadPersistentTaskFinished", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *schedulerClient) UploadPersistentTaskFailed(ctx context.Context, in *UploadPersistentTaskFailedRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/UploadPersistentTaskFailed", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *schedulerClient) StatPersistentTask(ctx context.Context, in *StatPersistentTaskRequest, opts ...grpc.CallOption) (*v2.PersistentTask, error) {
	out := new(v2.PersistentTask)
	err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/StatPersistentTask", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *schedulerClient) DeletePersistentTask(ctx context.Context, in *DeletePersistentTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/DeletePersistentTask", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *schedulerClient) AnnouncePersistentCachePeer(ctx context.Context, opts ...grpc.CallOption) (Scheduler_AnnouncePersistentCachePeerClient, error) {
	stream, err := c.cc.NewStream(ctx, &Scheduler_ServiceDesc.Streams[3], "/scheduler.v2.Scheduler/AnnouncePersistentCachePeer", opts...)
	if err != nil {
		return nil, err
	}
	x := &schedulerAnnouncePersistentCachePeerClient{stream}
	return x, nil
}

type Scheduler_AnnouncePersistentCachePeerClient interface {
	Send(*AnnouncePersistentCachePeerRequest) error
	Recv() (*AnnouncePersistentCachePeerResponse, error)
	grpc.ClientStream
}

type schedulerAnnouncePersistentCachePeerClient struct {
	grpc.ClientStream
}

func (x *schedulerAnnouncePersistentCachePeerClient) Send(m *AnnouncePersistentCachePeerRequest) error {
	return x.ClientStream.SendMsg(m)
}

func (x *schedulerAnnouncePersistentCachePeerClient) Recv() (*AnnouncePersistentCachePeerResponse, error) {
	m := new(AnnouncePersistentCachePeerResponse)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func (c *schedulerClient) StatPersistentCachePeer(ctx context.Context, in *StatPersistentCachePeerRequest, opts ...grpc.CallOption) (*v2.PersistentCachePeer, error) {
	out := new(v2.PersistentCachePeer)
	err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/StatPersistentCachePeer", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *schedulerClient) DeletePersistentCachePeer(ctx context.Context, in *DeletePersistentCachePeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/DeletePersistentCachePeer", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *schedulerClient) UploadPersistentCacheTaskStarted(ctx context.Context, in *UploadPersistentCacheTaskStartedRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/UploadPersistentCacheTaskStarted", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *schedulerClient) UploadPersistentCacheTaskFinished(ctx context.Context, in *UploadPersistentCacheTaskFinishedRequest, opts ...grpc.CallOption) (*v2.PersistentCacheTask, error) {
	out := new(v2.PersistentCacheTask)
	err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/UploadPersistentCacheTaskFinished", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *schedulerClient) UploadPersistentCacheTaskFailed(ctx context.Context, in *UploadPersistentCacheTaskFailedRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/UploadPersistentCacheTaskFailed", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *schedulerClient) StatPersistentCacheTask(ctx context.Context, in *StatPersistentCacheTaskRequest, opts ...grpc.CallOption) (*v2.PersistentCacheTask, error) {
	out := new(v2.PersistentCacheTask)
	err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/StatPersistentCacheTask", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *schedulerClient) DeletePersistentCacheTask(ctx context.Context, in *DeletePersistentCacheTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/DeletePersistentCacheTask", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *schedulerClient) PreheatImage(ctx context.Context, in *PreheatImageRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/PreheatImage", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *schedulerClient) StatImage(ctx context.Context, in *StatImageRequest, opts ...grpc.CallOption) (*StatImageResponse, error) {
	out := new(StatImageResponse)
	err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/StatImage", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *schedulerClient) PreheatFile(ctx context.Context, in *PreheatFileRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/PreheatFile", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *schedulerClient) StatFile(ctx context.Context, in *StatFileRequest, opts ...grpc.CallOption) (*StatFileResponse, error) {
	out := new(StatFileResponse)
	err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/StatFile", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// SchedulerServer is the server API for Scheduler service.
// All implementations should embed UnimplementedSchedulerServer
// for forward compatibility
type SchedulerServer interface {
	// AnnouncePeer announces peer to scheduler.
	AnnouncePeer(Scheduler_AnnouncePeerServer) error
	// Checks information of peer.
	StatPeer(context.Context, *StatPeerRequest) (*v2.Peer, error)
	// DeletePeer releases peer in scheduler.
	DeletePeer(context.Context, *DeletePeerRequest) (*emptypb.Empty, error)
	// Checks information of task.
	StatTask(context.Context, *StatTaskRequest) (*v2.Task, error)
	// DeleteTask releases task in scheduler.
	DeleteTask(context.Context, *DeleteTaskRequest) (*emptypb.Empty, error)
	// AnnounceHost announces host to scheduler.
	AnnounceHost(context.Context, *AnnounceHostRequest) (*emptypb.Empty, error)
	// ListHosts lists hosts in scheduler.
	ListHosts(context.Context, *ListHostsRequest) (*ListHostsResponse, error)
	// DeleteHost releases host in scheduler.
	DeleteHost(context.Context, *DeleteHostRequest) (*emptypb.Empty, error)
	// AnnounceCachePeer announces cache peer to scheduler.
	AnnounceCachePeer(Scheduler_AnnounceCachePeerServer) error
	// Checks information of cache peer.
	StatCachePeer(context.Context, *StatCachePeerRequest) (*v2.CachePeer, error)
	// DeleteCachePeer releases cache peer in scheduler.
	DeleteCachePeer(context.Context, *DeleteCachePeerRequest) (*emptypb.Empty, error)
	// Checks information of cache task.
	StatCacheTask(context.Context, *StatCacheTaskRequest) (*v2.CacheTask, error)
	// DeleteCacheTask releases cache task in scheduler.
	DeleteCacheTask(context.Context, *DeleteCacheTaskRequest) (*emptypb.Empty, error)
	// AnnouncePersistentPeer announces persistent peer to scheduler.
	AnnouncePersistentPeer(Scheduler_AnnouncePersistentPeerServer) error
	// Checks information of persistent peer.
	StatPersistentPeer(context.Context, *StatPersistentPeerRequest) (*v2.PersistentPeer, error)
	// DeletePersistentPeer releases persistent peer in scheduler.
	DeletePersistentPeer(context.Context, *DeletePersistentPeerRequest) (*emptypb.Empty, error)
	// UploadPersistentTaskStarted uploads persistent task started to scheduler.
	UploadPersistentTaskStarted(context.Context, *UploadPersistentTaskStartedRequest) (*emptypb.Empty, error)
	// UploadPersistentTaskFinished uploads persistent task finished to scheduler.
	UploadPersistentTaskFinished(context.Context, *UploadPersistentTaskFinishedRequest) (*v2.PersistentTask, error)
	// UploadPersistentTaskFailed uploads persistent task failed to scheduler.
	UploadPersistentTaskFailed(context.Context, *UploadPersistentTaskFailedRequest) (*emptypb.Empty, error)
	// Checks information of persistent task.
	StatPersistentTask(context.Context, *StatPersistentTaskRequest) (*v2.PersistentTask, error)
	// DeletePersistentTask releases persistent task in scheduler.
	DeletePersistentTask(context.Context, *DeletePersistentTaskRequest) (*emptypb.Empty, error)
	// AnnouncePersistentCachePeer announces persistent cache peer to scheduler.
	AnnouncePersistentCachePeer(Scheduler_AnnouncePersistentCachePeerServer) error
	// Checks information of persistent cache peer.
	StatPersistentCachePeer(context.Context, *StatPersistentCachePeerRequest) (*v2.PersistentCachePeer, error)
	// DeletePersistentCachePeer releases persistent cache peer in scheduler.
	DeletePersistentCachePeer(context.Context, *DeletePersistentCachePeerRequest) (*emptypb.Empty, error)
	// UploadPersistentCacheTaskStarted uploads persistent cache task started to scheduler.
	UploadPersistentCacheTaskStarted(context.Context, *UploadPersistentCacheTaskStartedRequest) (*emptypb.Empty, error)
	// UploadPersistentCacheTaskFinished uploads persistent cache task finished to scheduler.
	UploadPersistentCacheTaskFinished(context.Context, *UploadPersistentCacheTaskFinishedRequest) (*v2.PersistentCacheTask, error)
	// UploadPersistentCacheTaskFailed uploads persistent cache task failed to scheduler.
	UploadPersistentCacheTaskFailed(context.Context, *UploadPersistentCacheTaskFailedRequest) (*emptypb.Empty, error)
	// Checks information of persistent cache task.
	StatPersistentCacheTask(context.Context, *StatPersistentCacheTaskRequest) (*v2.PersistentCacheTask, error)
	// DeletePersistentCacheTask releases persistent cache task in scheduler.
	DeletePersistentCacheTask(context.Context, *DeletePersistentCacheTaskRequest) (*emptypb.Empty, error)
	// PreheatImage synchronously resolves an image manifest and triggers an asynchronous preheat task.
	//
	// This is a blocking call. The RPC will not return until the server has completed the
	// initial synchronous work: resolving the image manifest and preparing all layer URLs.
	//
	// After this call successfully returns, a scheduler on the server begins the actual
	// preheating process, instructing peers to download the layers in the background.
	//
	// A successful response (google.protobuf.Empty) confirms that the preparation is complete
	// and the asynchronous download task has been scheduled.
	PreheatImage(context.Context, *PreheatImageRequest) (*emptypb.Empty, error)
	// StatImage provides detailed status for a container image's distribution in peers.
	//
	// This is a blocking call that first resolves the image manifest and then queries
	// all peers to collect the image's download state across the network.
	// The response includes both layer information and the status on each peer.
	StatImage(context.Context, *StatImageRequest) (*StatImageResponse, error)
	// PreheatFile synchronously resolves a file URL and triggers an asynchronous preheat task.
	//
	// This is a blocking call. The RPC will not return until the server has completed the
	// initial synchronous work: resolving the file URL.
	//
	// After this call successfully returns, a scheduler on the server begins the actual
	// preheating process, instructing peers to download the file in the background.
	//
	// A successful response (google.protobuf.Empty) confirms that the preparation is complete
	// and the asynchronous download task has been scheduled.
	PreheatFile(context.Context, *PreheatFileRequest) (*emptypb.Empty, error)
	// StatFile provides detailed status for a file's distribution in peers.
	//
	// This is a blocking call that first resolves the file URL and then queries
	// all peers to collect the file's download state across the network.
	// The response includes both file information and the status on each peer.
	StatFile(context.Context, *StatFileRequest) (*StatFileResponse, error)
}

// UnimplementedSchedulerServer should be embedded to have forward compatible implementations.
type UnimplementedSchedulerServer struct {
}

func (UnimplementedSchedulerServer) AnnouncePeer(Scheduler_AnnouncePeerServer) error {
	return status.Errorf(codes.Unimplemented, "method AnnouncePeer not implemented")
}
func (UnimplementedSchedulerServer) StatPeer(context.Context, *StatPeerRequest) (*v2.Peer, error) {
	return nil, status.Errorf(codes.Unimplemented, "method StatPeer not implemented")
}
func (UnimplementedSchedulerServer) DeletePeer(context.Context, *DeletePeerRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeletePeer not implemented")
}
func (UnimplementedSchedulerServer) StatTask(context.Context, *StatTaskRequest) (*v2.Task, error) {
	return nil, status.Errorf(codes.Unimplemented, "method StatTask not implemented")
}
func (UnimplementedSchedulerServer) DeleteTask(context.Context, *DeleteTaskRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeleteTask not implemented")
}
func (UnimplementedSchedulerServer) AnnounceHost(context.Context, *AnnounceHostRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method AnnounceHost not implemented")
}
func (UnimplementedSchedulerServer) ListHosts(context.Context, *ListHostsRequest) (*ListHostsResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListHosts not implemented")
}
func (UnimplementedSchedulerServer) DeleteHost(context.Context, *DeleteHostRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeleteHost not implemented")
}
func (UnimplementedSchedulerServer) AnnounceCachePeer(Scheduler_AnnounceCachePeerServer) error {
	return status.Errorf(codes.Unimplemented, "method AnnounceCachePeer not implemented")
}
func (UnimplementedSchedulerServer) StatCachePeer(context.Context, *StatCachePeerRequest) (*v2.CachePeer, error) {
	return nil, status.Errorf(codes.Unimplemented, "method StatCachePeer not implemented")
}
func (UnimplementedSchedulerServer) DeleteCachePeer(context.Context, *DeleteCachePeerRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeleteCachePeer not implemented")
}
func (UnimplementedSchedulerServer) StatCacheTask(context.Context, *StatCacheTaskRequest) (*v2.CacheTask, error) {
	return nil, status.Errorf(codes.Unimplemented, "method StatCacheTask not implemented")
}
func (UnimplementedSchedulerServer) DeleteCacheTask(context.Context, *DeleteCacheTaskRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeleteCacheTask not implemented")
}
func (UnimplementedSchedulerServer) AnnouncePersistentPeer(Scheduler_AnnouncePersistentPeerServer) error {
	return status.Errorf(codes.Unimplemented, "method AnnouncePersistentPeer not implemented")
}
func (UnimplementedSchedulerServer) StatPersistentPeer(context.Context, *StatPersistentPeerRequest) (*v2.PersistentPeer, error) {
	return nil, status.Errorf(codes.Unimplemented, "method StatPersistentPeer not implemented")
}
func (UnimplementedSchedulerServer) DeletePersistentPeer(context.Context, *DeletePersistentPeerRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeletePersistentPeer not implemented")
}
func (UnimplementedSchedulerServer) UploadPersistentTaskStarted(context.Context, *UploadPersistentTaskStartedRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method UploadPersistentTaskStarted not implemented")
}
func (UnimplementedSchedulerServer) UploadPersistentTaskFinished(context.Context, *UploadPersistentTaskFinishedRequest) (*v2.PersistentTask, error) {
	return nil, status.Errorf(codes.Unimplemented, "method UploadPersistentTaskFinished not implemented")
}
func (UnimplementedSchedulerServer) UploadPersistentTaskFailed(context.Context, *UploadPersistentTaskFailedRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method UploadPersistentTaskFailed not implemented")
}
func (UnimplementedSchedulerServer) StatPersistentTask(context.Context, *StatPersistentTaskRequest) (*v2.PersistentTask, error) {
	return nil, status.Errorf(codes.Unimplemented, "method StatPersistentTask not implemented")
}
func (UnimplementedSchedulerServer) DeletePersistentTask(context.Context, *DeletePersistentTaskRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeletePersistentTask not implemented")
}
func (UnimplementedSchedulerServer) AnnouncePersistentCachePeer(Scheduler_AnnouncePersistentCachePeerServer) error {
	return status.Errorf(codes.Unimplemented, "method AnnouncePersistentCachePeer not implemented")
}
func (UnimplementedSchedulerServer) StatPersistentCachePeer(context.Context, *StatPersistentCachePeerRequest) (*v2.PersistentCachePeer, error) {
	return nil, status.Errorf(codes.Unimplemented, "method StatPersistentCachePeer not implemented")
}
func (UnimplementedSchedulerServer) DeletePersistentCachePeer(context.Context, *DeletePersistentCachePeerRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeletePersistentCachePeer not implemented")
}
func (UnimplementedSchedulerServer) UploadPersistentCacheTaskStarted(context.Context, *UploadPersistentCacheTaskStartedRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method UploadPersistentCacheTaskStarted not implemented")
}
func (UnimplementedSchedulerServer) UploadPersistentCacheTaskFinished(context.Context, *UploadPersistentCacheTaskFinishedRequest) (*v2.PersistentCacheTask, error) {
	return nil, status.Errorf(codes.Unimplemented, "method UploadPersistentCacheTaskFinished not implemented")
}
func (UnimplementedSchedulerServer) UploadPersistentCacheTaskFailed(context.Context, *UploadPersistentCacheTaskFailedRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method UploadPersistentCacheTaskFailed not implemented")
}
func (UnimplementedSchedulerServer) StatPersistentCacheTask(context.Context, *StatPersistentCacheTaskRequest) (*v2.PersistentCacheTask, error) {
	return nil, status.Errorf(codes.Unimplemented, "method StatPersistentCacheTask not implemented")
}
func (UnimplementedSchedulerServer) DeletePersistentCacheTask(context.Context, *DeletePersistentCacheTaskRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeletePersistentCacheTask not implemented")
}
func (UnimplementedSchedulerServer) PreheatImage(context.Context, *PreheatImageRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method PreheatImage not implemented")
}
func (UnimplementedSchedulerServer) StatImage(context.Context, *StatImageRequest) (*StatImageResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method StatImage not implemented")
}
func (UnimplementedSchedulerServer) PreheatFile(context.Context, *PreheatFileRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method PreheatFile not implemented")
}
func (UnimplementedSchedulerServer) StatFile(context.Context, *StatFileRequest) (*StatFileResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method StatFile not implemented")
}

// UnsafeSchedulerServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to SchedulerServer will
// result in compilation errors.
type UnsafeSchedulerServer interface {
	mustEmbedUnimplementedSchedulerServer()
}

func RegisterSchedulerServer(s grpc.ServiceRegistrar, srv SchedulerServer) {
	s.RegisterService(&Scheduler_ServiceDesc, srv)
}

func _Scheduler_AnnouncePeer_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(SchedulerServer).AnnouncePeer(&schedulerAnnouncePeerServer{stream})
}

type Scheduler_AnnouncePeerServer interface {
	Send(*AnnouncePeerResponse) error
	Recv() (*AnnouncePeerRequest, error)
	grpc.ServerStream
}

type schedulerAnnouncePeerServer struct {
	grpc.ServerStream
}

func (x *schedulerAnnouncePeerServer) Send(m *AnnouncePeerResponse) error {
	return x.ServerStream.SendMsg(m)
}

func (x *schedulerAnnouncePeerServer) Recv() (*AnnouncePeerRequest, error) {
	m := new(AnnouncePeerRequest)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func _Scheduler_StatPeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(StatPeerRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SchedulerServer).StatPeer(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/scheduler.v2.Scheduler/StatPeer",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SchedulerServer).StatPeer(ctx, req.(*StatPeerRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Scheduler_DeletePeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeletePeerRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SchedulerServer).DeletePeer(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/scheduler.v2.Scheduler/DeletePeer",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SchedulerServer).DeletePeer(ctx, req.(*DeletePeerRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Scheduler_StatTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(StatTaskRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SchedulerServer).StatTask(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/scheduler.v2.Scheduler/StatTask",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SchedulerServer).StatTask(ctx, req.(*StatTaskRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Scheduler_DeleteTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteTaskRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SchedulerServer).DeleteTask(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/scheduler.v2.Scheduler/DeleteTask",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SchedulerServer).DeleteTask(ctx, req.(*DeleteTaskRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Scheduler_AnnounceHost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(AnnounceHostRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SchedulerServer).AnnounceHost(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/scheduler.v2.Scheduler/AnnounceHost",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SchedulerServer).AnnounceHost(ctx, req.(*AnnounceHostRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Scheduler_ListHosts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListHostsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SchedulerServer).ListHosts(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/scheduler.v2.Scheduler/ListHosts",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SchedulerServer).ListHosts(ctx, req.(*ListHostsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Scheduler_DeleteHost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteHostRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SchedulerServer).DeleteHost(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/scheduler.v2.Scheduler/DeleteHost",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SchedulerServer).DeleteHost(ctx, req.(*DeleteHostRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Scheduler_AnnounceCachePeer_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(SchedulerServer).AnnounceCachePeer(&schedulerAnnounceCachePeerServer{stream})
}

type Scheduler_AnnounceCachePeerServer interface {
	Send(*AnnounceCachePeerResponse) error
	Recv() (*AnnounceCachePeerRequest, error)
	grpc.ServerStream
}

type schedulerAnnounceCachePeerServer struct {
	grpc.ServerStream
}

func (x *schedulerAnnounceCachePeerServer) Send(m *AnnounceCachePeerResponse) error {
	return x.ServerStream.SendMsg(m)
}

func (x *schedulerAnnounceCachePeerServer) Recv() (*AnnounceCachePeerRequest, error) {
	m := new(AnnounceCachePeerRequest)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func _Scheduler_StatCachePeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(StatCachePeerRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SchedulerServer).StatCachePeer(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/scheduler.v2.Scheduler/StatCachePeer",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SchedulerServer).StatCachePeer(ctx, req.(*StatCachePeerRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Scheduler_DeleteCachePeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteCachePeerRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SchedulerServer).DeleteCachePeer(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/scheduler.v2.Scheduler/DeleteCachePeer",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SchedulerServer).DeleteCachePeer(ctx, req.(*DeleteCachePeerRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Scheduler_StatCacheTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(StatCacheTaskRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SchedulerServer).StatCacheTask(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/scheduler.v2.Scheduler/StatCacheTask",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SchedulerServer).StatCacheTask(ctx, req.(*StatCacheTaskRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Scheduler_DeleteCacheTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteCacheTaskRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SchedulerServer).DeleteCacheTask(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/scheduler.v2.Scheduler/DeleteCacheTask",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SchedulerServer).DeleteCacheTask(ctx, req.(*DeleteCacheTaskRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Scheduler_AnnouncePersistentPeer_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(SchedulerServer).AnnouncePersistentPeer(&schedulerAnnouncePersistentPeerServer{stream})
}

type Scheduler_AnnouncePersistentPeerServer interface {
	Send(*AnnouncePersistentPeerResponse) error
	Recv() (*AnnouncePersistentPeerRequest, error)
	grpc.ServerStream
}

type schedulerAnnouncePersistentPeerServer struct {
	grpc.ServerStream
}

func (x *schedulerAnnouncePersistentPeerServer) Send(m *AnnouncePersistentPeerResponse) error {
	return x.ServerStream.SendMsg(m)
}

func (x *schedulerAnnouncePersistentPeerServer) Recv() (*AnnouncePersistentPeerRequest, error) {
	m := new(AnnouncePersistentPeerRequest)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func _Scheduler_StatPersistentPeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(StatPersistentPeerRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SchedulerServer).StatPersistentPeer(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/scheduler.v2.Scheduler/StatPersistentPeer",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SchedulerServer).StatPersistentPeer(ctx, req.(*StatPersistentPeerRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Scheduler_DeletePersistentPeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeletePersistentPeerRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SchedulerServer).DeletePersistentPeer(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/scheduler.v2.Scheduler/DeletePersistentPeer",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SchedulerServer).DeletePersistentPeer(ctx, req.(*DeletePersistentPeerRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Scheduler_UploadPersistentTaskStarted_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UploadPersistentTaskStartedRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SchedulerServer).UploadPersistentTaskStarted(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/scheduler.v2.Scheduler/UploadPersistentTaskStarted",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SchedulerServer).UploadPersistentTaskStarted(ctx, req.(*UploadPersistentTaskStartedRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Scheduler_UploadPersistentTaskFinished_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UploadPersistentTaskFinishedRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SchedulerServer).UploadPersistentTaskFinished(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/scheduler.v2.Scheduler/UploadPersistentTaskFinished",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SchedulerServer).UploadPersistentTaskFinished(ctx, req.(*UploadPersistentTaskFinishedRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Scheduler_UploadPersistentTaskFailed_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UploadPersistentTaskFailedRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SchedulerServer).UploadPersistentTaskFailed(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/scheduler.v2.Scheduler/UploadPersistentTaskFailed",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SchedulerServer).UploadPersistentTaskFailed(ctx, req.(*UploadPersistentTaskFailedRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Scheduler_StatPersistentTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(StatPersistentTaskRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SchedulerServer).StatPersistentTask(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/scheduler.v2.Scheduler/StatPersistentTask",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SchedulerServer).StatPersistentTask(ctx, req.(*StatPersistentTaskRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Scheduler_DeletePersistentTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeletePersistentTaskRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SchedulerServer).DeletePersistentTask(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/scheduler.v2.Scheduler/DeletePersistentTask",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SchedulerServer).DeletePersistentTask(ctx, req.(*DeletePersistentTaskRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Scheduler_AnnouncePersistentCachePeer_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(SchedulerServer).AnnouncePersistentCachePeer(&schedulerAnnouncePersistentCachePeerServer{stream})
}

type Scheduler_AnnouncePersistentCachePeerServer interface {
	Send(*AnnouncePersistentCachePeerResponse) error
	Recv() (*AnnouncePersistentCachePeerRequest, error)
	grpc.ServerStream
}

type schedulerAnnouncePersistentCachePeerServer struct {
	grpc.ServerStream
}

func (x *schedulerAnnouncePersistentCachePeerServer) Send(m *AnnouncePersistentCachePeerResponse) error {
	return x.ServerStream.SendMsg(m)
}

func (x *schedulerAnnouncePersistentCachePeerServer) Recv() (*AnnouncePersistentCachePeerRequest, error) {
	m := new(AnnouncePersistentCachePeerRequest)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func _Scheduler_StatPersistentCachePeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(StatPersistentCachePeerRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SchedulerServer).StatPersistentCachePeer(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/scheduler.v2.Scheduler/StatPersistentCachePeer",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SchedulerServer).StatPersistentCachePeer(ctx, req.(*StatPersistentCachePeerRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Scheduler_DeletePersistentCachePeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeletePersistentCachePeerRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SchedulerServer).DeletePersistentCachePeer(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/scheduler.v2.Scheduler/DeletePersistentCachePeer",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SchedulerServer).DeletePersistentCachePeer(ctx, req.(*DeletePersistentCachePeerRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Scheduler_UploadPersistentCacheTaskStarted_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UploadPersistentCacheTaskStartedRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SchedulerServer).UploadPersistentCacheTaskStarted(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/scheduler.v2.Scheduler/UploadPersistentCacheTaskStarted",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SchedulerServer).UploadPersistentCacheTaskStarted(ctx, req.(*UploadPersistentCacheTaskStartedRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Scheduler_UploadPersistentCacheTaskFinished_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UploadPersistentCacheTaskFinishedRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SchedulerServer).UploadPersistentCacheTaskFinished(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/scheduler.v2.Scheduler/UploadPersistentCacheTaskFinished",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SchedulerServer).UploadPersistentCacheTaskFinished(ctx, req.(*UploadPersistentCacheTaskFinishedRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Scheduler_UploadPersistentCacheTaskFailed_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UploadPersistentCacheTaskFailedRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SchedulerServer).UploadPersistentCacheTaskFailed(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/scheduler.v2.Scheduler/UploadPersistentCacheTaskFailed",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SchedulerServer).UploadPersistentCacheTaskFailed(ctx, req.(*UploadPersistentCacheTaskFailedRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Scheduler_StatPersistentCacheTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(StatPersistentCacheTaskRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SchedulerServer).StatPersistentCacheTask(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/scheduler.v2.Scheduler/StatPersistentCacheTask",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SchedulerServer).StatPersistentCacheTask(ctx, req.(*StatPersistentCacheTaskRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Scheduler_DeletePersistentCacheTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeletePersistentCacheTaskRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SchedulerServer).DeletePersistentCacheTask(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/scheduler.v2.Scheduler/DeletePersistentCacheTask",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SchedulerServer).DeletePersistentCacheTask(ctx, req.(*DeletePersistentCacheTaskRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Scheduler_PreheatImage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PreheatImageRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SchedulerServer).PreheatImage(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/scheduler.v2.Scheduler/PreheatImage",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SchedulerServer).PreheatImage(ctx, req.(*PreheatImageRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Scheduler_StatImage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(StatImageRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SchedulerServer).StatImage(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/scheduler.v2.Scheduler/StatImage",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SchedulerServer).StatImage(ctx, req.(*StatImageRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Scheduler_PreheatFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PreheatFileRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SchedulerServer).PreheatFile(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/scheduler.v2.Scheduler/PreheatFile",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SchedulerServer).PreheatFile(ctx, req.(*PreheatFileRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Scheduler_StatFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(StatFileRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SchedulerServer).StatFile(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/scheduler.v2.Scheduler/StatFile",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SchedulerServer).StatFile(ctx, req.(*StatFileRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// 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.v2.Scheduler",
	HandlerType: (*SchedulerServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "StatPeer",
			Handler:    _Scheduler_StatPeer_Handler,
		},
		{
			MethodName: "DeletePeer",
			Handler:    _Scheduler_DeletePeer_Handler,
		},
		{
			MethodName: "StatTask",
			Handler:    _Scheduler_StatTask_Handler,
		},
		{
			MethodName: "DeleteTask",
			Handler:    _Scheduler_DeleteTask_Handler,
		},
		{
			MethodName: "AnnounceHost",
			Handler:    _Scheduler_AnnounceHost_Handler,
		},
		{
			MethodName: "ListHosts",
			Handler:    _Scheduler_ListHosts_Handler,
		},
		{
			MethodName: "DeleteHost",
			Handler:    _Scheduler_DeleteHost_Handler,
		},
		{
			MethodName: "StatCachePeer",
			Handler:    _Scheduler_StatCachePeer_Handler,
		},
		{
			MethodName: "DeleteCachePeer",
			Handler:    _Scheduler_DeleteCachePeer_Handler,
		},
		{
			MethodName: "StatCacheTask",
			Handler:    _Scheduler_StatCacheTask_Handler,
		},
		{
			MethodName: "DeleteCacheTask",
			Handler:    _Scheduler_DeleteCacheTask_Handler,
		},
		{
			MethodName: "StatPersistentPeer",
			Handler:    _Scheduler_StatPersistentPeer_Handler,
		},
		{
			MethodName: "DeletePersistentPeer",
			Handler:    _Scheduler_DeletePersistentPeer_Handler,
		},
		{
			MethodName: "UploadPersistentTaskStarted",
			Handler:    _Scheduler_UploadPersistentTaskStarted_Handler,
		},
		{
			MethodName: "UploadPersistentTaskFinished",
			Handler:    _Scheduler_UploadPersistentTaskFinished_Handler,
		},
		{
			MethodName: "UploadPersistentTaskFailed",
			Handler:    _Scheduler_UploadPersistentTaskFailed_Handler,
		},
		{
			MethodName: "StatPersistentTask",
			Handler:    _Scheduler_StatPersistentTask_Handler,
		},
		{
			MethodName: "DeletePersistentTask",
			Handler:    _Scheduler_DeletePersistentTask_Handler,
		},
		{
			MethodName: "StatPersistentCachePeer",
			Handler:    _Scheduler_StatPersistentCachePeer_Handler,
		},
		{
			MethodName: "DeletePersistentCachePeer",
			Handler:    _Scheduler_DeletePersistentCachePeer_Handler,
		},
		{
			MethodName: "UploadPersistentCacheTaskStarted",
			Handler:    _Scheduler_UploadPersistentCacheTaskStarted_Handler,
		},
		{
			MethodName: "UploadPersistentCacheTaskFinished",
			Handler:    _Scheduler_UploadPersistentCacheTaskFinished_Handler,
		},
		{
			MethodName: "UploadPersistentCacheTaskFailed",
			Handler:    _Scheduler_UploadPersistentCacheTaskFailed_Handler,
		},
		{
			MethodName: "StatPersistentCacheTask",
			Handler:    _Scheduler_StatPersistentCacheTask_Handler,
		},
		{
			MethodName: "DeletePersistentCacheTask",
			Handler:    _Scheduler_DeletePersistentCacheTask_Handler,
		},
		{
			MethodName: "PreheatImage",
			Handler:    _Scheduler_PreheatImage_Handler,
		},
		{
			MethodName: "StatImage",
			Handler:    _Scheduler_StatImage_Handler,
		},
		{
			MethodName: "PreheatFile",
			Handler:    _Scheduler_PreheatFile_Handler,
		},
		{
			MethodName: "StatFile",
			Handler:    _Scheduler_StatFile_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "AnnouncePeer",
			Handler:       _Scheduler_AnnouncePeer_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
		{
			StreamName:    "AnnounceCachePeer",
			Handler:       _Scheduler_AnnounceCachePeer_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
		{
			StreamName:    "AnnouncePersistentPeer",
			Handler:       _Scheduler_AnnouncePersistentPeer_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
		{
			StreamName:    "AnnouncePersistentCachePeer",
			Handler:       _Scheduler_AnnouncePersistentCachePeer_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "pkg/apis/scheduler/v2/scheduler.proto",
}
