本文整理了Java中org.apache.hadoop.yarn.util.resource.Resources.unbounded
方法的一些代码示例,展示了Resources.unbounded
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Resources.unbounded
方法的具体详情如下:
包路径:org.apache.hadoop.yarn.util.resource.Resources
类名称:Resources
方法名:unbounded
暂无
代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager
@Override
public Resource getMaxShare() {
return Resources.unbounded();
}
代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager
@Override
public Resource getMaxShare() {
return Resources.unbounded();
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
@Override
public Resource getMaxShare() {
return Resources.unbounded();
}
代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager
/**
* Get the maximum resource allocation for the given queue.
* @return the cap set on this queue, or Integer.MAX_VALUE if not set.
*/
public Resource getMaxResources(String queueName) {
Resource maxQueueResource = maxQueueResources.get(queueName);
return (maxQueueResource == null) ? Resources.unbounded() : maxQueueResource;
}
代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager
/**
* Get the maximum resource allocation for the given queue.
* @return the cap set on this queue, or Integer.MAX_VALUE if not set.
*/
public Resource getMaxResources(String queueName) {
Resource maxQueueResource = maxQueueResources.get(queueName);
return (maxQueueResource == null) ? Resources.unbounded() : maxQueueResource;
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
@VisibleForTesting
Resource getQueueMaxContainerAllocation(String queue) {
Resource resource = queueMaxContainerAllocationMap.get(queue);
return resource == null ? Resources.unbounded() : resource;
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
public ConfigurableResource getQueueMaxResourcesDefault()
throws AllocationConfigurationException {
Optional<String> value = getTextValue(QUEUE_MAX_RESOURCES_DEFAULT);
if (value.isPresent()) {
return FairSchedulerConfiguration.parseResourceConfigValue(value.get());
}
return new ConfigurableResource(Resources.unbounded());
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
public AllocationConfiguration(Configuration conf) {
minQueueResources = new HashMap<>();
maxChildQueueResources = new HashMap<>();
maxQueueResources = new HashMap<>();
queueWeights = new HashMap<>();
queueMaxApps = new HashMap<>();
userMaxApps = new HashMap<>();
queueMaxAMShares = new HashMap<>();
userMaxAppsDefault = Integer.MAX_VALUE;
queueMaxAppsDefault = Integer.MAX_VALUE;
queueMaxResourcesDefault = new ConfigurableResource(Resources.unbounded());
queueMaxAMShareDefault = 0.5f;
queueAcls = new HashMap<>();
resAcls = new HashMap<>();
minSharePreemptionTimeouts = new HashMap<>();
fairSharePreemptionTimeouts = new HashMap<>();
fairSharePreemptionThresholds = new HashMap<>();
schedulingPolicies = new HashMap<>();
defaultSchedulingPolicy = SchedulingPolicy.DEFAULT_POLICY;
reservableQueues = new HashSet<>();
configuredQueues = new HashMap<>();
for (FSQueueType queueType : FSQueueType.values()) {
configuredQueues.put(queueType, new HashSet<>());
}
placementPolicy =
QueuePlacementPolicy.fromConfiguration(conf, configuredQueues);
nonPreemptableQueues = new HashSet<>();
queueMaxContainerAllocationMap = new HashMap<>();
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
@Override
public Resource getMaximumContainerAllocation() {
if (getName().equals("root")) {
return maxContainerAllocation;
}
if (maxContainerAllocation.equals(Resources.unbounded())
&& getParent() != null) {
return getParent().getMaximumContainerAllocation();
} else {
return maxContainerAllocation;
}
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
@Override
public Resource getMaximumContainerAllocation() {
if (maxContainerAllocation.equals(Resources.unbounded())
&& getParent() != null) {
return getParent().getMaximumContainerAllocation();
} else {
return maxContainerAllocation;
}
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
@Override
public Resource getMaximumResourceCapability(String queueName) {
if(queueName == null || queueName.isEmpty()) {
return getMaximumResourceCapability();
}
FSQueue queue = queueMgr.getQueue(queueName);
Resource schedulerLevelMaxResourceCapability =
getMaximumResourceCapability();
if (queue == null) {
return schedulerLevelMaxResourceCapability;
}
Resource queueMaxResourceCapability = queue.getMaximumContainerAllocation();
if (queueMaxResourceCapability.equals(Resources.unbounded())) {
return schedulerLevelMaxResourceCapability;
} else {
return Resources.componentwiseMin(schedulerLevelMaxResourceCapability,
queueMaxResourceCapability);
}
}
代码示例来源:origin: io.hops/hadoop-yarn-common
@Test(timeout=10000)
public void testCompareToWithUnboundedResource() {
assertTrue(Resources.unbounded().compareTo(
createResource(Long.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE)) == 0);
assertTrue(Resources.unbounded().compareTo(
createResource(Long.MAX_VALUE, 0 , Integer.MAX_VALUE )) > 0);
assertTrue(Resources.unbounded().compareTo(
createResource(0, Integer.MAX_VALUE , Integer.MAX_VALUE)) > 0);
assertTrue(Resources.unbounded().compareTo(
createResource(Long.MAX_VALUE, Integer.MAX_VALUE , 0)) > 0);
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
/**
* Test creation of a leaf queue with no resource limits.
*/
@Test
public void testCreateLeafQueueWithDefaults() {
AllocationConfiguration allocConf = scheduler.getAllocationConfiguration();
FSQueue q1 = queueManager.createQueue("root.queue1", FSQueueType.LEAF);
assertNotNull("Leaf queue root.queue1 was not created",
queueManager.getLeafQueue("root.queue1", false));
assertEquals("createQueue() returned wrong queue",
"root.queue1", q1.getName());
// Min default is 0,0
assertEquals("Min resources were not set to default",
Resources.createResource(0, 0),
q1.getMinShare());
// Max default is unbounded
assertEquals("Max resources were not set to default", Resources.unbounded(),
q1.getMaxShare());
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
queueManager.getLeafQueue("root.test.childA", false));
assertEquals("Max resources for root.test.childA were inherited from "
+ "parent's max child resources", Resources.unbounded(),
queueManager.getLeafQueue("root.test.childA", false).getMaxShare());
assertNotNull("Leaf queue root.test.childB was not created during setup",
queueManager.getParentQueue("root.test.childB", false));
assertEquals("Max resources for root.test.childB were inherited from "
+ "parent's max child resources", Resources.unbounded(),
queueManager.getParentQueue("root.test.childB", false).getMaxShare());
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
expectedResourceWithCustomType.setResourceValue(A_CUSTOM_RESOURCE, 10);
assertEquals(Resources.unbounded(),
queueConf.getQueueMaxContainerAllocation(
"root." + YarnConfiguration.DEFAULT_QUEUE_NAME));
assertEquals(Resources.unbounded(),
queueConf.getQueueMaxContainerAllocation("root.queueA"));
assertEquals(Resources.unbounded(),
queueConf.getQueueMaxContainerAllocation("root.queueB"));
assertEquals(Resources.unbounded(),
queueConf.getQueueMaxContainerAllocation("root.queueC"));
assertEquals(Resources.unbounded(),
queueConf.getQueueMaxContainerAllocation("root.queueD"));
assertEquals(Resources.unbounded(),
queueConf.getQueueMaxContainerAllocation("root.queueE"));
assertEquals(Resources.unbounded(),
queueConf.getQueueMaxContainerAllocation("root.queueF"));
assertEquals(expectedResourceWithCustomType,
内容来源于网络,如有侵权,请联系作者删除!