Li Lu commented on YARN-4075:

bq. This can lead to code bloating with similar methods repeating again and 
OK here are the possible solutions: 
- Having two endpoints, one with a cluster name and the other don't. Both 
methods will be redirected to the same internal method getFlows(clusterId). For 
the endpoint that does not have a cluster id, we can help figure out on the 
server side. With proper overloading I don't see significant code duplication 
- Always requiring the cluster id. Then, to allow the web apps to figure out 
the cluster name, we have to either implement another "client" in javascript, 
or we let the user input the cluster name (because the web app cannot figure 
them out). The first approach is not introducing any duplicated code, but 
actually is introducing duplicated logic, even in two different programming 
languages. The second approach will cause usability problems. 

Am I missing anything here?

bq. Well currently the entities are returned in order, sorted by created time. 
That is how we have documented our reader API as well. 
TimelineReader#getEntities is supposed to return entities sorted descendingly 
by created time. 
TimelineEntities is not only used by the reader. It is also used by the writer 
and aggregation logic. Enforcing an order on this class will introduce 
unnecessary overhead to both writers and aggregators. If the reader needs it, 
we should derive it and make an ordered version, if possible. 

bq. You want me to do this refactoring in this JIRA ?
To be clear, I'm only asking for Private and VisibleForTesting annotations in 
this JIRA. We should refactor the UTs in the JIRA that fully disables fs in 

> [reader REST API] implement support for querying for flows and flow runs
> ------------------------------------------------------------------------
>                 Key: YARN-4075
>                 URL: https://issues.apache.org/jira/browse/YARN-4075
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: timelineserver
>    Affects Versions: YARN-2928
>            Reporter: Sangjin Lee
>            Assignee: Varun Saxena
>         Attachments: YARN-4075-YARN-2928.POC.1.patch, 
> YARN-4075-YARN-2928.POC.2.patch
> We need to be able to query for flows and flow runs via REST.

This message was sent by Atlassian JIRA

Reply via email to