Example usage for org.apache.hadoop.yarn.client.api YarnClientApplication YarnClientApplication

List of usage examples for org.apache.hadoop.yarn.client.api YarnClientApplication YarnClientApplication

Introduction

In this page you can find the example usage for org.apache.hadoop.yarn.client.api YarnClientApplication YarnClientApplication.

Prototype

public YarnClientApplication(GetNewApplicationResponse newAppResponse,
            ApplicationSubmissionContext appContext) 

Source Link

Usage

From source file:org.apache.slider.core.launch.TestAppMasterLauncherWithAmReset.java

License:Apache License

@Before
public void initialize() throws Exception {
    mockYarnClient = EasyMock.createNiceMock(SliderYarnClientImpl.class);
    yarnClientApp = EasyMock.createNiceMock(YarnClientApplication.class);
    newApp = EasyMock.createNiceMock(GetNewApplicationResponse.class);
    EasyMock.expect(mockYarnClient.createApplication()).andReturn(
            new YarnClientApplication(newApp, Records.newRecord(ApplicationSubmissionContext.class)));
}

From source file:org.apache.tez.client.LocalClient.java

License:Apache License

@Override
public YarnClientApplication createApplication() throws YarnException, IOException {
    ApplicationSubmissionContext context = Records.newRecord(ApplicationSubmissionContext.class);
    ApplicationId appId = ApplicationId.newInstance(clusterTimeStamp, appIdNumber++);
    context.setApplicationId(appId);//  w w w .  j  a  v  a  2s . c o m
    GetNewApplicationResponse response = Records.newRecord(GetNewApplicationResponse.class);
    response.setApplicationId(appId);
    return new YarnClientApplication(response, context);
}