Documentation ¶
Overview ¶
Generated source file. Edit files in 'src' folder
Index ¶
- Constants
- Variables
- func ExecFile(path string, args []string, env []string, opts *ExecFileOpts) (pid int, errno int)
- func ForEachTrackedProcess(cb func(int, *ProcessRecord))
- func InitProcessEvents(config maestroSpecs.StatsConfig)
- func InitProcessMgmt(config *configs.ProcessesConfig)
- func InitProcessSubsystem(maxevent uint32)
- func IsJobActive(jobname string) (status bool, pid int)
- func New_processEventFIFO(maxsize uint32) (ret *processEventFIFO)
- func ReapChildren() (ret int, status unix.WaitStatus)
- func RegisterContainer(cont maestroSpecs.ContainerTemplate) (err error)
- func RegisterJob(job maestroSpecs.JobDefinition) (err error)
- func RegisterJobOverwrite(job maestroSpecs.JobDefinition) (err error)
- func RegisterMutableJob(job maestroSpecs.JobDefinition) (err error)
- func RestartJob(name string) (errout error)
- func StartAllAutoStartJobs()
- func StartEventsMonitor()
- func StartJob(name string) (errout error)
- func StopEventsMonitor()
- func SubmitEvent(ev Event)
- func TrackNewProcessByPid(pid int) (ret *ProcessRecord, old *ProcessRecord)
- func ValidateJobs() error
- type ContainerError
- type Event
- type EventList
- type ExecFileOpts
- func (opts *ExecFileOpts) GetOriginLabelId() uint32
- func (opts *ExecFileOpts) GetStderrFd() (ret int)
- func (opts *ExecFileOpts) GetStdoutFd() (ret int)
- func (opts *ExecFileOpts) SetJobName(name string)
- func (opts *ExecFileOpts) SetMessageString(msg string)
- func (opts *ExecFileOpts) SetNewPgid()
- func (opts *ExecFileOpts) SetNewSid()
- func (opts *ExecFileOpts) SetOkString(ok bool)
- func (opts *ExecFileOpts) SetUsePgid(pid int)
- type JobError
- type JobStatusData
- type MemStatEvent
- type ProcessEvent
- type ProcessRecord
- type ProcessStatsConfig
- type WakeupFd
Constants ¶
View Source
const ( STDIN_CLOSE = iota STDIN_TO_MANAGER = iota )
View Source
const ( STDOUT_CLOSE = iota STDOUT_TO_LOGGER = iota STDOUT_TO_MANAGER = iota )
View Source
const ( STDERR_CLOSE = iota STDERR_TO_LOGGER = iota STDERR_TO_MANAGER = iota )
View Source
const ( PROCESS_STARTED = 0x1 PROCESS_READY = 0x2 PROCESS_DIED = 0x4 )
View Source
const ( // JOB_STATUS_UNSET = iota // zero should be the unset NEVER_RAN = iota RUNNING = iota STOPPED = iota WAITING_FOR_DEPS = iota STARTING = iota STOPPING = iota RESTARTING = iota FAILED = iota )
enum JOB_STATUS
View Source
const ( CONTAINERERROR_UNKNOWN = iota CONTAINERERROR_DUPLICATE = iota )
View Source
const ( JOBERROR_UNKNOWN = iota JOBERROR_NOT_FOUND = iota // don't have a job by that name JOBERROR_DUPLICATE_JOB = iota JOBERROR_MISSING_DEPENDENCY = iota JOBERROR_DEPENDENCY_FAILURE = iota JOBERROR_MISSING_CONTAINER_TEMPLATE = iota JOBERROR_INVALID_CONFIG = iota // config options don't make sense JOBERROR_INTERNAL_ERROR = iota // catch all for things which should just not happen )
View Source
const ( EPOLLET = 1 << 31 MaxEpollEvents = 32 )
View Source
const ( EFD_SEMAPHORE = 00000001 EFD_CLOEXEC = 02000000 EFD_NONBLOCK = 00004000 )
Variables ¶
View Source
var CWD string
View Source
var PROCESS_STATES = map[uint32]string{ 0: "unknown", PROCESS_STARTED: "started", PROCESS_READY: "ready", PROCESS_DIED: "died", }
View Source
var THIS_DIR string
Functions ¶
func ForEachTrackedProcess ¶
func ForEachTrackedProcess(cb func(int, *ProcessRecord))
func InitProcessEvents ¶
func InitProcessEvents(config maestroSpecs.StatsConfig)
called after config file is read
func InitProcessMgmt ¶
func InitProcessMgmt(config *configs.ProcessesConfig)
func InitProcessSubsystem ¶
func InitProcessSubsystem(maxevent uint32)
func IsJobActive ¶
Returns true, pid if the job specified by jobname is active
func New_processEventFIFO ¶
func New_processEventFIFO(maxsize uint32) (ret *processEventFIFO)
func ReapChildren ¶
func ReapChildren() (ret int, status unix.WaitStatus)
attempts to reap a child, but does not block a valid PID is returned if a reap happened, otherwise 0
func RegisterContainer ¶
func RegisterContainer(cont maestroSpecs.ContainerTemplate) (err error)
func RegisterJob ¶
func RegisterJob(job maestroSpecs.JobDefinition) (err error)
func RegisterJobOverwrite ¶
func RegisterJobOverwrite(job maestroSpecs.JobDefinition) (err error)
func RegisterMutableJob ¶
func RegisterMutableJob(job maestroSpecs.JobDefinition) (err error)
func RestartJob ¶
func StartAllAutoStartJobs ¶
func StartAllAutoStartJobs()
func StartEventsMonitor ¶
func StartEventsMonitor()
func StopEventsMonitor ¶
func StopEventsMonitor()
func SubmitEvent ¶
func SubmitEvent(ev Event)
func TrackNewProcessByPid ¶
func TrackNewProcessByPid(pid int) (ret *ProcessRecord, old *ProcessRecord)
creates a new ProcessRecord, stores it in the tracking map, and returns this new one the old one - if for some rare reason a process with the same PID was already there
func ValidateJobs ¶
func ValidateJobs() error
Types ¶
type ContainerError ¶
func (*ContainerError) Error ¶
func (this *ContainerError) Error() string
type ExecFileOpts ¶
type ExecFileOpts struct {
// contains filtered or unexported fields
}
func NewExecFileOpts ¶
func NewExecFileOpts(jobname string, compid string) (opts *ExecFileOpts)
func (*ExecFileOpts) GetOriginLabelId ¶
func (opts *ExecFileOpts) GetOriginLabelId() uint32
func (*ExecFileOpts) GetStderrFd ¶
func (opts *ExecFileOpts) GetStderrFd() (ret int)
func (*ExecFileOpts) GetStdoutFd ¶
func (opts *ExecFileOpts) GetStdoutFd() (ret int)
func (*ExecFileOpts) SetJobName ¶
func (opts *ExecFileOpts) SetJobName(name string)
func (*ExecFileOpts) SetMessageString ¶
func (opts *ExecFileOpts) SetMessageString(msg string)
func (*ExecFileOpts) SetNewPgid ¶
func (opts *ExecFileOpts) SetNewPgid()
func (*ExecFileOpts) SetNewSid ¶
func (opts *ExecFileOpts) SetNewSid()
func (*ExecFileOpts) SetOkString ¶
func (opts *ExecFileOpts) SetOkString(ok bool)
func (*ExecFileOpts) SetUsePgid ¶
func (opts *ExecFileOpts) SetUsePgid(pid int)
type JobStatusData ¶
func GetJobStatus ¶
func GetJobStatus() (data JobStatusData, err error)
type MemStatEvent ¶
type MemStatEvent struct {
// contains filtered or unexported fields
}
func NewVirtualMemEvent ¶
func NewVirtualMemEvent(stats *mem.VirtualMemoryStat) (ret *MemStatEvent)
func (MemStatEvent) MarshalJSON ¶
func (this MemStatEvent) MarshalJSON() ([]byte, error)
func (MemStatEvent) UnmarshalJSON ¶
func (this MemStatEvent) UnmarshalJSON(b []byte) error
type ProcessEvent ¶
type ProcessEvent struct { Pid int `json:"pid"` // The PID may change on restart, but the job name remains the same Job string `json:"job"` ExitVal int `json:"exitVal"` // 0 if the process is not exited // contains filtered or unexported fields }
func (ProcessEvent) MarshalJSON ¶
func (this ProcessEvent) MarshalJSON() ([]byte, error)
func (ProcessEvent) UnmarshalJSON ¶
func (this ProcessEvent) UnmarshalJSON(b []byte) error
type ProcessRecord ¶
type ProcessRecord struct { Pid int // the Path to start the process executable Path string // serves as a generic identifier for a particular job // jobs maybe restarted, etc. A Job should be a unique name to the // instance of maestro on this gateway Job string CompId string Started time.Time Stopped time.Time State uint32 // see PROCESS_STATES ExitValue int }
a record of start and/or stop operation. basically a single life of a process (not a Job)
func GetTrackedProcessByPid ¶
func GetTrackedProcessByPid(pid int) (ret *ProcessRecord, ok bool)
returns a ProcessRecord by its PID (process ID)
func RemoveTrackedProcessByPid ¶
func RemoveTrackedProcessByPid(pid int) (ret *ProcessRecord)
type ProcessStatsConfig ¶
type WakeupFd ¶
type WakeupFd struct {
// contains filtered or unexported fields
}
func (*WakeupFd) ReadWakeup ¶
Click to show internal directories.
Click to hide internal directories.