YARN-6994. [YARN-3926] Remove last uses of Long from resource types code. (Daniel Templeton via Yufei Gu)
(cherry picked from commit d5e9939ebb
)
This commit is contained in:
parent
d8f388652e
commit
59cfecd60e
|
@ -273,14 +273,14 @@ public abstract class Resource implements Comparable<Resource> {
|
|||
*/
|
||||
@Public
|
||||
@Evolving
|
||||
public void setResourceValue(String resource, Long value)
|
||||
public void setResourceValue(String resource, long value)
|
||||
throws ResourceNotFoundException {
|
||||
if (resource.equals(MEMORY)) {
|
||||
this.setMemorySize(value);
|
||||
return;
|
||||
}
|
||||
if (resource.equals(VCORES)) {
|
||||
this.setVirtualCores(value.intValue());
|
||||
this.setVirtualCores((int)value);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,8 +31,8 @@ import org.apache.hadoop.yarn.exceptions.YarnRuntimeException;
|
|||
import org.apache.hadoop.yarn.proto.YarnProtos.ResourceProto;
|
||||
import org.apache.hadoop.yarn.proto.YarnProtos.ResourceProtoOrBuilder;
|
||||
import org.apache.hadoop.yarn.proto.YarnProtos.ResourceInformationProto;
|
||||
import org.apache.hadoop.yarn.util.resource.ResourceUtils;
|
||||
import org.apache.hadoop.yarn.util.UnitsConversionUtil;
|
||||
import org.apache.hadoop.yarn.util.resource.ResourceUtils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
@ -174,7 +174,7 @@ public class ResourcePBImpl extends BaseResource {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setResourceValue(String resource, Long value)
|
||||
public void setResourceValue(String resource, long value)
|
||||
throws ResourceNotFoundException {
|
||||
maybeInitBuilder();
|
||||
if (resource == null) {
|
||||
|
|
|
@ -104,7 +104,7 @@ public class Resources {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setResourceValue(String resource, Long value)
|
||||
public void setResourceValue(String resource, long value)
|
||||
throws ResourceNotFoundException {
|
||||
throw new RuntimeException(name + " cannot be modified!");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue