sched

package
v0.0.0-...-1b79cdd Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2016 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSchedulerDriver

func NewSchedulerDriver(config *Config, client models.Client) (*scheduler.MesosSchedulerDriver, error)

Types

type Config

type Config struct {
	Name            string
	User            string
	Principal       string
	Checkpoint      bool
	WebuiUrl        string
	Role            string
	FailoverTimeout float64
	Secret          string
	AuthProvider    string
	Address         string
	CoordinatorAddr string
	CoordinatorName string
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(master string) *Config

func (*Config) GetAddress

func (c *Config) GetAddress() string

func (*Config) GetAuthProvider

func (c *Config) GetAuthProvider() string

func (*Config) GetCheckpoint

func (c *Config) GetCheckpoint() bool

func (*Config) GetFailoverTimeout

func (c *Config) GetFailoverTimeout() float64

func (*Config) GetMaster

func (c *Config) GetMaster() string

func (*Config) GetName

func (c *Config) GetName() string

func (*Config) GetPrincipal

func (c *Config) GetPrincipal() string

func (*Config) GetRole

func (c *Config) GetRole() string

func (*Config) GetSecret

func (c *Config) GetSecret() string

func (*Config) GetUser

func (c *Config) GetUser() string

func (*Config) GetWebuiUrl

func (c *Config) GetWebuiUrl() string

type MedisScheduler

type MedisScheduler struct {
	// contains filtered or unexported fields
}

func NewMedisScheduler

func NewMedisScheduler(client models.Client) (*MedisScheduler, error)

func (*MedisScheduler) Disconnected

func (sched *MedisScheduler) Disconnected(driver sched.SchedulerDriver)

* Invoked when the scheduler becomes "disconnected" from the master * (e.g., the master fails and another is taking over).

func (*MedisScheduler) Error

func (sched *MedisScheduler) Error(driver sched.SchedulerDriver, err string)

* Invoked when there is an unrecoverable error in the scheduler or * scheduler driver. The driver will be aborted BEFORE invoking this * callback.

func (*MedisScheduler) ExecutorLost

func (sched *MedisScheduler) ExecutorLost(driver sched.SchedulerDriver, eid *mesos.ExecutorID, sid *mesos.SlaveID, code int)

* Invoked when an executor has exited/terminated. Note that any * tasks running will have TASK_LOST status updates automagically * generated. * * NOTE: This callback is not reliably delivered. If a host or * network failure causes messages between the master and the * scheduler to be dropped, this callback may not be invoked.

func (*MedisScheduler) FrameworkMessage

func (sched *MedisScheduler) FrameworkMessage(driver sched.SchedulerDriver, eid *mesos.ExecutorID, sid *mesos.SlaveID, msg string)

* Invoked when an executor sends a message. These messages are best * effort; do not expect a framework message to be retransmitted in * any reliable fashion.

func (*MedisScheduler) OfferRescinded

func (sched *MedisScheduler) OfferRescinded(driver sched.SchedulerDriver, id *mesos.OfferID)

* Invoked when an offer is no longer valid (e.g., the slave was * lost or another framework used resources in the offer). If for * whatever reason an offer is never rescinded (e.g., dropped * message, failing over framework, etc.), a framework that attempts * to launch tasks using an invalid offer will receive TASK_LOST * status updates for those tasks (see Scheduler::resourceOffers).

func (*MedisScheduler) Registered

func (sched *MedisScheduler) Registered(driver sched.SchedulerDriver, frameworkId *mesos.FrameworkID, masterInfo *mesos.MasterInfo)

* Invoked when the scheduler successfully registers with a Mesos * master. A unique ID (generated by the master) used for * distinguishing this framework from others and `MasterInfo` * with the ip and port of the current master are provided as arguments.

func (*MedisScheduler) Reregistered

func (sched *MedisScheduler) Reregistered(driver sched.SchedulerDriver, masterInfo *mesos.MasterInfo)

* Invoked when the scheduler re-registers with a newly elected Mesos master. * This is only called when the scheduler has previously been registered. * `MasterInfo` containing the updated information about the elected master * is provided as an argument.

func (*MedisScheduler) ResourceOffers

func (sched *MedisScheduler) ResourceOffers(driver sched.SchedulerDriver, offers []*mesos.Offer)

* Invoked when resources have been offered to this framework. A * single offer will only contain resources from a single slave. * Resources associated with an offer will not be re-offered to * _this_ framework until either (a) this framework has rejected * those resources (see SchedulerDriver::launchTasks) or (b) those * resources have been rescinded (see Scheduler::offerRescinded). * Note that resources may be concurrently offered to more than one * framework at a time (depending on the allocator being used). In * that case, the first framework to launch tasks using those * resources will be able to use them while the other frameworks * will have those resources rescinded (or if a framework has * already launched tasks with those resources then those tasks will * fail with a TASK_LOST status and a message saying as much).

func (*MedisScheduler) SlaveLost

func (sched *MedisScheduler) SlaveLost(driver sched.SchedulerDriver, id *mesos.SlaveID)

* Invoked when a slave has been determined unreachable (e.g., * machine failure, network partition). Most frameworks will need to * reschedule any tasks launched on this slave on a new slave. * * NOTE: This callback is not reliably delivered. If a host or * network failure causes messages between the master and the * scheduler to be dropped, this callback may not be invoked.

func (*MedisScheduler) StatusUpdate

func (sched *MedisScheduler) StatusUpdate(driver sched.SchedulerDriver, status *mesos.TaskStatus)

* Invoked when the status of a task has changed (e.g., a slave is * lost and so the task is lost, a task finishes and an executor * sends a status update saying so, etc). If implicit * acknowledgements are being used, then returning from this * callback _acknowledges_ receipt of this status update! If for * whatever reason the scheduler aborts during this callback (or * the process exits) another status update will be delivered (note, * however, that this is currently not true if the slave sending the * status update is lost/fails during that time). If explicit * acknowledgements are in use, the scheduler must acknowledge this * status on the driver.

Jump to

Keyboard shortcuts

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