org.apache.hadoop.yarn.util.resource.Resources.createResourceWithSameValue()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(96)

本文整理了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

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());
}

相关文章