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

Junping Du commented on YARN-4966:
----------------------------------

Agree with [~vvasudev] that the run() method is too long now and we should do 
some refactor work (may be in another JIRA?). Within the same method call, we 
are construct/destruct yarnclient for several times, like: 
getApplicationState(), getContainerReport(), etc. - that should be improved.
Also, there is question here: 
{noformat}
+        } else if (!isApplicationFinished(appState)) {
+          System.err.println("Unable to get logs for this container:"
+              + containerIdStr + "for the application:" + appId);
+          System.out.println("Please specify the nodeAddress, and use "
+              + "yarn logs -applicationId <appId> -containerId <containerId> "
+              + "--nodeAddress <nodeAddress> to get the container logs");
+          return -1;
         }
{noformat}
Why we must need node address if app is not finished? Can we ask RM to get the 
nodeAddress instead?

> More improvement to get Container logs without specify nodeId
> -------------------------------------------------------------
>
>                 Key: YARN-4966
>                 URL: https://issues.apache.org/jira/browse/YARN-4966
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>            Reporter: Xuan Gong
>            Assignee: Xuan Gong
>         Attachments: YARN-4966.1.patch, YARN-4966.2.patch, YARN-4966.3.patch
>
>
> Currently, for the finished application, we can get the container logs 
> without specify node id, but we need to enable 
> yarn.timeline-service.generic-application-history.enabled.



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

Reply via email to