job

package
v0.2.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2014 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

type Job struct {
	Name            string
	JobRequirements map[string][]string
	Payload         *JobPayload
	State           *JobState
}

func NewJob

func NewJob(name string, requirements map[string][]string, payload *JobPayload, state *JobState) *Job

func (*Job) Requirements

func (self *Job) Requirements() map[string][]string

type JobBid

type JobBid struct {
	JobName string

	// MachineBootID started life as MachineBootId in the datastore.
	// It cannot be changed without a migration.
	MachineBootID string `json:"MachineBootId"`
}

func NewBid

func NewBid(jobName string, machBootID string) *JobBid

type JobOffer

type JobOffer struct {
	Job Job

	// MachineBootIDs represents a set of machines for which this offer is valid.
	// If nil or len == 0 then all machines. Must be to be sorted.
	// MachineBootIDs started life as MachineBootIds in the datastore.
	// It cannot be changed without a migration
	MachineBootIDs []string `json:"MachineBootIds"`
}

func NewOfferFromJob

func NewOfferFromJob(j Job, machineBootIDs []string) *JobOffer

func (*JobOffer) OfferedTo added in v0.2.0

func (jo *JobOffer) OfferedTo(machineBootID string) bool

OfferedTo returns true if job is being offered to specified machine.

type JobPayload

type JobPayload struct {
	Name string
	Unit unit.SystemdUnitFile
}

func NewJobPayload

func NewJobPayload(name string, uFile unit.SystemdUnitFile) *JobPayload

func (*JobPayload) Conflicts

func (jp *JobPayload) Conflicts() []string

func (*JobPayload) MarshalJSON added in v0.2.0

func (jp *JobPayload) MarshalJSON() ([]byte, error)

func (*JobPayload) Peers

func (jp *JobPayload) Peers() []string

func (*JobPayload) Type

func (jp *JobPayload) Type() (string, error)

func (*JobPayload) UnmarshalJSON added in v0.2.0

func (jp *JobPayload) UnmarshalJSON(data []byte) error

type JobState

type JobState struct {
	LoadState    string                `json:"loadState"`
	ActiveState  string                `json:"activeState"`
	SubState     string                `json:"subState"`
	Sockets      []string              `json:"sockets"`
	MachineState *machine.MachineState `json:"machineState"`
}

func NewJobState

func NewJobState(loadState, activeState, subState string, sockets []string, ms *machine.MachineState) *JobState

Jump to

Keyboard shortcuts

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