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


Java CapacityScheduler.getRootQueueMetrics方法代码示例

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


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

示例1: setup

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

  // 1 sec step
  step = 1000L;

  initTime = System.currentTimeMillis();
  minAlloc = Resource.newInstance(1024, 1);
  res = new DefaultResourceCalculator();
  maxAlloc = Resource.newInstance(1024 * 8, 8);

  mAgent = mock(ReservationAgent.class);
  ReservationSystemTestUtil testUtil = new ReservationSystemTestUtil();
  CapacityScheduler scheduler = testUtil.mockCapacityScheduler(totCont);
  String reservationQ = testUtil.getFullReservationQueueName();
  CapacitySchedulerConfiguration capConf = scheduler.getConfiguration();
  NoOverCommitPolicy policy = new NoOverCommitPolicy();
  policy.init(reservationQ, capConf);

  plan =
      new InMemoryPlan(scheduler.getRootQueueMetrics(), policy, mAgent,
          scheduler.getClusterResource(), step, res, minAlloc, maxAlloc,
          "dedicated", null, true);
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:25,代码来源:TestNoOverCommitPolicy.java

示例2: setup

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

  // 24h window
  timeWindow = 86400000L;
  // 1 sec step
  step = 1000L;

  // 25% avg cap on capacity
  avgConstraint = 25;

  // 70% instantaneous cap on capacity
  instConstraint = 70;

  initTime = System.currentTimeMillis();
  minAlloc = Resource.newInstance(1024, 1);
  res = new DefaultResourceCalculator();
  maxAlloc = Resource.newInstance(1024 * 8, 8);

  mAgent = mock(ReservationAgent.class);
  ReservationSystemTestUtil testUtil = new ReservationSystemTestUtil();
  CapacityScheduler scheduler = testUtil.mockCapacityScheduler(totCont);
  String reservationQ = testUtil.getFullReservationQueueName();
  CapacitySchedulerConfiguration capConf = scheduler.getConfiguration();
  capConf.setReservationWindow(reservationQ, timeWindow);
  capConf.setInstantaneousMaxCapacity(reservationQ, instConstraint);
  capConf.setAverageCapacity(reservationQ, avgConstraint);
  CapacityOverTimePolicy policy = new CapacityOverTimePolicy();
  policy.init(reservationQ, capConf);

  plan =
      new InMemoryPlan(scheduler.getRootQueueMetrics(), policy, mAgent,
          scheduler.getClusterResource(), step, res, minAlloc, maxAlloc,
          "dedicated", null, true);
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:36,代码来源:TestCapacityOverTimePolicy.java

示例3: testStress

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler; //导入方法依赖的package包/类
public void testStress(int numJobs) throws PlanningException, IOException {

    long timeWindow = 1000000L;
    Resource clusterCapacity = Resource.newInstance(500 * 100 * 1024, 500 * 32, 500 * 32);
    step = 1000L;
    ReservationSystemTestUtil testUtil = new ReservationSystemTestUtil();
    CapacityScheduler scheduler = testUtil.mockCapacityScheduler(500 * 100);
    String reservationQ = testUtil.getFullReservationQueueName();
    float instConstraint = 100;
    float avgConstraint = 100;
    ReservationSchedulerConfiguration conf =
        ReservationSystemTestUtil.createConf(reservationQ, timeWindow,
            instConstraint, avgConstraint);
    CapacityOverTimePolicy policy = new CapacityOverTimePolicy();
    policy.init(reservationQ, conf);

    plan = new InMemoryPlan(scheduler.getRootQueueMetrics(), policy, agent,
      clusterCapacity, step, res, minAlloc, maxAlloc, "dedicated", null, true);

    int acc = 0;
    List<ReservationDefinition> list = new ArrayList<ReservationDefinition>();
    for (long i = 0; i < numJobs; i++) {
      list.add(ReservationSystemTestUtil.generateRandomRR(rand, i));
    }

    long start = System.currentTimeMillis();
    for (int i = 0; i < numJobs; i++) {

      try {
        if (agent.createReservation(
            ReservationSystemTestUtil.getNewReservationId(), "u" + i % 100,
            plan, list.get(i))) {
          acc++;
        }
      } catch (PlanningException p) {
        // ignore exceptions
      }
    }

    long end = System.currentTimeMillis();
    System.out.println("Submitted " + numJobs + " jobs " + " accepted " + acc
        + " in " + (end - start) + "ms");
  }
 
开发者ID:naver,项目名称:hadoop,代码行数:44,代码来源:TestGreedyReservationAgent.java

示例4: testStress

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler; //导入方法依赖的package包/类
public void testStress(int numJobs) throws PlanningException, IOException {

    long timeWindow = 1000000L;
    Resource clusterCapacity = Resource.newInstance(500 * 100 * 1024, 500 * 32);
    step = 1000L;
    ReservationSystemTestUtil testUtil = new ReservationSystemTestUtil();
    CapacityScheduler scheduler = testUtil.mockCapacityScheduler(500 * 100);
    String reservationQ =
        ReservationSystemTestUtil.getFullReservationQueueName();
    float instConstraint = 100;
    float avgConstraint = 100;
    ReservationSchedulerConfiguration conf =
        ReservationSystemTestUtil.createConf(reservationQ, timeWindow,
            instConstraint, avgConstraint);
    CapacityOverTimePolicy policy = new CapacityOverTimePolicy();
    policy.init(reservationQ, conf);
    RMContext context = ReservationSystemTestUtil.createMockRMContext();

    plan = new InMemoryPlan(scheduler.getRootQueueMetrics(), policy, agent,
      clusterCapacity, step, res, minAlloc, maxAlloc, "dedicated", null,
        true, context);

    int acc = 0;
    List<ReservationDefinition> list = new ArrayList<ReservationDefinition>();
    for (long i = 0; i < numJobs; i++) {
      list.add(ReservationSystemTestUtil.generateRandomRR(rand, i));
    }

    long start = System.currentTimeMillis();
    for (int i = 0; i < numJobs; i++) {

      try {
        if (agent.createReservation(
            ReservationSystemTestUtil.getNewReservationId(), "u" + i % 100,
            plan, list.get(i))) {
          acc++;
        }
      } catch (PlanningException p) {
        // ignore exceptions
      }
    }

    long end = System.currentTimeMillis();
    System.out.println("Submitted " + numJobs + " jobs " + " accepted " + acc
        + " in " + (end - start) + "ms");
  }
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:47,代码来源:TestGreedyReservationAgent.java

示例5: testStress

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler; //导入方法依赖的package包/类
public void testStress(int numJobs) throws PlanningException, IOException {

    long timeWindow = 1000000L;
    Resource clusterCapacity = Resource.newInstance(500 * 100 * 1024, 500 * 32);
    step = 1000L;
    ReservationSystemTestUtil testUtil = new ReservationSystemTestUtil();
    CapacityScheduler scheduler = testUtil.mockCapacityScheduler(500 * 100);
    String reservationQ = testUtil.getFullReservationQueueName();
    float instConstraint = 100;
    float avgConstraint = 100;
    ReservationSchedulerConfiguration conf =
        ReservationSystemTestUtil.createConf(reservationQ, timeWindow,
            instConstraint, avgConstraint);
    CapacityOverTimePolicy policy = new CapacityOverTimePolicy();
    policy.init(reservationQ, conf);

    plan = new InMemoryPlan(scheduler.getRootQueueMetrics(), policy, agent,
      clusterCapacity, step, res, minAlloc, maxAlloc, "dedicated", null, true);

    int acc = 0;
    List<ReservationDefinition> list = new ArrayList<ReservationDefinition>();
    for (long i = 0; i < numJobs; i++) {
      list.add(ReservationSystemTestUtil.generateRandomRR(rand, i));
    }

    long start = System.currentTimeMillis();
    for (int i = 0; i < numJobs; i++) {

      try {
        if (agent.createReservation(
            ReservationSystemTestUtil.getNewReservationId(), "u" + i % 100,
            plan, list.get(i))) {
          acc++;
        }
      } catch (PlanningException p) {
        // ignore exceptions
      }
    }

    long end = System.currentTimeMillis();
    System.out.println("Submitted " + numJobs + " jobs " + " accepted " + acc
        + " in " + (end - start) + "ms");
  }
 
开发者ID:yncxcw,项目名称:big-c,代码行数:44,代码来源:TestGreedyReservationAgent.java

示例6: testStress

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler; //导入方法依赖的package包/类
public void testStress(int numJobs) throws PlanningException, IOException {

    long timeWindow = 1000000L;
    Resource clusterCapacity = Resource.newInstance(500 * 100 * 1024, 500 * 32);
    step = 1000L;
    ReservationSystemTestUtil testUtil = new ReservationSystemTestUtil();
    CapacityScheduler scheduler = testUtil.mockCapacityScheduler(500 * 100);
    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);

    plan = new InMemoryPlan(scheduler.getRootQueueMetrics(), policy, agent,
      clusterCapacity, step, res, minAlloc, maxAlloc, "dedicated", null, true);

    int acc = 0;
    List<ReservationDefinition> list = new ArrayList<ReservationDefinition>();
    for (long i = 0; i < numJobs; i++) {
      list.add(ReservationSystemTestUtil.generateRandomRR(rand, i));
    }

    long start = System.currentTimeMillis();
    for (int i = 0; i < numJobs; i++) {

      try {
        if (agent.createReservation(
            ReservationSystemTestUtil.getNewReservationId(), "u" + i % 100,
            plan, list.get(i))) {
          acc++;
        }
      } catch (PlanningException p) {
        // ignore exceptions
      }
    }

    long end = System.currentTimeMillis();
    System.out.println("Submitted " + numJobs + " jobs " + " accepted " + acc
        + " in " + (end - start) + "ms");
  }
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:43,代码来源:TestGreedyReservationAgent.java


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