本文整理了Java中org.apache.hadoop.yarn.util.resource.Resources.createResourceWithSameValue
方法的一些代码示例,展示了Resources.createResourceWithSameValue
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Resources.createResourceWithSameValue
方法的具体详情如下:
包路径:org.apache.hadoop.yarn.util.resource.Resources
类名称:Resources
方法名:createResourceWithSameValue
[英]Return a new Resource instance with all resource values initialized to value.
[中]返回一个新的资源实例,其中所有资源值都初始化为value。
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
/**
* Creates a {@link ConfigurableResource} instance with all resource values
* initialized to {@code value}.
* @param value the value to use for all resources
*/
ConfigurableResource(long value) {
this(Resources.createResourceWithSameValue(value));
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-common
@Test
public void testCreateSimpleResourceWithSameLongValue() {
Resource res = Resources.createResourceWithSameValue(11L);
assertEquals(11L, res.getMemorySize());
assertEquals(11, res.getVirtualCores());
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-common
@Test
public void testCreateSimpleResourceWithSameIntValue() {
Resource res = Resources.createResourceWithSameValue(11);
assertEquals(11, res.getMemorySize());
assertEquals(11, res.getVirtualCores());
}
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-common
@Test
public void testCreateResourceWithSameLongValue() throws Exception {
unsetExtraResourceType();
setupExtraResourceType();
Resource res = Resources.createResourceWithSameValue(11L);
assertEquals(11L, res.getMemorySize());
assertEquals(11, res.getVirtualCores());
assertEquals(11L, res.getResourceInformation(EXTRA_RESOURCE_TYPE).getValue());
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-common
@Test
public void testCreateResourceWithSameIntValue() throws Exception {
unsetExtraResourceType();
setupExtraResourceType();
Resource res = Resources.createResourceWithSameValue(11);
assertEquals(11, res.getMemorySize());
assertEquals(11, res.getVirtualCores());
assertEquals(11, res.getResourceInformation(EXTRA_RESOURCE_TYPE).getValue());
}
内容来源于网络,如有侵权,请联系作者删除!