worker

package
v0.0.0-...-f5fddd7 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2014 License: BSD-2-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ID_HEARTBEATER   = 0
	ID_WORKSTEALER   = 1
	ID_DATAMOVER     = 2
	ID_WORKER        = 3
	ID_DELIVERER     = 4
	ID_REDISTRIBUTOR = 5
)

Variables

This section is empty.

Functions

func CheckoutTokenByJobId

func CheckoutTokenByJobId(jobid string) (token string, err error)

func CheckoutWorkunitRemote

func CheckoutWorkunitRemote() (workunit *core.Workunit, err error)

func CleanDisk

func CleanDisk() (err error)

func ComposeProfile

func ComposeProfile() (profile *core.Client, err error)

func DiscardWorkunit

func DiscardWorkunit(id string) (err error)

func FetchDataTokenByWorkId

func FetchDataTokenByWorkId(workid string) (token string, err error)

func InitWorkers

func InitWorkers(client *core.Client) (err error)

func ParseWorkunitArgs

func ParseWorkunitArgs(work *core.Workunit) (args []string, err error)

parse workunit, fetch input data, compose command arguments

func ReRegisterWithSelf

func ReRegisterWithSelf(host string) (client *core.Client, err error)

func RegisterWithAuth

func RegisterWithAuth(host string, profile *core.Client) (client *core.Client, err error)

func RegisterWithProfile

func RegisterWithProfile(host string, profile *core.Client) (client *core.Client, err error)

func RestartClient

func RestartClient() (err error)

func RunWorkunit

func RunWorkunit(work *core.Workunit) (err error)

func SendHeartBeat

func SendHeartBeat()

client sends heartbeat to server to maintain active status and re-register when needed

func StartClientWorkers

func StartClientWorkers()

func StartProxyWorkers

func StartProxyWorkers()

func StopClient

func StopClient() (err error)

func SubmitWorkProxy

func SubmitWorkProxy(work *core.Workunit) (err error)

Types

type ClientResponse

type ClientResponse struct {
	Code int         `bson:"status" json:"status"`
	Data core.Client `bson:"data" json:"data"`
	Errs []string    `bson:"error" json:"error"`
}

type HeartbeatResponse

type HeartbeatResponse struct {
	Code int        `bson:"status" json:"status"`
	Data core.HBmsg `bson:"data" json:"data"`
	Errs []string   `bson:"error" json:"error"`
}

type TokenResponse

type TokenResponse struct {
	Code int      `bson:"status" json:"status"`
	Data string   `bson:"data" json:"data"`
	Errs []string `bson:"error" json:"error"`
}

type WorkResponse

type WorkResponse struct {
	Code int            `bson:"status" json:"status"`
	Data *core.Workunit `bson:"data" json:"data"`
	Errs []string       `bson:"error" json:"error"`
}

Jump to

Keyboard shortcuts

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