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

Adam Antal commented on YARN-10031:
-----------------------------------

Thanks for the patch [~gandras]. 

Looks good overall: I agree with the direction. One thing I could add that I 
think we should separate the new code paths from the existing ones - I suggest 
to use a term, like "generic", "extended" or "filtered" in the functions and 
objects (like {{UserLogsRequest}}) and use it consequently.

Generic comment: please don't forget to add unit tests to the patch.

I see a few minor nits besides these, but I'll take another look in the next 
patch:

In {{LogAggregationTFileController#getLogMetaFilesOfNode}}:
- use try-with-resource for {{LogReader}}
- this can be simplified:
{code:java}
if (logRequest.getContainerId() == null ||
    logRequest.getContainerId().equals(key.toString())) {
    ...
{code}
to
{code:java}
if (key.toString().equals(logRequest.getContainerId().equals())) {
   ...
{code}

I see that in the {{/userlogs}} endpoint ({{getAggregatedLogsMeta()}}) we have 
this as parameter:
{code:java}
@QueryParam(YarnWebServiceParams.FILESIZE) Set<String> fileSize,

{code}
I don't see how an input like {{file_size=<1500}} translates to this set. Could 
you also add some comment or cover it with tests?

> Create a general purpose log request with additional query parameters
> ---------------------------------------------------------------------
>
>                 Key: YARN-10031
>                 URL: https://issues.apache.org/jira/browse/YARN-10031
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: yarn
>            Reporter: Adam Antal
>            Assignee: Andras Gyori
>            Priority: Major
>         Attachments: YARN-10031-WIP.001.patch, YARN-10031.001.patch
>
>
> The current endpoints are robust but not very flexible with regards to 
> filtering options. I suggest to add an endpoint which provides filtering 
> options.
> E.g.:
> In ATS we have multiple endpoints:
> /containers/{containerid}/logs/{filename}
> /containerlogs/{containerid}/{filename}
> We could add @QueryParams parameters to the REST endpoints like this:
> /containers/{containerid}/logs?fileName=stderr&containerState=FAILED&nodeId=nm45



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to