thrift

package
v0.0.1-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package thrift implements the Scoot API, see scoot.thrift for details

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClassLoadPercents

func GetClassLoadPercents(scheduler server.Scheduler) (map[string]int32, error)

GetClassLoadPercents get the target load pcts for the classes

func GetJobStatus

func GetJobStatus(jobId string, sc s.SagaCoordinator) (*scoot.JobStatus, error)

func GetRebalanceMinimumDuration

func GetRebalanceMinimumDuration(scheduler server.Scheduler) (time.Duration, error)

GetRebalanceMinimumDuration get the duration (min) that the rebalance threshold must be exceeded before triggering rebalance. <= 0 implies no rebalancing

func GetRebalanceThreshold

func GetRebalanceThreshold(scheduler server.Scheduler) (int32, error)

GetRebalanceThreshold get the rebalance threshold. The %s spread must exceed this for RebalanceMinimumDuration to trigger rebalance. <= 0 implies no rebalancing

func GetRequestorToClassMap

func GetRequestorToClassMap(scheduler server.Scheduler) (map[string]string, error)

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 NewCanNotScheduleNow(untilRetry time.Duration, errMsg string) error

func NewInvalidJobRequest

func NewInvalidJobRequest(errMsg string) error

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

func SetClassLoadPercents(scheduler server.Scheduler, classLoads map[string]int32) error

SetClassLoadPercents set the target worker load % for each job class

func SetRebalanceMinimumDuration

func SetRebalanceMinimumDuration(scheduler server.Scheduler, duration time.Duration) error

SetRebalanceMinimumDuration get the duration (min) that the rebalance threshold must be exceeded before triggering rebalance. <= 0 implies no rebalancing

func SetRebalanceThreshold

func SetRebalanceThreshold(scheduler server.Scheduler, threshold int32) error

SetRebalanceThreshold get the rebalance threshold. The %s spread must exceed this for RebalanceMinimumDuration to trigger rebalance. <= 0 implies no rebalancing

func SetRequestorToClassMap

func SetRequestorToClassMap(scheduler server.Scheduler, requestorToClassMap map[string]string) error

SetRequestorToClassMap set the map of requestor (requestor value is reg exp) to class name

func SetSchedulerStatus

func SetSchedulerStatus(scheduler server.Scheduler, maxTasks int32) error

* throttle the scheduler - set the max number of tasks it will allow

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

Directories

Path Synopsis
gen-go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL