Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAgentInfo ¶
GetAgentInfo return agent info from global map.
Types ¶
type AgentMap ¶
type AgentMap struct { // Registered agent details by id. RegisteredAgents map[string]*mesos_master.Response_GetAgents_Agent Capacity scalar.Resources SlackCapacity scalar.Resources }
AgentMap is a placeholder from agent id to agent related information. Note that AgentInfo is immutable as of Mesos 1.3.
func GetAgentMap ¶
func GetAgentMap() *AgentMap
GetAgentMap returns a full map of all registered agents. Note that caller should not mutable the content since it's not protected by any lock.
func (*AgentMap) ReportCapacityMetrics ¶
ReportCapacityMetrics into given metric scope.
type Drainer ¶
type Drainer interface { Start() Stop() }
Drainer defines the interface for host drainer
func NewDrainer ¶
func NewDrainer( drainerPeriod time.Duration, masterOperatorClient mpb.MasterOperatorClient, maintenanceQueue queue.MaintenanceQueue, hostInfoMap MaintenanceHostInfoMap, ) Drainer
NewDrainer creates a new host drainer
type Loader ¶
type Loader struct { sync.Mutex OperatorClient mpb.MasterOperatorClient MaintenanceHostInfoMap MaintenanceHostInfoMap SlackResourceTypes []string Scope tally.Scope }
Loader loads hostmap from Mesos and stores in global singleton.
type MaintenanceHostInfoMap ¶
type MaintenanceHostInfoMap interface { // GetDrainingHostInfos returns HostInfo of the specified DRAINING hosts. // If the hostFilter is empty then HostInfos of all DRAINING hosts is returned. GetDrainingHostInfos(hostFilter []string) []*host.HostInfo // GetDownHostInfos returns HostInfo of hosts in DOWN state // If the hostFilter is empty then HostInfos of all DOWN hosts is returned. GetDownHostInfos(hostFilter []string) []*host.HostInfo // AddHostInfo adds a HostInfo to the map. AddHostInfo is called when a host // transitions to a maintenance states (DRAINING and DRAINED). AddHostInfo(hostInfo *host.HostInfo) // RemoveHostInfo removes the host's hostInfo from // the relevant host state based list of hostInfos // RemoveHostInfo is needed to remove entries of hosts from the map when // hosts transition from one of the maintenance states to UP state. RemoveHostInfo(host string) // UpdateHostState updates the HostInfo.HostState of the specified // host from 'from' state to 'to' state. UpdateHostState(hostname string, from host.HostState, to host.HostState) error // ClearAndFillMap clears the content of the // map and fills the map with the given host infos ClearAndFillMap(hostInfos []*host.HostInfo) }
MaintenanceHostInfoMap defines an interface of a map of HostInfos of hosts in maintenance TODO: remove this once GetAgents Response has maintenance state of the agents
func NewMaintenanceHostInfoMap ¶
func NewMaintenanceHostInfoMap(scope tally.Scope) MaintenanceHostInfoMap
NewMaintenanceHostInfoMap returns a new MaintenanceHostInfoMap
type Metrics ¶
type Metrics struct { DrainingHosts tally.Gauge DownHosts tally.Gauge // contains filtered or unexported fields }
Metrics is placeholder for all metrics in hostmgr/host package.
func NewMetrics ¶
NewMetrics returns a new Metrics struct, with all metrics initialized and rooted at the given tally.Scope