Jose Luis López created YARN-12052:
--------------------------------------
Summary: Timeline v1 entity REST calls do not use the documented
field names, and POST rejects them
Key: YARN-12052
URL: https://issues.apache.org/jira/browse/YARN-12052
Project: Hadoop YARN
Issue Type: Bug
Components: timelineserver
Affects Versions: 3.6.0
Reporter: Jose Luis López
*Problem*: the timeline v1 entity REST calls do not use the field names
documented in {{TimelineServer.md}}.
* {{GET /ws/v1/timeline/\{type\}/\{id\}}} and {{GET /ws/v1/timeline/\{type\}}}
return {{entityType}}, {{entityId}}, {{startTime}}, {{relatedEntities}},
{{primaryFilters}}, {{otherInfo}} and {{domainId}}, and include null fields.
The documentation shows {{entitytype}}, {{entity}}, {{starttime}},
{{relatedentities}}, {{primaryfilters}}, {{otherinfo}} and {{domain}}.
* {{POST /ws/v1/timeline}} with the documented names is rejected.
Seen on a live ApplicationHistoryServer on trunk:
{code}
$ POST /ws/v1/timeline
{"entities":[{"entity":"docid","entitytype":"T","starttime":1}]}
HTTP 400 {"exception":"BadRequestException","message":"Incomplete entity
without entity id/type",...}
$ GET /ws/v1/timeline/T/id1
{"entityType":"T","entityId":"id1","startTime":1,"events":[],"relatedEntities":{},"primaryFilters":{},"otherInfo":{},"domainId":"DEFAULT"}
{code}
*Cause*: {{TimelineEntity}} carries the documented names as {{@XmlElement}}
annotations. {{TimelineEntitiesWriter}}, {{TimelineEntityWriter}},
{{TimelineEntitiesReader}} and {{TimelineEntityReader}} in
{{org.apache.hadoop.yarn.api.records.timeline}} use a plain {{ObjectMapper}}
without the JAXB introspector, so those annotations are ignored.
{{TimelineEntity}} also ignores unknown properties, so the documented names are
dropped without an error and the entity then fails with "Incomplete entity
without entity id/type".
These classes were added by HADOOP-15984. {{YarnJacksonJaxbJsonProvider}}
writes the documented names, and it still writes the other timeline types, so
one server answers with both spellings. YARN-12030 leaves this in place.
*Compatibility*: this needs a decision before a patch. The v1 client,
{{TimelineWriter}}, posts through the same {{TimelineEntitiesWriter}}, so it
sends the camelCase names. Changing what the server accepts could break
existing clients, and changing what it returns could break readers that adapted
to the camelCase names. A possible direction is for the server to accept both
spellings on input through {{@JsonAlias}}, as YARN-12030 does for
{{TimelinePutError}}, with the output spelling decided separately.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]