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

Varun Vasudev commented on YARN-4905:
-------------------------------------

Thanks for the patch [~xgong]. A few things -
# If I don't have AHS enabled, and restart the RM, the yarn logs command will 
give me the logs of an older app, but the -ls doesn't work. We should change 
this to return valid information if it's present on the file system.
# {code} yarn logs -applicationId application_1459856011417_0002 -ls 
-nodeAddress ubuntu_60321 -containerId container_1459856011417_0002_01_000002
Can not find log meta for container: container_1459856011417_0002_01_000002 on 
ubuntu_60321
{code} 
In this case, container_1459856011417_0002_01_000002 ran on another node. From 
the containerId we can get the node it ran on and we should let the user know 
which node it ran on. We don't need to publish the information, just a helpful 
message like "The container couldn't be found on the node specified. From the 
logs, it appears the container ran on <actual node>".
# {code}yarn logs -applicationId application_1459856011417_0002 -ls 
-nodeAddress ubuntu_60322 -containerId blah
Can not find log meta for container: blah on ubuntu_60322
{code}
Similar to (2), in this case we should list all the containers that did run on 
the node and let the user know
# {code} +    opts.addOption(LS_OPTION, false, "List Container log meta," {code}
Change "meta" to "metadata". There are other places where "meta" is used - it 
should be changed to "metadata".
# {code}+    public static int listContainerLogs(DataInputStream valueStream,
+        PrintStream out) throws IOException {
{code}
It would be better if this function returned a formatted String instead of 
printing the data directly to the PrintStream. Also, can you add a test case 
for this function to make sure that any future changes don't break this piece?
# {code}+  public void listContainerLogInfo(ApplicationId appId, String 
containerIdStr,
+      String nodeId, String appOwner, PrintStream out) throws IOException {
{code}
Rename to printContainerLogMetadata

> Improve Yarn log Command line option to show log metadata
> ---------------------------------------------------------
>
>                 Key: YARN-4905
>                 URL: https://issues.apache.org/jira/browse/YARN-4905
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>            Reporter: Xuan Gong
>            Assignee: Xuan Gong
>         Attachments: YARN-4905.1.patch
>
>
> Improve the Yarn log commandline to have "ls" command which can list 
> containers for which we have logs, list files within each container, along 
> with file size



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

Reply via email to