Documentation
¶
Overview ¶
Package thrift implements the Scoot API, see scoot.thrift for details
Index ¶
- func GetClassLoadPercents(scheduler server.Scheduler) (map[string]int32, error)
- func GetJobStatus(jobId string, sc s.SagaCoordinator) (*scoot.JobStatus, error)
- func GetRebalanceMinimumDuration(scheduler server.Scheduler) (time.Duration, error)
- func GetRebalanceThreshold(scheduler server.Scheduler) (int32, error)
- func GetRequestorToClassMap(scheduler server.Scheduler) (map[string]string, error)
- func GetSchedulerStatus(scheduler server.Scheduler) (*scoot.SchedulerStatus, error)
- func KillJob(jobId string, scheduler server.Scheduler, sc saga.SagaCoordinator) (*scoot.JobStatus, error)
- func NewCanNotScheduleNow(untilRetry time.Duration, errMsg string) error
- func NewInvalidJobRequest(errMsg string) error
- func NewSchedulerStatus(numTasks int, maxTasks int) *scoot.SchedulerStatus
- func OfflineWorker(req *scoot.OfflineWorkerReq, scheduler server.Scheduler) error
- func ReinstateWorker(req *scoot.ReinstateWorkerReq, scheduler server.Scheduler) error
- func RunJob(scheduler server.Scheduler, def *scoot.JobDefinition, stat stats.StatsReceiver) (*scoot.JobId, error)
- func SetClassLoadPercents(scheduler server.Scheduler, classLoads map[string]int32) error
- func SetRebalanceMinimumDuration(scheduler server.Scheduler, duration time.Duration) error
- func SetRebalanceThreshold(scheduler server.Scheduler, threshold int32) error
- func SetRequestorToClassMap(scheduler server.Scheduler, requestorToClassMap map[string]string) error
- func SetSchedulerStatus(scheduler server.Scheduler, maxTasks int32) error
- type CanNotScheduleNow
- type InvalidJobRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetClassLoadPercents ¶
GetClassLoadPercents get the target load pcts for the classes
func GetJobStatus ¶
func GetRebalanceMinimumDuration ¶
GetRebalanceMinimumDuration get the duration (min) that the rebalance threshold must be exceeded before triggering rebalance. <= 0 implies no rebalancing
func GetRebalanceThreshold ¶
GetRebalanceThreshold get the rebalance threshold. The %s spread must exceed this for RebalanceMinimumDuration to trigger rebalance. <= 0 implies no rebalancing
func GetRequestorToClassMap ¶
GetRequestorToClassMap get map of requestor (reg exp) to class load pct
func GetSchedulerStatus ¶
func GetSchedulerStatus(scheduler server.Scheduler) (*scoot.SchedulerStatus, error)
func KillJob ¶
func KillJob(jobId string, scheduler server.Scheduler, sc saga.SagaCoordinator) (*scoot.JobStatus, error)
* Kill the job identified by jobId. Update the saga for the job to indicate that it was killed. Return a job status indicating that the job was successfully killed or one of the following errors
func NewCanNotScheduleNow ¶
func NewInvalidJobRequest ¶
func NewSchedulerStatus ¶
func NewSchedulerStatus(numTasks int, maxTasks int) *scoot.SchedulerStatus
* Get the scheduler status: how many tasks is it currently handling and it's current throttle value (-1 implies it is not throttled)
func OfflineWorker ¶
func OfflineWorker(req *scoot.OfflineWorkerReq, scheduler server.Scheduler) error
func ReinstateWorker ¶
func ReinstateWorker(req *scoot.ReinstateWorkerReq, scheduler server.Scheduler) error
func RunJob ¶
func RunJob(scheduler server.Scheduler, def *scoot.JobDefinition, stat stats.StatsReceiver) (*scoot.JobId, error)
Implementation of the RunJob API
func SetClassLoadPercents ¶
SetClassLoadPercents set the target worker load % for each job class
func SetRebalanceMinimumDuration ¶
SetRebalanceMinimumDuration get the duration (min) that the rebalance threshold must be exceeded before triggering rebalance. <= 0 implies no rebalancing
func SetRebalanceThreshold ¶
SetRebalanceThreshold get the rebalance threshold. The %s spread must exceed this for RebalanceMinimumDuration to trigger rebalance. <= 0 implies no rebalancing
Types ¶
type CanNotScheduleNow ¶
type CanNotScheduleNow struct { UntilRetry time.Duration // contains filtered or unexported fields }
Error to be returned when a Job cannot be scheduled because of a transient error. i.e. Scheduler is too busy, SagaLog is Unavailable etc...
Error indicates that the user could retry the request at another time and it will succeed
Analogous to an HTTP 500 level error
func (*CanNotScheduleNow) Error ¶
func (e *CanNotScheduleNow) Error() string
type InvalidJobRequest ¶
type InvalidJobRequest struct {
// contains filtered or unexported fields
}
Error to be returned when a Job Request cannot be processed because the request is malformed. Retrying this request will never result in a success.
Analogous to an HTTP 400 level error
func (*InvalidJobRequest) Error ¶
func (e *InvalidJobRequest) Error() string