- All Implemented Interfaces:
- Serializable, Comparator<Schedulable>
- Enclosing class:
- FairSharePolicy
public static class FairSharePolicy.FairShareComparator
extends Object
implements Comparator<Schedulable>, Serializable
Compare Schedulables via weighted fair sharing. In addition, Schedulables
below their min share get priority over those whose min share is met.
Schedulables below their min share are compared by how far below it they
are as a ratio. For example, if job A has 8 out of a min share of 10 tasks
and job B has 50 out of a min share of 100, then job B is scheduled next,
because B is at 50% of its min share and A is at 80% of its min share.
Schedulables above their min share are compared by (runningTasks / weight).
If all weights are equal, slots are given to the job with the fewest tasks;
otherwise, jobs with more weight get proportionally more slots.
- See Also:
- Serialized Form