Package haizea :: Package core :: Package scheduler :: Module policy :: Class PolicyManager
[hide private]
[frames] | no frames]

Class PolicyManager

source code


The Policy Manager

This class manages the policy modules and provides methods to access these modules.

Instance Methods [hide private]
 
__init__(self, admission, preemption, host_selection)
Constructor
source code
 
sort_leases(self, preemptor, preemptees, time)
Sorts a list of leases by their preemptability
source code
 
sort_hosts(self, nodes, time, lease)
Sorts a list of hosts by their score
source code
 
accept_lease(self, lease)
Lease admission function
source code
 
get_lease_preemptability_score(self, preemptor, preemptee, time)
Computes the lease preemptability score
source code
 
get_host_score(self, node, time, lease)
Computes the score of a host
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, admission, preemption, host_selection)
(Constructor)

source code 

Constructor

Expects fully-constructed policies (these are currently loaded in the Manager class, based on the config file).

Arguments: admission -- A child of LeaseAdmissionPolicy preemption -- A child of PreemptabilityPolicy host_selection -- A child of HostSelectionPolicy

Overrides: object.__init__

sort_leases(self, preemptor, preemptees, time)

source code 

Sorts a list of leases by their preemptability

Takes a list of leases (the "preemptees"), determines their preemptability by another lease (the "preemptor"), and returns a list with the leases sorted by decreasing preemptability score (most preemptable leases first)

See documentation of PreemptabilityPolicy.get_lease_preemptability_score for more details on the preemptability score.

Argument preemptor -- Preemptor lease preemptees -- List of preemptee leases time -- Time at which preemption would take place

sort_hosts(self, nodes, time, lease)

source code 

Sorts a list of hosts by their score

Takes a list of hosts, determines their score, and sorts them in order of decreasing score (most desireable hosts first)

See documentation of HostSelectionPolicy.get_host_score for more details.

Arguments: nodes -- List of physical node (the integer identifier used in the slot table) time -- Time at which the lease might be scheduled lease -- Lease that is being scheduled.

accept_lease(self, lease)

source code 

Lease admission function

Returns True if the lease can be accepted, False if it should be rejected.

Argument lease -- Lease request

get_lease_preemptability_score(self, preemptor, preemptee, time)

source code 

Computes the lease preemptability score

See documentation of PreemptabilityPolicy.get_lease_preemptability_score for more details.

Arguments: preemptor -- Preemptor lease preemptee -- Preemptee lease time -- Time at which preemption would take place

get_host_score(self, node, time, lease)

source code 

Computes the score of a host

See documentation of HostSelectionPolicy.get_host_score for more details.

Arguments: node -- Physical node (the integer identifier used in the slot table) time -- Time at which the lease might be scheduled lease -- Lease that is being scheduled.