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 IsKeyNotFound(err error) bool
- func ListKeys(nodes []*etcd.Node) []string
- 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 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)
Constants ¶
View Source
const ( TasksDir = "tasks" NodesDir = "nodes" ConfigDir = "config" FreeDir = "freeTasks" Epoch = "epoch" 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 IsKeyNotFound ¶
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 ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.