etcdq

package
v0.0.0-...-2ac77b5 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2014 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	StatusAlive = WorkerStatus("ALIVE")
	StatusDead  = WorkerStatus("DEAD")

	JobStateQueued   = JobState("QUEUED")
	JobStateStarted  = JobState("STARTED")
	JobStateFinished = JobState("FINISHED")

	PathWorkers = "/workers"
	PathJobs    = "/jobs"

	SignalStop    = Signal("STOP")
	SignalSave    = Signal("SAVE")
	SignalJobDone = Signal("JOB_DONE")
	SignalOK      = Signal("OK")
)

Variables

View Source
var (
	JobRate = 5 * time.Second
)

Functions

func JobKey

func JobKey(id string) string

func WorkerKey

func WorkerKey(id string) string

Types

type Fileset

type Fileset struct {
	Name     string
	Patterns []string
}

type Job

type Job struct {
	Container *docker.Container
	Fileset   *JobFileset
	Owner     string
	States    []State
	Result    *JobResult
	// contains filtered or unexported fields
}

type JobFileset

type JobFileset struct {
	Input  *Fileset
	Output *Fileset
}

type JobResult

type JobResult struct {
	Status string
	Info   string
}

type JobState

type JobState string

type Signal

type Signal string

type State

type State struct {
	State JobState
	Step  string
	Date  time.Time
}

type Worker

type Worker struct {
	// The following are exported fields matching a worker's serialized form
	Name       string
	InstanceId string
	PrivateIp  string
	PublicIp   string
	Job        int64
	Heartbeat  time.Time
	Stats      WorkerStats
	Status     WorkerStatus
	Id         string
	// contains filtered or unexported fields
}

func NewWorker

func NewWorker(config *WorkerConfig) (worker *Worker, err error)

func (*Worker) Start

func (worker *Worker) Start()

type WorkerConfig

type WorkerConfig struct {
	AwsAccessKey string
	AwsSecretKey string
	AwsRegion    string
	S3Bucket     string
	Workspace    string
	EarthkitImg  string
	DataDir      string
}

type WorkerStats

type WorkerStats struct {
	Cpu  float32
	Mem  float32
	MemX int
}

type WorkerStatus

type WorkerStatus string

Jump to

Keyboard shortcuts

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