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

Junping Du commented on YARN-3431:
----------------------------------

Thanks [~zjshen] for the patch and [~gtCarrera9] for review and comments.
bq.  However, I'm a little bit confused about the big picture of this patch.
I put some contents and background in JIRA description. Hope it helps.

{code}
-    putObjects("entities", params, entitiesContainer);
+    for (org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity 
entity : entities) {
+      String path = "entities";
+      try {
+        path += "/" + TimelineEntityType.valueOf(entity.getType()).toString();
+      } catch (IllegalArgumentException e) {
+        // Do nothing, generic entity type
+      }
+      putObjects(path, params, entity);
+    }
{code}
Looks like we are breaking one put operation into pieces. This doesn't make 
sense in performance prospective. Do we have to do this? BTW, we should handle 
IllegalArgumentException instead of ignoring it. Isn't it?

> 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
>
>
> 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