...

Package scheduler_service

import "scheduler/scheduler_service"
Overview
Index

Overview ▾

Package scheduler_service implements the code for query the scheduler service in other nodes.

func GetApiUrl

func GetApiUrl(host string) string

func GetLeastLoadedMachineOfNRandom

func GetLeastLoadedMachineOfNRandom(n uint, currentLoad uint, checkQueues bool, cached bool) (string, float64, error)

GetLeastLoadedMachineOfNRandom retrieves the least loaded machine from an array of ips, if all machines are full loaded, the least queue is returned, and if there is no less loaded queue than us, an error is returned. This function returns (ip, mean_probing_time, errors)

func GetMonitoringLoadUrl

func GetMonitoringLoadUrl(host string) string

func GetPeerFunctionUrl

func GetPeerFunctionUrl(host string, functionName string) string

type APIResponse

type APIResponse struct {
    Headers    http.Header
    Body       []byte
    StatusCode int
}

func ExecuteFunction

func ExecuteFunction(host string, peerRequest *types.PeerJobRequest) (*APIResponse, error)

ExecuteFunction allows to request another machine to execute a function

func GetLoad

func GetLoad(host string) (int, *APIResponse, error)

GetLoad allows to get the load of another machine, from a machine

type NoLessLoadedMachine

type NoLessLoadedMachine struct {
    Reason string
}

func (NoLessLoadedMachine) Error

func (n NoLessLoadedMachine) Error() string