Documentation ¶
Index ¶
- Constants
- Variables
- func InitLogging(level string) error
- func NewStorage(storage string) (utils.Storage, error)
- type ApiRequest
- func (r *ApiRequest) Get() *ApiResponse
- func (r *ApiRequest) PutBool(key string, value bool)
- func (r *ApiRequest) PutFloat(key string, value float64)
- func (r *ApiRequest) PutInt(key string, value int64)
- func (r *ApiRequest) PutString(key string, value interface{})
- func (r *ApiRequest) PutStringSlice(key string, value []string)
- type ApiResponse
- type Cluster
- func (c *Cluster) Add(task Task)
- func (c *Cluster) Exists(id string) bool
- func (c *Cluster) ExpandIDs(expr string) ([]string, error)
- func (c *Cluster) Get(id string) Task
- func (c *Cluster) GetAllTasks() []Task
- func (c *Cluster) GetConstrained() []utils.Constrained
- func (c *Cluster) GetTasksWithState(state TaskState) []Task
- func (c *Cluster) IsReconciling() bool
- func (c *Cluster) Load()
- func (c *Cluster) Remove(id string)
- func (c *Cluster) Save()
- type CommonTask
- type ConsumerTask
- type HttpServer
- type MirrorMakerExecutor
- func (e *MirrorMakerExecutor) Disconnected(executor.ExecutorDriver)
- func (e *MirrorMakerExecutor) Error(driver executor.ExecutorDriver, message string)
- func (e *MirrorMakerExecutor) FrameworkMessage(driver executor.ExecutorDriver, message string)
- func (e *MirrorMakerExecutor) KillTask(driver executor.ExecutorDriver, id *mesos.TaskID)
- func (e *MirrorMakerExecutor) LaunchTask(driver executor.ExecutorDriver, task *mesos.TaskInfo)
- func (e *MirrorMakerExecutor) Registered(driver executor.ExecutorDriver, executor *mesos.ExecutorInfo, ...)
- func (e *MirrorMakerExecutor) Reregistered(driver executor.ExecutorDriver, slave *mesos.SlaveInfo)
- func (e *MirrorMakerExecutor) Shutdown(driver executor.ExecutorDriver)
- type MirrorMakerTask
- type Scheduler
- func (s *Scheduler) Disconnected(scheduler.SchedulerDriver)
- func (s *Scheduler) Error(driver scheduler.SchedulerDriver, message string)
- func (s *Scheduler) ExecutorLost(driver scheduler.SchedulerDriver, executor *mesos.ExecutorID, ...)
- func (s *Scheduler) FrameworkMessage(driver scheduler.SchedulerDriver, executor *mesos.ExecutorID, ...)
- func (s *Scheduler) OfferRescinded(driver scheduler.SchedulerDriver, id *mesos.OfferID)
- func (s *Scheduler) Registered(driver scheduler.SchedulerDriver, id *mesos.FrameworkID, ...)
- func (s *Scheduler) Reregistered(driver scheduler.SchedulerDriver, master *mesos.MasterInfo)
- func (s *Scheduler) ResourceOffers(driver scheduler.SchedulerDriver, offers []*mesos.Offer)
- func (s *Scheduler) Shutdown(driver *scheduler.MesosSchedulerDriver)
- func (s *Scheduler) SlaveLost(driver scheduler.SchedulerDriver, slave *mesos.SlaveID)
- func (s *Scheduler) Start() error
- func (s *Scheduler) StatusUpdate(driver scheduler.SchedulerDriver, status *mesos.TaskStatus)
- type Task
- type TaskConfig
- func (tc TaskConfig) GetInt(key string) (int64, error)
- func (tc TaskConfig) GetString(key string) (string, error)
- func (tc TaskConfig) SetIntConfig(key string, where *int)
- func (tc TaskConfig) SetStringConfig(key string, where *string)
- func (tc TaskConfig) SetStringSliceConfig(key string, where *[]string)
- type TaskData
- func (td *TaskData) Attribute(name string) string
- func (td *TaskData) Constraints() map[string][]utils.Constraint
- func (td *TaskData) ResetTaskInfo()
- func (td *TaskData) String() string
- func (td *TaskData) Update(queryParams url.Values) error
- func (td *TaskData) WaitFor(state TaskState, timeout time.Duration) bool
- type TaskState
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", }
View Source
var Logger log.LoggerInterface
Functions ¶
func InitLogging ¶
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 ¶
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) GetAllTasks ¶
func (*Cluster) GetConstrained ¶
func (c *Cluster) GetConstrained() []utils.Constrained
func (*Cluster) GetTasksWithState ¶
func (*Cluster) IsReconciling ¶
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) 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) 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) StatusUpdate ¶
func (s *Scheduler) StatusUpdate(driver scheduler.SchedulerDriver, status *mesos.TaskStatus)
type Task ¶
type TaskConfig ¶
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) Constraints ¶
func (td *TaskData) Constraints() map[string][]utils.Constraint
func (*TaskData) ResetTaskInfo ¶
func (td *TaskData) ResetTaskInfo()
Click to show internal directories.
Click to hide internal directories.