Skip to content

Commit a5b718e

Browse files
author
fanshilun
committed
YARN-11764. Add the JsonInclude annotation.
1 parent 2e3f5e6 commit a5b718e

File tree

1 file changed

+5
-5
lines changed
  • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/timelineservice

1 file changed

+5
-5
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/timelineservice/ApplicationEntity.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818
package org.apache.hadoop.yarn.api.records.timelineservice;
1919

20+
import com.fasterxml.jackson.annotation.JsonInclude;
2021
import org.apache.hadoop.classification.InterfaceAudience;
2122
import org.apache.hadoop.classification.InterfaceStability;
2223

@@ -42,13 +43,12 @@ public ApplicationEntity(TimelineEntity entity) {
4243
}
4344
}
4445

46+
@JsonInclude(JsonInclude.Include.NON_NULL)
4547
public String getQueue() {
46-
if (getInfo() != null) {
47-
if (getInfo().containsKey(QUEUE_INFO_KEY)) {
48-
return getInfo().get(QUEUE_INFO_KEY).toString();
49-
}
48+
if (getInfo() != null && getInfo().containsKey(QUEUE_INFO_KEY)) {
49+
return getInfo().get(QUEUE_INFO_KEY).toString();
5050
}
51-
return "";
51+
return null;
5252
}
5353

5454
public void setQueue(String queue) {

0 commit comments

Comments
 (0)