You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by su...@apache.org on 2019/02/17 14:50:47 UTC

[hadoop] branch branch-3.1 updated: YARN-7824. [UI2] Yarn Component Instance page should include link to container logs. Contributed by Akhil PB.

This is an automated email from the ASF dual-hosted git repository.

sunilg pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new 2576aea  YARN-7824. [UI2] Yarn Component Instance page should include link to container logs. Contributed by Akhil PB.
2576aea is described below

commit 2576aea72928015af1ab5cf2f492515126983945
Author: Sunil G <su...@apache.org>
AuthorDate: Sun Feb 17 20:19:46 2019 +0530

    YARN-7824. [UI2] Yarn Component Instance page should include link to container logs. Contributed by Akhil PB.
    
    (cherry picked from commit a060e8cb518445994d1ace4c0dd625f18ae11cd9)
---
 .../webapp/app/controllers/yarn-component-instances/info.js | 13 +++++++++++++
 .../src/main/webapp/app/models/yarn-component-instance.js   |  7 +++++++
 .../webapp/app/templates/yarn-component-instance/info.hbs   |  4 ++++
 3 files changed, 24 insertions(+)

diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-component-instances/info.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-component-instances/info.js
index be4b4f3..16e0e03 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-component-instances/info.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-component-instances/info.js
@@ -61,6 +61,19 @@ export default Ember.Controller.extend({
       id: 'startedDate',
       headerTitle: 'Started Time',
       contentPath: 'startedDate'
+    }, {
+      id: 'logsLink',
+      headerTitle: 'Logs',
+      contentPath: 'logsLink',
+      cellComponentName: 'em-table-html-cell',
+      getCellContent: function(row) {
+        var containerLogUrl = row.get('containerLogURL');
+        if (containerLogUrl) {
+          return `<a href="${containerLogUrl}&service=${serviceName}">Link</a>`;
+        } else {
+          return 'N/A';
+        }
+      }
     });
 
     return ColumnDef.make(cols);
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-component-instance.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-component-instance.js
index 532fc55..4f781bf 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-component-instance.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-component-instance.js
@@ -47,5 +47,12 @@ export default DS.Model.extend({
       return Converter.timeStampToDate(timestamp);
     }
     return 'N/A';
+  }),
+
+  containerLogURL: Ember.computed('containerId', function() {
+    const containerId = this.get('containerId');
+    const attemptId = Converter.containerIdToAttemptId(containerId);
+    const appId = Converter.attemptIdToAppId(attemptId);
+    return `#/yarn-app/${appId}/logs?attempt=${attemptId}&containerid=${containerId}`;
   })
 });
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-component-instance/info.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-component-instance/info.hbs
index 1b9d04a..3907194 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-component-instance/info.hbs
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-component-instance/info.hbs
@@ -61,6 +61,10 @@
             <td>Exit Status Code</td>
             <td>{{check-availability model.container.exitStatusCode}}</td>
           </tr>
+          <tr>
+            <td>Logs</td>
+            <td><a href="{{model.container.containerLogURL}}&service={{service}}">Link</a></td>
+          </tr>
         </tbody>
       </table>
     </div>


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org