Documentation ¶
Overview ¶
Package agentstate helps us keep a mental map of all the workload that is running across different Agents. It helps us remember what Instance is running in which node so that we can perform the load distribution or workload affinitiy more easily
Index ¶
- type Inst
- type NElement
- type State
- func (S *State) Add(Node string, Name string, Count int) bool
- func (S *State) Canfit(Node string, Name string, DistributionValue int) bool
- func (S *State) Del(Node string, Name string) bool
- func (S *State) InstancesRunning(Node string, Name string) int
- func (S *State) ListDistribution(Name string) []NElement
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type State ¶
type State struct { Agents map[string]Inst Count int IsSet bool // contains filtered or unexported fields }
State struct is responsible for maintaining Map of Agents, this should also have methods to let the Package Implementer know that if a particular instace can be provisioned here or not
func (*State) Add ¶
Add adds an Instance to a particular node, if the entry is unavailable it tries to create it first
func (*State) Canfit ¶
Canfit This will tell us if a Particualr Instnace with supplied distribution value can fit in that node or not
func (*State) Del ¶
Del This removes an entry from the Map it returns false which means that such an entry itself is not available in the map
func (*State) InstancesRunning ¶
InstancesRunning This will return how many workload for this instance running on this particular slave, if it returns -1 it means there is no such slave
func (*State) ListDistribution ¶
ListDistribution will Retrun an array of Nodes with structure