Documentation ¶
Index ¶
- Constants
- func CheckConstraints(offer *mesos.Offer, taskConstraints map[string][]Constraint, ...) string
- func Environment(vars map[string]string) *mesos.Environment
- func GetRangeResources(offer *mesos.Offer, resourceName string) []*mesos.Value_Range
- func GetScalarResources(offer *mesos.Offer, resourceName string) float64
- func OfferAttributes(offer *mesos.Offer) map[string]string
- func StringToLabels(s string) *mesos.Labels
- func TaskMatches(data *TaskData, offer *mesos.Offer) string
- type Cluster
- type Constrained
- type Constraint
- type Constraints
- type DefaultLogger
- func (dl *DefaultLogger) Critical(message string, params ...interface{})
- func (dl *DefaultLogger) Debug(message string, params ...interface{})
- func (dl *DefaultLogger) Error(message string, params ...interface{})
- func (dl *DefaultLogger) Info(message string, params ...interface{})
- func (dl *DefaultLogger) Trace(message string, params ...interface{})
- func (dl *DefaultLogger) Warn(message string, params ...interface{})
- type FileStorage
- type GroupBy
- type Like
- type Log
- type LogLevel
- type Range
- type Reconciler
- type Storage
- type Task
- type TaskConfig
- type TaskData
- type TaskState
- type Tasks
- type Unique
- type Unlike
- type ZKStorage
Constants ¶
const ( ResourceCpus = "cpus" ResourceMem = "mem" ResourceDisk = "disk" ResourcePorts = "ports" )
Variables ¶
This section is empty.
Functions ¶
func CheckConstraints ¶
func CheckConstraints(offer *mesos.Offer, taskConstraints map[string][]Constraint, otherTasks []Constrained) string
func Environment ¶
func Environment(vars map[string]string) *mesos.Environment
func GetRangeResources ¶
func GetRangeResources(offer *mesos.Offer, resourceName string) []*mesos.Value_Range
func StringToLabels ¶
Convert param string like "param1=value1;param2=value2" to mesos.Labels
Types ¶
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
func NewClusterConstraint ¶
type Constrained ¶
type Constrained interface { Constraints() map[string][]Constraint Attribute(name string) string }
type Constraint ¶
func MustParseConstraint ¶
func MustParseConstraint(value string) Constraint
func ParseConstraint ¶
func ParseConstraint(value string) (Constraint, error)
type Constraints ¶
type Constraints map[string][]Constraint
func (Constraints) MarshalJSON ¶
func (c Constraints) MarshalJSON() ([]byte, error)
func (Constraints) UnmarshalJSON ¶
func (c Constraints) UnmarshalJSON(data []byte) error
type DefaultLogger ¶
type DefaultLogger struct {
// contains filtered or unexported fields
}
DefaultLogger is a default implementation of Log interface used in this client.
func NewDefaultLogger ¶
func NewDefaultLogger(Level LogLevel) *DefaultLogger
NewDefaultLogger creates a new DefaultLogger that is configured to write messages to console with minimum log level Level.
func (*DefaultLogger) Critical ¶
func (dl *DefaultLogger) Critical(message string, params ...interface{})
Critical formats a given message according to given params to log with level Critical.
func (*DefaultLogger) Debug ¶
func (dl *DefaultLogger) Debug(message string, params ...interface{})
Debug formats a given message according to given params to log with level Debug.
func (*DefaultLogger) Error ¶
func (dl *DefaultLogger) Error(message string, params ...interface{})
Error formats a given message according to given params to log with level Error.
func (*DefaultLogger) Info ¶
func (dl *DefaultLogger) Info(message string, params ...interface{})
Info formats a given message according to given params to log with level Info.
func (*DefaultLogger) Trace ¶
func (dl *DefaultLogger) Trace(message string, params ...interface{})
Trace formats a given message according to given params to log with level Trace.
func (*DefaultLogger) Warn ¶
func (dl *DefaultLogger) Warn(message string, params ...interface{})
Warn formats a given message according to given params to log with level Warn.
type FileStorage ¶
type FileStorage struct {
// contains filtered or unexported fields
}
func NewFileStorage ¶
func NewFileStorage(file string) *FileStorage
func (*FileStorage) Load ¶
func (fs *FileStorage) Load() ([]byte, error)
func (*FileStorage) Save ¶
func (fs *FileStorage) Save(contents []byte) error
func (*FileStorage) String ¶
func (fs *FileStorage) String() string
type GroupBy ¶
type GroupBy struct {
// contains filtered or unexported fields
}
func NewGroupByConstraint ¶
type Log ¶
type Log interface { //Formats a given message according to given params to log with level Trace. Trace(message string, params ...interface{}) //Formats a given message according to given params to log with level Debug. Debug(message string, params ...interface{}) //Formats a given message according to given params to log with level Info. Info(message string, params ...interface{}) //Formats a given message according to given params to log with level Warn. Warn(message string, params ...interface{}) //Formats a given message according to given params to log with level Error. Error(message string, params ...interface{}) //Formats a given message according to given params to log with level Critical. Critical(message string, params ...interface{}) }
Log is a logger interface. Lets you plug-in your custom logging library instead of using built-in one.
var Logger Log = NewDefaultLogger(InfoLevel)
Logger used by this client. Defaults to build-in logger with Info log level.
type LogLevel ¶
type LogLevel string
LogLevel represents a logging level.
const ( // TraceLevel is used for debugging to find problems in functions, variables etc. TraceLevel LogLevel = "trace" // DebugLevel is used for detailed system reports and diagnostic messages. DebugLevel LogLevel = "debug" // InfoLevel is used for general information about a running application. InfoLevel LogLevel = "info" // WarnLevel is used to indicate small errors and failures that should not happen normally but are recovered automatically. WarnLevel LogLevel = "warn" // ErrorLevel is used to indicate severe errors that affect application workflow and are not handled automatically. ErrorLevel LogLevel = "error" // CriticalLevel is used to indicate fatal errors that may cause data corruption or loss. CriticalLevel LogLevel = "critical" )
type Reconciler ¶
type Reconciler struct { ReconcileDelay time.Duration ReconcileMaxTries int // contains filtered or unexported fields }
func NewReconciler ¶
func NewReconciler() *Reconciler
func (*Reconciler) ExplicitReconcile ¶
func (r *Reconciler) ExplicitReconcile(taskIDs []string, driver scheduler.SchedulerDriver)
func (*Reconciler) ImplicitReconcile ¶
func (r *Reconciler) ImplicitReconcile(driver scheduler.SchedulerDriver)
func (*Reconciler) Update ¶
func (r *Reconciler) Update(status *mesos.TaskStatus)
type TaskConfig ¶
func (TaskConfig) GetString ¶
func (tc TaskConfig) GetString(key string) string
type TaskData ¶
type TaskData struct { Type string ID string TaskID string SlaveID string ExecutorID string Attributes map[string]string State TaskState Cpu float64 Mem float64 ConstraintMap Constraints }
also implements Constrained
func (*TaskData) Constraints ¶
func (td *TaskData) Constraints() map[string][]Constraint
type Tasks ¶
type Tasks interface { Exists(id string) bool Add(task Task) Remove(id string) Get(id string) Task GetAll() []Task GetWithFilter(filter func(Task) bool) []Task GetStopped() []Task IsReconciling() bool GetConstrained() []Constrained }
func NewThreadSafeTasks ¶
func NewThreadSafeTasks() Tasks
type Unlike ¶
type Unlike struct {
// contains filtered or unexported fields
}
func NewUnlikeConstraint ¶
type ZKStorage ¶
type ZKStorage struct {
// contains filtered or unexported fields
}