detector

package
v0.0.0-...-eaf5374 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2015 License: Apache-2.0 Imports: 11 Imported by: 0

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.

func New

func New(spec string) (m Master, err error)

type MasterChanged

type MasterChanged interface {
	// Invoked when the master changes
	Notify(*mesos.MasterInfo)
}

type PluginFactory

type PluginFactory func(string) (Master, error)

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{}

func (*Standalone) Stop

func (s *Standalone) Stop()

Stop the detection.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL