Documentation ¶
Overview ¶
The detector package houses implementation of master detectors. The default implementation is the zookeeper master detector. It uses zookeeper to detect the lead Mesos master during startup/failover.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(prefix string, f PluginFactory) error
associates a plugin implementation with a Master specification prefix. packages that provide plugins are expected to invoke this func within their init() implementation. schedulers that wish to support plugins may anonymously import ("_") a package the auto-registers said plugins.
Types ¶
type AsMasterChanged ¶
type AsMasterChanged func(*mesos.MasterInfo)
func/interface adapter
func (AsMasterChanged) Notify ¶
func (f AsMasterChanged) Notify(mi *mesos.MasterInfo)
type Master ¶
type Master interface { // Detect new master election. Every time a new master is // elected, the detector will alert the observer. // If it fails to start detection, then an error is returned. Detect(MasterChanged) error // returns a chan that, when closed, indicates the detector has terminated Done() <-chan struct{} }
An abstraction of a Master detector which can be used to detect the leading master from a group.
type MasterChanged ¶
type MasterChanged interface { // Invoked when the master changes Notify(*mesos.MasterInfo) }
type PluginFactory ¶
func MatchingPlugin ¶
func MatchingPlugin(spec string) (PluginFactory, bool)
type Standalone ¶
type Standalone struct {
// contains filtered or unexported fields
}
func NewStandalone ¶
func NewStandalone(mi *mesos.MasterInfo) *Standalone
Create a new stand alone master detector.
func (*Standalone) Appoint ¶
func (s *Standalone) Appoint(m *mesos.MasterInfo)
Trigger a master detected event.
func (*Standalone) Detect ¶
func (s *Standalone) Detect(o MasterChanged) error
Detecting the new master.
func (*Standalone) Done ¶
func (s *Standalone) Done() <-chan struct{}