Documentation ¶
Index ¶
- Constants
- func CASEpoch(client *etcd.Client, appname string, prevEpoch, epoch uint64) error
- func ChildMetaPath(appName string, taskID uint64) string
- func DetectFailure(client *etcd.Client, name string, stop chan bool, logger *log.Logger) 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 MustCreate(c *etcd.Client, logger *log.Logger, key, value string, ttl uint64) *etcd.Response
- func MustNewMember(t *testing.T, name string) *member
- func ParentMetaPath(appName string, taskID uint64) string
- func ReportFailure(client *etcd.Client, name, failedTask string) error
- func SetJobStatus(client *etcd.Client, name string, status int) error
- func StartNewEtcdServer(t *testing.T, name string) *member
- 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
- func WaitFreeTask(client *etcd.Client, name string, logger *log.Logger) (uint64, error)
- func WatchMeta(c *etcd.Client, taskID uint64, path string, stop chan bool, ...) error
Constants ¶
View Source
const ( TasksDir = "tasks" NodesDir = "nodes" ConfigDir = "config" FreeDir = "freeTasks" Epoch = "epoch" Status = "status" TaskMaster = "0" TaskParentMeta = "parentMeta" TaskChildMeta = "childMeta" NodeAddr = "address" NodeTTL = "ttl" Healthy = "healthy" )
Variables ¶
This section is empty.
Functions ¶
func ChildMetaPath ¶
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 MustCreate ¶
func MustNewMember ¶
func ParentMetaPath ¶
func ReportFailure ¶
report failure to etcd cluster If a framework detects a failure, it tries to report failure to /FreeTasks/{taskID}
func StartNewEtcdServer ¶
func TaskDirPath ¶
func TaskHealthyPath ¶
func TaskMasterPath ¶
func TryOccupyTask ¶
func WaitFreeTask ¶
WaitFreeTask blocks until it gets a hint of free task
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.