Search in sources :

Example 1 with ApplicationHistoryManager

use of org.apache.hadoop.yarn.server.applicationhistoryservice.ApplicationHistoryManager in project hadoop by apache.

the class TestAHSWebApp method testAppControllerIndex.

@Test
public void testAppControllerIndex() throws Exception {
    ApplicationHistoryManager ahManager = mock(ApplicationHistoryManager.class);
    Injector injector = WebAppTests.createMockInjector(ApplicationHistoryManager.class, ahManager);
    AHSController controller = injector.getInstance(AHSController.class);
    controller.index();
    Assert.assertEquals("Application History", controller.get(TITLE, "unknown"));
}
Also used : ApplicationHistoryManager(org.apache.hadoop.yarn.server.applicationhistoryservice.ApplicationHistoryManager) Injector(com.google.inject.Injector) Test(org.junit.Test)

Example 2 with ApplicationHistoryManager

use of org.apache.hadoop.yarn.server.applicationhistoryservice.ApplicationHistoryManager in project hadoop by apache.

the class TestAHSWebApp method mockApplicationHistoryClientService.

ApplicationHistoryClientService mockApplicationHistoryClientService(int numApps, int numAppAttempts, int numContainers) throws Exception {
    ApplicationHistoryManager ahManager = new MockApplicationHistoryManagerImpl(store);
    ApplicationHistoryClientService historyClientService = new ApplicationHistoryClientService(ahManager);
    for (int i = 1; i <= numApps; ++i) {
        ApplicationId appId = ApplicationId.newInstance(0, i);
        writeApplicationStartData(appId);
        for (int j = 1; j <= numAppAttempts; ++j) {
            ApplicationAttemptId appAttemptId = ApplicationAttemptId.newInstance(appId, j);
            writeApplicationAttemptStartData(appAttemptId);
            for (int k = 1; k <= numContainers; ++k) {
                ContainerId containerId = ContainerId.newContainerId(appAttemptId, k);
                writeContainerStartData(containerId);
                writeContainerFinishData(containerId);
            }
            writeApplicationAttemptFinishData(appAttemptId);
        }
        writeApplicationFinishData(appId);
    }
    return historyClientService;
}
Also used : ApplicationHistoryManager(org.apache.hadoop.yarn.server.applicationhistoryservice.ApplicationHistoryManager) ApplicationHistoryClientService(org.apache.hadoop.yarn.server.applicationhistoryservice.ApplicationHistoryClientService) ContainerId(org.apache.hadoop.yarn.api.records.ContainerId) ApplicationAttemptId(org.apache.hadoop.yarn.api.records.ApplicationAttemptId) ApplicationId(org.apache.hadoop.yarn.api.records.ApplicationId)

Aggregations

ApplicationHistoryManager (org.apache.hadoop.yarn.server.applicationhistoryservice.ApplicationHistoryManager)2 Injector (com.google.inject.Injector)1 ApplicationAttemptId (org.apache.hadoop.yarn.api.records.ApplicationAttemptId)1 ApplicationId (org.apache.hadoop.yarn.api.records.ApplicationId)1 ContainerId (org.apache.hadoop.yarn.api.records.ContainerId)1 ApplicationHistoryClientService (org.apache.hadoop.yarn.server.applicationhistoryservice.ApplicationHistoryClientService)1 Test (org.junit.Test)1