* @param type the type
* @param headers the headers
* @return the submitted report
*/
protected String getSubmittedReport(YarnClient client, boolean verbose, String type, Map<String,String> headers) {
SubmittedReportBuilder builder = ApplicationsReport.submittedReportBuilder();
builder.add(SubmittedField.ID, SubmittedField.USER, SubmittedField.NAME, SubmittedField.QUEUE,
SubmittedField.TYPE, SubmittedField.STARTTIME, SubmittedField.FINISHTIME, SubmittedField.STATE,
SubmittedField.FINALSTATUS, SubmittedField.ORIGTRACKURL)
.sort(SubmittedField.ID);
if (verbose) {
builder.from(client.listApplications(type));
} else {
builder.from(client.listRunningApplications(type));
}
if (headers != null) {
for (Entry<String, String> entry : headers.entrySet()) {
builder.header(entry.getKey(), entry.getValue());
}
}
return builder.build().toString();
}