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

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

本文整理了Java中org.apache.hadoop.yarn.util.resource.Resources.multiplyAndNormalizeUp方法的一些代码示例,展示了Resources.multiplyAndNormalizeUp的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Resources.multiplyAndNormalizeUp方法的具体详情如下:
包路径:org.apache.hadoop.yarn.util.resource.Resources
类名称:Resources
方法名:multiplyAndNormalizeUp

Resources.multiplyAndNormalizeUp介绍

暂无

代码示例

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

private void updateAbsoluteCapacityResource(Resource clusterResource) {
 absoluteCapacityResource =
   Resources.multiplyAndNormalizeUp(resourceCalculator, clusterResource,
     queueCapacities.getAbsoluteCapacity(), minimumAllocation);
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

private void updateAbsoluteCapacityResource(Resource clusterResource) {
 absoluteCapacityResource =
   Resources.multiplyAndNormalizeUp(resourceCalculator, clusterResource,
     queueCapacities.getAbsoluteCapacity(), minimumAllocation);
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

public synchronized Resource getUserAMResourceLimit() {
  /*
  * The user amresource limit is based on the same approach as the 
  * user limit (as it should represent a subset of that).  This means that
  * it uses the absolute queue capacity instead of the max and is modified
  * by the userlimit and the userlimit factor as is the userlimit
  *
  */ 
  float effectiveUserLimit = Math.max(userLimit / 100.0f, 1.0f /    
   Math.max(getActiveUsersManager().getNumActiveUsers(), 1));
    return Resources.multiplyAndNormalizeUp( 
    resourceCalculator,
    absoluteCapacityResource, 
    maxAMResourcePerQueuePercent * effectiveUserLimit  *
     userLimitFactor, minimumAllocation);
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

public synchronized Resource getUserAMResourceLimit() {
  /*
  * The user amresource limit is based on the same approach as the 
  * user limit (as it should represent a subset of that).  This means that
  * it uses the absolute queue capacity instead of the max and is modified
  * by the userlimit and the userlimit factor as is the userlimit
  *
  */ 
  float effectiveUserLimit = Math.max(userLimit / 100.0f, 1.0f /    
   Math.max(getActiveUsersManager().getNumActiveUsers(), 1));
    return Resources.multiplyAndNormalizeUp( 
    resourceCalculator,
    absoluteCapacityResource, 
    maxAMResourcePerQueuePercent * effectiveUserLimit  *
     userLimitFactor, minimumAllocation);
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

public synchronized Resource getAMResourceLimit() {
  /* 
  * The limit to the amount of resources which can be consumed by
  * application masters for applications running in the queue
  * is calculated by taking the greater of the max resources currently
  * available to the queue (see absoluteMaxAvailCapacity) and the absolute
  * resources guaranteed for the queue and multiplying it by the am
  * resource percent.
  *
  * This is to allow a queue to grow its (proportional) application 
  * master resource use up to its max capacity when other queues are 
  * idle but to scale back down to it's guaranteed capacity as they 
  * become busy.
  *
  */
  Resource queueCurrentLimit;
  synchronized (queueResourceLimitsInfo) {
   queueCurrentLimit = queueResourceLimitsInfo.getQueueCurrentLimit();
  }
  Resource queueCap = Resources.max(resourceCalculator, lastClusterResource,
   absoluteCapacityResource, queueCurrentLimit);
  return Resources.multiplyAndNormalizeUp( 
    resourceCalculator,
    queueCap, 
    maxAMResourcePerQueuePercent, minimumAllocation);
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

public synchronized Resource getAMResourceLimit() {
  /* 
  * The limit to the amount of resources which can be consumed by
  * application masters for applications running in the queue
  * is calculated by taking the greater of the max resources currently
  * available to the queue (see absoluteMaxAvailCapacity) and the absolute
  * resources guaranteed for the queue and multiplying it by the am
  * resource percent.
  *
  * This is to allow a queue to grow its (proportional) application 
  * master resource use up to its max capacity when other queues are 
  * idle but to scale back down to it's guaranteed capacity as they 
  * become busy.
  *
  */
  Resource queueCurrentLimit;
  synchronized (queueResourceLimitsInfo) {
   queueCurrentLimit = queueResourceLimitsInfo.getQueueCurrentLimit();
  }
  Resource queueCap = Resources.max(resourceCalculator, lastClusterResource,
   absoluteCapacityResource, queueCurrentLimit);
  return Resources.multiplyAndNormalizeUp( 
    resourceCalculator,
    queueCap, 
    maxAMResourcePerQueuePercent, minimumAllocation);
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

lastClusterResource, queueCurrentLimit, queuePartitionResource);
Resource amResouceLimit = Resources.multiplyAndNormalizeUp(
  resourceCalculator, queuePartitionUsableResource, amResourcePercent,
  minimumAllocation);

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

Resource userAMLimit = Resources.multiplyAndNormalizeUp(
  resourceCalculator, queuePartitionResource,
  queueCapacities.getMaxAMResourcePercentage(nodePartition)
    Resources.clone(getAMResourceLimitPerPartition(nodePartition)));
Resource preWeighteduserAMLimit = Resources.multiplyAndNormalizeUp(
  resourceCalculator, queuePartitionResource,
  queueCapacities.getMaxAMResourcePercentage(nodePartition)

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

for (Iterator<TempQueue> i = underserved.iterator(); i.hasNext();) {
 TempQueue sub = i.next();
 Resource wQavail = Resources.multiplyAndNormalizeUp(rc,
   unassigned, sub.normalizedGuarantee, Resource.newInstance(1, 1));
 Resource wQidle = sub.offer(wQavail, rc, tot_guarant);

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

for (Iterator<TempQueue> i = underserved.iterator(); i.hasNext();) {
 TempQueue sub = i.next();
 Resource wQavail = Resources.multiplyAndNormalizeUp(rc,
   unassigned, sub.normalizedGuarantee, Resource.newInstance(1, 1));
 Resource wQidle = sub.offer(wQavail, rc, tot_guarant);

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

if (Resources.greaterThan(rc, clusterResource, resToObtain,
  Resource.newInstance(0, 0))) {
 resToObtain = Resources.multiplyAndNormalizeUp(rc, qT.toBePreempted,
   context.getNaturalTerminationFactor(), Resource.newInstance(1, 1));

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

Resource wQavail = Resources.multiplyAndNormalizeUp(rc,
  dupUnassignedForTheRound,
  sub.normalizedGuarantee, this.stepFactor);

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

Resources
  .max(resourceCalculator, clusterResource, queueCapacity,
    Resources.multiplyAndNormalizeUp(resourceCalculator,
      labelManager.getResourceByLabel(firstLabel,
        clusterResource),
Resources.multiplyAndNormalizeUp(resourceCalculator, labelManager
   .getResourceByLabel(CommonNodeLabelsManager.NO_LABEL, clusterResource),
  queueCapacities.getAbsoluteCapacity(), minimumAllocation);

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

Resources
  .max(resourceCalculator, clusterResource, queueCapacity,
    Resources.multiplyAndNormalizeUp(resourceCalculator,
      labelManager.getResourceByLabel(firstLabel,
        clusterResource),
Resources.multiplyAndNormalizeUp(resourceCalculator, labelManager
   .getResourceByLabel(CommonNodeLabelsManager.NO_LABEL, clusterResource),
  queueCapacities.getAbsoluteCapacity(), minimumAllocation);

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

Resource consumed = Resources.multiplyAndNormalizeUp(resourceCalculator,
  partitionResource, getUsageRatio(nodePartition),
  lQueue.getMinimumAllocation());

相关文章