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
|
@Public
|
||||||
@Evolving
|
@Evolving
|
||||||
public void setResourceValue(String resource, Long value)
|
public void setResourceValue(String resource, long value)
|
||||||
throws ResourceNotFoundException {
|
throws ResourceNotFoundException {
|
||||||
if (resource.equals(MEMORY)) {
|
if (resource.equals(MEMORY)) {
|
||||||
this.setMemorySize(value);
|
this.setMemorySize(value);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (resource.equals(VCORES)) {
|
if (resource.equals(VCORES)) {
|
||||||
this.setVirtualCores(value.intValue());
|
this.setVirtualCores((int)value);
|
||||||
return;
|
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.ResourceProto;
|
||||||
import org.apache.hadoop.yarn.proto.YarnProtos.ResourceProtoOrBuilder;
|
import org.apache.hadoop.yarn.proto.YarnProtos.ResourceProtoOrBuilder;
|
||||||
import org.apache.hadoop.yarn.proto.YarnProtos.ResourceInformationProto;
|
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.UnitsConversionUtil;
|
||||||
|
import org.apache.hadoop.yarn.util.resource.ResourceUtils;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -174,7 +174,7 @@ public class ResourcePBImpl extends BaseResource {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setResourceValue(String resource, Long value)
|
public void setResourceValue(String resource, long value)
|
||||||
throws ResourceNotFoundException {
|
throws ResourceNotFoundException {
|
||||||
maybeInitBuilder();
|
maybeInitBuilder();
|
||||||
if (resource == null) {
|
if (resource == null) {
|
||||||
|
|
|
@ -104,7 +104,7 @@ public class Resources {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setResourceValue(String resource, Long value)
|
public void setResourceValue(String resource, long value)
|
||||||
throws ResourceNotFoundException {
|
throws ResourceNotFoundException {
|
||||||
throw new RuntimeException(name + " cannot be modified!");
|
throw new RuntimeException(name + " cannot be modified!");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue