Repository: hadoop
Updated Branches:
  refs/heads/branch-3.1 dd7002925 -> fae24b474


Revert "YARN-7957. [UI2] YARN service delete option disappears after stopping 
application. Contributed by Akhil PB."

This reverts commit dd70029255e9621675f2bcf1083d787d24896733.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/fae24b47
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/fae24b47
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/fae24b47

Branch: refs/heads/branch-3.1
Commit: fae24b4747378f11a63da0e195df6c548f6e90e9
Parents: dd70029
Author: Sunil G <sun...@apache.org>
Authored: Fri Oct 5 13:38:21 2018 +0530
Committer: Sunil G <sun...@apache.org>
Committed: Fri Oct 5 13:38:21 2018 +0530

----------------------------------------------------------------------
 .../main/webapp/app/adapters/yarn-service.js    | 32 --------------
 .../webapp/app/controllers/app-table-columns.js | 14 ++-----
 .../src/main/webapp/app/controllers/yarn-app.js | 20 +--------
 .../src/main/webapp/app/models/yarn-app.js      | 15 +------
 .../src/main/webapp/app/models/yarn-service.js  | 30 -------------
 .../src/main/webapp/app/routes/yarn-app.js      | 12 ------
 .../src/main/webapp/app/serializers/yarn-app.js |  4 +-
 .../main/webapp/app/serializers/yarn-service.js | 44 --------------------
 .../src/main/webapp/app/templates/yarn-app.hbs  | 28 ++++---------
 .../main/webapp/app/templates/yarn-services.hbs |  4 +-
 10 files changed, 18 insertions(+), 185 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/fae24b47/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-service.js
----------------------------------------------------------------------
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-service.js
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-service.js
deleted file mode 100644
index 2212810..0000000
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-service.js
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import RESTAbstractAdapter from './restabstract';
-
-export default RESTAbstractAdapter.extend({
-  address: "rmWebAddress",
-  restNameSpace: "dashService",
-  serverName: "DASH",
-
-  urlForQueryRecord(query/*, modelName*/) {
-    var url = this.buildURL();
-    url += '/' + query.serviceName;
-    delete query.serviceName;
-    return url;
-  }
-});

http://git-wip-us.apache.org/repos/asf/hadoop/blob/fae24b47/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/app-table-columns.js
----------------------------------------------------------------------
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/app-table-columns.js
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/app-table-columns.js
index c2cb0bd..552a157 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/app-table-columns.js
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/app-table-columns.js
@@ -85,7 +85,7 @@ export default Ember.Controller.extend({
           contentPath: 'startTime',
           facetType: null,
           getCellContent: function(row) {
-            return row.get('formattedStartTime');
+            return Converter.timeStampToDate(row.get('startTime'));
           }
       }, {
           id: 'elTime',
@@ -100,10 +100,7 @@ export default Ember.Controller.extend({
           headerTitle: 'Finished Time',
           contentPath: 'validatedFinishedTs',
           facetType: null,
-          observePath: true,
-          getCellContent: function(row) {
-            return row.get('formattedFinishedTime');
-          }
+          observePath: true
       }, {
           id: 'priority',
           headerTitle: 'Priority',
@@ -177,17 +174,14 @@ export default Ember.Controller.extend({
       contentPath: 'startTime',
       facetType: null,
       getCellContent: function(row) {
-        return row.get('formattedStartTime');
+        return Converter.timeStampToDate(row.get('startTime'));
       }
     }, {
       id: 'finishTime',
       headerTitle: 'Finished Time',
       contentPath: 'validatedFinishedTs',
       facetType: null,
-      observePath: true,
-      getCellContent: function(row) {
-        return row.get('formattedFinishedTime');
-      }
+      observePath: true
     });
     return ColumnDef.make(colums);
   }.property(),

http://git-wip-us.apache.org/repos/asf/hadoop/blob/fae24b47/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app.js
----------------------------------------------------------------------
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app.js
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app.js
index 8b48347..799c8d2 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app.js
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app.js
@@ -160,29 +160,11 @@ export default Ember.Controller.extend({
     return amHostAddress;
   }),
 
-  isAppKillable: Ember.computed("model.app.state", function () {
+  isKillable: Ember.computed("model.app.state", function () {
     if (this.get("model.app.applicationType") === 'yarn-service') {
       return false;
     }
     const killableStates = ['NEW', 'NEW_SAVING', 'SUBMITTED', 'ACCEPTED', 
'RUNNING'];
     return killableStates.indexOf(this.get("model.app.state")) > -1;
-  }),
-
-  isServiceDeployedOrRunning: Ember.computed('model.serviceInfo', function() {
-    const serviceInfo = this.get('model.serviceInfo');
-    const stoppedStates = ['STOPPED', 'SUCCEEDED', 'FAILED'];
-    if (serviceInfo) {
-      return stoppedStates.indexOf(serviceInfo.get('state')) === -1;
-    }
-    return false;
-  }),
-
-  isServiceStoppped: Ember.computed('model.serviceInfo', function() {
-    const serviceInfo = this.get('model.serviceInfo');
-    const stoppedStates = ['STOPPED', 'SUCCEEDED'];
-    if (serviceInfo) {
-      return stoppedStates.indexOf(serviceInfo.get('state')) > -1;
-    }
-    return false;
   })
 });

http://git-wip-us.apache.org/repos/asf/hadoop/blob/fae24b47/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app.js
----------------------------------------------------------------------
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app.js
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app.js
index f0d6a72..8f4a899 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app.js
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app.js
@@ -24,10 +24,10 @@ export default DS.Model.extend({
   user: DS.attr("string"),
   queue: DS.attr("string"),
   state: DS.attr("string"),
-  startTime: DS.attr("number"),
+  startTime: DS.attr("string"),
   elapsedTime: DS.attr("string"),
   finalStatus: DS.attr("string"),
-  finishedTime: DS.attr("number"),
+  finishedTime: DS.attr("finishedTime"),
   progress: DS.attr("number"),
   diagnostics: DS.attr("string"),
   amHostHttpAddress: DS.attr("string"),
@@ -71,17 +71,6 @@ export default DS.Model.extend({
     return this.get("finishedTime") >= this.get("startTime");
   }.property("hasFinishedTime"),
 
-  formattedStartTime: function() {
-    return Converter.timeStampToDate(this.get('startTime'));
-  }.property('startTime'),
-
-  formattedFinishedTime: function() {
-    if (this.get("finishedTime") < this.get("startTime")) {
-      return "N/A";
-    }
-    return Converter.timeStampToDate(this.get("finishedTime"));
-  }.property('finishedTime'),
-
   formattedElapsedTime: function() {
     return Converter.msToElapsedTimeUnit(this.get("elapsedTime"));
   }.property("elapsedTime"),

http://git-wip-us.apache.org/repos/asf/hadoop/blob/fae24b47/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-service.js
----------------------------------------------------------------------
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-service.js
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-service.js
deleted file mode 100644
index f7d114e..0000000
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-service.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import DS from 'ember-data';
-
-export default DS.Model.extend({
-  appId: DS.attr('string'),
-  name: DS.attr('string'),
-  state: DS.attr('string'),
-  version: DS.attr('string'),
-  lifetime: DS.attr('string'),
-  components: DS.attr(),
-  configuration: DS.attr(),
-  quicklinks: DS.attr()
-});

http://git-wip-us.apache.org/repos/asf/hadoop/blob/fae24b47/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app.js
----------------------------------------------------------------------
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app.js
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app.js
index 21f5c95..8cd44bd 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app.js
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app.js
@@ -37,18 +37,6 @@ export default AbstractRoute.extend(AppAttemptMixin, {
         return [];
       }, function () {
         return [];
-      }),
-
-      serviceInfo: new Ember.RSVP.Promise(resolve => {
-        if (service) {
-          this.store.queryRecord('yarn-service', {serviceName: 
service}).then(function(info) {
-            resolve(info);
-          }, function() {
-            resolve(null);
-          });
-        } else {
-          resolve(null);
-        }
       })
     });
   },

http://git-wip-us.apache.org/repos/asf/hadoop/blob/fae24b47/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app.js
----------------------------------------------------------------------
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app.js
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app.js
index b3d9f19..f4de725 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app.js
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app.js
@@ -42,9 +42,9 @@ export default DS.JSONAPISerializer.extend({
           user: payload.user,
           queue: payload.queue,
           state: payload.state,
-          startTime: payload.startedTime, // will be formatted in yarn-app 
model
+          startTime: payload.startedTime, // will be formatted in em-table
           elapsedTime: payload.elapsedTime,
-          finishedTime: payload.finishedTime, // will be formatted in yarn-app 
model
+          finishedTime: Converter.timeStampToDate(payload.finishedTime),
           finalStatus: payload.finalStatus,
           progress: payload.progress,
           applicationType: payload.applicationType,

http://git-wip-us.apache.org/repos/asf/hadoop/blob/fae24b47/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-service.js
----------------------------------------------------------------------
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-service.js
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-service.js
deleted file mode 100644
index a96b28b..0000000
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-service.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import DS from 'ember-data';
-
-export default DS.JSONAPISerializer.extend({
-  internalNormalizeSingleResponse(store, primaryModelClass, payload) {
-    const fixedPayload = {
-      id: 'yarn_service_' + (payload.id || Date.now()),
-      type: primaryModelClass.modelName,
-      attributes: {
-        appId: payload.id,
-        name: payload.name,
-        state: payload.state,
-        version: payload.version,
-        lifetime: payload.lifetime,
-        components: payload.components,
-        configuration: payload.configuration,
-        quicklinks: payload.quicklinks
-      }
-    };
-    return fixedPayload;
-  },
-
-  normalizeSingleResponse(store, primaryModelClass, payload/*, id, 
requestType*/) {
-    const pl = this.internalNormalizeSingleResponse(store, primaryModelClass, 
payload);
-    return {data: pl};
-  }
-});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hadoop/blob/fae24b47/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app.hbs
----------------------------------------------------------------------
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app.hbs
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app.hbs
index 6e9bc08..13d14e8 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app.hbs
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app.hbs
@@ -60,14 +60,14 @@
               <i class="glyphicon glyphicon-user glyphicon-gray" /> 
{{model.app.user}}
             </div>
             {{#if model.app.hasFinishedTime}}
-              <div title="Started at {{model.app.formattedStartTime}}. &#10; 
Ran for {{model.app.formattedElapsedTime}}" class="yarn-tooltip">
+              <div title="Started at {{model.app.startTime}}. &#10; Ran for 
{{model.app.formattedElapsedTime}}" class="yarn-tooltip">
                 <i class="glyphicon glyphicon-time glyphicon-gray" />
-                Finished at {{model.app.formattedFinishedTime}}
+                Finished at {{model.app.validatedFinishedTs}}
               </div>
             {{else}}
               <div title="Running for {{model.app.formattedElapsedTime}}" 
class="yarn-tooltip">
                 <i class="glyphicon glyphicon-time glyphicon-gray" />
-                Started at {{model.app.formattedStartTime}}
+                Started at {{model.app.startTime}}
               </div>
             {{/if}}
           </div>
@@ -75,33 +75,21 @@
 
         <div class="flex-right">
           <div class="links">
-              {{#if (or (or isServiceDeployedOrRunning isServiceStoppped) 
isAppKillable)}}
+              {{#if (or isRunningService isKillable)}}
               <div class="btn-group">
                 <button type="button" class="btn btn-unstyled dropdown-toggle" 
title="Settings"
                   data-toggle="dropdown" aria-haspopup="true" 
aria-expanded="false" style="margin-left: -5px;">
                   <i class="glyphicon glyphicon-cog"/> Settings
                 </button>
                 <ul class="dropdown-menu dropdown-menu-right">
-                  {{#if isServiceDeployedOrRunning}}
+                  {{#if isRunningService}}
                     <li>
-                      <a href="#"  {{action "showStopServiceConfirm"}} 
target="_blank">
-                        <i class="glyphicon glyphicon-stop" /> &nbsp;Stop 
Service
-                      </a>
+                      <a href="#"  {{action "showStopServiceConfirm"}} 
target="_blank"><i class="glyphicon glyphicon-stop" /> &nbsp;Stop Service</a>
                     </li>
                     <li>
-                      <a href="#" target="_blank" {{action 
"showDeleteServiceConfirm"}}>
-                        <i class="glyphicon glyphicon-trash" /> &nbsp;Delete 
Service
-                      </a>
+                      <a href="#" target="_blank" {{action 
"showDeleteServiceConfirm"}}><i class="glyphicon glyphicon-trash" /> 
&nbsp;Delete Service </a>
                     </li>
-                  {{/if}}
-                  {{#if isServiceStoppped}}
-                  <li>
-                    <a href="#" target="_blank" {{action 
"showDeleteServiceConfirm"}}>
-                      <i class="glyphicon glyphicon-trash" /> &nbsp;Delete 
Service
-                    </a>
-                  </li>
-                  {{/if}}
-                  {{#if isAppKillable}}
+                  {{else if isKillable}}
                     <li>
                       <a href="#"  {{action "showKillApplicationConfirm"}} 
target="_blank">
                         <i class="glyphicon glyphicon-stop" />&nbsp;Kill 
Application

http://git-wip-us.apache.org/repos/asf/hadoop/blob/fae24b47/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-services.hbs
----------------------------------------------------------------------
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-services.hbs
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-services.hbs
index c971b0b..ec39e81 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-services.hbs
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-services.hbs
@@ -17,9 +17,7 @@
 --}}
 
 {{breadcrumb-bar breadcrumbs=breadcrumbs}}
-<div class="col-md-12">
-  <a class="btn btn-primary pull-right" href="#/yarn-deploy-service">New 
Service</a>
-</div>
+<a class="btn btn-primary pull-right" href="#/yarn-deploy-service">New 
Service</a>
 <div class="col-md-12 container-fluid yarn-applications-container">
   {{#if model.apps}}
     {{em-table columns=serviceColumns rows=model.apps 
definition=tableDefinition}}


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

Reply via email to