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

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

Introduction

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

Prototype

@Public
@Stable
@Idempotent
public GetNewApplicationResponse getNewApplication(GetNewApplicationRequest request)
        throws YarnException, IOException;

Source Link

Document

The interface used by clients to obtain a new ApplicationId for submitting new applications.

The ResourceManager responds with a new, monotonically increasing, ApplicationId which is used by the client to submit a new application.

The ResourceManager also responds with details such as maximum resource capabilities in the cluster as specified in GetNewApplicationResponse .

Usage

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

License:Apache License

@Override
public GetNewApplicationResponse getNewApplication() {
    return execute(new YarnRpcCallback<GetNewApplicationResponse, ApplicationClientProtocol>() {
        @Override/*w  w  w.  java2s .  co m*/
        public GetNewApplicationResponse doInYarn(ApplicationClientProtocol proxy)
                throws YarnException, IOException {
            GetNewApplicationRequest request = Records.newRecord(GetNewApplicationRequest.class);
            return proxy.getNewApplication(request);
        }
    });
}