[ 
https://issues.apache.org/jira/browse/YARN-3431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14499413#comment-14499413
 ] 

Li Lu commented on YARN-3431:
-----------------------------

bq. After receiving the entity from the endpoint of the web server, not matter 
it was the generic TimelineEntity or the subclass object, it will be 
deserialized as TimelineEntity object. If it was the subclass object, the 
content is preserved, but the Java class hierarchy is lost after 
deserialization. However, we can use TimelineEntity and its type to construct 
the right subclass object in a proxy way.

OK, I agree the current design would save us one deep copy every time we 
receive a timeline entity. I'm still thinking about an appropriate name for the 
"prototype" field to better represent its nature...

bq. For HierarchicalTimelineEntity, seems like we're not adding any special 
tags when we addIsRelatedToEntity() in setParent()
bq. Yeah, relates to/ is related to is used to construct a directed graph among 
entities. Parent-child relationship is a tree, which can be described by 
relates to/ is related.
bq. Are we prohibiting the users from using isRelatedToEntities in 
HierarchicalTimelineEntity completely to avoid problems?
bq. Sounds good. I used to think about it, but not include it in this patch.

That sounds good. It would be very helpful to explicitly prohibit direct usages 
of isRelatedToEntities and relatesToEntities IMHO. 

> Sub resources of timeline entity needs to be passed to a separate endpoint.
> ---------------------------------------------------------------------------
>
>                 Key: YARN-3431
>                 URL: https://issues.apache.org/jira/browse/YARN-3431
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: timelineserver
>            Reporter: Zhijie Shen
>            Assignee: Zhijie Shen
>         Attachments: YARN-3431.1.patch, YARN-3431.2.patch, YARN-3431.3.patch
>
>
> We have TimelineEntity and some other entities as subclass that inherit from 
> it. However, we only have a single endpoint, which consume TimelineEntity 
> rather than sub-classes and this endpoint will check the incoming request 
> body contains exactly TimelineEntity object. However, the json data which is 
> serialized from sub-class object seems not to be treated as an TimelineEntity 
> object, and won't be deserialized into the corresponding sub-class object 
> which cause deserialization failure as some discussions in YARN-3334 : 
> https://issues.apache.org/jira/browse/YARN-3334?focusedCommentId=14391059&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14391059.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to