当前位置: 首页>>代码示例>>Java>>正文


Java NoLock类代码示例

本文整理汇总了Java中org.apache.hadoop.yarn.server.utils.Lock.NoLock的典型用法代码示例。如果您正苦于以下问题:Java NoLock类的具体用法?Java NoLock怎么用?Java NoLock使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


NoLock类属于org.apache.hadoop.yarn.server.utils.Lock包,在下文中一共展示了NoLock类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getNodeLocalityDelay

import org.apache.hadoop.yarn.server.utils.Lock.NoLock; //导入依赖的package包/类
@Lock(NoLock.class)
public int getNodeLocalityDelay() {
  return nodeLocalityDelay;
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:5,代码来源:LeafQueue.java

示例2: getRackLocalityFullReset

import org.apache.hadoop.yarn.server.utils.Lock.NoLock; //导入依赖的package包/类
@Lock(NoLock.class)
public boolean getRackLocalityFullReset() {
  return rackLocalityFullReset;
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:5,代码来源:LeafQueue.java

示例3: computeUserLimit

import org.apache.hadoop.yarn.server.utils.Lock.NoLock; //导入依赖的package包/类
@Lock(NoLock.class)
private Resource computeUserLimit(FiCaSchedulerApp application, 
    Resource clusterResource, Resource required) {
  // What is our current capacity? 
  // * It is equal to the max(required, queue-capacity) if
  //   we're running below capacity. The 'max' ensures that jobs in queues
  //   with miniscule capacity (< 1 slot) make progress
  // * If we're running over capacity, then its
  //   (usedResources + required) (which extra resources we are allocating)

  // Allow progress for queues with miniscule capacity
  final Resource queueCapacity =
      Resources.max(
          resourceCalculator, clusterResource, 
          Resources.multiplyAndNormalizeUp(
              resourceCalculator, 
              clusterResource, 
              absoluteCapacity, 
              minimumAllocation), 
          required);

  Resource currentCapacity =
      Resources.lessThan(resourceCalculator, clusterResource, 
          usedResources, queueCapacity) ?
          queueCapacity : Resources.add(usedResources, required);
  
  // Never allow a single user to take more than the 
  // queue's configured capacity * user-limit-factor.
  // Also, the queue's configured capacity should be higher than 
  // queue-hard-limit * ulMin
  
  final int activeUsers = activeUsersManager.getNumActiveUsers();  
  		
  Resource limit =
      Resources.roundUp(
          resourceCalculator, 
          Resources.min(
              resourceCalculator, clusterResource,   
              Resources.max(
                  resourceCalculator, clusterResource, 
                  Resources.divideAndCeil(
                      resourceCalculator, currentCapacity, activeUsers),
                  Resources.divideAndCeil(
                      resourceCalculator, 
                      Resources.multiplyAndRoundDown(
                          currentCapacity, userLimit), 
                      100)
                  ), 
              Resources.multiplyAndRoundDown(queueCapacity, userLimitFactor)
              ), 
          minimumAllocation);

  if (LOG.isDebugEnabled()) {
    String userName = application.getUser();
    LOG.debug("User limit computation for " + userName + 
        " in queue " + getQueueName() +
        " userLimit=" + userLimit +
        " userLimitFactor=" + userLimitFactor +
        " required: " + required + 
        " consumed: " + getUser(userName).getConsumedResources() + 
        " limit: " + limit +
        " queueCapacity: " + queueCapacity + 
        " qconsumed: " + usedResources +
        " currentCapacity: " + currentCapacity +
        " activeUsers: " + activeUsers +
        " clusterCapacity: " + clusterResource
    );
  }

  return limit;
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:72,代码来源:LeafQueue.java


注:本文中的org.apache.hadoop.yarn.server.utils.Lock.NoLock类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。