You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2013/02/28 21:59:46 UTC

svn commit: r1451338 - in /incubator/ambari/trunk: ./ ambari-web/app/ ambari-web/app/templates/main/dashboard/service/ ambari-web/app/templates/main/service/info/ ambari-web/app/templates/main/service/info/summary/ ambari-web/app/views/main/dashboard/s...

Author: yusaku
Date: Thu Feb 28 20:59:45 2013
New Revision: 1451338

URL: http://svn.apache.org/r1451338
Log:
AMBARI-1524. Service summary for Hive does not display clients properly. (yusaku)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-web/app/messages.js
    incubator/ambari/trunk/ambari-web/app/templates.js
    incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/zookeeper.hbs
    incubator/ambari/trunk/ambari-web/app/templates/main/service/info/summary.hbs
    incubator/ambari/trunk/ambari-web/app/templates/main/service/info/summary/ganglia.hbs
    incubator/ambari/trunk/ambari-web/app/templates/main/service/info/summary/oozie.hbs
    incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/zookeeper.js
    incubator/ambari/trunk/ambari-web/app/views/main/service/info/summary.js

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1451338&r1=1451337&r2=1451338&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Thu Feb 28 20:59:45 2013
@@ -387,6 +387,9 @@ Trunk (unreleased changes):
 
  BUG FIXES
 
+ AMBARI-1524. Service summary for Hive does not display clients properly.
+ (yusaku)
+
  AMBARI-1520. Alerts take around 20-30 seconds to show up everytime you
  refresh the dashboad. (srimanth via yusaku)
 

Modified: incubator/ambari/trunk/ambari-web/app/messages.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/messages.js?rev=1451338&r1=1451337&r2=1451338&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/messages.js (original)
+++ incubator/ambari/trunk/ambari-web/app/messages.js Thu Feb 28 20:59:45 2013
@@ -650,6 +650,20 @@ Em.I18n.translations = {
   'services.reassign.header':'Reassign Master Wizard',
   'services.service.add':'Add Service',
 
+  /** services page constants **/
+  'services.hive.client': 'Hive Client',
+  'services.hive.clients': 'Hive Clients',
+
+  'services.oozie.client': 'Oozie Client',
+  'services.oozie.clients': 'Oozie Clients',
+  'services.oozie.webUi': 'Oozie Web UI',
+
+  'services.ganglia.webUi': 'Ganglia Web UI',
+  'services.ganglia.monitors': 'Ganglia Monitors',
+
+  'services.zookeeper.prefix': '{0} of',
+  'services.zookeeper.title': '{0} ZooKeepers',
+  'services.zookeeper.postfix': 'running',
 
   'hosts.host.add':'Add New Hosts',
   'hosts.host.back':'Back to Hosts',
@@ -828,20 +842,6 @@ Em.I18n.translations = {
   'dashboard.services.hbase.masterStarted':'Master Started',
   'dashboard.services.hbase.masterActivated':'Master Activated',
 
-  'dashboard.services.hive.client': '{0} Hive Client',
-  'dashboard.services.hive.clients': '{0} Hive Clients',
-
-  'dashboard.services.oozie.client': '{0} Oozie Client',
-  'dashboard.services.oozie.clients': '{0} Oozie Clients',
-  'dashboard.services.oozie.webUi': 'Oozie Web UI',
-
-  'dashboard.services.ganglia.webUi': 'Ganglia Web UI',
-  'dashboard.services.ganglia.monitors': 'Ganglia Monitors',
-
-  'dashboard.services.zookeeper.prefix': '{0} of',
-  'dashboard.services.zookeeper.title': '{0} ZooKeepers',
-  'dashboard.services.zookeeper.postfix': 'running',
-
   'dashboard.services.configs.popup.stopService.header':'Stop service',
   'dashboard.services.configs.popup.stopService.body' : 'Service needs to be stopped for reconfiguration',
   'dashboard.services.configs.popup.restartService.header' : 'Restart service',

Modified: incubator/ambari/trunk/ambari-web/app/templates.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates.js?rev=1451338&r1=1451337&r2=1451338&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/templates.js (original)
+++ incubator/ambari/trunk/ambari-web/app/templates.js Thu Feb 28 20:59:45 2013
@@ -23,3 +23,4 @@
 require('templates/main/service/info/summary/ganglia');
 require('templates/main/service/info/summary/oozie');
 require('templates/main/service/info/summary/zookeeper');
+require('templates/main/service/info/summary/hive');

Modified: incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/zookeeper.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/zookeeper.hbs?rev=1451338&r1=1451337&r2=1451338&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/zookeeper.hbs (original)
+++ incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/zookeeper.hbs Thu Feb 28 20:59:45 2013
@@ -30,6 +30,6 @@
   <div class="summary span">
     {{view.titleInfo.pre}}
     <a href="#" {{action filterHosts view.titleInfo.component}}>{{view.titleInfo.title}}</a>
-    {{t dashboard.services.zookeeper.postfix}}
+    {{t services.zookeeper.postfix}}
   </div>
 </div>
\ No newline at end of file

Modified: incubator/ambari/trunk/ambari-web/app/templates/main/service/info/summary.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/main/service/info/summary.hbs?rev=1451338&r1=1451337&r2=1451338&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/templates/main/service/info/summary.hbs (original)
+++ incubator/ambari/trunk/ambari-web/app/templates/main/service/info/summary.hbs Thu Feb 28 20:59:45 2013
@@ -90,16 +90,7 @@
         {{template "templates/main/service/info/summary/ganglia"}}
       {{/if}}
       {{#if view.serviceStatus.hive}}
-		    {{#each component in view.hiveComponentsInfo}}
-		    <tr>
-		      <td>
-		        {{component.label}}
-		      </td>
-		      <td>
-	          <a href="#" {{action selectHost component.host}}>{{component.host.publicHostName}}</a>
-		      </td>
-		    </tr>
-		    {{/each}}
+        {{template "templates/main/service/info/summary/hive"}}
       {{/if}}
       </tbody>
     </table>

Modified: incubator/ambari/trunk/ambari-web/app/templates/main/service/info/summary/ganglia.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/main/service/info/summary/ganglia.hbs?rev=1451338&r1=1451337&r2=1451338&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/templates/main/service/info/summary/ganglia.hbs (original)
+++ incubator/ambari/trunk/ambari-web/app/templates/main/service/info/summary/ganglia.hbs Thu Feb 28 20:59:45 2013
@@ -24,10 +24,10 @@
   {{/if}}
 {{/each}}
 <tr>
-  <td class="summary-label">{{t dashboard.services.ganglia.monitors}}</td>
+  <td class="summary-label">{{t services.ganglia.monitors}}</td>
   <td><a {{action filterHosts view.monitorsObj}} href="javascript:void(null)">{{view.monitors}}</a></td>
 </tr>
 <tr>
-  <td class="summary-label">{{t dashboard.services.ganglia.webUi}}</td>
+  <td class="summary-label">{{t services.ganglia.webUi}}</td>
   <td><a target=_blank href="http://{{unbound view.gangliaServer}}/ganglia">{{view.gangliaServer}}/ganglia</a></td>
 </tr>

Modified: incubator/ambari/trunk/ambari-web/app/templates/main/service/info/summary/oozie.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/main/service/info/summary/oozie.hbs?rev=1451338&r1=1451337&r2=1451338&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/templates/main/service/info/summary/oozie.hbs (original)
+++ incubator/ambari/trunk/ambari-web/app/templates/main/service/info/summary/oozie.hbs Thu Feb 28 20:59:45 2013
@@ -25,12 +25,12 @@
   {{/if}}
 {{/each}}
 <tr>
-  <td class="summary-label">{{t common.clients}}</td>
+  <td class="summary-label">{{t services.oozie.clients}}</td>
   <td>
-    <a {{action filterHosts view.clientObj}} href="javascript:void(null)">{{view.clients.length}} Oozie Client{{#if view.hasManyClients}}s{{/if}}</a>
+    <a {{action filterHosts view.clientObj}} href="javascript:void(null)">{{view.clients.length}} {{t services.oozie.client}}{{#if view.hasManyClients}}s{{/if}}</a>
   </td>
 </tr>
 <tr>
-  <td class="summary-label">{{t dashboard.services.oozie.webUi}}</td>
+  <td class="summary-label">{{t services.oozie.webUi}}</td>
   <td><a target=_blank href="http://{{unbound view.oozieServer}}:11000/oozie">{{view.oozieServer}}/oozie</a></td>
 </tr>

Modified: incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/zookeeper.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/zookeeper.js?rev=1451338&r1=1451337&r2=1451338&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/zookeeper.js (original)
+++ incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/zookeeper.js Thu Feb 28 20:59:45 2013
@@ -32,8 +32,8 @@ App.MainDashboardServiceZookeperView = A
     });
 
     return {
-      pre: this.t('dashboard.services.zookeeper.prefix').format(running),
-      title: this.t('dashboard.services.zookeeper.title').format(components.length),
+      pre: this.t('services.zookeeper.prefix').format(running),
+      title: this.t('services.zookeeper.title').format(components.length),
       component: components.objectAt(0)
     };
   }.property('service')

Modified: incubator/ambari/trunk/ambari-web/app/views/main/service/info/summary.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/service/info/summary.js?rev=1451338&r1=1451337&r2=1451338&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/main/service/info/summary.js (original)
+++ incubator/ambari/trunk/ambari-web/app/views/main/service/info/summary.js Thu Feb 28 20:59:45 2013
@@ -46,9 +46,8 @@ App.MainServiceInfoSummaryView = Em.View
   },
 
   clients: function () {
-    var result = [];
     var service = this.get('controller.content');
-    if (service.get("id") == "OOZIE" || service.get("id") == "ZOOKEEPER") {
+    if (["OOZIE", "ZOOKEEPER", "HIVE"].contains(service.get("id"))) {
       return service.get('hostComponents').filterProperty('isClient');
     }
     return [];
@@ -144,12 +143,13 @@ App.MainServiceInfoSummaryView = Em.View
 
   /**
    * Property related to OOZIE and ZOOKEEPER services, is unused for other services
+   * HIVE is supported too
    * @return {Object}
    */
   clientObj: function() {
     var service = this.get('controller.content');
-    if (service.get("id") == "OOZIE" || service.get("id") == "ZOOKEEPER") {
-      var clients = service.get('hostComponents').filterProperty('isMaster', false);
+    if (["OOZIE", "ZOOKEEPER", "HIVE"].contains(service.get("id"))) {
+      var clients = service.get('hostComponents').filterProperty('isClient', true);
       if (clients.length > 0) {
         return clients[0];
       }
@@ -188,35 +188,21 @@ App.MainServiceInfoSummaryView = Em.View
       return "";
     }
   }.property('controller.content'),
+
   /**
-   * Returns hive components information in 
-   * the following format:
-   * {
-   *  label: "Component Name",
-   *  host: Host,
-   *  
+   * Wrapper for displayName. used to render correct display name for mysql_server
    */
-  hiveComponentsInfo: function(){
-    var componentInfos = [];
-    var service=this.get('controller.content');
-    if(service.get("id") == "HIVE"){
-      var self = this;
-      var components = service.get("hostComponents");
-      if(components){
-        components.forEach(function(component){
-          var ci = {
-              label: component.get('displayName'),
-              host: component.get('host')
-          };
-          if(component.get('id')=='MYSQL_SERVER'){
-            ci.label = self.t('services.hive.databaseComponent');
-          }
-          componentInfos.push(ci);
-        });
+  componentNameView: Ember.View.extend({
+    template: Ember.Handlebars.compile('{{view.displayName}}'),
+    comp : null,
+    displayName: function(){
+      if(this.get('comp.componentName') == 'MYSQL_SERVER'){
+        return this.t('services.hive.databaseComponent');
       }
-    }
-    return componentInfos;
-  }.property('controller.content'),
+      return this.get('comp.displayName');
+    }.property('comp')
+  }),
+
   service:function () {
     var svc = this.get('controller.content');
     var svcName = svc.get('serviceName');