YARN-7270 addendum: Reapplied changes after YARN-3926 backports
This commit is contained in:
parent
d6673c5491
commit
72d90e750b
@ -285,7 +285,7 @@ public void setResourceInformation(String resource,
|
||||
return;
|
||||
}
|
||||
if (resource.equals(ResourceInformation.VCORES_URI)) {
|
||||
this.setVirtualCores((int) resourceInformation.getValue());
|
||||
this.setVirtualCores(castToIntSafely(resourceInformation.getValue()));
|
||||
return;
|
||||
}
|
||||
ResourceInformation storedResourceInfo = getResourceInformation(resource);
|
||||
@ -331,7 +331,7 @@ public void setResourceValue(String resource, long value)
|
||||
return;
|
||||
}
|
||||
if (resource.equals(ResourceInformation.VCORES_URI)) {
|
||||
this.setVirtualCores((int)value);
|
||||
this.setVirtualCores(castToIntSafely(value));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ private static ResourceInformation newDefaultInformation(String name,
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public int getMemory() {
|
||||
return (int) memoryResInfo.getValue();
|
||||
return castToIntSafely(memoryResInfo.getValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -113,7 +113,7 @@ public void setMemorySize(long memory) {
|
||||
|
||||
@Override
|
||||
public int getVirtualCores() {
|
||||
return (int) vcoresResInfo.getValue();
|
||||
return castToIntSafely(vcoresResInfo.getValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -117,7 +117,7 @@ public void setMemorySize(long memory) {
|
||||
@Override
|
||||
public int getVirtualCores() {
|
||||
// vcores should always be present
|
||||
return (int) resources[VCORES_INDEX].getValue();
|
||||
return castToIntSafely(resources[VCORES_INDEX].getValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user