Documentation ¶
Index ¶
- Constants
- func CASEpoch(client *etcd.Client, appname string, prevEpoch, epoch uint64) error
- func DetectFailure(client *etcd.Client, name string, stop chan bool) error
- func EpochPath(appName string) string
- func FreeTaskDir(appName string) string
- func FreeTaskPath(appName, idStr string) string
- func GetAddress(client *etcd.Client, name string, id uint64) (string, error)
- func GetAndWatchEpoch(client *etcd.Client, appname string, epochC chan uint64, stop chan bool) (uint64, error)
- func HealthyPath(appName string) string
- func Heartbeat(client *etcd.Client, name string, taskID uint64, interval time.Duration, ...) error
- func JobStatusPath(appName string) string
- func ListKeys(nodes []*etcd.Node) []string
- func MasterPath(job string) string
- func MetaPath(appName string, taskID uint64) string
- func MustCreate(c *etcd.Client, logger *log.Logger, key, value string, ttl uint64) *etcd.Response
- func ReportFailure(client *etcd.Client, name, failedTask string) error
- func SetJobStatus(client *etcd.Client, name string, status int) error
- func TaskDirPath(appName string) string
- func TaskHealthyPath(appName string, taskID uint64) string
- func TaskMasterPath(appName string, taskID uint64) string
- func TryOccupyTask(client *etcd.Client, name string, taskID uint64, connection string) (bool, error)
- func WaitFreeTask(client *etcd.Client, name string, logger *log.Logger) (uint64, error)
- func WatchMeta(c *etcd.Client, path string, stop chan bool, ...) error
- func WorkerPath(job string, id uint64) string
Constants ¶
View Source
const ( TasksDir = "tasks" NodesDir = "nodes" ConfigDir = "config" FreeDir = "freeTasks" Epoch = "epoch" Status = "status" TaskMaster = "0" NodeAddr = "address" NodeTTL = "ttl" Healthy = "healthy" )
Variables ¶
This section is empty.
Functions ¶
func DetectFailure ¶
detect failure of the given taskID
func FreeTaskDir ¶
func FreeTaskPath ¶
func GetAddress ¶
getAddress will return the host:port address of the service taking care of the task that we want to talk to. Currently we grab the information from etcd every time. Local cache could be used. If it failed, e.g. network failure, it should return error.
func GetAndWatchEpoch ¶
func HealthyPath ¶
func Heartbeat ¶
func Heartbeat(client *etcd.Client, name string, taskID uint64, interval time.Duration, stop chan struct{}) error
heartbeat to etcd cluster until stop
func JobStatusPath ¶
func MasterPath ¶
func MustCreate ¶
func ReportFailure ¶
report failure to etcd cluster If a framework detects a failure, it tries to report failure to /FreeTasks/{taskID}
func TaskDirPath ¶
func TaskHealthyPath ¶
func TaskMasterPath ¶
func TryOccupyTask ¶
func WaitFreeTask ¶
WaitFreeTask blocks until it gets a hint of free task
func WorkerPath ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.