Used to balance containers across hosts.
Used to balance containers across hosts.
Accepts a map of hosts to resource offers for that host, and returns a prioritized list of resource offers representing the order in which the offers should be used. The resource offers are ordered such that we'll allocate one container on each host before allocating a second container on any host, and so on, in order to reduce the damage if a host fails.
For example, given <h1, [o1, o2, o3]>, <h2, [o4]>, <h1, [o5, o6]>, returns [o1, o5, o4, 02, o6, o3]