YARN-1923. Make Fair Scheduler resource ratio calculations terminate faster (Anubhav Dhoot via Sandy Ryza)
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1586795 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
35a5a32f17
commit
755e8c684c
|
@ -35,6 +35,9 @@ Release 2.5.0 - UNRELEASED
|
||||||
YARN-1889. In Fair Scheduler, avoid creating objects on each call to
|
YARN-1889. In Fair Scheduler, avoid creating objects on each call to
|
||||||
AppSchedulable comparator (Hong Zhiguo via Sandy Ryza)
|
AppSchedulable comparator (Hong Zhiguo via Sandy Ryza)
|
||||||
|
|
||||||
|
YARN-1923. Make Fair Scheduler resource ratio calculations terminate faster
|
||||||
|
(Anubhav Dhoot via Sandy Ryza)
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
BUG FIXES
|
BUG FIXES
|
||||||
|
|
|
@ -107,8 +107,12 @@ public class ComputeFairShares {
|
||||||
double right = rMax;
|
double right = rMax;
|
||||||
for (int i = 0; i < COMPUTE_FAIR_SHARES_ITERATIONS; i++) {
|
for (int i = 0; i < COMPUTE_FAIR_SHARES_ITERATIONS; i++) {
|
||||||
double mid = (left + right) / 2.0;
|
double mid = (left + right) / 2.0;
|
||||||
if (resourceUsedWithWeightToResourceRatio(mid, schedulables, type) <
|
int plannedResourceUsed = resourceUsedWithWeightToResourceRatio(
|
||||||
totalResource) {
|
mid, schedulables, type);
|
||||||
|
if (plannedResourceUsed == totalResource) {
|
||||||
|
right = mid;
|
||||||
|
break;
|
||||||
|
} else if (plannedResourceUsed < totalResource) {
|
||||||
left = mid;
|
left = mid;
|
||||||
} else {
|
} else {
|
||||||
right = mid;
|
right = mid;
|
||||||
|
|
Loading…
Reference in New Issue