libmantle
 All Classes Files Functions Typedefs Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Mantle Class Reference

Public Member Functions

 Mantle (Server s)
 
int when (bool &decision)
 
int where (Targets &decision)
 
int howmuch (Load &decision)
 
int configure (Policy when, Policy where, Policy howmuch)
 
int update (ClusterMetrics metrics)
 

Protected Member Functions

int execute (Policy p, Server s, ClusterMetrics m)
 

Protected Attributes

lua_State * L
 
Server whoami
 
ClusterMetrics metrics
 
Policy when_callback
 
Policy howmuch_callback
 
Policy where_callback
 

Constructor & Destructor Documentation

Mantle::Mantle ( Server  s)
inline

Initializes a Mantle instance

Parameters
sname of current server (the one running Mantle)

Member Function Documentation

int Mantle::configure ( Policy  when,
Policy  where,
Policy  howmuch 
)

Configure load balancing policies

Parameters
whencallback that decides when to move load
wherecallback that decides which servers to send load to
howmuchcallback that decides what fraction of load to shed
Returns
0 on success, < 0 otherwise
int Mantle::howmuch ( Load &  decision)

Executes the howmuch callback, which decides how much load the service should move

Parameters
decisionamount of load the service should move
Returns
0 on success, < 0 otherwise
int Mantle::update ( ClusterMetrics  metrics)

Update the metrics maintained by Mantle (should be done every polling interval)

Parameters
metricsvalues to update metrics data structure with
Returns
0 on success, < 0 otherwise
int Mantle::when ( bool &  decision)

Executes the when callback, which decides whether the service should move load or not

Parameters
decisiontrue if the policy wants the service to migrate load, false otherwise
Returns
0 on success, < 0 otherwise
int Mantle::where ( Targets &  decision)

Executes the where callback, which decides where the service should move load (which servers)

Parameters
decisiondictionary (rank -> load) that describes which rank to send load to
Returns
0 on success, < 0 otherwise

The documentation for this class was generated from the following file: