Przeglądaj źródła

YARN-7850. [UI2] Log Aggregation status to be displayed in Application Page. Contributed by Gergely Novák.

Sunil G 7 lat temu
rodzic
commit
2c326088ae

+ 17 - 1
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app.js

@@ -127,5 +127,21 @@ export default DS.Model.extend({
     }
 
     return "label label-" + style;
-  }.property("finalStatus")
+  }.property("finalStatus"),
+
+  logAggregationStatusStyle: function() {
+    const logAggregationStatus = this.get("logAggregationStatus");
+    var style = "";
+    if (logAggregationStatus === "FAILED" ||
+        logAggregationStatus === "TIME_OUT") {
+      style = "danger";
+    } else if (logAggregationStatus === "RUNNING_WITH_FAILURE") {
+      style = "warning";
+    } else if (logAggregationStatus === "SUCCEEDED") {
+      style = "success";
+    } else {
+      style = "default";
+    }
+    return "label label-" + style;
+  }.property("logAggregationStatus")
 });

+ 2 - 1
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app/logs.js

@@ -30,7 +30,8 @@ export default AbstractRoute.extend(AppAttemptMixin, {
       serviceName: service,
       attempts: this.fetchAttemptListFromRMorATS(app_id, this.store).catch(function() {
         return [];
-      })
+      }),
+      app: this.fetchAppInfoFromRMorATS(app_id, this.store)
     });
   },
 

+ 4 - 0
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app/logs.hbs

@@ -23,6 +23,10 @@
         Logs {{collapsible-panel targetId="logFilesCollapsablePanel"}}
       </div>
       <div class="panel-body" id="logFilesCollapsablePanel">
+        <label>Log aggregation status:</label>&nbsp;
+        <span class={{model.app.logAggregationStatusStyle}}>
+          {{model.app.logAggregationStatus}}
+        </span>
         {{#if _isLoadingTopPanel}}
           <div class="text-center" style="z-index: 100; position: absolute; left: 46%;">
             <img src="assets/images/spinner.gif" alt="Loading...">