Search in sources :

Example 6 with AHSClient

use of org.apache.hadoop.yarn.client.api.AHSClient in project hadoop by apache.

the class TestAHSClient method testClientStop.

@Test
public void testClientStop() {
    Configuration conf = new Configuration();
    AHSClient client = AHSClient.createAHSClient();
    client.init(conf);
    client.start();
    client.stop();
}
Also used : Configuration(org.apache.hadoop.conf.Configuration) AHSClient(org.apache.hadoop.yarn.client.api.AHSClient) Test(org.junit.Test)

Example 7 with AHSClient

use of org.apache.hadoop.yarn.client.api.AHSClient in project hadoop by apache.

the class TestAHSClient method testGetApplicationAttempts.

@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();
}
Also used : ApplicationAttemptReport(org.apache.hadoop.yarn.api.records.ApplicationAttemptReport) Configuration(org.apache.hadoop.conf.Configuration) AHSClient(org.apache.hadoop.yarn.client.api.AHSClient) ApplicationId(org.apache.hadoop.yarn.api.records.ApplicationId) Test(org.junit.Test)

Aggregations

Configuration (org.apache.hadoop.conf.Configuration)7 AHSClient (org.apache.hadoop.yarn.client.api.AHSClient)7 Test (org.junit.Test)7 ApplicationId (org.apache.hadoop.yarn.api.records.ApplicationId)5 ApplicationReport (org.apache.hadoop.yarn.api.records.ApplicationReport)4 ApplicationAttemptId (org.apache.hadoop.yarn.api.records.ApplicationAttemptId)3 ApplicationAttemptReport (org.apache.hadoop.yarn.api.records.ApplicationAttemptReport)2 ContainerReport (org.apache.hadoop.yarn.api.records.ContainerReport)2 ContainerId (org.apache.hadoop.yarn.api.records.ContainerId)1