Example usage for org.apache.hadoop.yarn.api.records YarnApplicationAttemptState FAILED

List of usage examples for org.apache.hadoop.yarn.api.records YarnApplicationAttemptState FAILED

Introduction

In this page you can find the example usage for org.apache.hadoop.yarn.api.records YarnApplicationAttemptState FAILED.

Prototype

YarnApplicationAttemptState FAILED

To view the source code for org.apache.hadoop.yarn.api.records YarnApplicationAttemptState FAILED.

Click Source Link

Document

AppAttempt failed.

Usage

From source file:org.apache.samza.validation.TestYarnJobValidationTool.java

License:Apache License

@Test
public void testValidateRunningAttemptId() throws Exception {
    ApplicationReport appReport = mock(ApplicationReport.class);
    when(client.getApplicationReport(appId)).thenReturn(appReport);
    when(appReport.getCurrentApplicationAttemptId()).thenReturn(attemptId);
    ApplicationAttemptReport attemptReport = mock(ApplicationAttemptReport.class);
    when(attemptReport.getYarnApplicationAttemptState()).thenReturn(YarnApplicationAttemptState.RUNNING);
    when(attemptReport.getApplicationAttemptId()).thenReturn(attemptId);
    when(client.getApplicationAttemptReport(attemptId)).thenReturn(attemptReport);
    assertTrue(tool.validateRunningAttemptId(appId).equals(attemptId));

    when(attemptReport.getYarnApplicationAttemptState()).thenReturn(YarnApplicationAttemptState.FAILED);
    exception.expect(SamzaException.class);
    tool.validateRunningAttemptId(appId);
}