Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Masters ¶
type Masters struct {
// contains filtered or unexported fields
}
Masters detects changes of leader and/or master elections and sends these changes to a channel.
func NewMasters ¶
NewMasters returns a new Masters detector with the given initial masters and the given changed channel to which master changes will be sent to. Initially the leader is unknown which is represented by setting the first item of the sent masters slice to be empty.
func (*Masters) OnMasterChanged ¶
func (ms *Masters) OnMasterChanged(leader *mesos.MasterInfo)
OnMasterChanged sets the given MasterInfo as the current leader leaving the remaining masters unchanged and emits the current masters state. It implements the detector.MasterChanged interface.
func (*Masters) UpdatedMasters ¶
func (ms *Masters) UpdatedMasters(infos []*mesos.MasterInfo)
UpdatedMasters sets the given slice of MasterInfo as the current remaining masters leaving the current leader unchanged and emits the current masters state. It implements the detector.AllMasters interface.
Notes ¶
Bugs ¶
The byte order of the `ip` field in MasterInfo is platform dependent. We assume that Mesos is compiled with the same architecture as Mesos-DNS and hence same byte order. If this isn't the case, the address returned will be wrong. This only affects Mesos versions < 0.24.0