YARN-9175. Null resources check in ResourceInfo for branch-3.0
(cherry picked from commit a0291a015c1af0ea1282849bd8fb32824d7452fa)
This commit is contained in:
parent
4d30c90a1b
commit
078dfb09fe
@ -62,7 +62,7 @@ public int getvCores() {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return resources.toString();
|
||||
return getResource().toString();
|
||||
}
|
||||
|
||||
public void setMemory(int memory) {
|
||||
@ -82,6 +82,9 @@ public void setvCores(int vCores) {
|
||||
}
|
||||
|
||||
public Resource getResource() {
|
||||
if (resources == null) {
|
||||
resources = Resource.newInstance(memory, vCores);
|
||||
}
|
||||
return Resource.newInstance(resources);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user