Documentation
¶
Index ¶
- Constants
- func NewEventManager() *eventManager
- func NewHTTPClient(leader string) *httpClient
- func NewReader(r io.Reader) io.Reader
- type Agent
- type Filter
- type Scheduler
- func (s *Scheduler) AckUpdateEvent(status *mesosproto.TaskStatus) error
- func (s *Scheduler) ClusterName() string
- func (s *Scheduler) DetectError(status *mesosproto.TaskStatus) error
- func (s *Scheduler) FrameworkId() *mesosproto.FrameworkID
- func (s *Scheduler) FrameworkState() (*megos.Framework, error)
- func (s *Scheduler) InitFilters(filters []Filter)
- func (s *Scheduler) KillTask(taskId, agentId string) error
- func (s *Scheduler) LaunchTask(t *Task) error
- func (s *Scheduler) MesosState() (*megos.State, error)
- func (s *Scheduler) Send(call *mesosproto.Call) (*http.Response, error)
- func (s *Scheduler) Subscribe() error
- func (s *Scheduler) SubscribeEvent(w http.ResponseWriter, remote string) error
- func (s *Scheduler) TaskEvents() []*types.TaskEvent
- func (s *Scheduler) Unsubscribe() error
- type SchedulerConfig
- type Strategy
- type Task
- func (t *Task) Build(offer *mesosproto.Offer)
- func (t *Task) DetectError(status *mesosproto.TaskStatus) error
- func (t *Task) GetStatus() chan *mesosproto.TaskStatus
- func (t *Task) ID() string
- func (t *Task) IsDone(status *mesosproto.TaskStatus) bool
- func (t *Task) IsTerminated(status *mesosproto.TaskStatus) bool
- func (t *Task) SendStatus(status *mesosproto.TaskStatus)
Constants ¶
View Source
const ( HttpTimeoutDuration = 10 * time.Second HttpKeepaliveDuration = 30 * time.Second UserAgent = "swan" MesosSchedulerAPI = "/api/v1/scheduler" )
View Source
const DefaultFrameworkFailoverTimeout = 7 * 24 * 60 * 60
Variables ¶
This section is empty.
Functions ¶
func NewEventManager ¶
func NewEventManager() *eventManager
func NewHTTPClient ¶
func NewHTTPClient(leader string) *httpClient
Types ¶
type Agent ¶
func ApplyFilters ¶
func ApplyFilters(filters []Filter, config *types.TaskConfig, agents []*Agent) []*Agent
func (*Agent) Attributes ¶
type Scheduler ¶
Scheduler represents a client interacting with mesos master via x-protobuf
func NewScheduler ¶
func NewScheduler(cfg *SchedulerConfig, db store.Store, strategy Strategy, mgr *eventManager) (*Scheduler, error)
NewScheduler...
func (*Scheduler) AckUpdateEvent ¶
func (s *Scheduler) AckUpdateEvent(status *mesosproto.TaskStatus) error
func (*Scheduler) ClusterName ¶
Cluster return current mesos cluster's name
func (*Scheduler) DetectError ¶
func (s *Scheduler) DetectError(status *mesosproto.TaskStatus) error
func (*Scheduler) FrameworkId ¶
func (s *Scheduler) FrameworkId() *mesosproto.FrameworkID
func (*Scheduler) FrameworkState ¶
FrameworkState obtain current framework stats
func (*Scheduler) InitFilters ¶
func (*Scheduler) LaunchTask ¶
func (*Scheduler) MesosState ¶
MesosState obtain current mesos stats
func (*Scheduler) Send ¶
Send send mesos request against the mesos master's scheduler api endpoint. NOTE it's the caller's responsibility to deal with the Send() error
func (*Scheduler) SubscribeEvent ¶
func (s *Scheduler) SubscribeEvent(w http.ResponseWriter, remote string) error
func (*Scheduler) TaskEvents ¶
TaskEvents generate all of current app tasks' db stats into sse events
func (*Scheduler) Unsubscribe ¶
type SchedulerConfig ¶
type Task ¶
type Task struct {
mesosproto.TaskInfo
// contains filtered or unexported fields
}
runtime Task object
func (*Task) Build ¶
func (t *Task) Build(offer *mesosproto.Offer)
func (*Task) DetectError ¶
func (t *Task) DetectError(status *mesosproto.TaskStatus) error
func (*Task) GetStatus ¶
func (t *Task) GetStatus() chan *mesosproto.TaskStatus
GetStatus method reads the task status on the updates channel
func (*Task) IsDone ¶
func (t *Task) IsDone(status *mesosproto.TaskStatus) bool
IsDone check that if a task is done or not according by task status.
func (*Task) IsTerminated ¶
func (t *Task) IsTerminated(status *mesosproto.TaskStatus) bool
func (*Task) SendStatus ¶
func (t *Task) SendStatus(status *mesosproto.TaskStatus)
SendStatus method writes the task status in the updates channel
Source Files
¶
Click to show internal directories.
Click to hide internal directories.