Package haizea :: Package pluggable :: Package policies :: Module host_selection :: Class GreedyPolicy
[hide private]
[frames] | no frames]

Class GreedyPolicy

source code


A greedy host selection policy.

This policy scores hosts such that hosts with fewer leases already scheduled on them, with the highest capacity, and with fewest leases scheduled in the future are scored highest.

Instance Methods [hide private]
 
__init__(self, slottable)
Constructor
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, slottable)
(Constructor)

source code 

Constructor

Argument slottable -- A fully constructed SlotTable

Overrides: object.__init__

get_host_score(self, node, time, lease)

source code 

Computes the score of a host

See class documentation for details on what policy is implemented here. See documentation of HostSelectionPolicy.get_host_score for more details on this method.

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.

Overrides: core.scheduler.policy.HostSelectionPolicy.get_host_score