Varun Saxena commented on YARN-3814:


bq. Why we're not using if statement but using exception handling to decide the 
type of pairStrs[1]? I think we can pretty much restrict the type of 
pairStrs[1] here, so maybe instanceof will do the work?
We are not using exception handling to determine the type. readValue can throw 
an Exception which has been caught here. So if GenericObjectMapper cannot 
convert the value and throws an Exception, we merely forward whatever came in 
the request. Hope I am not misunderstanding your comment.

bq. We may further want to move those parse methods into a helper method 
collection file?
Ok. Will move these helper functions to another file.

bq. Change its name into newEntity or initEntity?
Hmm...Well this function entity is used as a shorthand for creating entity and 
used during assertion. Maybe name it as newEntity.

bq. But still we need some rationales in the code as comment for why we can 
swallow the exception. It will be also helpful if we output something about the 
404? I think it will be quite hard to debug if we hit an exception which cause 
a null return value and then a 404.
Would a code comment be fine ?

bq.  String msg = new String(); instead of using immediate value

bq. We don't really need a separate JIRA for each set of RESTful APIs since 
this part is relatively trivial.
I agree. Even I meant to do it in a single JIRA.

> REST API implementation for getting raw entities in TimelineReader
> ------------------------------------------------------------------
>                 Key: YARN-3814
>                 URL: https://issues.apache.org/jira/browse/YARN-3814
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: timelineserver
>    Affects Versions: YARN-2928
>            Reporter: Varun Saxena
>            Assignee: Varun Saxena
>         Attachments: YARN-3814-YARN-2928.01.patch, 
> YARN-3814-YARN-2928.02.patch, YARN-3814-YARN-2928.03.patch, 
> YARN-3814-YARN-2928.04.patch, YARN-3814.reference.patch

This message was sent by Atlassian JIRA

Reply via email to