Examples of AHSClient


Examples of org.apache.hadoop.yarn.client.api.AHSClient

  }

  @Test(timeout = 10000)
  public void testGetContainers() throws YarnException, IOException {
    Configuration conf = new Configuration();
    final AHSClient client = new MockAHSClient();
    client.init(conf);
    client.start();

    ApplicationId applicationId = ApplicationId.newInstance(1234, 5);
    ApplicationAttemptId appAttemptId =
        ApplicationAttemptId.newInstance(applicationId, 1);
    List<ContainerReport> reports = client.getContainers(appAttemptId);
    Assert.assertNotNull(reports);
    Assert.assertEquals(reports.get(0).getContainerId(),
      (ContainerId.newInstance(appAttemptId, 1)));
    Assert.assertEquals(reports.get(1).getContainerId(),
      (ContainerId.newInstance(appAttemptId, 2)));
    client.stop();
  }
View Full Code Here

Examples of org.apache.hadoop.yarn.client.api.AHSClient

  }

  @Test(timeout = 10000)
  public void testGetContainerReport() throws YarnException, IOException {
    Configuration conf = new Configuration();
    final AHSClient client = new MockAHSClient();
    client.init(conf);
    client.start();

    List<ApplicationReport> expectedReports =
        ((MockAHSClient) client).getReports();

    ApplicationId applicationId = ApplicationId.newInstance(1234, 5);
    ApplicationAttemptId appAttemptId =
        ApplicationAttemptId.newInstance(applicationId, 1);
    ContainerId containerId = ContainerId.newInstance(appAttemptId, 1);
    ContainerReport report = client.getContainerReport(containerId);
    Assert.assertNotNull(report);
    Assert.assertEquals(report.getContainerId().toString(), (ContainerId
      .newInstance(expectedReports.get(0).getCurrentApplicationAttemptId(), 1))
      .toString());
    client.stop();
  }
View Full Code Here

Examples of org.apache.hadoop.yarn.client.api.AHSClient

public class TestAHSClient {

  @Test
  public void testClientStop() {
    Configuration conf = new Configuration();
    AHSClient client = AHSClient.createAHSClient();
    client.init(conf);
    client.start();
    client.stop();
  }
View Full Code Here

Examples of org.apache.hadoop.yarn.client.api.AHSClient

  }

  @Test(timeout = 10000)
  public void testGetApplications() throws YarnException, IOException {
    Configuration conf = new Configuration();
    final AHSClient client = new MockAHSClient();
    client.init(conf);
    client.start();

    List<ApplicationReport> expectedReports =
        ((MockAHSClient) client).getReports();

    List<ApplicationReport> reports = client.getApplications();
    Assert.assertEquals(reports, expectedReports);

    reports = client.getApplications();
    Assert.assertEquals(reports.size(), 4);
    client.stop();
  }
View Full Code Here

Examples of org.apache.hadoop.yarn.client.api.AHSClient

  }

  @Test(timeout = 10000)
  public void testGetApplicationReport() throws YarnException, IOException {
    Configuration conf = new Configuration();
    final AHSClient client = new MockAHSClient();
    client.init(conf);
    client.start();

    List<ApplicationReport> expectedReports =
        ((MockAHSClient) client).getReports();
    ApplicationId applicationId = ApplicationId.newInstance(1234, 5);
    ApplicationReport report = client.getApplicationReport(applicationId);
    Assert.assertEquals(report, expectedReports.get(0));
    Assert.assertEquals(report.getApplicationId().toString(), expectedReports
      .get(0).getApplicationId().toString());
    client.stop();
  }
View Full Code Here

Examples of org.apache.hadoop.yarn.client.api.AHSClient

  }

  @Test(timeout = 10000)
  public void testGetApplicationAttempts() throws YarnException, IOException {
    Configuration conf = new Configuration();
    final AHSClient client = new MockAHSClient();
    client.init(conf);
    client.start();

    ApplicationId applicationId = ApplicationId.newInstance(1234, 5);
    List<ApplicationAttemptReport> reports =
        client.getApplicationAttempts(applicationId);
    Assert.assertNotNull(reports);
    Assert.assertEquals(reports.get(0).getApplicationAttemptId(),
      ApplicationAttemptId.newInstance(applicationId, 1));
    Assert.assertEquals(reports.get(1).getApplicationAttemptId(),
      ApplicationAttemptId.newInstance(applicationId, 2));
    client.stop();
  }
View Full Code Here

Examples of org.apache.hadoop.yarn.client.api.AHSClient

  }

  @Test(timeout = 10000)
  public void testGetApplicationAttempt() throws YarnException, IOException {
    Configuration conf = new Configuration();
    final AHSClient client = new MockAHSClient();
    client.init(conf);
    client.start();

    List<ApplicationReport> expectedReports =
        ((MockAHSClient) client).getReports();

    ApplicationId applicationId = ApplicationId.newInstance(1234, 5);
    ApplicationAttemptId appAttemptId =
        ApplicationAttemptId.newInstance(applicationId, 1);
    ApplicationAttemptReport report =
        client.getApplicationAttemptReport(appAttemptId);
    Assert.assertNotNull(report);
    Assert.assertEquals(report.getApplicationAttemptId().toString(),
      expectedReports.get(0).getCurrentApplicationAttemptId().toString());
    client.stop();
  }
View Full Code Here

Examples of org.apache.hadoop.yarn.client.api.AHSClient

  }

  @Test(timeout = 10000)
  public void testGetApplicationAttempt() throws YarnException, IOException {
    Configuration conf = new Configuration();
    final AHSClient client = new MockAHSClient();
    client.init(conf);
    client.start();

    List<ApplicationReport> expectedReports =
        ((MockAHSClient) client).getReports();

    ApplicationId applicationId = ApplicationId.newInstance(1234, 5);
    ApplicationAttemptId appAttemptId =
        ApplicationAttemptId.newInstance(applicationId, 1);
    ApplicationAttemptReport report =
        client.getApplicationAttemptReport(appAttemptId);
    Assert.assertNotNull(report);
    Assert.assertEquals(report.getApplicationAttemptId().toString(),
      expectedReports.get(0).getCurrentApplicationAttemptId().toString());
    client.stop();
  }
View Full Code Here

Examples of org.apache.hadoop.yarn.client.api.AHSClient

  }

  @Test(timeout = 10000)
  public void testGetContainers() throws YarnException, IOException {
    Configuration conf = new Configuration();
    final AHSClient client = new MockAHSClient();
    client.init(conf);
    client.start();

    ApplicationId applicationId = ApplicationId.newInstance(1234, 5);
    ApplicationAttemptId appAttemptId =
        ApplicationAttemptId.newInstance(applicationId, 1);
    List<ContainerReport> reports = client.getContainers(appAttemptId);
    Assert.assertNotNull(reports);
    Assert.assertEquals(reports.get(0).getContainerId(),
      (ContainerId.newInstance(appAttemptId, 1)));
    Assert.assertEquals(reports.get(1).getContainerId(),
      (ContainerId.newInstance(appAttemptId, 2)));
    client.stop();
  }
View Full Code Here

Examples of org.apache.hadoop.yarn.client.api.AHSClient

  }

  @Test(timeout = 10000)
  public void testGetContainerReport() throws YarnException, IOException {
    Configuration conf = new Configuration();
    final AHSClient client = new MockAHSClient();
    client.init(conf);
    client.start();

    List<ApplicationReport> expectedReports =
        ((MockAHSClient) client).getReports();

    ApplicationId applicationId = ApplicationId.newInstance(1234, 5);
    ApplicationAttemptId appAttemptId =
        ApplicationAttemptId.newInstance(applicationId, 1);
    ContainerId containerId = ContainerId.newInstance(appAttemptId, 1);
    ContainerReport report = client.getContainerReport(containerId);
    Assert.assertNotNull(report);
    Assert.assertEquals(report.getContainerId().toString(), (ContainerId
      .newInstance(expectedReports.get(0).getCurrentApplicationAttemptId(), 1))
      .toString());
    client.stop();
  }
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.