Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
There are some inconsistency in annotations and getter setter methods for org.apache.hadoop.yarn.service.api.records.* entity beans.
@XmlAccessorType is not defined. It is unclear if the serialization should be based on PUBLIC_MEMBER, FIELD or PROPERTY.
/** * The time when the service was created, e.g. 2016-03-16T01:01:49.000Z. **/ public Service launchTime(Date launchTime) { this.launchTime = launchTime == null ? null : (Date) launchTime.clone(); return this; } @ApiModelProperty(example = "null", value = "The time when the service was created, e.g. 2016-03-16T01:01:49.000Z.") @JsonProperty("launch_time") public Date getLaunchTime() { return launchTime == null ? null : (Date) launchTime.clone(); } @XmlElement(name = "launch_time") public void setLaunchTime(Date launchTime) { this.launchTime = launchTime == null ? null : (Date) launchTime.clone(); }
JsonProperty and XmlElement tags are put in separate places, it is difficult to track. Jersey complains duplicated getLaunchTime and launchTime serialized to the same field. It would be nice if we agree on accessor type = FIELD or PUBLIC_MEMBER, and we only need one place to define both JsonProperty and XmlElement name. We should not have a public method without getter or setter method to avoid confusion to Jersey or Jackson.
Attachments
Issue Links
- is part of
-
YARN-7054 Yarn Service Phase 2
- Open