* Kill a submitted application by sending a call to the ASM
* @param appId Application Id to be killed.
* @throws YarnRemoteException
*/
private void killApplication(ApplicationId appId) throws YarnRemoteException {
KillApplicationRequest request = Records.newRecord(KillApplicationRequest.class);
// TODO clarify whether multiple jobs with the same app id can be submitted and be running at
// the same time.
// If yes, can we kill a particular attempt only?
request.setApplicationId(appId);
// KillApplicationResponse response = applicationsManager.forceKillApplication(request);
// Response can be ignored as it is non-null on success or
// throws an exception in case of failures
applicationsManager.forceKillApplication(request);
}