const ForwardSchedulerName = "ForwardScheduler"
const LearningSchedulerHeaderKeyAction = "X-P2pfaas-Scheduler-Learning-Action"
const LearningSchedulerHeaderKeyEid = "X-P2pfaas-Scheduler-Learning-Eid"
const LearningSchedulerHeaderKeyEps = "X-P2pfaas-Scheduler-Learning-Eps"
const LearningSchedulerHeaderKeyFps = "X-P2pfaas-Scheduler-Learning-Fps"
const LearningSchedulerHeaderKeyState = "X-P2pfaas-Scheduler-Learning-State"
const LearningSchedulerHeaderKeyTaskType = "X-P2pfaas-Scheduler-Learning-Task-Type"
const LearningSchedulerName = "LearningScheduler"
const NoSchedulingSchedulerName = "NoScheduler"
const PowerOfNSchedulerName = "PowerOfNScheduler"
const PowerOfNSchedulerTauName = "PowerOfNSchedulerTau"
const RejectSchedulerSchedulerName = "RejectScheduler"
const RoundRobinWithMasterSchedulerName = "RoundRobinWithMasterScheduler"
func GetName() string
GetName returns the friendly name of current set scheduler
func GetScheduler() *types.SchedulerDescriptor
GetScheduler returns the types.SchedulerDescriptor object of current set scheduler
func SetScheduler(sched *types.SchedulerDescriptor) error
SetScheduler replaces the current scheduler with the passed one
func Start()
type BadSchedulerParameters struct{}
func (e BadSchedulerParameters) Error() string
type CannotChangeScheduler struct{}
func (e CannotChangeScheduler) Error() string
type CannotRetrieveAction struct {
// contains filtered or unexported fields
}
func (e CannotRetrieveAction) Error() string
type CannotRetrieveRecipientNode struct {
// contains filtered or unexported fields
}
func (e CannotRetrieveRecipientNode) Error() string
ExternalExecutionInfo holds information about the external execution of the task
type ExternalExecutionInfo struct { PeersList []types.PeersListMember `json:"peers_list"` }
ForwardScheduler scheduler forwards all the requests to a random node, this is used for testing purposes
type ForwardScheduler struct { // MaxHops is the maximum number of hops that a request can be subjected to before being executed MaxHops uint }
func (s ForwardScheduler) GetFullName() string
func (s ForwardScheduler) GetScheduler() *types.SchedulerDescriptor
func (s ForwardScheduler) Schedule(req *types.ServiceRequest) (*JobResult, error)
Schedule a service request. This call is blocking until the job has been executed locally or externally.
type JobCannotBeForwarded struct {
// contains filtered or unexported fields
}
func (e JobCannotBeForwarded) Error() string
type JobCannotBeScheduled struct {
// contains filtered or unexported fields
}
func (e JobCannotBeScheduled) Error() string
type JobDeliberatelyRejected struct { }
func (e JobDeliberatelyRejected) Error() string
JobResult represents the result of the execution of a task
type JobResult struct { Response *types.APIResponse `json:"response"` ProbingMessages uint `json:"probing_messages"` ExternalExecution bool `json:"external_execution"` ExternalExecutionInfo *ExternalExecutionInfo `json:"external_executed_info"` ErrorExecution bool `json:"error_execution"` TimingsStart *types.TimingsStart `json:"timings_start"` Timings *types.Timings `json:"timings"` ResponseHeaders *map[string]string `json:"response_headers"` // custom headers to be returned to clients Scheduler string `json:"scheduler"` // the scheduler that executed the job }
func Schedule(req *types.ServiceRequest) (*JobResult, error)
Schedule schedules a service request with the current set scheduler
func ScheduleBypassAlgorithm(req *types.ServiceRequest) (*JobResult, error)
ScheduleBypassAlgorithm schedules a service request with the NoScheduler algorithm which always execute locally the function
func ScheduleForward(req *types.ServiceRequest) (*JobResult, error)
ScheduleForward schedules a service request with the ForwardScheduler algorithm which always forward the request to a random node
func ScheduleReject(req *types.ServiceRequest) (*JobResult, error)
ScheduleReject schedules a service request with the RejectScheduler algorithm which always reject the request
LearningScheduler is a scheduler with makes scheduling decisions based on the Learner service which implements RL models
type LearningScheduler struct { // NumberOfTaskTypes is the number of task types which can arrive to the node NumberOfTaskTypes uint64 }
func (s LearningScheduler) GetFullName() string
func (s LearningScheduler) GetScheduler() *types.SchedulerDescriptor
func (s LearningScheduler) Schedule(req *types.ServiceRequest) (*JobResult, error)
Schedule a service request. This call is blocking until the job has been executed locally or externally.
NoSchedulingScheduler is a scheduler which executes all the requests locally
type NoSchedulingScheduler struct { // Loss tells if tasks are loss when there are no free slots for executing the task in parallel with others Loss bool }
func (NoSchedulingScheduler) GetFullName() string
func (s NoSchedulingScheduler) GetScheduler() *types.SchedulerDescriptor
func (s NoSchedulingScheduler) Schedule(req *types.ServiceRequest) (*JobResult, error)
type PeerResponseNil struct {
// contains filtered or unexported fields
}
func (e PeerResponseNil) Error() string
PowerOfNScheduler implement the power-of-n choices based scheduler
type PowerOfNScheduler struct { // F is the fan-out, that is the number of probed nodes F uint // T is threshold, that from which number of currently executing tasks the probing to others is started T uint // Loss tells if tasks are loss when there are no free slots for executing the task in parallel with others Loss bool // MaxHops is the maximum number of hops that a request can be subjected to before being executed MaxHops uint // maximum number of hops }
func (s PowerOfNScheduler) GetFullName() string
func (s PowerOfNScheduler) GetScheduler() *types.SchedulerDescriptor
func (s PowerOfNScheduler) Schedule(req *types.ServiceRequest) (*JobResult, error)
Schedule a service request. This call is blocking until the job has been executed locally or externally.
PowerOfNSchedulerTau implements the power-of-n choices scheduler but a delay is added before probing nodes
type PowerOfNSchedulerTau struct { // F is the fan-out, that is the number of probed nodes F uint // T is threshold, that from which number of currently executing tasks the probing to others is started T uint // Loss tells if tasks are loss when there are no free slots for executing the task in parallel with others Loss bool // MaxHops is the maximum number of hops that a request can be subjected to before being executed MaxHops uint // Tau is the amount of time the probing must be delayed Tau time.Duration }
func (s PowerOfNSchedulerTau) GetFullName() string
func (s PowerOfNSchedulerTau) GetScheduler() *types.SchedulerDescriptor
func (s PowerOfNSchedulerTau) Schedule(req *types.ServiceRequest) (*JobResult, error)
Schedule a service request. This call is blocking until the job has been executed locally or externally.
RejectScheduler is a scheduler which rejects all the tasks
type RejectScheduler struct { }
func (RejectScheduler) GetFullName() string
func (s RejectScheduler) GetScheduler() *types.SchedulerDescriptor
func (s RejectScheduler) Schedule(req *types.ServiceRequest) (*JobResult, error)
RoundRobinWithMasterScheduler is a scheduler which implements a round-robin fashion with a master node
type RoundRobinWithMasterScheduler struct { // Master tells if the current node is the master node Master bool // MasterIP stores the IP address of the master node MasterIP string // Loss tells if tasks are loss when there are no free slots for executing the task in parallel with others Loss bool // contains filtered or unexported fields }
func (s *RoundRobinWithMasterScheduler) GetFullName() string
func (s *RoundRobinWithMasterScheduler) GetScheduler() *types.SchedulerDescriptor
func (s *RoundRobinWithMasterScheduler) Schedule(req *types.ServiceRequest) (*JobResult, error)