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:
Yufei Gu 2017-08-14 11:18:08 -07:00 committed by Jonathan Hung
parent d8f388652e
commit 59cfecd60e
3 changed files with 5 additions and 5 deletions

View File

@ -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;
}

View File

@ -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) {

View File

@ -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!");
}