YARN-10691. DominantResourceCalculator isInvalidDivisor should consider only countable resource types. Contributed by Bilwa S T.
(cherry picked from commit c4581827a9
)
This commit is contained in:
parent
464bbd5b7c
commit
48aa23eb3b
|
@ -380,8 +380,9 @@ public class DominantResourceCalculator extends ResourceCalculator {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isInvalidDivisor(Resource r) {
|
public boolean isInvalidDivisor(Resource r) {
|
||||||
for (ResourceInformation res : r.getResources()) {
|
int maxLength = ResourceUtils.getNumberOfCountableResourceTypes();
|
||||||
if (res.getValue() == 0L) {
|
for (int i = 0; i < maxLength; i++) {
|
||||||
|
if (r.getResourceInformation(i).getValue() == 0L) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue