framework

package
v0.0.0-...-72424f1 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2016 License: Apache-2.0 Imports: 25 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TaskTypeMirrorMaker = "mirrormaker"
	TaskTypeConsumer    = "consumer"
)

Variables

View Source
var Config *config = &config{
	FrameworkName:    "go_kafka_client",
	FrameworkRole:    "*",
	FrameworkTimeout: 30 * time.Minute,
	LogLevel:         "info",
	Storage:          "file:go_kafka_client_mesos.json",
}

Functions

func InitLogging

func InitLogging(level string) error

func NewStorage

func NewStorage(storage string) (utils.Storage, error)

Types

type ApiRequest

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

func NewApiRequest

func NewApiRequest(url string) *ApiRequest

func (*ApiRequest) Get

func (r *ApiRequest) Get() *ApiResponse

func (*ApiRequest) PutBool

func (r *ApiRequest) PutBool(key string, value bool)

func (*ApiRequest) PutFloat

func (r *ApiRequest) PutFloat(key string, value float64)

func (*ApiRequest) PutInt

func (r *ApiRequest) PutInt(key string, value int64)

func (*ApiRequest) PutString

func (r *ApiRequest) PutString(key string, value interface{})

func (*ApiRequest) PutStringSlice

func (r *ApiRequest) PutStringSlice(key string, value []string)

type ApiResponse

type ApiResponse struct {
	Success bool
	Message string
}

func NewApiResponse

func NewApiResponse(success bool, message string) *ApiResponse

type Cluster

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

func NewCluster

func NewCluster() *Cluster

func (*Cluster) Add

func (c *Cluster) Add(task Task)

func (*Cluster) Exists

func (c *Cluster) Exists(id string) bool

func (*Cluster) ExpandIDs

func (c *Cluster) ExpandIDs(expr string) ([]string, error)

func (*Cluster) Get

func (c *Cluster) Get(id string) Task

func (*Cluster) GetAllTasks

func (c *Cluster) GetAllTasks() []Task

func (*Cluster) GetConstrained

func (c *Cluster) GetConstrained() []utils.Constrained

func (*Cluster) GetTasksWithState

func (c *Cluster) GetTasksWithState(state TaskState) []Task

func (*Cluster) IsReconciling

func (c *Cluster) IsReconciling() bool

func (*Cluster) Load

func (c *Cluster) Load()

func (*Cluster) Remove

func (c *Cluster) Remove(id string)

func (*Cluster) Save

func (c *Cluster) Save()

type CommonTask

type CommonTask struct {
	*TaskData
}

func (*CommonTask) Data

func (ct *CommonTask) Data() *TaskData

type ConsumerTask

type ConsumerTask struct {
	*CommonTask
}

func NewConsumerTask

func NewConsumerTask(id string, queryParams url.Values) (*ConsumerTask, error)

func (*ConsumerTask) MarshalJSON

func (ct *ConsumerTask) MarshalJSON() ([]byte, error)

func (*ConsumerTask) Matches

func (ct *ConsumerTask) Matches(offer *mesos.Offer) string

func (*ConsumerTask) NewTaskInfo

func (ct *ConsumerTask) NewTaskInfo(offer *mesos.Offer) *mesos.TaskInfo

func (*ConsumerTask) String

func (ct *ConsumerTask) String() string

type HttpServer

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

func NewHttpServer

func NewHttpServer(address string) *HttpServer

func (*HttpServer) Start

func (hs *HttpServer) Start()

type MirrorMakerExecutor

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

func NewMirrorMakerExecutor

func NewMirrorMakerExecutor() *MirrorMakerExecutor

func (*MirrorMakerExecutor) Disconnected

func (e *MirrorMakerExecutor) Disconnected(executor.ExecutorDriver)

func (*MirrorMakerExecutor) Error

func (e *MirrorMakerExecutor) Error(driver executor.ExecutorDriver, message string)

func (*MirrorMakerExecutor) FrameworkMessage

func (e *MirrorMakerExecutor) FrameworkMessage(driver executor.ExecutorDriver, message string)

func (*MirrorMakerExecutor) KillTask

func (e *MirrorMakerExecutor) KillTask(driver executor.ExecutorDriver, id *mesos.TaskID)

func (*MirrorMakerExecutor) LaunchTask

func (e *MirrorMakerExecutor) LaunchTask(driver executor.ExecutorDriver, task *mesos.TaskInfo)

func (*MirrorMakerExecutor) Registered

func (e *MirrorMakerExecutor) Registered(driver executor.ExecutorDriver, executor *mesos.ExecutorInfo, framework *mesos.FrameworkInfo, slave *mesos.SlaveInfo)

func (*MirrorMakerExecutor) Reregistered

func (e *MirrorMakerExecutor) Reregistered(driver executor.ExecutorDriver, slave *mesos.SlaveInfo)

func (*MirrorMakerExecutor) Shutdown

func (e *MirrorMakerExecutor) Shutdown(driver executor.ExecutorDriver)

type MirrorMakerTask

type MirrorMakerTask struct {
	*CommonTask
}

func NewMirrorMakerTask

func NewMirrorMakerTask(id string, queryParams url.Values) (*MirrorMakerTask, error)

func (*MirrorMakerTask) MarshalJSON

func (mm *MirrorMakerTask) MarshalJSON() ([]byte, error)

func (*MirrorMakerTask) Matches

func (mm *MirrorMakerTask) Matches(offer *mesos.Offer) string

func (*MirrorMakerTask) NewTaskInfo

func (mm *MirrorMakerTask) NewTaskInfo(offer *mesos.Offer) *mesos.TaskInfo

func (*MirrorMakerTask) String

func (mm *MirrorMakerTask) String() string

type Scheduler

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

func NewScheduler

func NewScheduler() *Scheduler

func (*Scheduler) Disconnected

func (s *Scheduler) Disconnected(scheduler.SchedulerDriver)

func (*Scheduler) Error

func (s *Scheduler) Error(driver scheduler.SchedulerDriver, message string)

func (*Scheduler) ExecutorLost

func (s *Scheduler) ExecutorLost(driver scheduler.SchedulerDriver, executor *mesos.ExecutorID, slave *mesos.SlaveID, status int)

func (*Scheduler) FrameworkMessage

func (s *Scheduler) FrameworkMessage(driver scheduler.SchedulerDriver, executor *mesos.ExecutorID, slave *mesos.SlaveID, message string)

func (*Scheduler) OfferRescinded

func (s *Scheduler) OfferRescinded(driver scheduler.SchedulerDriver, id *mesos.OfferID)

func (*Scheduler) Registered

func (s *Scheduler) Registered(driver scheduler.SchedulerDriver, id *mesos.FrameworkID, master *mesos.MasterInfo)

func (*Scheduler) Reregistered

func (s *Scheduler) Reregistered(driver scheduler.SchedulerDriver, master *mesos.MasterInfo)

func (*Scheduler) ResourceOffers

func (s *Scheduler) ResourceOffers(driver scheduler.SchedulerDriver, offers []*mesos.Offer)

func (*Scheduler) Shutdown

func (s *Scheduler) Shutdown(driver *scheduler.MesosSchedulerDriver)

func (*Scheduler) SlaveLost

func (s *Scheduler) SlaveLost(driver scheduler.SchedulerDriver, slave *mesos.SlaveID)

func (*Scheduler) Start

func (s *Scheduler) Start() error

func (*Scheduler) StatusUpdate

func (s *Scheduler) StatusUpdate(driver scheduler.SchedulerDriver, status *mesos.TaskStatus)

type Task

type Task interface {
	Data() *TaskData
	Matches(*mesos.Offer) string
	NewTaskInfo(*mesos.Offer) *mesos.TaskInfo
}

func NewTaskFromRequest

func NewTaskFromRequest(taskType string, id string, r *http.Request) (Task, error)

type TaskConfig

type TaskConfig map[string]string

func (TaskConfig) GetInt

func (tc TaskConfig) GetInt(key string) (int64, error)

func (TaskConfig) GetString

func (tc TaskConfig) GetString(key string) (string, error)

func (TaskConfig) SetIntConfig

func (tc TaskConfig) SetIntConfig(key string, where *int)

func (TaskConfig) SetStringConfig

func (tc TaskConfig) SetStringConfig(key string, where *string)

func (TaskConfig) SetStringSliceConfig

func (tc TaskConfig) SetStringSliceConfig(key string, where *[]string)

type TaskData

type TaskData struct {
	ID         string
	TaskID     string
	SlaveID    string
	ExecutorID string
	Attributes map[string]string
	State      TaskState
	Config     TaskConfig
	Cpu        float64
	Mem        float64
	// contains filtered or unexported fields
}

func (*TaskData) Attribute

func (td *TaskData) Attribute(name string) string

func (*TaskData) Constraints

func (td *TaskData) Constraints() map[string][]utils.Constraint

func (*TaskData) ResetTaskInfo

func (td *TaskData) ResetTaskInfo()

func (*TaskData) String

func (td *TaskData) String() string

func (*TaskData) Update

func (td *TaskData) Update(queryParams url.Values) error

func (*TaskData) WaitFor

func (td *TaskData) WaitFor(state TaskState, timeout time.Duration) bool

type TaskState

type TaskState string
const (
	TaskStateInactive    TaskState = "inactive"
	TaskStateStopped     TaskState = "stopped"
	TaskStateStaging     TaskState = "staging"
	TaskStateRunning     TaskState = "running"
	TaskStateReconciling TaskState = "reconciling"
)

Jump to

Keyboard shortcuts

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