Examples of CapacityScheduler


Examples of org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler

          resourceManager.adminService.getAccessControlList()
              .getAclString().trim();
      Assert.assertEquals(aclStringAfter, "world:anyone:rwcda");

      // validate values for queue configuration
      CapacityScheduler cs =
          (CapacityScheduler) resourceManager.getRMContext().getScheduler();
      int maxAppsAfter = cs.getConfiguration().getMaximumSystemApplications();
      Assert.assertEquals(maxAppsAfter, 5000);

      // verify service Acls for AdminService
      ServiceAuthorizationManager adminServiceServiceManager =
          resourceManager.adminService.getServer()
View Full Code Here

Examples of org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler

  @Test
  public void testRMAppSubmit() throws Exception {
    long now = System.currentTimeMillis();

    RMContext rmContext = mockRMContext(0, now - 10);
    ResourceScheduler scheduler = new CapacityScheduler();
    Configuration conf = new Configuration();
    ApplicationMasterService masterService =
        new ApplicationMasterService(rmContext, scheduler);
    TestRMAppManager appMonitor = new TestRMAppManager(rmContext,
        new ClientToAMSecretManager(), scheduler, masterService,
View Full Code Here

Examples of org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler

  @Test
  public void testRMAppSubmitWithQueueAndName() throws Exception {
    long now = System.currentTimeMillis();

    RMContext rmContext = mockRMContext(1, now - 10);
    ResourceScheduler scheduler = new CapacityScheduler();
    Configuration conf = new Configuration();
    ApplicationMasterService masterService =
        new ApplicationMasterService(rmContext, scheduler);
    TestRMAppManager appMonitor = new TestRMAppManager(rmContext,
        new ClientToAMSecretManager(), scheduler, masterService,
View Full Code Here

Examples of org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler

  public void testRMAppSubmitError() throws Exception {
    long now = System.currentTimeMillis();

    // specify 1 here and use same appId below so it gets duplicate entry
    RMContext rmContext = mockRMContext(1, now - 10);
    ResourceScheduler scheduler = new CapacityScheduler();
    Configuration conf = new Configuration();
    ApplicationMasterService masterService =
        new ApplicationMasterService(rmContext, scheduler);
    TestRMAppManager appMonitor = new TestRMAppManager(rmContext,
        new ClientToAMSecretManager(), scheduler, masterService,
View Full Code Here

Examples of org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler

  public static CapacityScheduler mockCapacityScheduler() throws IOException {
    // stolen from TestCapacityScheduler
    CapacitySchedulerConfiguration conf = new CapacitySchedulerConfiguration();
    setupQueueConfiguration(conf);

    CapacityScheduler cs = new CapacityScheduler();
    cs.setConf(new YarnConfiguration());
    cs.reinitialize(conf, new RMContextImpl(null, null, null, null, null, null,
      null, new RMContainerTokenSecretManager(conf)));
    return cs;
  }
View Full Code Here

Examples of org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler

  @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
  public SchedulerTypeInfo getSchedulerInfo() {
    ResourceScheduler rs = rm.getResourceScheduler();
    SchedulerInfo sinfo;
    if (rs instanceof CapacityScheduler) {
      CapacityScheduler cs = (CapacityScheduler) rs;
      CSQueue root = cs.getRootQueue();
      sinfo = new CapacitySchedulerInfo(root);
    } else if (rs instanceof FifoScheduler) {
      sinfo = new FifoSchedulerInfo(this.rm);
    } else {
      throw new NotFoundException("Unknown scheduler configured");
View Full Code Here

Examples of org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler

        }
      }
      if (queueQuery != null && !queueQuery.isEmpty()) {
        ResourceScheduler rs = rm.getResourceScheduler();
        if (rs instanceof CapacityScheduler) {
          CapacityScheduler cs = (CapacityScheduler) rs;
          // validate queue exists
          try {
            cs.getQueueInfo(queueQuery, false, false);
          } catch (IOException e) {
            throw new BadRequestException(e.getMessage());
          }
        }
        if (!app.getQueue().equals(queueQuery)) {
View Full Code Here

Examples of org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler

  @Test
  public void testQueueParsing() throws Exception {
    CapacitySchedulerConfiguration conf = new CapacitySchedulerConfiguration();
    setupQueueConfiguration(conf);

    CapacityScheduler capacityScheduler = new CapacityScheduler();
    capacityScheduler.reinitialize(conf, null, null);
   
    CSQueue a = capacityScheduler.getQueue("a");
    Assert.assertEquals(0.10, a.getAbsoluteCapacity(), DELTA);
    Assert.assertEquals(0.15, a.getAbsoluteMaximumCapacity(), DELTA);
   
    CSQueue b1 = capacityScheduler.getQueue("b1");
    Assert.assertEquals(0.2 * 0.5, b1.getAbsoluteCapacity(), DELTA);
    Assert.assertEquals("Parent B has no MAX_CAP",
        0.85, b1.getAbsoluteMaximumCapacity(), DELTA);
   
    CSQueue c12 = capacityScheduler.getQueue("c12");
    Assert.assertEquals(0.7 * 0.5 * 0.45, c12.getAbsoluteCapacity(), DELTA);
    Assert.assertEquals(0.7 * 0.55 * 0.7,
        c12.getAbsoluteMaximumCapacity(), DELTA);
  }
View Full Code Here

Examples of org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler

    CapacitySchedulerConfiguration conf = new CapacitySchedulerConfiguration();

    // non-100 percent value will throw IllegalArgumentException
    conf.setCapacity(CapacitySchedulerConfiguration.ROOT, 90);

    CapacityScheduler capacityScheduler = new CapacityScheduler();
    capacityScheduler.reinitialize(conf, null, null);
  }
View Full Code Here

Examples of org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler

    conf.setCapacity(B, 50);
    conf.setMaximumCapacity(B, 45)// Should throw an exception


    boolean fail = false;
    CapacityScheduler capacityScheduler;
    try {
      capacityScheduler = new CapacityScheduler();
      capacityScheduler.reinitialize(conf, null, null);
    } catch (IllegalArgumentException iae) {
      fail = true;
    }
    Assert.assertTrue("Didn't throw IllegalArgumentException for wrong maxCap",
        fail);

    conf.setMaximumCapacity(B, 60);
   
    // Now this should work
    capacityScheduler = new CapacityScheduler();
    capacityScheduler.reinitialize(conf, null, null);
   
    fail = false;
    try {
    LeafQueue a = (LeafQueue)capacityScheduler.getQueue(A);
    a.setMaxCapacity(45);
    } catch  (IllegalArgumentException iae) {
      fail = true;
    }
    Assert.assertTrue("Didn't throw IllegalArgumentException for wrong " +
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.