mesos

package
v0.3.3-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2017 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

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

func NewReader

func NewReader(r io.Reader) io.Reader

NewReader returns an io.Reader that unpacks the data read from r out of RecordIO framing before returning it.

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 (s *Scheduler) CloseClusterAgent(id string)

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

func (s *Scheduler) ClusterName() string

Cluster return current mesos cluster's name

func (*Scheduler) Dump added in v0.2.1

func (s *Scheduler) Dump() interface{}

func (*Scheduler) FrameworkId

func (s *Scheduler) FrameworkId() *mesosproto.FrameworkID

func (*Scheduler) FrameworkInfo

func (s *Scheduler) FrameworkInfo() *types.FrameworkInfo

func (*Scheduler) FrameworkState

func (s *Scheduler) FrameworkState() (*megos.Framework, error)

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) KillTask

func (s *Scheduler) KillTask(taskId, agentId string, gracePeriod int64) error

func (*Scheduler) LaunchTasks added in v0.2.1

func (s *Scheduler) LaunchTasks(tasks []*Task) error

func (*Scheduler) Load added in v0.2.1

func (s *Scheduler) Load() map[string]interface{}

func (*Scheduler) MesosState

func (s *Scheduler) MesosState() (*megos.State, error)

MesosState obtain current mesos stats

func (*Scheduler) SendCall added in v0.2.3

func (s *Scheduler) SendCall(call *mesosproto.Call, expectCode int) (*http.Response, error)

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) SendEvent added in v0.2.3

func (s *Scheduler) SendEvent(appId string, task *types.Task) error

func (*Scheduler) Subscribe

func (s *Scheduler) Subscribe() error

Subscribe ...

func (*Scheduler) SubscribeEvent

func (s *Scheduler) SubscribeEvent(w io.Writer, remote string) error

func (*Scheduler) Unsubscribe

func (s *Scheduler) Unsubscribe() error

type SchedulerConfig

type SchedulerConfig struct {
	ZKHost []string
	ZKPath string

	Strategy string

	ReconciliationInterval  float64
	ReconciliationStep      int64
	ReconciliationStepDelay float64

	HeartbeatTimeout        float64
	MaxTasksPerOffer        int
	EnableCapabilityKilling bool
	EnableCheckPoint        bool
}

type Task

type Task struct {
	mesosproto.TaskInfo
	// contains filtered or unexported fields
}

runtime Task object

func NewTask

func NewTask(cfg *types.TaskConfig, id, name string) *Task

func (*Task) Build

func (t *Task) Build()

func (*Task) GetStatus

func (t *Task) GetStatus() chan *mesosproto.TaskStatus

GetStatus method reads the task status on the updates channel

func (*Task) ID

func (t *Task) ID() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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