Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scheduling ¶
type Scheduling interface {
// ScheduleCandidateParents schedules candidate parents to the given normal peer for task download.
// This method is used exclusively in the v2 gRPC version.
ScheduleCandidateParents(context.Context, *standard.Peer, set.SafeSet[string]) error
// ScheduleParentAndCandidateParents schedules a primary parent along with candidate parents to the given normal peer for task download.
// This method is used exclusively in the v1 gRPC version.
ScheduleParentAndCandidateParents(context.Context, *standard.Peer, set.SafeSet[string])
// FindCandidateParents identifies suitable candidate parents for the given peer to download the task.
// This method is used exclusively in the v2 gRPC version.
FindCandidateParents(context.Context, *standard.Peer, set.SafeSet[string]) ([]*standard.Peer, bool)
// FindParentAndCandidateParents identifies a primary parent along with suitable candidate parents for the given peer to download the task.
// This method is used exclusively in the v1 gRPC version.
FindParentAndCandidateParents(context.Context, *standard.Peer, set.SafeSet[string]) ([]*standard.Peer, bool)
// FindReplicatePersistentHosts identifies replication hosts for persistent tasks. It compares the current persistent replica count
// against the target count to select sufficient parents, returning cached replication peers, non-cached replication hosts, and a success flag.
FindReplicatePersistentHosts(context.Context, *persistent.Task, set.SafeSet[string]) ([]*persistent.Peer, []*persistent.Host, bool)
// FindCandidatePersistentParents identifies suitable candidate parents in the persistent for the given peer to download the task.
FindCandidatePersistentParents(context.Context, *persistent.Peer, set.SafeSet[string]) ([]*persistent.Peer, bool)
// FindReplicatePersistentCacheHosts identifies replication hosts for persistent cache tasks. It compares the current persistent replica count
// against the target count to select sufficient parents, returning cached replication peers, non-cached replication hosts, and a success flag.
FindReplicatePersistentCacheHosts(context.Context, *persistentcache.Task, set.SafeSet[string]) ([]*persistentcache.Peer, []*persistentcache.Host, bool)
// FindCandidatePersistentCacheParents identifies suitable candidate parents in the persistent cache for the given peer to download the task.
FindCandidatePersistentCacheParents(context.Context, *persistentcache.Peer, set.SafeSet[string]) ([]*persistentcache.Peer, bool)
}
Scheduling defines the interface for scheduling operations in the peer-to-peer download system. It provides methods for selecting parents and candidates for normal and persistent cache tasks, supporting both v1 and v2 gRPC versions, as well as persistent cache replication.
func New ¶
func New(cfg *config.SchedulerConfig, persistentResource persistent.Resource, persistentCacheResource persistentcache.Resource, dynconfig config.DynconfigInterface, pluginDir string) Scheduling
New creates a new scheduling instance with the given configuration and dependencies.
Click to show internal directories.
Click to hide internal directories.