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


Java Queue类代码示例

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


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

示例1: forQueue

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.Queue; //导入依赖的package包/类
public synchronized 
static FSQueueMetrics forQueue(String queueName, Queue parent,
    boolean enableUserMetrics, Configuration conf) {
  MetricsSystem ms = DefaultMetricsSystem.instance();
  QueueMetrics metrics = queueMetrics.get(queueName);
  if (metrics == null) {
    metrics = new FSQueueMetrics(ms, queueName, parent, enableUserMetrics, conf)
        .tag(QUEUE_INFO, queueName);
    
    // Register with the MetricsSystems
    if (ms != null) {
      metrics = ms.register(
              sourceName(queueName).toString(), 
              "Metrics for queue: " + queueName, metrics);
    }
    queueMetrics.put(queueName, metrics);
  }

  return (FSQueueMetrics)metrics;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:FSQueueMetrics.java

示例2: addQueue

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.Queue; //导入依赖的package包/类
@Override
public synchronized void addQueue(Queue queue)
    throws SchedulerDynamicEditException {

  if (!(queue instanceof ReservationQueue)) {
    throw new SchedulerDynamicEditException("Queue " + queue.getQueueName()
        + " is not a ReservationQueue");
  }

  ReservationQueue newQueue = (ReservationQueue) queue;

  if (newQueue.getParent() == null
      || !(newQueue.getParent() instanceof PlanQueue)) {
    throw new SchedulerDynamicEditException("ParentQueue for "
        + newQueue.getQueueName()
        + " is not properly set (should be set and be a PlanQueue)");
  }

  PlanQueue parentPlan = (PlanQueue) newQueue.getParent();
  String queuename = newQueue.getQueueName();
  parentPlan.addChildQueue(newQueue);
  this.queues.put(queuename, newQueue);
  LOG.info("Creation of ReservationQueue " + newQueue + " succeeded");
}
 
开发者ID:naver,项目名称:hadoop,代码行数:25,代码来源:CapacityScheduler.java

示例3: forQueue

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.Queue; //导入依赖的package包/类
public synchronized static CSQueueMetrics forQueue(String queueName,
    Queue parent, boolean enableUserMetrics, Configuration conf) {
  MetricsSystem ms = DefaultMetricsSystem.instance();
  QueueMetrics metrics = queueMetrics.get(queueName);
  if (metrics == null) {
    metrics =
        new CSQueueMetrics(ms, queueName, parent, enableUserMetrics, conf)
            .tag(QUEUE_INFO, queueName);

    // Register with the MetricsSystems
    if (ms != null) {
      metrics =
          ms.register(sourceName(queueName).toString(), "Metrics for queue: "
              + queueName, metrics);
    }
    queueMetrics.put(queueName, metrics);
  }

  return (CSQueueMetrics) metrics;
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:21,代码来源:CSQueueMetrics.java

示例4: FiCaSchedulerApp

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.Queue; //导入依赖的package包/类
public FiCaSchedulerApp(ApplicationAttemptId applicationAttemptId, 
    String user, Queue queue, ActiveUsersManager activeUsersManager,
    RMContext rmContext) {
  super(applicationAttemptId, user, queue, activeUsersManager, rmContext);
  
  RMApp rmApp = rmContext.getRMApps().get(getApplicationId());
  
  Resource amResource;
  if (rmApp == null || rmApp.getAMResourceRequest() == null) {
    //the rmApp may be undefined (the resource manager checks for this too)
    //and unmanaged applications do not provide an amResource request
    //in these cases, provide a default using the scheduler
    amResource = rmContext.getScheduler().getMinimumResourceCapability();
  } else {
    amResource = rmApp.getAMResourceRequest().getCapability();
  }
  
  setAMResource(amResource);
  
  isTestDone=false;
}
 
开发者ID:yncxcw,项目名称:big-c,代码行数:22,代码来源:FiCaSchedulerApp.java

示例5: testLocalityLevelWithoutDelays

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.Queue; //导入依赖的package包/类
@Test
/**
 * Ensure that when negative paramaters are given (signaling delay scheduling
 * no tin use), the least restrictive locality level is returned.
 */
public void testLocalityLevelWithoutDelays() {
  Queue queue = Mockito.mock(Queue.class);
  Priority prio = Mockito.mock(Priority.class);
  Mockito.when(prio.getPriority()).thenReturn(1);

  ApplicationAttemptId applicationAttemptId = createAppAttemptId(1, 1);
  FSSchedulerApp schedulerApp =
      new FSSchedulerApp(applicationAttemptId, "user1", queue , null, null);
  assertEquals(NodeType.OFF_SWITCH, schedulerApp.getAllowedLocalityLevel(
      prio, 10, -1.0, -1.0));
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:17,代码来源:TestFSSchedulerApp.java

示例6: getPlanQueue

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.Queue; //导入依赖的package包/类
@Override
protected Queue getPlanQueue(String planQueueName) {
  CSQueue queue = cs.getQueue(planQueueName);
  if (!(queue instanceof PlanQueue)) {
    LOG.error("The Plan is not an PlanQueue!");
    return null;
  }
  return queue;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:CapacitySchedulerPlanFollower.java

示例7: getPlanResources

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.Queue; //导入依赖的package包/类
@Override
protected Resource getPlanResources(
    Plan plan, Queue queue, Resource clusterResources) {
  PlanQueue planQueue = (PlanQueue)queue;
  float planAbsCap = planQueue.getAbsoluteCapacity();
  Resource planResources = Resources.multiply(clusterResources, planAbsCap);
  plan.setTotalCapacity(planResources);
  return planResources;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:CapacitySchedulerPlanFollower.java

示例8: getPlanQueue

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.Queue; //导入依赖的package包/类
@Override
protected Queue getPlanQueue(String planQueueName) {
  Queue planQueue = fs.getQueueManager().getParentQueue(planQueueName, false);
  if (planQueue == null) {
    LOG.error("The queue " + planQueueName + " cannot be found or is not a " +
        "ParentQueue");
  }
  return planQueue;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:FairSchedulerPlanFollower.java

示例9: createDefaultReservationQueue

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.Queue; //导入依赖的package包/类
@Override
protected void createDefaultReservationQueue(String planQueueName,
    Queue queue, String defReservationId) {
  String defReservationQueueName = getReservationQueueName(planQueueName,
      defReservationId);
  if (!fs.getQueueManager().exists(defReservationQueueName)) {
    fs.getQueueManager().getLeafQueue(defReservationQueueName, true);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:FairSchedulerPlanFollower.java

示例10: getPlanResources

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.Queue; //导入依赖的package包/类
@Override
protected Resource getPlanResources(Plan plan, Queue queue,
    Resource clusterResources) {
  FSParentQueue planQueue = (FSParentQueue)queue;
  Resource planResources = planQueue.getSteadyFairShare();
  return planResources;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:FairSchedulerPlanFollower.java

示例11: FiCaSchedulerApp

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.Queue; //导入依赖的package包/类
public FiCaSchedulerApp(ApplicationAttemptId applicationAttemptId, 
    String user, Queue queue, ActiveUsersManager activeUsersManager,
    RMContext rmContext) {
  super(applicationAttemptId, user, queue, activeUsersManager, rmContext);
  
  RMApp rmApp = rmContext.getRMApps().get(getApplicationId());
  
  Resource amResource;
  String partition;

  if (rmApp == null || rmApp.getAMResourceRequest() == null) {
    // the rmApp may be undefined (the resource manager checks for this too)
    // and unmanaged applications do not provide an amResource request
    // in these cases, provide a default using the scheduler
    amResource = rmContext.getScheduler().getMinimumResourceCapability();
    partition = CommonNodeLabelsManager.NO_LABEL;
  } else {
    amResource = rmApp.getAMResourceRequest().getCapability();
    partition =
        (rmApp.getAMResourceRequest().getNodeLabelExpression() == null)
        ? CommonNodeLabelsManager.NO_LABEL
        : rmApp.getAMResourceRequest().getNodeLabelExpression();
  }
  
  setAppAMNodePartitionName(partition);
  setAMResource(partition, amResource);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:28,代码来源:FiCaSchedulerApp.java

示例12: FiCaSchedulerApp

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.Queue; //导入依赖的package包/类
public FiCaSchedulerApp(ApplicationAttemptId applicationAttemptId,
    String user, Queue queue, ActiveUsersManager activeUsersManager,
    RMContext rmContext, Priority appPriority) {
  super(applicationAttemptId, user, queue, activeUsersManager, rmContext);
  
  RMApp rmApp = rmContext.getRMApps().get(getApplicationId());

  Resource amResource;
  String partition;

  if (rmApp == null || rmApp.getAMResourceRequest() == null) {
    // the rmApp may be undefined (the resource manager checks for this too)
    // and unmanaged applications do not provide an amResource request
    // in these cases, provide a default using the scheduler
    amResource = rmContext.getScheduler().getMinimumResourceCapability();
    partition = CommonNodeLabelsManager.NO_LABEL;
  } else {
    amResource = rmApp.getAMResourceRequest().getCapability();
    partition =
        (rmApp.getAMResourceRequest().getNodeLabelExpression() == null)
        ? CommonNodeLabelsManager.NO_LABEL
        : rmApp.getAMResourceRequest().getNodeLabelExpression();
  }

  setAppAMNodePartitionName(partition);
  setAMResource(partition, amResource);
  setPriority(appPriority);

  scheduler = rmContext.getScheduler();

  if (scheduler.getResourceCalculator() != null) {
    rc = scheduler.getResourceCalculator();
  }
  
  containerAllocator = new ContainerAllocator(this, rc, rmContext);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:37,代码来源:FiCaSchedulerApp.java

示例13: getDefaultPriorityForQueue

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.Queue; //导入依赖的package包/类
private Priority getDefaultPriorityForQueue(String queueName) {
  Queue queue = getQueue(queueName);
  if (null == queue || null == queue.getDefaultApplicationPriority()) {
    // Return with default application priority
    return Priority.newInstance(CapacitySchedulerConfiguration
        .DEFAULT_CONFIGURATION_APPLICATION_PRIORITY);
  }

  return Priority.newInstance(queue.getDefaultApplicationPriority()
      .getPriority());
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:12,代码来源:CapacityScheduler.java

示例14: FSSchedulerApp

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.Queue; //导入依赖的package包/类
public FSSchedulerApp(ApplicationAttemptId applicationAttemptId, 
    String user, Queue queue, ActiveUsersManager activeUsersManager,
    RMContext rmContext) {
  this.rmContext = rmContext;
  this.appSchedulingInfo = 
      new AppSchedulingInfo(applicationAttemptId, user, queue,  
          activeUsersManager);
  this.queue = queue;
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:10,代码来源:FSSchedulerApp.java

示例15: FiCaSchedulerApp

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.Queue; //导入依赖的package包/类
public FiCaSchedulerApp(ApplicationAttemptId applicationAttemptId, 
    String user, Queue queue, ActiveUsersManager activeUsersManager,
    RMContext rmContext) {
  this.rmContext = rmContext;
  this.appSchedulingInfo = 
      new AppSchedulingInfo(applicationAttemptId, user, queue,  
          activeUsersManager);
  this.queue = queue;
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:10,代码来源:FiCaSchedulerApp.java


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