YARN-9764. Print application submission context label in application summary. Contributed by Manoj Kumar
This commit is contained in:
parent
ca32917e0f
commit
43e389b980
@ -215,7 +215,14 @@ public static SummaryBuilder createAppSummary(RMApp app) {
|
||||
metrics.getPreemptedResourceSecondsMap()))
|
||||
.add("applicationTags", StringHelper.CSV_JOINER.join(
|
||||
app.getApplicationTags() != null ? new TreeSet<>(
|
||||
app.getApplicationTags()) : Collections.<String>emptySet()));
|
||||
app.getApplicationTags()) : Collections.<String>emptySet()))
|
||||
.add("applicationNodeLabel",
|
||||
app.getApplicationSubmissionContext().getNodeLabelExpression()
|
||||
== null
|
||||
? ""
|
||||
: app.getApplicationSubmissionContext()
|
||||
.getNodeLabelExpression());
|
||||
|
||||
return summary;
|
||||
}
|
||||
|
||||
|
@ -1063,6 +1063,9 @@ public void testRMAppSubmitInvalidResourceRequest() throws Exception {
|
||||
@Test (timeout = 30000)
|
||||
public void testEscapeApplicationSummary() {
|
||||
RMApp app = mock(RMAppImpl.class);
|
||||
ApplicationSubmissionContext asc = mock(ApplicationSubmissionContext.class);
|
||||
when(asc.getNodeLabelExpression()).thenReturn("test");
|
||||
when(app.getApplicationSubmissionContext()).thenReturn(asc);
|
||||
when(app.getApplicationId()).thenReturn(
|
||||
ApplicationId.newInstance(100L, 1));
|
||||
when(app.getName()).thenReturn("Multiline\n\n\r\rAppName");
|
||||
@ -1101,6 +1104,7 @@ public void testEscapeApplicationSummary() {
|
||||
assertTrue(msg.contains("preemptedResources=<memory:1234\\, vCores:56>"));
|
||||
assertTrue(msg.contains("applicationType=MAPREDUCE"));
|
||||
assertTrue(msg.contains("applicationTags=tag1\\,tag2"));
|
||||
assertTrue(msg.contains("applicationNodeLabel=test"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
Reference in New Issue
Block a user