Example usage for org.apache.hadoop.yarn.api ApplicationClientProtocol submitApplication

List of usage examples for org.apache.hadoop.yarn.api ApplicationClientProtocol submitApplication

Introduction

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

Prototype

@Public
@Stable
@Idempotent
public SubmitApplicationResponse submitApplication(SubmitApplicationRequest request)
        throws YarnException, IOException;

Source Link

Document

The interface used by clients to submit a new application to the ResourceManager.

The client is required to provide details such as queue, Resource required to run the ApplicationMaster, the equivalent of ContainerLaunchContext for launching the ApplicationMaster etc.

Usage

From source file:org.springframework.yarn.client.ClientRmTemplate.java

License:Apache License

@Override
public SubmitApplicationResponse submitApplication(final ApplicationSubmissionContext appSubContext) {
    return execute(new YarnRpcCallback<SubmitApplicationResponse, ApplicationClientProtocol>() {
        @Override// w  ww.j av a2 s . co m
        public SubmitApplicationResponse doInYarn(ApplicationClientProtocol proxy)
                throws YarnException, IOException {
            SubmitApplicationRequest request = Records.newRecord(SubmitApplicationRequest.class);
            request.setApplicationSubmissionContext(appSubContext);
            return proxy.submitApplication(request);
        }
    });
}