Documentation ¶
Index ¶
- Constants
- Variables
- func AcquireLock(identifier string, namespace string, durationInSeconds uint64) error
- func ClearAnnouncments(base string) error
- func ClearClusterStates(base string) error
- func GetClusterAnnouncements(path string) (map[string]NodeState, error)
- func GetClusterStates(base string) (map[string]NodeState, error)
- func NewEtcdClient() (client *etcd.Client)
- func ReleaseLock(identifier string, namespace string) error
- func SaveClusterStates(base string, states map[string]NodeState) error
- func Schedule(path string) (map[string]NodeState, error)
- func ScheduleCore(announcements map[string]NodeState, currentStates map[string]NodeState) map[string]NodeState
- func SelectMaster(currentStates map[string]NodeState) map[string]NodeState
- func SetClusterAnnouncement(base string, state NodeState) error
- func StartScheduler(servicePath string, timeoutInSeconds int, stop <-chan bool, ...)
- type NodeState
Constants ¶
View Source
const ( // ErrorKeyNotFound is the key not found error code from etcd ErrorKeyNotFound = 100 // ErrorCompareFailed is the key compare failed error code from etcd ErrorCompareFailed = 101 // ErrorNodeExist is the key exists failed error code from etcd ErrorNodeExist = 105 )
Variables ¶
View Source
var ErrLockInUse = errors.New("lock in use")
ErrLockInUse is returned when a lock is in use
View Source
var SchedulerStateClustered = "clustered"
View Source
var SchedulerStateDeleted = "deleted"
View Source
var SchedulerStateEmpty = ""
View Source
var SchedulerStateNew = "new"
View Source
var SchedulerStateRelax = "relax"
View Source
var TTL uint64 = 5
Functions ¶
func AcquireLock ¶
AcquireLock attempts to create a new lock. If the lock already exists it returns an error
func ClearAnnouncments ¶
func ClearClusterStates ¶
func GetClusterAnnouncements ¶
func NewEtcdClient ¶
func ReleaseLock ¶
ReleaseLock releases an existing lock
func ScheduleCore ¶
func SetClusterAnnouncement ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.