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


Java QueueMetrics.forQueue方法代码示例

本文整理汇总了Java中org.apache.hadoop.yarn.server.resourcemanager.scheduler.QueueMetrics.forQueue方法的典型用法代码示例。如果您正苦于以下问题:Java QueueMetrics.forQueue方法的具体用法?Java QueueMetrics.forQueue怎么用?Java QueueMetrics.forQueue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.yarn.server.resourcemanager.scheduler.QueueMetrics的用法示例。


在下文中一共展示了QueueMetrics.forQueue方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initScheduler

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.QueueMetrics; //导入方法依赖的package包/类
private synchronized void initScheduler(Configuration conf) {
  validateConf(conf);
  //Use ConcurrentSkipListMap because applications need to be ordered
  this.applications =
      new ConcurrentSkipListMap<ApplicationId, SchedulerApplication<FiCaSchedulerApp>>();
  this.minimumAllocation =
      Resources.createResource(conf.getInt(
          YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB,
          YarnConfiguration.DEFAULT_RM_SCHEDULER_MINIMUM_ALLOCATION_MB));
  initMaximumResourceCapability(
      Resources.createResource(conf.getInt(
          YarnConfiguration.RM_SCHEDULER_MAXIMUM_ALLOCATION_MB,
          YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_MB),
        conf.getInt(
          YarnConfiguration.RM_SCHEDULER_MAXIMUM_ALLOCATION_VCORES,
          YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_VCORES),
        conf.getInt(
          YarnConfiguration.RM_SCHEDULER_MAXIMUM_ALLOCATION_GCORES,
          YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_GCORES)));
  this.usePortForNodeName = conf.getBoolean(
      YarnConfiguration.RM_SCHEDULER_INCLUDE_PORT_IN_NODE_NAME,
      YarnConfiguration.DEFAULT_RM_SCHEDULER_USE_PORT_FOR_NODE_NAME);
  this.metrics = QueueMetrics.forQueue(DEFAULT_QUEUE_NAME, null, false,
      conf);
  this.activeUsersManager = new ActiveUsersManager(metrics);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:27,代码来源:FifoScheduler.java

示例2: AbstractCSQueue

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.QueueMetrics; //导入方法依赖的package包/类
public AbstractCSQueue(CapacitySchedulerContext cs, 
    String queueName, CSQueue parent, CSQueue old) throws IOException {
  this.labelManager = cs.getRMContext().getNodeLabelManager();
  this.parent = parent;
  this.queueName = queueName;
  this.resourceCalculator = cs.getResourceCalculator();
  
  // must be called after parent and queueName is set
  this.metrics = old != null ? old.getMetrics() :
      QueueMetrics.forQueue(getQueuePath(), parent,
          cs.getConfiguration().getEnableUserMetrics(),
          cs.getConf());

  this.csContext = cs;
  this.minimumAllocation = csContext.getMinimumResourceCapability();
  
  // initialize ResourceUsage
  queueUsage = new ResourceUsage();
  queueEntity = new PrivilegedEntity(EntityType.QUEUE, getQueuePath());
  
  // initialize QueueCapacities
  queueCapacities = new QueueCapacities(parent == null);    
}
 
开发者ID:naver,项目名称:hadoop,代码行数:24,代码来源:AbstractCSQueue.java

示例3: initScheduler

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.QueueMetrics; //导入方法依赖的package包/类
private synchronized void initScheduler(Configuration conf) {
  validateConf(conf);
  //Use ConcurrentSkipListMap because applications need to be ordered
  this.applications =
      new ConcurrentSkipListMap<ApplicationId, SchedulerApplication<FiCaSchedulerApp>>();
  this.minimumAllocation =
      Resources.createResource(conf.getInt(
          YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB,
          YarnConfiguration.DEFAULT_RM_SCHEDULER_MINIMUM_ALLOCATION_MB));
  initMaximumResourceCapability(
      Resources.createResource(conf.getInt(
          YarnConfiguration.RM_SCHEDULER_MAXIMUM_ALLOCATION_MB,
          YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_MB),
        conf.getInt(
          YarnConfiguration.RM_SCHEDULER_MAXIMUM_ALLOCATION_VCORES,
          YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_VCORES)));
  this.usePortForNodeName = conf.getBoolean(
      YarnConfiguration.RM_SCHEDULER_INCLUDE_PORT_IN_NODE_NAME,
      YarnConfiguration.DEFAULT_RM_SCHEDULER_USE_PORT_FOR_NODE_NAME);
  this.metrics = QueueMetrics.forQueue(DEFAULT_QUEUE_NAME, null, false,
      conf);
  this.activeUsersManager = new ActiveUsersManager(metrics);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:24,代码来源:FifoScheduler.java

示例4: reinitialize

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.QueueMetrics; //导入方法依赖的package包/类
@Override
public synchronized void
    reinitialize(Configuration conf, RMContext rmContext) throws IOException
{
  setConf(conf);
  if (!this.initialized) {
    validateConf(conf);
    this.rmContext = rmContext;
    this.minimumAllocation = 
      Resources.createResource(conf.getInt(
          YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB,
          YarnConfiguration.DEFAULT_RM_SCHEDULER_MINIMUM_ALLOCATION_MB));
    this.maximumAllocation = 
      Resources.createResource(conf.getInt(
          YarnConfiguration.RM_SCHEDULER_MAXIMUM_ALLOCATION_MB,
          YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_MB));
    this.usePortForNodeName = conf.getBoolean(
        YarnConfiguration.RM_SCHEDULER_INCLUDE_PORT_IN_NODE_NAME, 
        YarnConfiguration.DEFAULT_RM_SCHEDULER_USE_PORT_FOR_NODE_NAME);
    this.metrics = QueueMetrics.forQueue(DEFAULT_QUEUE_NAME, null, false,
        conf);
    this.activeUsersManager = new ActiveUsersManager(metrics);
    this.initialized = true;
  }
}
 
开发者ID:chendave,项目名称:hadoop-TCP,代码行数:26,代码来源:FifoScheduler.java

示例5: setup

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.QueueMetrics; //导入方法依赖的package包/类
@Before
public void setup() throws Exception {

  long seed = rand.nextLong();
  rand.setSeed(seed);
  Log.info("Running with seed: " + seed);

  // setting completely loose quotas
  long timeWindow = 1000000L;
  Resource clusterCapacity = Resource.newInstance(100 * 1024, 100);
  step = 1000L;
  ReservationSystemTestUtil testUtil = new ReservationSystemTestUtil();
  CapacityScheduler scheduler = testUtil.mockCapacityScheduler(125);
  String reservationQ = testUtil.getFullReservationQueueName();
  CapacitySchedulerConfiguration capConf = scheduler.getConfiguration();
  capConf.setReservationWindow(reservationQ, timeWindow);
  capConf.setMaximumCapacity(reservationQ, 100);
  capConf.setAverageCapacity(reservationQ, 100);
  CapacityOverTimePolicy policy = new CapacityOverTimePolicy();
  policy.init(reservationQ, capConf);
  agent = new GreedyReservationAgent();

  QueueMetrics queueMetrics = QueueMetrics.forQueue("dedicated",
      mock(ParentQueue.class), false, capConf);

  plan = new InMemoryPlan(queueMetrics, policy, agent, clusterCapacity, step,
      res, minAlloc, maxAlloc, "dedicated", null, true);
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:29,代码来源:TestGreedyReservationAgent.java

示例6: reinitialize

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.QueueMetrics; //导入方法依赖的package包/类
@Override
public synchronized void
    reinitialize(Configuration conf, RMContext rmContext) throws IOException
{
  setConf(conf);
  if (!this.initialized) {
    validateConf(conf);
    this.rmContext = rmContext;
    this.minimumAllocation = 
      Resources.createResource(conf.getInt(
          YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB,
          YarnConfiguration.DEFAULT_RM_SCHEDULER_MINIMUM_ALLOCATION_MB),
          conf.getInt(
          		YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_VCORES,
          		YarnConfiguration.DEFAULT_RM_SCHEDULER_MINIMUM_ALLOCATION_VCORES),
          conf.getInt(
          		YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_GPU_CORES,
          		YarnConfiguration.DEFAULT_RM_SCHEDULER_MINIMUM_ALLOCATION_GPU_CORES));
    this.maximumAllocation = 
      Resources.createResource(conf.getInt(
          YarnConfiguration.RM_SCHEDULER_MAXIMUM_ALLOCATION_MB,
          YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_MB),
          conf.getInt(
          		YarnConfiguration.RM_SCHEDULER_MAXIMUM_ALLOCATION_VCORES,
          		YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_VCORES),
          conf.getInt(
          		YarnConfiguration.RM_SCHEDULER_MAXIMUM_ALLOCATION_GPU_CORES,
          		YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_GPU_CORES));
    this.metrics = QueueMetrics.forQueue(DEFAULT_QUEUE_NAME, null, false,
        conf);
    this.activeUsersManager = new ActiveUsersManager(metrics);
    this.initialized = true;
  }
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:35,代码来源:FifoScheduler.java

示例7: reinitialize

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.QueueMetrics; //导入方法依赖的package包/类
@Override
public synchronized void
    reinitialize(Configuration conf, RMContext rmContext) throws IOException
{
  setConf(conf);
  if (!this.initialized) {
    validateConf(conf);
    this.rmContext = rmContext;
    //Use ConcurrentSkipListMap because applications need to be ordered
    this.applications =
        new ConcurrentSkipListMap<ApplicationId, SchedulerApplication>();
    this.minimumAllocation = 
      Resources.createResource(conf.getInt(
          YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB,
          YarnConfiguration.DEFAULT_RM_SCHEDULER_MINIMUM_ALLOCATION_MB));
    this.maximumAllocation = 
      Resources.createResource(conf.getInt(
          YarnConfiguration.RM_SCHEDULER_MAXIMUM_ALLOCATION_MB,
          YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_MB));
    this.usePortForNodeName = conf.getBoolean(
        YarnConfiguration.RM_SCHEDULER_INCLUDE_PORT_IN_NODE_NAME, 
        YarnConfiguration.DEFAULT_RM_SCHEDULER_USE_PORT_FOR_NODE_NAME);
    this.metrics = QueueMetrics.forQueue(DEFAULT_QUEUE_NAME, null, false,
        conf);
    this.activeUsersManager = new ActiveUsersManager(metrics);
    this.initialized = true;
  }
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:29,代码来源:FifoScheduler.java

示例8: AbstractCSQueue

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.QueueMetrics; //导入方法依赖的package包/类
public AbstractCSQueue(CapacitySchedulerContext cs, 
    String queueName, CSQueue parent, CSQueue old) throws IOException {
  this.minimumAllocation = cs.getMinimumResourceCapability();
  this.maximumAllocation = cs.getMaximumResourceCapability();
  this.labelManager = cs.getRMContext().getNodeLabelManager();
  this.parent = parent;
  this.queueName = queueName;
  this.resourceCalculator = cs.getResourceCalculator();
  
  // must be called after parent and queueName is set
  this.metrics = old != null ? old.getMetrics() :
      QueueMetrics.forQueue(getQueuePath(), parent,
          cs.getConfiguration().getEnableUserMetrics(),
          cs.getConf());
  
  // get labels
  this.accessibleLabels = cs.getConfiguration().getAccessibleNodeLabels(getQueuePath());
  this.defaultLabelExpression = cs.getConfiguration()
      .getDefaultNodeLabelExpression(getQueuePath());

  // inherit from parent if labels not set
  if (this.accessibleLabels == null && parent != null) {
    this.accessibleLabels = parent.getAccessibleNodeLabels();
  }
  SchedulerUtils.checkIfLabelInClusterNodeLabels(labelManager,
      this.accessibleLabels);
  
  // inherit from parent if labels not set
  if (this.defaultLabelExpression == null && parent != null
      && this.accessibleLabels.containsAll(parent.getAccessibleNodeLabels())) {
    this.defaultLabelExpression = parent.getDefaultNodeLabelExpression();
  }
  
  // set capacity by labels
  capacitiyByNodeLabels =
      cs.getConfiguration().getNodeLabelCapacities(getQueuePath(), accessibleLabels,
          labelManager);

  // set maximum capacity by labels
  maxCapacityByNodeLabels =
      cs.getConfiguration().getMaximumNodeLabelCapacities(getQueuePath(),
          accessibleLabels, labelManager);
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:44,代码来源:AbstractCSQueue.java

示例9: ParentQueue

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.QueueMetrics; //导入方法依赖的package包/类
public ParentQueue(CapacitySchedulerContext cs, 
    String queueName, CSQueue parent, CSQueue old) {
  minimumAllocation = cs.getMinimumResourceCapability();
  
  this.parent = parent;
  this.queueName = queueName;
  this.rootQueue = (parent == null);
  this.resourceCalculator = cs.getResourceCalculator();

  // must be called after parent and queueName is set
  this.metrics = old != null ? old.getMetrics() :
      QueueMetrics.forQueue(getQueuePath(), parent,
	      cs.getConfiguration().getEnableUserMetrics(),
	      cs.getConf());

  float rawCapacity = cs.getConfiguration().getCapacity(getQueuePath());

  if (rootQueue &&
      (rawCapacity != CapacitySchedulerConfiguration.MAXIMUM_CAPACITY_VALUE)) {
    throw new IllegalArgumentException("Illegal " +
        "capacity of " + rawCapacity + " for queue " + queueName +
        ". Must be " + CapacitySchedulerConfiguration.MAXIMUM_CAPACITY_VALUE);
  }

  float capacity = (float) rawCapacity / 100;
  float parentAbsoluteCapacity = 
    (rootQueue) ? 1.0f : parent.getAbsoluteCapacity();
  float absoluteCapacity = parentAbsoluteCapacity * capacity; 

  float  maximumCapacity =
    (float) cs.getConfiguration().getMaximumCapacity(getQueuePath()) / 100;
  float absoluteMaxCapacity = 
        CSQueueUtils.computeAbsoluteMaximumCapacity(maximumCapacity, parent);
  
  QueueState state = cs.getConfiguration().getState(getQueuePath());

  Map<QueueACL, AccessControlList> acls = 
    cs.getConfiguration().getAcls(getQueuePath());
  
  this.queueInfo = recordFactory.newRecordInstance(QueueInfo.class);
  this.queueInfo.setQueueName(queueName);
  this.queueInfo.setChildQueues(new ArrayList<QueueInfo>());

  setupQueueConfigs(cs.getClusterResources(),
      capacity, absoluteCapacity, 
      maximumCapacity, absoluteMaxCapacity, state, acls);
  
  this.queueComparator = cs.getQueueComparator();
  this.childQueues = new TreeSet<CSQueue>(queueComparator);

  LOG.info("Initialized parent-queue " + queueName + 
      " name=" + queueName + 
      ", fullname=" + getQueuePath()); 
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:55,代码来源:ParentQueue.java


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