Details
-
Sub-task
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.0.3-alpha
-
None
-
Incompatible change
Description
Right now, we're doing multiple steps to create a relevant ApplicationSubmissionContext for a pre-received GetNewApplicationResponse.
GetNewApplicationResponse newApp = yarnClient.getNewApplication(); ApplicationId appId = newApp.getApplicationId(); ApplicationSubmissionContext appContext = Records.newRecord(ApplicationSubmissionContext.class); appContext.setApplicationId(appId);
A simplified way may be to have the GetNewApplicationResponse itself provide a helper method that builds a usable ApplicationSubmissionContext for us. Something like:
GetNewApplicationResponse newApp = yarnClient.getNewApplication(); ApplicationSubmissionContext appContext = newApp.generateApplicationSubmissionContext();
[The above method can also take an arg for the container launch spec, or perhaps pre-load defaults like min-resource, etc. in the returned object, aside of just associating the application ID automatically.]