Github user chtyim commented on a diff in the pull request:

    https://github.com/apache/twill/pull/53#discussion_r109553180
  
    --- Diff: 
twill-yarn/src/main/java/org/apache/twill/yarn/YarnTwillController.java ---
    @@ -322,7 +314,46 @@ private boolean hasRun(YarnApplicationState state) {
     
       @Override
       public ResourceReport getResourceReport() {
    -    // in case the user calls this before starting, return null
    +    // Only has resource report if the app is running.
    +    if (state() != State.RUNNING) {
    +      return null;
    +    }
    +    ResourceReportClient resourcesClient = getResourcesClient();
         return (resourcesClient == null) ? null : resourcesClient.get();
       }
    +
    +  /**
    +   * Returns the {@link ResourceReportClient} for fetching resource report 
from the AM.
    +   * It first consults the RM for the tracking URL and get the resource 
report from there.
    +   */
    +  @Nullable
    +  private ResourceReportClient getResourcesClient() {
    +    YarnApplicationReport report = processController.getReport();
    +    List<URL> urls = new ArrayList<>(2);
    --- End diff --
    
    Because we store the tracking URL and the original tracking URL.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to