Documentation
¶
Index ¶
- Constants
- func DetectTaskError(status *mesosproto.TaskStatus) error
- func IsTaskDone(status *mesosproto.TaskStatus) bool
- func NewEventManager() *eventManager
- func NewHTTPClient(leader string) *httpClient
- func NewReader(r io.Reader) io.Reader
- type Scheduler
- func (s *Scheduler) AckUpdateEvent(status *mesosproto.TaskStatus) error
- func (s *Scheduler) CloseClusterAgent(id string)
- func (s *Scheduler) ClusterAgent(id string) *mole.ClusterAgent
- func (s *Scheduler) ClusterAgents() map[string]*mole.ClusterAgent
- func (s *Scheduler) ClusterName() string
- func (s *Scheduler) Dump() interface{}
- func (s *Scheduler) FrameworkId() *mesosproto.FrameworkID
- func (s *Scheduler) FrameworkInfo() *types.FrameworkInfo
- func (s *Scheduler) FrameworkState() (*megos.Framework, error)
- func (s *Scheduler) FullTaskEventsAndRecords() []*types.CombinedEvents
- func (s *Scheduler) KillTask(taskId, agentId string, gracePeriod int64) error
- func (s *Scheduler) LaunchTasks(tasks []*Task) error
- func (s *Scheduler) Load() map[string]interface{}
- func (s *Scheduler) MesosState() (*megos.State, error)
- func (s *Scheduler) Offers() interface{}
- func (s *Scheduler) SendCall(call *mesosproto.Call, expectCode int) (*http.Response, error)
- func (s *Scheduler) SendEvent(appId string, task *types.Task) error
- func (s *Scheduler) Subscribe() error
- func (s *Scheduler) SubscribeEvent(w io.Writer, remote string) error
- func (s *Scheduler) Unsubscribe() error
- type SchedulerConfig
- type Task
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 DetectTaskError ¶ added in v0.2.3
func DetectTaskError(status *mesosproto.TaskStatus) error
func IsTaskDone ¶ added in v0.2.3
func IsTaskDone(status *mesosproto.TaskStatus) bool
IsTaskDone check that if a task is done or not according by task status.
func NewEventManager ¶
func NewEventManager() *eventManager
func NewHTTPClient ¶
func NewHTTPClient(leader string) *httpClient
Types ¶
type Scheduler ¶
type Scheduler struct {
sync.RWMutex // protect followings two
// contains filtered or unexported fields
}
Scheduler represents a client interacting with mesos master via x-protobuf
func NewScheduler ¶
func NewScheduler(cfg *SchedulerConfig, db store.Store, clusterMaster *mole.Master) (*Scheduler, error)
NewScheduler...
func (*Scheduler) AckUpdateEvent ¶
func (s *Scheduler) AckUpdateEvent(status *mesosproto.TaskStatus) error
func (*Scheduler) CloseClusterAgent ¶ added in v0.2.2
func (*Scheduler) ClusterAgent ¶ added in v0.2.1
func (s *Scheduler) ClusterAgent(id string) *mole.ClusterAgent
func (*Scheduler) ClusterAgents ¶ added in v0.2.1
func (s *Scheduler) ClusterAgents() map[string]*mole.ClusterAgent
func (*Scheduler) ClusterName ¶
Cluster return current mesos cluster's name
func (*Scheduler) FrameworkId ¶
func (s *Scheduler) FrameworkId() *mesosproto.FrameworkID
func (*Scheduler) FrameworkInfo ¶
func (s *Scheduler) FrameworkInfo() *types.FrameworkInfo
func (*Scheduler) FrameworkState ¶
FrameworkState obtain current framework stats
func (*Scheduler) FullTaskEventsAndRecords ¶ added in v0.2.1
func (s *Scheduler) FullTaskEventsAndRecords() []*types.CombinedEvents
FullTaskEventsAndRecords generate all of current app tasks' db stats into sse events & proxy records & dns records
func (*Scheduler) LaunchTasks ¶ added in v0.2.1
func (*Scheduler) MesosState ¶
MesosState obtain current mesos stats
func (*Scheduler) SendCall ¶ added in v0.2.3
SendCall send mesos request against the mesos master's scheduler api endpoint. note it's the caller's responsibility to deal with the SendCall() error
func (*Scheduler) SubscribeEvent ¶
func (*Scheduler) Unsubscribe ¶
type SchedulerConfig ¶
type Task ¶
type Task struct {
mesosproto.TaskInfo
// contains filtered or unexported fields
}
runtime Task object
func (*Task) GetStatus ¶
func (t *Task) GetStatus() chan *mesosproto.TaskStatus
GetStatus method reads the task status on the updates channel
Source Files
¶
Click to show internal directories.
Click to hide internal directories.